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

new section - update uri (format) even if field hidden #13355

Merged
merged 3 commits into from
Jun 29, 2023

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Jun 26, 2023

Description

Improves the UX of new section creation by updating the URI/URI format field based on the name, even if the URI/URI format field is hidden. This is achieved by adding the updateWhenHidden property to the BaseInputGenerator settings. It’s false by default resulting in the same behaviour as currently, but if set to true, even hidden inputs will be populated with the generated value.

Previously, when you went to create a new section, and you filled out the name, the handle and URI got populated with the generated value. However, if you then changed the section type from channel or structure to single, the URI remained blank until you went on to save the section, at which point the URI got populated based on the section name and saved. You then had to edit the single section again and remove the URI if that’s what you wanted in the first place.

A similar logic applied the other way around too. If you went to create a new section, changed the type to single, and then filled out the name, the handle and URI were populated with the generated value. If you then changed the section type to channel or structure, the URI was blank and only populated on save.

Now, fields for the URI format for the new section get updated with the generated value even if the field is hidden, which means that the user sees the actual URI/URI format that will be saved and can adjust it without it being updated and overwritten on save.

Related issues

#13350

@i-just i-just requested a review from a team as a code owner June 26, 2023 08:28
@brandonkelly brandonkelly self-requested a review as a code owner June 29, 2023 16:40
@brandonkelly brandonkelly merged commit 18aeb6a into develop Jun 29, 2023
@brandonkelly brandonkelly deleted the bugfix/13350-new-section-uri-generation branch June 29, 2023 16:41
@brandonkelly
Copy link
Member

Nice one!

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

Successfully merging this pull request may close these issues.

2 participants