From 5e2fa14cd632931d68cb1377c9801a68d00c8c1f Mon Sep 17 00:00:00 2001 From: Noelia Date: Wed, 11 Jan 2023 14:57:50 +0100 Subject: [PATCH] fix(Community Permissions): Update change detected buttons labels according to the new design Exposed new properties in `SettingsDirtyToastMessage` to customise buttons texts. Exposed new properties in `SettingsPageLayout` to customise dirty toast buttons texts. Fixes #9046 --- ui/app/AppLayouts/Chat/layouts/SettingsPageLayout.qml | 3 +++ .../panels/communities/CommunityPermissionsSettingsPanel.qml | 2 ++ ui/imports/shared/popups/SettingsDirtyToastMessage.qml | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/ui/app/AppLayouts/Chat/layouts/SettingsPageLayout.qml b/ui/app/AppLayouts/Chat/layouts/SettingsPageLayout.qml index 84f0ab4df7..ad537a8b1f 100644 --- a/ui/app/AppLayouts/Chat/layouts/SettingsPageLayout.qml +++ b/ui/app/AppLayouts/Chat/layouts/SettingsPageLayout.qml @@ -24,6 +24,9 @@ Item { property int headerWidth: 0 property string previousPageName: "" property bool saveChangesButtonEnabled: !!root.contentItem && !!root.contentItem.saveChangesButtonEnabled + property alias saveChangesText: settingsDirtyToastMessage.saveChangesText + property alias cancelChangesText: settingsDirtyToastMessage.cancelChangesText + property alias changesDetectedText: settingsDirtyToastMessage.changesDetectedText readonly property Item contentItem: contentLoader.item readonly property size settingsDirtyToastMessageImplicitSize: diff --git a/ui/app/AppLayouts/Chat/panels/communities/CommunityPermissionsSettingsPanel.qml b/ui/app/AppLayouts/Chat/panels/communities/CommunityPermissionsSettingsPanel.qml index d3102b167d..5a1ab4d12f 100644 --- a/ui/app/AppLayouts/Chat/panels/communities/CommunityPermissionsSettingsPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/communities/CommunityPermissionsSettingsPanel.qml @@ -65,6 +65,8 @@ SettingsPageLayout { } saveChangesButtonEnabled: true + saveChangesText: qsTr("Update permission") + cancelChangesText: qsTr("Revert changes") state: d.getInitialState() states: [ State { diff --git a/ui/imports/shared/popups/SettingsDirtyToastMessage.qml b/ui/imports/shared/popups/SettingsDirtyToastMessage.qml index f40327b8ec..b9a61f3ddb 100644 --- a/ui/imports/shared/popups/SettingsDirtyToastMessage.qml +++ b/ui/imports/shared/popups/SettingsDirtyToastMessage.qml @@ -13,6 +13,9 @@ Rectangle { property bool active: false property bool saveChangesButtonEnabled: false + property alias saveChangesText: saveChangesButton.text + property alias cancelChangesText: cancelChangesButton.text + property alias changesDetectedText: changesDetectedTextItem.text property Flickable flickable: null @@ -100,6 +103,7 @@ Rectangle { } StatusBaseText { + id: changesDetectedTextItem Layout.columnSpan: 2 Layout.fillWidth: true padding: 8 @@ -109,6 +113,7 @@ Rectangle { } StatusButton { + id: cancelChangesButton text: qsTr("Cancel") enabled: root.active type: StatusBaseButton.Type.Danger