chore(Storybook): page for CreateChannelPopup added

This commit is contained in:
Michał Cieślak 2022-11-08 22:23:55 +01:00 committed by Alexandra Betouni
parent 3b866c2ff6
commit 1ca1866993
8 changed files with 112 additions and 4 deletions

View File

@ -59,6 +59,9 @@ ApplicationWindow {
ListElement { ListElement {
title: "BrowserSettings" title: "BrowserSettings"
} }
ListElement {
title: "CreateChannelPopup"
}
} }
SplitView { SplitView {

View File

@ -0,0 +1,89 @@
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import Storybook 1.0
import AppLayouts.Chat.popups.community 1.0
SplitView {
id: root
Logs { id: logs }
orientation: Qt.Vertical
Item {
SplitView.fillWidth: true
SplitView.fillHeight: true
PopupBackground {
anchors.fill: parent
}
CreateChannelPopup {
anchors.centerIn: parent
modal: false
closePolicy: Popup.NoAutoClose
isEdit: isEditCheckBox.checked
isDeleteable: isDeleteableCheckBox.checked
emojiPopup: Popup {
id: emojiPopup
parent: root
property var emojiSize
Button {
text: "😃"
onClicked: {
emojiPopup.emojiSelected(text, false)
emojiPopup.close()
}
}
signal emojiSelected(string emoji, bool atCu)
}
onCreateCommunityChannel: (chName, chDescription, chEmoji, chColor, chCategoryId) => {
logs.logEvent("onCreateCommunityChannel",
["chName", "chDescription", "chEmoji", "chColor", "chCategoryId"], arguments)
}
onEditCommunityChannel: (chName, chDescription, chEmoji, chColor, chCategoryId) => {
logs.logEvent("onEditCommunityChannel",
["chName", "chDescription", "chEmoji", "chColor", "chCategoryId"], arguments)
}
onDeleteCommunityChannel: () => {
logs.logEvent("onDeleteCommunityChannel")
}
Component.onCompleted: open()
}
}
LogsAndControlsPanel {
SplitView.minimumHeight: 100
SplitView.preferredHeight: 200
logsView.logText: logs.logText
RowLayout {
CheckBox {
id: isEditCheckBox
text: "isEdit"
}
CheckBox {
id: isDeleteableCheckBox
enabled: isEditCheckBox.checked
text: "isDeleteable"
}
}
}
}

View File

@ -19,8 +19,7 @@ SplitView {
SplitView.fillWidth: true SplitView.fillWidth: true
SplitView.fillHeight: true SplitView.fillHeight: true
Rectangle { PopupBackground {
color: 'lightgray'
anchors.fill: parent anchors.fill: parent
} }

View File

@ -2,6 +2,8 @@ import QtQuick 2.14
import QtQuick.Controls 2.14 import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14 import QtQuick.Layouts 1.14
import Qt.labs.settings 1.0
ColumnLayout { ColumnLayout {
readonly property alias logsView: logsView readonly property alias logsView: logsView
default property alias controls: controlsPane.contentData default property alias controls: controlsPane.contentData
@ -14,6 +16,8 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
contentHeight: 30 contentHeight: 30
currentIndex: settings.logsOrControlsTab
TabButton { TabButton {
text: "Events" text: "Events"
width: implicitWidth width: implicitWidth
@ -40,4 +44,10 @@ ColumnLayout {
id: controlsPane id: controlsPane
} }
} }
Settings {
id: settings
property alias logsOrControlsTab: tabs.currentIndex
}
} }

View File

@ -0,0 +1,5 @@
import QtQuick 2.14
Rectangle {
color: 'lightgray'
}

View File

@ -9,5 +9,6 @@ Logs 1.0 Logs.qml
LogsAndControlsPanel 1.0 LogsAndControlsPanel.qml LogsAndControlsPanel 1.0 LogsAndControlsPanel.qml
LogsView 1.0 LogsView.qml LogsView 1.0 LogsView.qml
PagesList 1.0 PagesList.qml PagesList 1.0 PagesList.qml
PopupBackground 1.0 PopupBackground.qml
SourceCodeBox 1.0 SourceCodeBox.qml SourceCodeBox 1.0 SourceCodeBox.qml
singleton StorybookUtils 1.0 StorybookUtils.qml singleton StorybookUtils 1.0 StorybookUtils.qml

View File

@ -0,0 +1 @@
CreateChannelPopup 1.0 CreateChannelPopup.qml

View File

@ -7,8 +7,8 @@ import StatusQ.Core.Theme 0.1
import StatusQ.Core.Utils 0.1 as StatusQUtils import StatusQ.Core.Utils 0.1 as StatusQUtils
QtObject { QtObject {
property var mainModuleInst: mainModule property var mainModuleInst: typeof mainModule !== "undefined" ? mainModule : null
property var globalUtilsInst: globalUtils property var globalUtilsInst: typeof globalUtils !== "undefined" ? globalUtils : null
function isDigit(value) { function isDigit(value) {
return /^\d$/.test(value); return /^\d$/.test(value);