2023-03-07 08:47:04 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2023-06-29 11:54:04 +00:00
|
|
|
import QtQuick.Layouts 1.15
|
2023-03-07 08:47:04 +00:00
|
|
|
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Core.Utils 0.1
|
2022-12-01 16:31:03 +00:00
|
|
|
|
2023-06-23 06:17:04 +00:00
|
|
|
import AppLayouts.Communities.views 1.0
|
2022-12-01 16:31:03 +00:00
|
|
|
|
|
|
|
import Models 1.0
|
2023-03-07 08:47:04 +00:00
|
|
|
import Storybook 1.0
|
2023-02-13 10:40:13 +00:00
|
|
|
|
2022-12-01 16:31:03 +00:00
|
|
|
|
|
|
|
SplitView {
|
|
|
|
Logs { id: logs }
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
color: Theme.palette.statusAppLayout.rightPanelBackgroundColor
|
2023-02-11 19:03:57 +00:00
|
|
|
|
2023-06-26 11:48:45 +00:00
|
|
|
PermissionsView {
|
2022-12-01 16:31:03 +00:00
|
|
|
anchors {
|
|
|
|
fill: parent
|
|
|
|
margins: 50
|
|
|
|
}
|
2023-02-11 19:03:57 +00:00
|
|
|
|
2023-06-29 11:54:04 +00:00
|
|
|
ListModel {
|
2023-03-07 08:47:04 +00:00
|
|
|
id: permissionsModel
|
2023-02-17 13:36:58 +00:00
|
|
|
|
2023-03-07 08:47:04 +00:00
|
|
|
Component.onCompleted: append(PermissionsModel.permissionsModelData)
|
|
|
|
}
|
|
|
|
|
2023-06-29 11:54:04 +00:00
|
|
|
ListModel {
|
|
|
|
id: emptyModel
|
|
|
|
}
|
|
|
|
|
|
|
|
permissionsModel: emptyModelCheckBox.checked ? emptyModel : permissionsModel
|
|
|
|
|
2023-03-07 08:47:04 +00:00
|
|
|
assetsModel: AssetsModel {
|
|
|
|
id: assetsModel
|
|
|
|
}
|
2022-12-01 16:31:03 +00:00
|
|
|
|
2023-03-07 08:47:04 +00:00
|
|
|
collectiblesModel: CollectiblesModel {
|
|
|
|
id: collectiblesModel
|
|
|
|
}
|
|
|
|
|
|
|
|
channelsModel: ChannelsModel {
|
|
|
|
id: channelsModel
|
|
|
|
}
|
2023-02-13 10:40:13 +00:00
|
|
|
|
2023-03-07 08:47:04 +00:00
|
|
|
communityDetails: QtObject {
|
2023-06-29 16:02:27 +00:00
|
|
|
readonly property string id: "sox"
|
2023-03-07 08:47:04 +00:00
|
|
|
readonly property string name: "Socks"
|
|
|
|
readonly property string image: ModelsData.icons.socks
|
|
|
|
readonly property string color: "red"
|
2023-06-29 22:05:46 +00:00
|
|
|
readonly property bool owner: isOwnerCheckBox.checked
|
2023-07-04 15:11:41 +00:00
|
|
|
readonly property bool admin: isAdminCheckBox.checked
|
2022-12-01 16:31:03 +00:00
|
|
|
}
|
2023-01-27 09:22:04 +00:00
|
|
|
|
2023-03-07 08:47:04 +00:00
|
|
|
function log(method, index) {
|
2023-06-26 11:48:45 +00:00
|
|
|
logs.logEvent(`PermissionsView::${method} - index: ${index}`)
|
2023-01-27 09:22:04 +00:00
|
|
|
}
|
|
|
|
|
2023-03-07 08:47:04 +00:00
|
|
|
onEditPermissionRequested: log("editPermissionRequested", index)
|
|
|
|
onRemovePermissionRequested: log("removePermissionRequested", index)
|
|
|
|
onDuplicatePermissionRequested: log("duplicatePermissionRequested", index)
|
2022-12-01 16:31:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
id: logsAndControlsPanel
|
|
|
|
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 150
|
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Pane {
|
|
|
|
SplitView.minimumWidth: 300
|
|
|
|
SplitView.preferredWidth: 300
|
|
|
|
|
2023-06-29 11:54:04 +00:00
|
|
|
ColumnLayout {
|
2022-12-01 16:31:03 +00:00
|
|
|
anchors.fill: parent
|
2023-02-13 10:40:13 +00:00
|
|
|
|
2023-06-29 11:54:04 +00:00
|
|
|
CheckBox {
|
2023-06-29 22:05:46 +00:00
|
|
|
id: isOwnerCheckBox
|
|
|
|
|
|
|
|
text: "Is owner"
|
|
|
|
}
|
2023-06-29 11:54:04 +00:00
|
|
|
|
2023-07-04 15:11:41 +00:00
|
|
|
CheckBox {
|
|
|
|
id: isAdminCheckBox
|
|
|
|
|
|
|
|
text: "Is admin"
|
|
|
|
}
|
|
|
|
|
2023-06-29 22:05:46 +00:00
|
|
|
CheckBox {
|
|
|
|
id: emptyModelCheckBox
|
2023-06-29 11:54:04 +00:00
|
|
|
|
|
|
|
text: "Empty model"
|
|
|
|
}
|
2023-02-28 12:44:46 +00:00
|
|
|
|
2023-06-29 22:05:46 +00:00
|
|
|
Item {
|
|
|
|
visible: emptyModelCheckBox.checked
|
|
|
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
|
|
|
|
2023-06-29 11:54:04 +00:00
|
|
|
CommunityPermissionsSettingsPanelEditor {
|
|
|
|
clip: true
|
|
|
|
visible: !emptyModelCheckBox.checked
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
model: permissionsModel
|
|
|
|
|
|
|
|
assetKeys: assetsModel.data.map(asset => asset.key)
|
|
|
|
collectibleKeys: collectiblesModel.data.map(collectible => collectible.key)
|
|
|
|
channelKeys: {
|
|
|
|
const array = ModelUtils.modelToArray(channelsModel,
|
|
|
|
["itemId", "isCategory"])
|
|
|
|
const channelsOnly = array.filter(channel => !channel.isCategory)
|
|
|
|
|
|
|
|
return channelsOnly.map(channel => channel.itemId)
|
|
|
|
}
|
2023-02-28 12:44:46 +00:00
|
|
|
}
|
2022-12-01 16:31:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-31 12:21:14 +00:00
|
|
|
// category: Views
|
2023-10-03 11:56:30 +00:00
|
|
|
|
|
|
|
// https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22813%3A497277&t=7gqqAFbdG5KrPOmn-0
|