feat(Permissions): Adding, duplicating, editing and deleting permissions when control node is offline
- It adds info panel when control node is offline. - It modifies UI texts when control node is offline. - It updates storybook updating permissions model and allowing permission state changes. NOTE: Only UI, no backend. There is 1 expected integration point: permissions model item `permissionState` role. Closes #11769
This commit is contained in:
parent
dcfebbcb9e
commit
351309a2c6
|
@ -6,6 +6,8 @@ import StatusQ.Core.Utils 0.1
|
||||||
|
|
||||||
import AppLayouts.Communities.controls 1.0
|
import AppLayouts.Communities.controls 1.0
|
||||||
|
|
||||||
|
import Models 1.0
|
||||||
|
|
||||||
Flickable {
|
Flickable {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
@ -49,6 +51,36 @@ Flickable {
|
||||||
spacing: 20
|
spacing: 20
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Label {
|
||||||
|
Layout.leftMargin: 5
|
||||||
|
|
||||||
|
text: "Permission State:"
|
||||||
|
}
|
||||||
|
ColumnLayout {
|
||||||
|
Layout.leftMargin: 5
|
||||||
|
|
||||||
|
RadioButton {
|
||||||
|
text: "Active state"
|
||||||
|
checked: true
|
||||||
|
onCheckedChanged: if(checked) PermissionsModel.changePermissionState(root.model, model.index, PermissionTypes.State.Active)
|
||||||
|
}
|
||||||
|
|
||||||
|
RadioButton {
|
||||||
|
text: "Creating state"
|
||||||
|
onCheckedChanged: if(checked) PermissionsModel.changePermissionState(root.model, model.index, PermissionTypes.State.Creating)
|
||||||
|
}
|
||||||
|
|
||||||
|
RadioButton {
|
||||||
|
text: "Editing state"
|
||||||
|
onCheckedChanged: if(checked) PermissionsModel.changePermissionState(root.model, model.index, PermissionTypes.State.Editing)
|
||||||
|
}
|
||||||
|
|
||||||
|
RadioButton {
|
||||||
|
text: "Deleting state"
|
||||||
|
onCheckedChanged: if(checked) PermissionsModel.changePermissionState(root.model, model.index, PermissionTypes.State.Deleting)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: holdingsListModel
|
model: holdingsListModel
|
||||||
|
|
||||||
|
|
|
@ -112,16 +112,10 @@ SplitView {
|
||||||
|
|
||||||
logsView.logText: logs.logText
|
logsView.logText: logs.logText
|
||||||
|
|
||||||
ColumnLayout {
|
CheckBox {
|
||||||
anchors.top: parent.top
|
id: isOwnerCheckBox
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
|
|
||||||
CheckBox {
|
text: "Is owner"
|
||||||
id: isOwnerCheckBox
|
|
||||||
|
|
||||||
text: "Is owner"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel1(),
|
holdingsListModel: root.createHoldingsModel1(),
|
||||||
channelsListModel: root.createChannelsModel1(),
|
channelsListModel: root.createChannelsModel1(),
|
||||||
permissionType: PermissionTypes.Type.Admin,
|
permissionType: PermissionTypes.Type.Admin,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: true,
|
isPrivate: true,
|
||||||
tokenCriteriaMet: false
|
tokenCriteriaMet: false
|
||||||
},
|
},
|
||||||
|
@ -21,6 +22,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel2(),
|
holdingsListModel: root.createHoldingsModel2(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Member,
|
permissionType: PermissionTypes.Type.Member,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: true
|
tokenCriteriaMet: true
|
||||||
}
|
}
|
||||||
|
@ -31,6 +33,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel4(),
|
holdingsListModel: root.createHoldingsModel4(),
|
||||||
channelsListModel: root.createChannelsModel1(),
|
channelsListModel: root.createChannelsModel1(),
|
||||||
permissionType: PermissionTypes.Type.Admin,
|
permissionType: PermissionTypes.Type.Admin,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: true
|
isPrivate: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -40,24 +43,28 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel4(),
|
holdingsListModel: root.createHoldingsModel4(),
|
||||||
channelsListModel: root.createChannelsModel1(),
|
channelsListModel: root.createChannelsModel1(),
|
||||||
permissionType: PermissionTypes.Type.Admin,
|
permissionType: PermissionTypes.Type.Admin,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: true
|
isPrivate: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
holdingsListModel: root.createHoldingsModel3(),
|
holdingsListModel: root.createHoldingsModel3(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Member,
|
permissionType: PermissionTypes.Type.Member,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
holdingsListModel: root.createHoldingsModel2(),
|
holdingsListModel: root.createHoldingsModel2(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Member,
|
permissionType: PermissionTypes.Type.Member,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
holdingsListModel: root.createHoldingsModel1(),
|
holdingsListModel: root.createHoldingsModel1(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Member,
|
permissionType: PermissionTypes.Type.Member,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -67,12 +74,14 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel1(),
|
holdingsListModel: root.createHoldingsModel1(),
|
||||||
channelsListModel: root.createChannelsModel1(),
|
channelsListModel: root.createChannelsModel1(),
|
||||||
permissionType: PermissionTypes.Type.Admin,
|
permissionType: PermissionTypes.Type.Admin,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: true
|
isPrivate: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
holdingsListModel: root.createHoldingsModel2(),
|
holdingsListModel: root.createHoldingsModel2(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Member,
|
permissionType: PermissionTypes.Type.Member,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -82,12 +91,14 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel5(),
|
holdingsListModel: root.createHoldingsModel5(),
|
||||||
channelsListModel: root.createChannelsModel1(),
|
channelsListModel: root.createChannelsModel1(),
|
||||||
permissionType: PermissionTypes.Type.Admin,
|
permissionType: PermissionTypes.Type.Admin,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: true
|
isPrivate: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
holdingsListModel: root.createHoldingsModel4(),
|
holdingsListModel: root.createHoldingsModel4(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Member,
|
permissionType: PermissionTypes.Type.Member,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -97,18 +108,21 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel1(),
|
holdingsListModel: root.createHoldingsModel1(),
|
||||||
channelsListModel: root.createChannelsModel1(),
|
channelsListModel: root.createChannelsModel1(),
|
||||||
permissionType: PermissionTypes.Type.Admin,
|
permissionType: PermissionTypes.Type.Admin,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: true
|
isPrivate: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
holdingsListModel: root.createHoldingsModel1b(),
|
holdingsListModel: root.createHoldingsModel1b(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Member,
|
permissionType: PermissionTypes.Type.Member,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
holdingsListModel: root.createHoldingsModel2(),
|
holdingsListModel: root.createHoldingsModel2(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Member,
|
permissionType: PermissionTypes.Type.Member,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -118,24 +132,28 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel1(),
|
holdingsListModel: root.createHoldingsModel1(),
|
||||||
channelsListModel: root.createChannelsModel1(),
|
channelsListModel: root.createChannelsModel1(),
|
||||||
permissionType: PermissionTypes.Type.Admin,
|
permissionType: PermissionTypes.Type.Admin,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: true
|
isPrivate: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
holdingsListModel: root.createHoldingsModel2(),
|
holdingsListModel: root.createHoldingsModel2(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Member,
|
permissionType: PermissionTypes.Type.Member,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
holdingsListModel: root.createHoldingsModel3(),
|
holdingsListModel: root.createHoldingsModel3(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Member,
|
permissionType: PermissionTypes.Type.Member,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
holdingsListModel: root.createHoldingsModel5(),
|
holdingsListModel: root.createHoldingsModel5(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Member,
|
permissionType: PermissionTypes.Type.Member,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false
|
isPrivate: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -146,6 +164,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel2b(),
|
holdingsListModel: root.createHoldingsModel2b(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Admin,
|
permissionType: PermissionTypes.Type.Admin,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: true
|
tokenCriteriaMet: true
|
||||||
},
|
},
|
||||||
|
@ -154,6 +173,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel3(),
|
holdingsListModel: root.createHoldingsModel3(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Admin,
|
permissionType: PermissionTypes.Type.Admin,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: false
|
tokenCriteriaMet: false
|
||||||
},
|
},
|
||||||
|
@ -162,6 +182,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel2(),
|
holdingsListModel: root.createHoldingsModel2(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Member,
|
permissionType: PermissionTypes.Type.Member,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: true
|
tokenCriteriaMet: true
|
||||||
},
|
},
|
||||||
|
@ -170,6 +191,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel3(),
|
holdingsListModel: root.createHoldingsModel3(),
|
||||||
channelsListModel: root.createChannelsModel2(),
|
channelsListModel: root.createChannelsModel2(),
|
||||||
permissionType: PermissionTypes.Type.Member,
|
permissionType: PermissionTypes.Type.Member,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: false
|
tokenCriteriaMet: false
|
||||||
}
|
}
|
||||||
|
@ -181,6 +203,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel1b(),
|
holdingsListModel: root.createHoldingsModel1b(),
|
||||||
channelsListModel: root.createChannelsModel1(),
|
channelsListModel: root.createChannelsModel1(),
|
||||||
permissionType: PermissionTypes.Type.Read,
|
permissionType: PermissionTypes.Type.Read,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: true
|
tokenCriteriaMet: true
|
||||||
},
|
},
|
||||||
|
@ -189,6 +212,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel1(),
|
holdingsListModel: root.createHoldingsModel1(),
|
||||||
channelsListModel: root.createChannelsModel1(),
|
channelsListModel: root.createChannelsModel1(),
|
||||||
permissionType: PermissionTypes.Type.Read,
|
permissionType: PermissionTypes.Type.Read,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: false
|
tokenCriteriaMet: false
|
||||||
},
|
},
|
||||||
|
@ -197,6 +221,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel3(),
|
holdingsListModel: root.createHoldingsModel3(),
|
||||||
channelsListModel: root.createChannelsModel1(),
|
channelsListModel: root.createChannelsModel1(),
|
||||||
permissionType: PermissionTypes.Type.Read,
|
permissionType: PermissionTypes.Type.Read,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: false
|
tokenCriteriaMet: false
|
||||||
},
|
},
|
||||||
|
@ -205,6 +230,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel2(),
|
holdingsListModel: root.createHoldingsModel2(),
|
||||||
channelsListModel: root.createChannelsModel3(),
|
channelsListModel: root.createChannelsModel3(),
|
||||||
permissionType: PermissionTypes.Type.Read,
|
permissionType: PermissionTypes.Type.Read,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: true
|
tokenCriteriaMet: true
|
||||||
},
|
},
|
||||||
|
@ -213,6 +239,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel5(),
|
holdingsListModel: root.createHoldingsModel5(),
|
||||||
channelsListModel: root.createChannelsModel3(),
|
channelsListModel: root.createChannelsModel3(),
|
||||||
permissionType: PermissionTypes.Type.Read,
|
permissionType: PermissionTypes.Type.Read,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: false
|
tokenCriteriaMet: false
|
||||||
},
|
},
|
||||||
|
@ -221,6 +248,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel3(),
|
holdingsListModel: root.createHoldingsModel3(),
|
||||||
channelsListModel: root.createChannelsModel1(),
|
channelsListModel: root.createChannelsModel1(),
|
||||||
permissionType: PermissionTypes.Type.ViewAndPost,
|
permissionType: PermissionTypes.Type.ViewAndPost,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: false
|
tokenCriteriaMet: false
|
||||||
},
|
},
|
||||||
|
@ -229,6 +257,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel2b(),
|
holdingsListModel: root.createHoldingsModel2b(),
|
||||||
channelsListModel: root.createChannelsModel1(),
|
channelsListModel: root.createChannelsModel1(),
|
||||||
permissionType: PermissionTypes.Type.ViewAndPost,
|
permissionType: PermissionTypes.Type.ViewAndPost,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: true
|
tokenCriteriaMet: true
|
||||||
},
|
},
|
||||||
|
@ -237,6 +266,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel3(),
|
holdingsListModel: root.createHoldingsModel3(),
|
||||||
channelsListModel: root.createChannelsModel3(),
|
channelsListModel: root.createChannelsModel3(),
|
||||||
permissionType: PermissionTypes.Type.ViewAndPost,
|
permissionType: PermissionTypes.Type.ViewAndPost,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: false
|
tokenCriteriaMet: false
|
||||||
},
|
},
|
||||||
|
@ -245,6 +275,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel5(),
|
holdingsListModel: root.createHoldingsModel5(),
|
||||||
channelsListModel: root.createChannelsModel3(),
|
channelsListModel: root.createChannelsModel3(),
|
||||||
permissionType: PermissionTypes.Type.ViewAndPost,
|
permissionType: PermissionTypes.Type.ViewAndPost,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: false
|
tokenCriteriaMet: false
|
||||||
},
|
},
|
||||||
|
@ -253,6 +284,7 @@ QtObject {
|
||||||
holdingsListModel: root.createHoldingsModel1(),
|
holdingsListModel: root.createHoldingsModel1(),
|
||||||
channelsListModel: root.createChannelsModel3(),
|
channelsListModel: root.createChannelsModel3(),
|
||||||
permissionType: PermissionTypes.Type.ViewAndPost,
|
permissionType: PermissionTypes.Type.ViewAndPost,
|
||||||
|
permissionState: PermissionTypes.State.Active,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
tokenCriteriaMet: false
|
tokenCriteriaMet: false
|
||||||
}
|
}
|
||||||
|
@ -526,4 +558,13 @@ QtObject {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changePermissionState(model, index, permissionState) {
|
||||||
|
model.get(index).permissionState = permissionState
|
||||||
|
}
|
||||||
|
|
||||||
|
function changeAllPermissionStates(model, permissionState) {
|
||||||
|
for(let i = 0; i < model.count; i++)
|
||||||
|
changePermissionState(model, i, permissionState)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ Control{
|
||||||
property var channelsListModel
|
property var channelsListModel
|
||||||
|
|
||||||
property int permissionType: PermissionTypes.Type.None
|
property int permissionType: PermissionTypes.Type.None
|
||||||
|
property int permissionState: PermissionTypes.State.Active
|
||||||
property bool isPrivate: false
|
property bool isPrivate: false
|
||||||
property bool showButtons: true
|
property bool showButtons: true
|
||||||
|
|
||||||
|
@ -32,6 +33,23 @@ Control{
|
||||||
readonly property int buttonTextPixelSize: 12
|
readonly property int buttonTextPixelSize: 12
|
||||||
readonly property int buttonDiameter: 36
|
readonly property int buttonDiameter: 36
|
||||||
readonly property int buttonTextSpacing: 6
|
readonly property int buttonTextSpacing: 6
|
||||||
|
readonly property int headerIconleftMargin: 20
|
||||||
|
readonly property bool isActiveState: root.permissionState === PermissionTypes.State.Active
|
||||||
|
readonly property bool isDeletingState: root.permissionState === PermissionTypes.State.Deleting
|
||||||
|
|
||||||
|
function getStateText(state) {
|
||||||
|
if(state === PermissionTypes.State.Active)
|
||||||
|
return qsTr("Active")
|
||||||
|
|
||||||
|
if(state === PermissionTypes.State.Creating)
|
||||||
|
return qsTr("Pending, will become active once owner node comes online")
|
||||||
|
|
||||||
|
if(state === PermissionTypes.State.Deleting)
|
||||||
|
return qsTr("Deletion pending, will be deleted once owner node comes online")
|
||||||
|
|
||||||
|
if(state === PermissionTypes.State.Editing)
|
||||||
|
return qsTr("Pending updates will be applied when owner node comes online")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
@ -55,16 +73,24 @@ Control{
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
||||||
StatusIcon {
|
StatusIcon {
|
||||||
Layout.leftMargin: 19
|
Layout.leftMargin: d.headerIconleftMargin
|
||||||
|
|
||||||
|
visible: d.isActiveState
|
||||||
icon: "checkmark"
|
icon: "checkmark"
|
||||||
Layout.preferredWidth: 11
|
Layout.preferredWidth: 11
|
||||||
Layout.preferredHeight: 8
|
Layout.preferredHeight: 8
|
||||||
color: Theme.palette.directColor1
|
color: Theme.palette.directColor1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StatusDotsLoadingIndicator {
|
||||||
|
Layout.leftMargin: d.headerIconleftMargin
|
||||||
|
|
||||||
|
visible: !d.isActiveState
|
||||||
|
}
|
||||||
|
|
||||||
StatusBaseText {
|
StatusBaseText {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: qsTr("Active")
|
text: d.getStateText(root.permissionState)
|
||||||
font.pixelSize: d.tagTextPixelSize
|
font.pixelSize: d.tagTextPixelSize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +255,7 @@ Control{
|
||||||
}
|
}
|
||||||
StatusBaseText {
|
StatusBaseText {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text: qsTr("Delete")
|
text: d.isDeletingState ? qsTr("Undo delete") : qsTr("Delete")
|
||||||
color: Theme.palette.dangerColor1
|
color: Theme.palette.dangerColor1
|
||||||
font.pixelSize: d.buttonTextPixelSize
|
font.pixelSize: d.buttonTextPixelSize
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,10 @@ QtObject {
|
||||||
None, Admin, Member, Read, ViewAndPost, Moderator
|
None, Admin, Member, Read, ViewAndPost, Moderator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum State {
|
||||||
|
Active, Creating, Deleting, Editing
|
||||||
|
}
|
||||||
|
|
||||||
function getName(type) {
|
function getName(type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case PermissionTypes.Type.Admin:
|
case PermissionTypes.Type.Admin:
|
||||||
|
|
|
@ -595,6 +595,16 @@ StatusScrollView {
|
||||||
visible: root.permissionDuplicated || root.permissionTypeLimitReached
|
visible: root.permissionDuplicated || root.permissionTypeLimitReached
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StatusWarningBox {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: Style.current.padding
|
||||||
|
|
||||||
|
icon: "desktop"
|
||||||
|
text: qsTr("Any changes to community permissions will take effect after the control node receives and processes them")
|
||||||
|
borderColor: Theme.palette.baseColor1
|
||||||
|
iconColor: textColor
|
||||||
|
}
|
||||||
|
|
||||||
StatusButton {
|
StatusButton {
|
||||||
Layout.preferredHeight: 44
|
Layout.preferredHeight: 44
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
|
@ -85,6 +85,7 @@ StatusScrollView {
|
||||||
}
|
}
|
||||||
|
|
||||||
permissionType: model.permissionType
|
permissionType: model.permissionType
|
||||||
|
permissionState: model.permissionState // TODO: Backend!
|
||||||
|
|
||||||
ChannelsSelectionModel {
|
ChannelsSelectionModel {
|
||||||
id: channelsSelectionModel
|
id: channelsSelectionModel
|
||||||
|
|
Loading…
Reference in New Issue