Final changes for Room Moderation (#2576)

* Add confirmation that the user would like to discard unsaved changes.

* Update string on permissions screen.

* Fix UI tests and update snapshots.

* Fix integration tests.

* Run periphery for Moderation feature.
This commit is contained in:
Doug
2024-03-15 13:41:23 +00:00
committed by GitHub
parent 668c5188fb
commit 3ba34c0704
29 changed files with 84 additions and 47 deletions
@@ -74,6 +74,8 @@ class RoomChangeRolesScreenViewModel: RoomChangeRolesScreenViewModelType, RoomCh
} else {
Task { await save() }
}
case .cancel:
confirmDiscardChanges()
}
}
@@ -148,6 +150,14 @@ class RoomChangeRolesScreenViewModel: RoomChangeRolesScreenViewModelType, RoomCh
}
}
private func confirmDiscardChanges() {
state.bindings.alertInfo = AlertInfo(id: .discardChanges,
title: L10n.screenRoomChangeRoleUnsavedChangesTitle,
message: L10n.screenRoomChangeRoleUnsavedChangesDescription,
primaryButton: .init(title: L10n.actionSave) { Task { await self.save() } },
secondaryButton: .init(title: L10n.actionDiscard, role: .cancel) { self.actionsSubject.send(.complete) })
}
// MARK: Loading indicator
private static let indicatorID = "SavingRoomRoles"