This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/admin/addon/controllers
Selase Krakani 862007fb18
FEATURE: Add support for case-sensitive Watched Words (#17445)
* FEATURE: Add case-sensitivity flag to watched_words

Currently, all watched words are matched case-insensitively. This flag
allows a watched word to be flagged for case-sensitive matching.
To allow allow for backwards compatibility the flag is set to false by
default.

* FEATURE: Support case-sensitive creation of Watched Words via API

Extend admin creation and upload of Watched Words to support case
sensitive flag. This lays the ground work for supporting
case-insensitive matching of Watched Words.

Support for an extra column has also been introduced for the Watched
Words upload CSV file. The new column structure is as follows:

 word,replacement,case_sentive

* FEATURE: Enable case-sensitive matching of Watched Words

WordWatcher's word_matcher_regexp now returns a list of regular
expressions instead of one case-insensitive regular expression.

With the ability to flag a Watched Word as case-sensitive, an action
can have words of both sensitivities.This makes the use of the global
Regexp::IGNORECASE flag added to all words problematic.

To get around platform limitations around the use of subexpression level
switches/flags, a list of regular expressions is returned instead, one for each
case sensitivity.

Word matching has also been updated to use this list of regular expressions
instead of one.

* FEATURE: Use case-sensitive regular expressions for Watched Words

Update Watched Words regular expressions matching and processing to handle
the extra metadata which comes along with the introduction of
case-sensitive Watched Words.

This allows case-sensitive Watched Words to matched as such.

* DEV: Simplify type casting of case-sensitive flag from uploads

Use builtin semantics instead of a custom method for converting
string case flags in uploaded Watched Words to boolean.

* UX: Add case-sensitivity details to Admin Watched Words UI

Update Watched Word form to include a toggle for case-sensitivity.
This also adds support for, case-sensitive testing and matching of  Watched Word
in the admin UI.

* DEV: Code improvements from review feedback

 - Extract watched word regex creation out to a utility function
 - Make JS array presence check more explicit and readable

* DEV: Extract Watched Word regex creation to utility function

Clean-up work from review feedback. Reduce code duplication.

* DEV: Rename word_matcher_regexp to word_matcher_regexp_list

Since a list is returned now instead of a single regular expression,
change `word_matcher_regexp` to `word_matcher_regexp_list` to better communicate
this change.

* DEV:  Incorporate WordWatcher updates from upstream

Resolve conflicts and ensure apply_to_text does not remove non-word characters in matches
that aren't at the beginning of the line.
2022-08-02 10:06:03 +02:00
..
modals FEATURE: Add support for case-sensitive Watched Words (#17445) 2022-08-02 10:06:03 +02:00
admin-api-keys-index.js FEATURE: Add pagination to API keys page (#14777) 2021-11-09 12:18:23 +02:00
admin-api-keys-new.js FEATURE: Add read-only scope to API keys (#14856) 2021-11-10 17:48:00 +02:00
admin-api-keys-show.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-api-keys.js DEV: Modernize Ember Resolver (#17353) 2022-07-06 14:20:00 +01:00
admin-backups-index.js FEATURE: Local chunked uppy backup uploads with a new uploader plugin (#14894) 2021-11-23 08:45:42 +10:00
admin-backups-logs.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-backups.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-badges-award.js FEATURE: Add option to grant badge multiple times to users using Bulk Award (#13571) 2021-07-15 05:53:26 +03:00
admin-badges-show.js DEV: Remove use of run-loop-dot-access (#17114) 2022-06-17 11:19:14 -05:00
admin-badges.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-customize-colors-show.js DEV: Introduce discourseLater (#17532) 2022-07-17 00:50:49 +02:00
admin-customize-colors.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-customize-email-style-edit.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-customize-email-templates-edit.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-customize-email-templates.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-customize-robots-txt.js DEV: Fix typo in customize-robots-txt (#16599) 2022-05-02 22:54:05 +02:00
admin-customize-themes-edit.js DEV: Use method definition syntax consistently (#14915) 2021-11-13 14:01:55 +01:00
admin-customize-themes-show.js DEV: Extensively use includes() (#17541) 2022-07-17 20:48:36 +02:00
admin-customize-themes.js FIX: Detect installed themes using URLs instead of names (#12201) 2021-02-25 00:10:17 +03:00
admin-dashboard-general.js DEV: Use import { inject as controller} Ember idiom (#13140) 2021-05-25 18:37:32 +02:00
admin-dashboard-moderation.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-dashboard-reports.js DEV: Extensively use includes() (#17541) 2022-07-17 20:48:36 +02:00
admin-dashboard.js FEATURE: Scheduled group email credential problem check (#15396) 2022-01-04 10:14:33 +10:00
admin-email-advanced-test.js REFACTOR: Support bundling our admin section as an ember addon 2020-09-22 15:14:29 -04:00
admin-email-bounced.js Revert "Revert "DEV: Wrap Ember.run.debounce. (#11352)"" (#11509) 2020-12-18 10:18:52 -03:00
admin-email-index.js FIX: Correctly display /admin/emails errors (#17321) 2022-07-04 16:03:53 +02:00
admin-email-logs.js FIX: Observers weren't working on admin email logs 2020-10-09 16:27:22 -04:00
admin-email-preview-digest.js DEV: {{user-selector}} replacement (#11726) 2021-02-01 13:07:11 +03:00
admin-email-received.js Revert "Revert "DEV: Wrap Ember.run.debounce. (#11352)"" (#11509) 2020-12-18 10:18:52 -03:00
admin-email-rejected.js Revert "Revert "DEV: Wrap Ember.run.debounce. (#11352)"" (#11509) 2020-12-18 10:18:52 -03:00
admin-email-sent.js Revert "Revert "DEV: Wrap Ember.run.debounce. (#11352)"" (#11509) 2020-12-18 10:18:52 -03:00
admin-email-skipped.js Revert "Revert "DEV: Wrap Ember.run.debounce. (#11352)"" (#11509) 2020-12-18 10:18:52 -03:00
admin-embedding.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-emojis.js FIX: Improve emoji upload UI (#15603) 2022-01-17 11:48:49 +10:00
admin-logs-screened-emails.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-logs-screened-ip-addresses.js FEATURE: Search screened IP address in blocks (#15461) 2022-01-11 09:16:51 +02:00
admin-logs-screened-urls.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-logs-staff-action-logs.js DEV: Bump eslint-config-discourse (#14868) 2021-11-10 09:31:41 +10:00
admin-permalinks.js DEV: Make clipboardCopy util available for import (#15874) 2022-02-09 16:11:41 +10:00
admin-plugins.js DEV: refactors admin-plugins/admin-site-settings (#15244) 2021-12-09 13:47:56 +01:00
admin-reports-show.js FIX: ensure we dont collapse data multiple times (#13399) 2021-06-17 09:15:20 +02:00
admin-search-logs-index.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-search-logs-term.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-site-settings-category.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin-site-settings.js DEV: Replace deprecated String.prototype.substr() (#16233) 2022-04-01 17:35:17 +02:00
admin-site-text-edit.js UX: Text customization for different languages. (#11729) 2021-01-18 14:53:45 -03:00
admin-site-text-index.js FIX: Show the fallback locale warning when both settings are enabled. (#11787) 2021-01-21 13:09:32 -03:00
admin-user-badges.js DEV: Use method definition syntax consistently (#14915) 2021-11-13 14:01:55 +01:00
admin-user-fields.js DEV: prettier 2.2.1 (#11862) 2021-01-27 12:39:20 +01:00
admin-user-index.js DEV: Remove grant admin 2FA modal (#16347) 2022-03-31 19:01:11 +03:00
admin-user.js REFACTOR: Support bundling our admin section as an ember addon 2020-09-22 15:14:29 -04:00
admin-users-list-show.js FIX: Make sure user list is complete and sorted (#17616) 2022-07-26 17:54:52 +03:00
admin-watched-words-action.js FEATURE: Show an error message if regex is invalid (#13164) 2021-05-27 19:42:43 +03:00
admin-watched-words.js DEV: Extensively use includes() (#17541) 2022-07-17 20:48:36 +02:00
admin-web-hooks-show-events.js DEV: Extensively use includes() (#17541) 2022-07-17 20:48:36 +02:00
admin-web-hooks-show.js DEV: Extensively use includes() (#17541) 2022-07-17 20:48:36 +02:00
admin-web-hooks.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
admin.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00