ondrej
04.Февраль.2026 19:47:35
1
На странице администратора пользователей, если прокрутить вниз до раздела «Группы» и попытаться добавить пользователя в пользовательскую группу, кнопка появится, как показано на изображении ниже.
Однако при нажатии на неё она не исчезает, создавая впечатление, что действие не выполнено. Но если обновить страницу, окажется, что пользователь действительно был добавлен в группу, хотя интерфейс этого не отражает.
2 лайка
Ещё одна страница, которую лучше было бы подвергнуть полноценному рефакторингу в Glimmer
А пока вот исправление
main ← fix/admin-user-custom-groups-save
merged 06:49PM - 10 Feb 26 UTC
The approve/reject buttons for custom group changes on the admin user page would… remain visible after saving, even though the changes were persisted successfully. Removing a group also failed to update the UI.
Three issues in the reactivity chain caused this:
1. The `@filter` computed macros (classic Ember) on the AdminUser model did not react to `@trackedArray` mutations. Replaced `customGroups` and `automaticGroups` with native getters so they participate in Glimmer autotracking.
2. The controller's `groupAdded()` and `groupRemoved()` wrappers did not return their promise chains, so `await` in `saveCustomGroups()` resolved immediately before the API calls completed and before the groups array was updated.
3. The controller's `customGroupIds`, `customGroupsDirty`, and `automaticGroups` used `@discourseComputed` which could not track changes from native getters on the model. Converted these to native getters and made `customGroupIdsBuffer` `@tracked`.
Additionally, `saveCustomGroups()` now awaits each operation sequentially and calls `resetCustomGroups()` on completion to sync the buffer with the updated group list, clearing the dirty state.
Note: only the properties involved in the groups reactivity chain were converted to modern Glimmer patterns. The rest of the controller and model still use classic Ember (`@discourseComputed`, `this.set`, etc.) and can be modernized separately.
Ref - https://meta.discourse.org/t/395210
1 лайк
zogstrip
Закрыл(а) тему
14.Февраль.2026 07:00:36
5
Эта тема была автоматически закрыта через 2 дня. Новые ответы больше не допускаются.