discourse/app/assets/javascripts/admin/addon
Krzysztof Kotlarek 56524f4bdf
DEV: flaky toggle flag spec (#28292)
Very similar to move up/down flag problem fixed here -  https://github.com/discourse/discourse/pull/28272

Those are the steps to toggle the flag:
1. click toggle - `saving` CSS class is added;
2. request to backend;
3. `saving` CSS class is removed.

And check if the flag was toggle was:
```ruby
def has_saved_flag?(key)
  has_css?(".admin-flag-item.#{key}.saving")
  has_no_css?(".admin-flag-item.#{key}.saving")
end
```
If the save action is very fast, then the saving class is removed before the first check.

Therefore I decided to invert it, and once action is finished add `saved` CSS class.

Then we can have a quick positive check:

```ruby
def has_saved_flag?(key)
  has_css?(".admin-flag-item.#{key}.saved")
end
```
2024-08-09 09:56:10 +10:00
..
adapters FEATURE: Add Filter for Webhook Events by Status (#27332) 2024-06-07 10:26:00 -05:00
components DEV: flaky toggle flag spec (#28292) 2024-08-09 09:56:10 +10:00
controllers FIX: Badge image uploader (#28188) 2024-08-01 15:36:17 +02:00
helpers DEV: replace registerUnbound usage with default exports (#23802) 2023-10-19 14:28:25 +01:00
lib DEV: Rename I18n imports to discourse-i18n (#23915) 2023-10-18 11:07:09 +01:00
mixins DEV: Remove object-property-decorators from admin mixins (#28172) 2024-07-31 17:37:15 +01:00
models DEV: Add stacked line chart mode (#28203) 2024-08-02 09:40:27 -07:00
routes DEV: Move config area site setting fetch into new controller (#28136) 2024-07-30 15:41:28 +10:00
services FIX: More header dropdown admin sidebar fixes (#27241) 2024-05-30 12:55:25 +10:00
templates FIX: Site setting category titles (#28281) 2024-08-08 18:05:35 +01:00