discourse/app/assets/javascripts/admin/addon
Loïc Guitaut 1166db12b4
FIX: Make watched words uploads work as intended (#17097)
* FIX: Make watched words uploads work as intended

Currently when we upload a file containing watched words, it will always
add the words to the action that was initially selected: this is the
`block` action by default but if changing manually the action in the URL
to `flag` for example, then this action will be selected and uploaded
watched words will be categorised as `flag` no matter what.

The problem lies with how the component works: it’s an Uppy object where
extra data is defined to provide an action key to the server but when
navigating to another listed action, while this action key is properly
updated on the component itself, the underlying Uppy object has already
been created and doesn’t care about the new value.

This patch solves this by using the `_perFileData` method instead of
`data`: the former is merged just before uploading a file whereas the
latter is used when the Uppy object is created.
2022-06-17 11:07:58 +02:00
..
adapters
components FIX: Make watched words uploads work as intended (#17097) 2022-06-17 11:07:58 +02:00
controllers DEV: Fix typo in customize-robots-txt (#16599) 2022-05-02 22:54:05 +02:00
helpers DEV: Remove 'htmlSafe' string prototype extensions (#16766) 2022-05-13 14:58:26 -05:00
mixins FEATURE: Add new site setting list type with name and values (#16045) 2022-03-08 13:18:43 +02:00
models DEV: Replace deprecated String.prototype.substr() (#16233) 2022-04-01 17:35:17 +02:00
routes DEV: Use method definition syntax consistently (#14915) 2021-11-13 14:01:55 +01:00
services DEV: Avoid unnecessary site-settings:main lookups (#15006) 2021-11-18 17:11:59 +01:00
templates COPY: Use main instead of master for theme installation modal (#17044) 2022-06-08 11:32:54 -07:00