discourse/app/assets/javascripts/admin/addon/services
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
..
admin-badges.js DEV: Add Settings tab to admin Badges page (#32251) 2025-04-21 09:41:29 +08:00
admin-emojis.js DEV: Replace deprecated Ember's array uniq and uniqBy (#35227) 2025-10-13 16:47:36 -03:00
admin-nav-manager.js UX: Better separate login and authentication settings (#33711) 2025-10-09 15:29:21 -04:00
admin-plugin-nav-manager.js DEV: Remove unused service injections (#34750) 2025-10-08 13:31:41 +02:00
admin-search-data-source.js DEV: Remove unused service injections (#34750) 2025-10-08 13:31:41 +02:00
admin-sidebar-state-manager.js DEV: Replace deprecated Ember's array uniq and uniqBy (#35227) 2025-10-13 16:47:36 -03:00
admin-tools.js FEATURE: Sync Reviewable Status (#31901) 2025-03-24 14:27:18 +11:00
admin-user-fields.js DEV: Modernize admin user fields (#29843) 2024-11-25 11:54:43 +08:00
site-setting-change-tracker.js FIX: bugs with refresh page after save fonts (#32282) 2025-04-15 12:02:28 +08:00