chore(Storybook): Basic page for CommunityNewPermissionView added

This commit is contained in:
Michał Cieślak 2022-12-20 01:03:25 +01:00 committed by Michał
parent fe7884cd29
commit 4fc52dddcb
5 changed files with 147 additions and 87 deletions

View File

@ -9,6 +9,10 @@ ListModel {
title: "CommunitiesPortalLayout" title: "CommunitiesPortalLayout"
section: "Views" section: "Views"
} }
ListElement {
title: "CommunityNewPermissionView"
section: "Views"
}
ListElement { ListElement {
title: "ProfileFetchingView" title: "ProfileFetchingView"
section: "Views" section: "Views"

View File

@ -0,0 +1,47 @@
import QtQuick 2.14
import QtQuick.Controls 2.14
import AppLayouts.Chat.views.communities 1.0
import AppLayouts.Chat.stores 1.0
import Models 1.0
Pane {
id: root
CommunityNewPermissionView {
store: CommunitiesStore {
readonly property var tokensModel: TokensModel {}
readonly property var collectiblesModel: CollectiblesModel {}
readonly property var channelsModel: ChannelsModel {}
function editPermission(index, holdings, permissions, channels, isPrivate) {
logs.logEvent("CommunitiesStore::editPermission - index: " + index)
}
function duplicatePermission(index) {
logs.logEvent("CommunitiesStore::duplicatePermission - index: " + index)
}
function removePermission(index) {
logs.logEvent("CommunitiesStore::removePermission - index: " + index)
}
}
rootStore: QtObject {
readonly property QtObject chatCommunitySectionModule: QtObject {
readonly property var model: ChannelsModel {}
}
readonly property QtObject mainModuleInst: QtObject {
readonly property QtObject activeSection: QtObject {
readonly property string name: "Socks"
readonly property string image: ModelsData.icons.socks
readonly property color color: "red"
}
}
}
}
}

View File

@ -27,7 +27,22 @@ SplitView {
store: CommunitiesStore { store: CommunitiesStore {
tokensModel: TokensModel {} tokensModel: TokensModel {}
collectiblesModel: CollectiblesModel {} collectiblesModel: CollectiblesModel {}
channelsModel: ChannelsModel {} channelsModel: ListModel {
Component.onCompleted: {
append([
{
key: "welcome",
iconSource: ModelsData.tokens.inch,
name: "#welcome"
},
{
key: "general",
iconSource: ModelsData.tokens.inch,
name: "#general"
}
])
}
}
function editPermission(index, holdings, permissions, channels, isPrivate) { function editPermission(index, holdings, permissions, channels, isPrivate) {
logs.logEvent("CommunitiesStore::editPermission - index: " + index) logs.logEvent("CommunitiesStore::editPermission - index: " + index)
@ -41,6 +56,20 @@ SplitView {
logs.logEvent("CommunitiesStore::removePermission - index: " + index) logs.logEvent("CommunitiesStore::removePermission - index: " + index)
} }
} }
rootStore: QtObject {
readonly property QtObject chatCommunitySectionModule: QtObject {
readonly property var model: ChannelsModel {}
}
readonly property QtObject mainModuleInst: QtObject {
readonly property QtObject activeSection: QtObject {
readonly property string name: "Socks"
readonly property string image: ModelsData.icons.socks
readonly property color color: "red"
}
}
}
} }
} }

View File

@ -3,9 +3,8 @@ import QtQuick.Controls 2.14
import AppLayouts.Chat.controls.community 1.0 import AppLayouts.Chat.controls.community 1.0
import Models 1.0
import Storybook 1.0 import Storybook 1.0
import Models 1.0
SplitView { SplitView {
id: root id: root
@ -20,75 +19,6 @@ SplitView {
SplitView.fillWidth: true SplitView.fillWidth: true
SplitView.fillHeight: true SplitView.fillHeight: true
ListModel {
id: chatsModel
ListElement {
itemId: 0
name: "welcome"
isCategory: false
color: ""
colorId: 1
icon: ""
}
ListElement {
itemId: 1
name: "announcements"
isCategory: false
color: ""
colorId: 1
icon: ""
}
ListElement {
name: "Discussion"
isCategory: true
subItems: [
ListElement {
itemId: 2
name: "general"
icon: ""
emoji: "👋"
},
ListElement {
itemId: 3
name: "help"
icon: ""
color: ""
colorId: 1
emoji: "⚽"
}
]
}
ListElement {
name: "Support"
isCategory: true
subItems: [
ListElement {
itemId: 4
name: "faq"
icon: ""
color: ""
colorId: 1
},
ListElement {
itemId: 5
name: "report-scam"
icon: ""
color: ""
colorId: 1
}
]
}
ListElement {
name: "Empty"
isCategory: true
subItems: []
}
}
InDropdown { InDropdown {
parent: pane parent: pane
anchors.centerIn: parent anchors.centerIn: parent
@ -97,7 +27,7 @@ SplitView {
communityImage: ModelsData.icons.socks communityImage: ModelsData.icons.socks
communityColor: "red" communityColor: "red"
model: chatsModel model: ChannelsModel {}
onAddChannelClicked: { onAddChannelClicked: {
logs.logEvent("InDropdown::addChannelClicked") logs.logEvent("InDropdown::addChannelClicked")

View File

@ -1,17 +1,67 @@
import QtQuick 2.0 import QtQuick 2.14
ListModel { ListModel {
Component.onCompleted: ListElement {
append([ itemId: 0
{ name: "welcome"
key: "welcome", isCategory: false
iconSource: ModelsData.tokens.inch, color: ""
name: "#welcome" colorId: 1
}, icon: ""
{ }
key: "general", ListElement {
iconSource: ModelsData.tokens.inch, itemId: 1
name: "#general" name: "announcements"
} isCategory: false
]) color: ""
colorId: 1
icon: ""
}
ListElement {
name: "Discussion"
isCategory: true
subItems: [
ListElement {
itemId: 2
name: "general"
icon: ""
emoji: "👋"
},
ListElement {
itemId: 3
name: "help"
icon: ""
color: ""
colorId: 1
emoji: "⚽"
}
]
}
ListElement {
name: "Support"
isCategory: true
subItems: [
ListElement {
itemId: 4
name: "faq"
icon: ""
color: ""
colorId: 1
},
ListElement {
itemId: 5
name: "report-scam"
icon: ""
color: ""
colorId: 1
}
]
}
ListElement {
name: "Empty"
isCategory: true
subItems: []
}
} }