discourse/app/assets/javascripts/select-kit/addon/components
Sérgio Saquetim 0c4f285618
DEV: Replace deprecated Ember's array uniq and uniqBy (#35227)
This commit replaces several instances of `.uniq`, `.uniqBy`, and related
array deduplication methods with a new utility function
`uniqueItemsFromArray`. This change ensures proper deduplication logic
across the codebase while addressing the deprecation issues.

**Main Changes:**

* Created new utility function `uniqueItemsFromArray`: Located in a new
file, `array-tools.js`, this function provides a reusable and
configurable alternative for deduplication.
* Replaced old methods: Updated multiple files to use the new utility
function instead of deprecated or custom implementations for
deduplication.
* Replaced manual deduplication: Replace uses of `[...new Set(array)]`
to standardize the deduplication logic across the codebase.
* Added unit tests: Introduced thorough test coverage
(`array-tools-test.js`) to validate functionality and edge cases for the
utility function.
* Updated deprecation workflow: Added logging for deprecated uniq and
uniqBy methods to the `deprecation-workflow.js`.

This change is primarily focused on code quality improvements, ensuring
future-proof deduplication, and maintaining alignment with deprecation
guidelines.
2025-10-13 16:47:36 -03:00
..
category-drop DEV: [gjs-codemod] Convert final core components/routes to gjs 2025-04-25 11:06:24 +01:00
color-palette-picker FEATURE: Add previews to color palette selectors (#34129) 2025-08-11 11:51:01 +08:00
color-palettes DEV: Replace the use of Ember's .findBy for native methods on arrays (#34557) 2025-09-24 15:32:13 -03:00
combo-box DEV: [gjs-codemod] Convert final core components/routes to gjs 2025-04-25 11:06:24 +01:00
dropdown-select-box DEV: [gjs-codemod] Convert final core components/routes to gjs 2025-04-25 11:06:24 +01:00
font-selector FEATURE: Improve wizard quality and rearrange steps (#30055) 2025-01-02 09:28:23 +10:00
future-date-input-selector DEV: [gjs-codemod] Convert final core components/routes to gjs 2025-04-25 11:06:24 +01:00
homepage-style-selector DEV: [gjs-codemod] Convert automation/styleguide/other to gjs 2025-04-14 15:36:16 +01:00
mini-tag-chooser DEV: Enable ember/no-classic-components (#33978) 2025-07-30 14:54:24 +02:00
multi-select DEV: Enable ember/no-classic-components (#33978) 2025-07-30 14:54:24 +02:00
notifications-button Cleanup mobile topic footer area (#30132) 2024-12-11 14:59:37 +01:00
notifications-filter DEV: [gjs-codemod] Convert automation/styleguide/other to gjs 2025-04-14 15:36:16 +01:00
period-chooser DEV: [gjs-codemod] Convert automation/styleguide/other to gjs 2025-04-14 15:36:16 +01:00
select-kit DEV: adds support for disabled in select-kit (#35037) 2025-09-30 10:48:35 +02:00
tag-drop DEV: [gjs-codemod] Convert final core components/routes to gjs 2025-04-25 11:06:24 +01:00
user-chooser DEV: [gjs-codemod] Convert automation/styleguide/other to gjs 2025-04-14 15:36:16 +01:00
bulk-select-bookmarks-dropdown.js DEV: standardise toasts duration (#32741) 2025-05-15 14:59:37 +02:00
categories-admin-dropdown.js DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
category-chooser.js FIX: pass ancestor data to category badge helper (#35169) 2025-10-03 15:43:34 +04:00
category-drop-more-collection.gjs DEV: Remove unused services from core (#34236) 2025-08-18 13:15:11 +02:00
category-drop.js DEV: Replace deprecated Ember's array .[] (#35159) 2025-10-08 14:45:40 -03:00
category-notifications-button.js DEV: Update lint-configs and rubocop-discourse (#31728) 2025-03-10 19:52:19 +01:00
category-row.gjs DEV: remove category badge recursive (#35175) 2025-10-06 09:31:33 +04:00
category-selector.js DEV: Replace Ember's deprecated mapBy with standard .map (#34963) 2025-09-26 12:59:35 -03:00
color-palette-picker.js FEATURE: Add previews to color palette selectors (#34129) 2025-08-11 11:51:01 +08:00
color-palettes.js DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
combo-box.js DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
composer-actions.js DEV: Modernize post-stream to remove Ember array deprecations (#35100) 2025-10-13 15:55:15 -03:00
create-color-row.gjs DEV: [gjs-codemod] Convert automation/styleguide/other to gjs 2025-04-14 15:36:16 +01:00
dropdown-select-box.js DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
email-group-user-chooser-filter.js DEV: Convert select-kit components to native class syntax (#28489) 2024-08-23 12:17:07 +01:00
email-group-user-chooser-row.gjs DEV: [gjs-codemod] Convert automation/styleguide/other to gjs 2025-04-14 15:36:16 +01:00
email-group-user-chooser.js DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
filter-for-more.gjs DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
flair-chooser.js DEV: Replace the use of Ember's .findBy for native methods on arrays (#34557) 2025-09-24 15:32:13 -03:00
flair-row.gjs DEV: [gjs-codemod] Convert automation/styleguide/other to gjs 2025-04-14 15:36:16 +01:00
font-selector.js DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
form-template-chooser.js DEV: Convert select-kit components to native class syntax (#28489) 2024-08-23 12:17:07 +01:00
future-date-input-selector.js DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
group-chooser.js FIX: Limit displayed groups in <GroupChooser /> to 100 groups (#31288) 2025-02-12 03:14:57 +03:00
group-dropdown.js DEV: Consolidate i18n import paths (#29804) 2024-11-19 20:45:18 +00:00
group-notifications-button.js DEV: Convert select-kit components to native class syntax (#28489) 2024-08-23 12:17:07 +01:00
homepage-style-selector.js DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
icon-picker.js DEV: Move discourse-common/config/environment to discourse/lib (#30738) 2025-01-13 15:29:26 +00:00
list-setting.js DEV: Replace deprecated Ember's array uniq and uniqBy (#35227) 2025-10-13 16:47:36 -03:00
mini-tag-chooser.js DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
multi-select.gjs DEV: Replace deprecated Ember's array uniq and uniqBy (#35227) 2025-10-13 16:47:36 -03:00
none-category-row.gjs DEV: remove category badge recursive (#35175) 2025-10-06 09:31:33 +04:00
notifications-button.js DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
notifications-filter.js DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
period-chooser.js DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
search-advanced-category-chooser.js DEV: Convert select-kit components to native class syntax (#28489) 2024-08-23 12:17:07 +01:00
select-kit.js DEV: Replace deprecated Ember's array uniq and uniqBy (#35227) 2025-10-13 16:47:36 -03:00
selected-choice-category.gjs DEV: [gjs-codemod] Convert final core components/routes to gjs 2025-04-25 11:06:24 +01:00
selected-choice-color.js DEV: Convert select-kit components to native class syntax (#28489) 2024-08-23 12:17:07 +01:00
selected-choice.gjs DEV: Enable ember/no-classic-components (#33978) 2025-07-30 14:54:24 +02:00
selected-color.js DEV: Convert select-kit components to native class syntax (#28489) 2024-08-23 12:17:07 +01:00
selected-flair.gjs DEV: [gjs-codemod] Convert automation/styleguide/other to gjs 2025-04-14 15:36:16 +01:00
selected-font.gjs FEATURE: Improve wizard quality and rearrange steps (#30055) 2025-01-02 09:28:23 +10:00
selected-name.gjs DEV: Enable ember/no-classic-components (#33978) 2025-07-30 14:54:24 +02:00
single-select.gjs DEV: Replace the use of Ember's .findBy for native methods on arrays (#34557) 2025-09-24 15:32:13 -03:00
tag-chooser-row.gjs DEV: [gjs-codemod] Convert automation/styleguide/other to gjs 2025-04-14 15:36:16 +01:00
tag-chooser.js DEV: Replace deprecated Ember's array uniq and uniqBy (#35227) 2025-10-13 16:47:36 -03:00
tag-drop.js DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
tag-group-chooser.js DEV: Replace deprecated Ember's array uniq and uniqBy (#35227) 2025-10-13 16:47:36 -03:00
tag-notifications-button.js DEV: Convert select-kit components to native class syntax (#28489) 2024-08-23 12:17:07 +01:00
tag-row.gjs DEV: [gjs-codemod] Convert automation/styleguide/other to gjs 2025-04-14 15:36:16 +01:00
tags-intersection-chooser.js UX: direct to single tag page from tag intersection when one tag remains (#34038) 2025-08-04 09:42:25 -04:00
timezone-input.js DEV: maps IST rails timezone to kolkata (#32896) 2025-05-26 08:56:04 +02:00
topic-chooser.js DEV: Replace Ember's deprecated mapBy with standard .map (#34963) 2025-09-26 12:59:35 -03:00
topic-notifications-button.gjs FIX: prevents d-menu trigger/untrigger propagation (#32078) 2025-03-31 13:47:24 +02:00
topic-notifications-options.js DEV: Convert select-kit components to native class syntax (#28489) 2024-08-23 12:17:07 +01:00
topic-row.gjs DEV: [gjs-codemod] Convert automation/styleguide/other to gjs 2025-04-14 15:36:16 +01:00
user-chooser.js DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
user-notifications-dropdown.js DEV: Add optional callback in notification dropdown action (#31257) 2025-02-10 13:26:19 -03:00
watched-words.js DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733) 2025-01-13 13:02:49 +00:00