Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource template required fields #2041

Open
allanaaa opened this issue Mar 27, 2023 · 10 comments
Open

Resource template required fields #2041

allanaaa opened this issue Mar 27, 2023 · 10 comments
Assignees

Comments

@allanaaa
Copy link

I have a resource template with several required fields.
When I apply the template to an existing item, then try to save, I get an error about the first required field that stops me from moving on. I don't get an error about the other field(s), in this case the creator field.
When I put in a description and save, it will save the new description value, give me an error about the creator, and fail to save the template change.

template-required
template-required2

What I'd like instead is for the creator (and any other required fields) error to work the same way as the description error does, and stop me from moving on until I fill everything out. I presume this is "We only show one error, the first we come across, and then don't do any more checks after that" rather than "We only check a few particular properties when they are required", which would be odd.

@allanaaa allanaaa changed the title Resource template required files Resource template required fields Mar 27, 2023
@jimsafley
Copy link
Member

This is due to an errant "value" class in the URI data type's markup (here). We need to remove the class, but it affects the styling.

@kimisgold Would you take a look at this? We need to replace that "value" class.

@kimisgold kimisgold self-assigned this Mar 27, 2023
@kimisgold
Copy link
Member

Edited the class to be more specific to the input. It's ready to test @allanaaa

@allanaaa
Copy link
Author

It's giving an error for all required fields now. But it's pulling both the original field name and the alternate titles in an unwieldy way:

creatorauthor

@zerocrates
Copy link
Member

The code attempts to do what I think is expected here: it just uses the label. The problem is that the non-custom label is there in the markup, hidden, so the code here is finding both the original and the alternate label. Something simple like calling .last() before getting the text may be sufficient.

@jimsafley
Copy link
Member

You should now only get one label, @allanaaa

@allanaaa
Copy link
Author

allanaaa commented Apr 4, 2023

No luck on this yet, sorry.

restemp

@zerocrates
Copy link
Member

Just to make sure, do the whole "clear cache" thing: this was a Javascript-only fix so if you're looking at the old Javascript you'd still see it.

@allanaaa
Copy link
Author

allanaaa commented Apr 4, 2023

Ah, yep, that worked.

Meanwhile, some of the required fields are still not being caught. It seems to be related to whether they have an assigned data type. Note "Date" not being caught in one example, and "Language" not being caught in the other.
date
restemp2

@zerocrates
Copy link
Member

zerocrates commented Apr 6, 2023

The basic deal is, value markup needs to have a to-require class on whatever needs to be filled in for the value to be considered complete. Probably for these ones that aren't triggering, they don't have a to-require on anything. If nothing in the value form is to-require then it's always considered "completed."

Both are a little oddball in that they involve having several inputs each of which is optional. ValueSuggest may be able to get by marking the main visible input as to-require but I suspect something more complex may be required for NumericDataTypes (or maybe just requiring the "first" input will be sufficient there).

This would be an issue for each module, anyway.

@allanaaa
Copy link
Author

Yep, it's fields with Value Suggest or some other data type assigned that don't always (but sometimes do) catch an error before you save. Instead you see this after saving.

required

This means that, if you enter in information elsewhere (like adding map markers on the Map tab), you'll lose that work when you save the item.

It looks like it'll report the first one it comes across each time, instead of all the ones that need to be fixed:
one-error

zerocrates pushed a commit that referenced this issue Jun 15, 2023
zerocrates pushed a commit that referenced this issue Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants