Skip to content

DEV: Deselect all and reset to defaults btns to edit categories modal #22143

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

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

tgxworld
Copy link
Contributor

What does this change do?

This change adds the deselect all and reset to defaults buttons to the
edit navigation menu categories modal. The deselect all button when
click deselects all the selected categories in the modal. If the user
saves with no categories selected, the user's categories section in the
navigation menu will be set to the site's top categories.

The reset to defaults button is only shown when the
default_navigation_menu_categories site setting has been configured.
When clicked, the user's categories section in the navigation menu is
automatically set to the categories defined by the
default_navigation_menu_categories site setting.

@tgxworld tgxworld force-pushed the deselect_all_button branch 2 times, most recently from c6209c5 to b4f343a Compare June 16, 2023 04:12
@tgxworld
Copy link
Contributor Author

Recordings

Reset to defaults

Peek 2023-06-16 12-08

Deselect all

Peek 2023-06-16 12-07

@tgxworld
Copy link
Contributor Author

@lis2 or @OsamaSayegh Can you review this for me? Thank you 👍

@tgxworld tgxworld force-pushed the deselect_all_button branch 5 times, most recently from ddff066 to 671bb8d Compare June 16, 2023 06:25
What does this change do?

This change adds the deselect all and reset to defaults buttons to the
edit navigation menu categories modal. The deselect all button when
click deselects all the selected categories in the modal. If the user
saves with no categories selected, the user's categories section in the
navigation menu will be set to the site's top categories.

The reset to defaults button is only shown when the
`default_navigation_menu_categories` site setting has been configured.
When clicked, the user's categories section in the navigation menu is
automatically set to the categories defined by the
`default_navigation_menu_categories` site setting.
@tgxworld tgxworld force-pushed the deselect_all_button branch from 671bb8d to ad8b5ff Compare June 16, 2023 08:37
@disabled={{this.saving}}
@action={{this.save}}
/>
{{#if (gt this.siteSettings.default_navigation_menu_categories.length 0)}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just idea, shall we display reset to default button only if current selection is different than default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this but I find buttons that disappear and reappear very confusing since it causes something to flash on the screen.

@tgxworld tgxworld merged commit 289d2a5 into discourse:main Jun 20, 2023
@tgxworld
Copy link
Contributor Author

Thank you for reviewing @lis2

@tgxworld tgxworld deleted the deselect_all_button branch June 20, 2023 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants