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
This commit is contained in:
Noelia 2023-01-11 14:57:50 +01:00 committed by Noelia
parent e7b746795f
commit 5e2fa14cd6
3 changed files with 10 additions and 0 deletions

View File

@ -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:

View File

@ -65,6 +65,8 @@ SettingsPageLayout {
}
saveChangesButtonEnabled: true
saveChangesText: qsTr("Update permission")
cancelChangesText: qsTr("Revert changes")
state: d.getInitialState()
states: [
State {

View File

@ -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