discourse/config
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
..
cloud/cloud66 DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
environments DEV: Deprecate DISCOURSE_DEV_HOSTS (#17245) 2022-06-27 19:04:42 +02:00
initializers FIX: CSS tweak and production position fix for miniprofiler (#17493) 2022-07-14 13:03:43 +02:00
locales FEATURE: Add support for case-sensitive Watched Words (#17445) 2022-08-02 10:06:03 +02:00
application.rb FIX: Allow Symbol objects to be deserialized in PostRevision (#17510) 2022-07-15 13:14:57 +01:00
boot.rb DEV: Improve multisite db scripts in dev (#17337) 2022-07-06 10:39:03 +02:00
cdn.yml.sample
database.yml DEV: Remove workaround for advisory lock (#17689) 2022-07-28 09:17:25 +08:00
deploy.rb.sample
dev_defaults.yml DEV: Fix typos and outdated comments (#16614) 2022-05-04 14:12:18 +08:00
discourse_defaults.conf DEV: Remove RTLit gem (#16620) 2022-05-04 14:11:12 +08:00
discourse.config.sample
discourse.pill.sample
environment.rb DEV: Upgrade to Rails 7 2022-04-28 11:51:03 +02:00
logrotate.conf
multisite.yml.production-sample DEV: Remove db_id from sample multisite config. 2020-05-29 10:48:29 +08:00
nginx.global.conf
nginx.sample.conf SECURITY: Do not cache error responses for static assets (#17693) 2022-07-27 16:41:44 -03:00
projections.json DEV: Use .hbr for raw template file extension (#8883) 2020-02-11 13:38:12 -06:00
puma.rb DEV: Allow changing APP_ROOT for puma via ENV variable (#15744) 2022-06-17 11:58:04 -04:00
routes.rb FIX: Accept HEAD requests for mandrill webhook (#17180) 2022-07-29 16:26:31 +10:00
sidekiq.yml
site_settings.yml FIX: Rejected emails should not be cleaned up before their logs (#17648) 2022-07-27 07:28:44 +01:00
spring.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
thin.yml.sample
unicorn_launcher
unicorn_upstart.conf
unicorn.conf.rb DEV: Avoid $ globals (#15453) 2022-01-08 23:39:46 +01:00