discourse-assign/assets/javascripts/discourse
Andrei Prigorshnev 0bcd0a1fee
FIX: Unassign buttons on the activity/assigned page don't work (#559)
We've noticed that when unassigning a topic on the `activity/assigned` one of 
two incorrect things happens when pressing this button:
1. The first topic on the page gets unassigned instead of the selected one
2. No topics get unassigned (that happens when the first topic on the list is 
not assigned and only has assigned _posts_)

That happens because this handler for all buttons somehow always use the 
same state - the state of the first topic on the page:

f2906e0885/assets/javascripts/discourse/components/assign-actions-dropdown.js (L55-L68)

There seem to be some nuances in select-kit and I'm not sure whether 
this should be qualified as a bug in select-kit. However, I've noticed that in other cases when we use `DropdownSelectBoxComponent` we use the `onChange` handler rather 
than `onSelect`.

So I switched this code to using `onChange` and that resolved the issue, 
the `onChange` handler has access to correct state.

Tests will be in a follow-up.
2024-04-04 20:03:03 +04:00
..
components FIX: Unassign buttons on the activity/assigned page don't work (#559) 2024-04-04 20:03:03 +04:00
connectors DEV: Update linting (#538) 2024-01-15 11:24:20 +00:00
controllers DEV: Update linting (#534) 2023-11-29 23:02:00 +01:00
initializers FEATURE: Add buttons for unassigning from posts to the topic level assign menu (#554) 2024-03-29 18:10:04 +04:00
pre-initializers DEV: Use `@discourse/lint-configs` (#517) 2023-10-23 12:08:11 +02:00
raw-templates DEV: Modernise assignment topic-list implementation (#510) 2023-09-28 15:07:15 +01:00
raw-views DEV: Use `@discourse/lint-configs` (#517) 2023-10-23 12:08:11 +02:00
routes DEV: Resolve transitionTo deprecation (#535) 2023-12-01 16:06:09 +00:00
services FEATURE: Add menu to assigned text on posts (#550) 2024-03-15 18:30:11 +04:00
templates DEV: Update linting (#538) 2024-01-15 11:24:20 +00:00
assigned-group-route-map.js DEV: Merge js dirs; prefix tests (#484) 2023-07-03 17:28:02 +02:00
assigned-messages-route-map.js DEV: Update linting (#534) 2023-11-29 23:02:00 +01:00
assigns-activity-route-map.js DEV: Merge js dirs; prefix tests (#484) 2023-07-03 17:28:02 +02:00