discourse/app/assets/javascripts/admin/addon/models
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
..
admin-dashboard.js FEATURE: Add new features section in admin dashboard (#11731) 2021-01-22 10:09:02 -05:00
admin-user.js FEATURE: Use second factor for admin confirmation (#14293) 2021-09-14 15:19:28 +03:00
api-key.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
backup-status.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
backup.js FIX: remove rendering UX from ember models (#11724) 2021-01-20 16:04:21 +11:00
color-scheme-color.js DEV: Replace deprecated String.prototype.substr() (#16233) 2022-04-01 17:35:17 +02:00
color-scheme.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
email-log.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
email-preview.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
email-settings.js DEV: Use method definition syntax consistently (#14915) 2021-11-13 14:01:55 +01:00
email-style.js REFACTOR: Support bundling our `admin` section as an ember addon 2020-09-22 15:14:29 -04:00
email-template.js DEV: Don't use the Ember global (#13535) 2021-06-29 19:54:18 +02:00
flag-type.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
incoming-email.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
permalink.js DEV: Use method definition syntax consistently (#14915) 2021-11-13 14:01:55 +01:00
report.js DEV: Fix typos "formated" -> "formatted" (#17156) 2022-06-20 20:02:05 +02:00
screened-email.js DEV: Use method definition syntax consistently (#14915) 2021-11-13 14:01:55 +01:00
screened-ip-address.js FEATURE: Search screened IP address in blocks (#15461) 2022-01-11 09:16:51 +02:00
screened-url.js DEV: Use method definition syntax consistently (#14915) 2021-11-13 14:01:55 +01:00
site-setting.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
site-text.js UX: Text customization for different languages. (#11729) 2021-01-18 14:53:45 -03:00
staff-action-log.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
theme-settings.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
theme.js FIX: Show unassigned component warning when installing multiple components successively (#11675) 2021-01-11 18:29:12 +03:00
tl3-requirements.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
user-field.js FEATURE: add multiselect user custom field (#13560) 2021-06-29 16:29:25 +10:00
version-check.js DEV: Replace deprecated String.prototype.substr() (#16233) 2022-04-01 17:35:17 +02:00
watched-word.js FEATURE: Add support for case-sensitive Watched Words (#17445) 2022-08-02 10:06:03 +02:00
web-hook.js DEV: Bump eslint-config-discourse (#14868) 2021-11-10 09:31:41 +10:00