discourse/app/assets/javascripts/select-kit/addon/components
Bianca Nenciu dcd81d56c0
FIX: category selectors for lazy loaded categories (#24533)
A lot of work has been put in the select kits used for selecting
categories: CategorySelector, CategoryChooser, CategoryDrop, however
they still do not work as expected when these selectors already have
values set, because the category were still looked up in the list of
categories stored on the client-side Categrories.list().

This PR fixes that by looking up the categories when the selector is
initialized. This required altering the /categories/find.json endpoint
to accept a list of IDs that need to be looked up. The API is called
using Category.asyncFindByIds on the client-side.

CategorySelector was also updated to receive a list of category IDs as
attribute, instead of the list of categories, because the list of
categories may have not been loaded.

During this development, I noticed that SiteCategorySerializer did not
serializer all fields (such as permission and notification_level)
which are not a property of category, but a property of the relationship
between users and categories. To make this more efficient, the
preload_user_fields! method was implemented that can be used to
preload these attributes for a user and a list of categories.
2023-12-08 12:01:08 +02:00
..
category-drop FEATURE: remove category badge style options, set bullet style as default (#24198) 2023-11-13 10:46:15 -05:00
color-palettes DEV: Sort imports 2023-10-10 21:46:54 +01:00
combo-box DEV: Sort imports 2023-10-10 21:46:54 +01:00
dropdown-select-box DEV: Sort imports 2023-10-10 21:46:54 +01:00
future-date-input-selector DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
mini-tag-chooser DEV: Sort imports 2023-10-10 21:46:54 +01:00
multi-select DEV: Sort imports 2023-10-10 21:46:54 +01:00
notifications-button DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
notifications-filter UX: adjust various button classes (#24121) 2023-10-27 10:26:59 -04:00
period-chooser DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
select-kit DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
tag-drop DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
toolbar-popup-menu-options DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
user-chooser DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
categories-admin-dropdown.js UX: create category doesn't always need a dropdown (#24610) 2023-11-28 16:28:07 -05:00
category-chooser.js FIX: category selectors for lazy loaded categories (#24533) 2023-12-08 12:01:08 +02:00
category-drop.js FIX: category-selector for top level categories (#24627) 2023-11-29 13:29:18 +02:00
category-notifications-button.js DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
category-row.hbs DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
category-row.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
category-selector.js FIX: category selectors for lazy loaded categories (#24533) 2023-12-08 12:01:08 +02:00
color-palettes.js DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
combo-box.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
composer-actions.js DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
create-color-row.hbs DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
create-color-row.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
dropdown-select-box.js DEV: update a couple button classes (#23127) 2023-09-25 16:45:57 -04:00
email-group-user-chooser-filter.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
email-group-user-chooser-row.hbs DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
email-group-user-chooser-row.js DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
email-group-user-chooser.js DEV: Use object spread instead of Object.assign({}, …) (#23167) 2023-08-21 14:28:16 +02:00
flair-chooser.js FIX: Do not show invalid option in flair chooser (#13725) 2021-07-13 19:22:39 +03:00
flair-row.hbs DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
flair-row.js DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
form-template-chooser.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
future-date-input-selector.js DEV: Don't use attrs (#24323) 2023-11-27 12:16:31 +01:00
group-chooser.js
group-dropdown.js DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
group-notifications-button.js
icon-picker.js DEV: Don't use attrs (#24323) 2023-11-27 12:16:31 +01:00
list-setting.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
mini-tag-chooser.js DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
multi-select.hbs UX: Compact option for multi-selects (#22239) 2023-07-25 11:00:02 -04:00
multi-select.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
none-category-row.hbs DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
none-category-row.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
notifications-button.js DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
notifications-filter.js DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
period-chooser.js DEV: Don't use attrs (#24323) 2023-11-27 12:16:31 +01:00
pinned-button.hbs DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
pinned-button.js DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
pinned-options.js DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
search-advanced-category-chooser.js
select-kit.js DEV: Don't use attrs (#24323) 2023-11-27 12:16:31 +01:00
selected-choice-category.hbs DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
selected-choice-category.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
selected-choice-color.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
selected-choice.hbs DEV: Update DButton uses (#23333) 2023-08-31 11:49:35 +02:00
selected-choice.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
selected-color.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
selected-flair.hbs DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
selected-flair.js DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
selected-name.hbs DEV: Update DButton uses (#23333) 2023-08-31 11:49:35 +02:00
selected-name.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
single-select.hbs UX: loading slider for select-kit filter (#21401) 2023-05-08 14:56:46 -04:00
single-select.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
tag-chooser-row.hbs DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
tag-chooser-row.js DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
tag-chooser.js FIX: update tag-chooser & category-selector action (#24318) 2023-11-10 00:05:02 +01:00
tag-drop.js FEATURE: remove category badge style options, set bullet style as default (#24198) 2023-11-13 10:46:15 -05:00
tag-group-chooser.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
tag-notifications-button.js
tag-row.hbs DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
tag-row.js DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
tags-intersection-chooser.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
timezone-input.js FIX: Regression in timezone name localizations (#15761) 2022-02-02 23:41:42 +01:00
toolbar-popup-menu-options.js DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
topic-chooser.js FEATURE: Use new topic-chooser for invite modal (#15884) 2022-02-14 13:43:52 +02:00
topic-footer-mobile-dropdown.js
topic-notifications-button.hbs DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
topic-notifications-button.js DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
topic-notifications-options.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
topic-row.hbs DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
topic-row.js DEV: Co-locate select-kit component templates (#20779) 2023-05-02 14:10:53 +01:00
user-chooser.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
user-notifications-dropdown.js DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00