From d28bcdb58a713e8a28f4d23adc87ca531054bcfe Mon Sep 17 00:00:00 2001 From: Noelia Date: Mon, 23 Jan 2023 16:51:12 +0100 Subject: [PATCH] feat(storybook): It adds `PermissionConflictWarningPanel` into storybook. Added new pages and updated figma files. --- storybook/PagesModel.qml | 4 + storybook/figma.json | 6 ++ .../pages/CommunityNewPermissionViewPage.qml | 7 ++ .../PermissionConflictWarningPanelPage.qml | 90 +++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 storybook/pages/PermissionConflictWarningPanelPage.qml diff --git a/storybook/PagesModel.qml b/storybook/PagesModel.qml index a68200e99c3..bd2bca9f0a0 100644 --- a/storybook/PagesModel.qml +++ b/storybook/PagesModel.qml @@ -53,6 +53,10 @@ ListModel { title: "PermissionQualificationPanel" section: "Panels" } + ListElement { + title: "PermissionConflictWarningPanel" + section: "Panels" + } ListElement { title: "InviteFriendsToCommunityPopup" section: "Popups" diff --git a/storybook/figma.json b/storybook/figma.json index 15d9f643b0a..99769844084 100644 --- a/storybook/figma.json +++ b/storybook/figma.json @@ -84,5 +84,11 @@ "PermissionQualificationPanel": [ "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=2934%3A480089", "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22734%3A502803" + ], + "PermissionConflictWarningPanel": [ + "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22253%3A486103&t=JrCIfks1zVzsk3vn-0" + ], + "CommunityNewPermissionView": [ + "https://www.figma.com/file/17fc13UBFvInrLgNUKJJg5/Kuba%E2%8E%9CDesktop?node-id=22253%3A486103&t=JrCIfks1zVzsk3vn-0" ] } diff --git a/storybook/pages/CommunityNewPermissionViewPage.qml b/storybook/pages/CommunityNewPermissionViewPage.qml index eb829e63236..621ef73cb04 100644 --- a/storybook/pages/CommunityNewPermissionViewPage.qml +++ b/storybook/pages/CommunityNewPermissionViewPage.qml @@ -15,6 +15,13 @@ Pane { readonly property var assetsModel: AssetsModel {} readonly property var collectiblesModel: CollectiblesModel {} readonly property var channelsModel: ChannelsModel {} + readonly property var permissionConflict: QtObject { + property bool exists: true + property string holdings: "1 ETH" + property string permissions: "View and Post" + property string channels: "#general" + + } function editPermission(index, holdings, permissions, channels, isPrivate) { logs.logEvent("CommunitiesStore::editPermission - index: " + index) diff --git a/storybook/pages/PermissionConflictWarningPanelPage.qml b/storybook/pages/PermissionConflictWarningPanelPage.qml new file mode 100644 index 00000000000..2795dcd7491 --- /dev/null +++ b/storybook/pages/PermissionConflictWarningPanelPage.qml @@ -0,0 +1,90 @@ +import QtQuick 2.14 +import QtQuick.Controls 2.14 +import QtQuick.Layouts 1.14 + +import Storybook 1.0 + +import AppLayouts.Chat.panels.communities 1.0 + +SplitView { + orientation: Qt.Vertical + + Item { + SplitView.fillWidth: true + SplitView.fillHeight: true + + Item { + id: container + width: widthSlider.value + height: conflictPanel.implicitHeight + anchors.centerIn: parent + + PermissionConflictWarningPanel{ + id: conflictPanel + anchors.left: parent.left + anchors.right: parent.right + holdings: holdingsField.text + permissions: permissionsField.text + channels: channelsField.text + } + } + } + + LogsAndControlsPanel { + SplitView.minimumHeight: 100 + SplitView.preferredHeight: 250 + + ColumnLayout { + spacing: 10 + Row { + Label { + anchors.verticalCenter: parent.verticalCenter + text: "Width:" + } + + Slider { + id: widthSlider + value: 400 + from: 200 + to: 600 + } + } + Row { + Label { + anchors.verticalCenter: parent.verticalCenter + text: "Holdings:" + } + + TextField { + id: holdingsField + text: "1 ETH" + } + } + + Row { + Label { + anchors.verticalCenter: parent.verticalCenter + text: "Permissions:" + } + + TextField { + id: permissionsField + text: "View and Post" + } + } + + Row { + Label { + anchors.verticalCenter: parent.verticalCenter + text: "Channels:" + } + + TextField { + id: channelsField + text: "#general" + } + } + + } + } +}