status-desktop/storybook/pages/CommunityNewPermissionViewP...

108 lines
2.6 KiB
QML

import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import AppLayouts.Chat.views.communities 1.0
import Storybook 1.0
import Models 1.0
SplitView {
orientation: Qt.Vertical
SplitView.fillWidth: true
Logs { id: logs }
Pane {
SplitView.fillWidth: true
SplitView.fillHeight: true
CommunityNewPermissionView {
id: communityNewPermissionView
anchors.fill: parent
isEditState: isEditStateCheckBox.checked
isPrivate: isPrivateCheckBox.checked
permissionDuplicated: isPermissionDuplicatedCheckBox.checked
permissionTypeLimitReached: isLimitReachedCheckBox.checked
showWhoHoldsSwitch: true
assetsModel: AssetsModel {}
collectiblesModel: CollectiblesModel {}
channelsModel: ChannelsModel {}
communityDetails: QtObject {
readonly property string name: "Socks"
readonly property string image: ModelsData.icons.socks
readonly property string color: "red"
readonly property string owner: isOwnerCheckBox.checked
}
onCreatePermissionClicked: {
logs.logEvent("CommunityNewPermissionView::onCreatePermissionClicked")
}
}
}
LogsAndControlsPanel {
id: logsAndControlsPanel
SplitView.minimumHeight: 100
SplitView.preferredHeight: 160
logsView.logText: logs.logText
ColumnLayout {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
RowLayout {
Layout.fillWidth: true
CheckBox {
id: isOwnerCheckBox
text: "Is owner"
}
CheckBox {
id: isEditStateCheckBox
text: "Is edit state"
}
CheckBox {
id: isPrivateCheckBox
text: "Is private"
}
CheckBox {
id: isPermissionDuplicatedCheckBox
text: "Is permission duplicated"
}
CheckBox {
id: isLimitReachedCheckBox
text: "Is limit reached"
}
}
Button {
text: "Reset changes"
onClicked: communityNewPermissionView.resetChanges()
}
Label {
text: "Is dirty: " + communityNewPermissionView.dirty
}
}
}
}