feat: use community.isControlNode as visible for archiveSupporVisible (#11560)
Close #11089
This commit is contained in:
parent
d2051c6247
commit
b75d8630ca
|
@ -145,6 +145,7 @@ method getCommunityItem(self: Module, c: CommunityDto): SectionItem =
|
|||
SectionType.Community,
|
||||
c.name,
|
||||
c.memberRole,
|
||||
c.isControlNode,
|
||||
c.description,
|
||||
c.introMessage,
|
||||
c.outroMessage,
|
||||
|
|
|
@ -265,6 +265,7 @@ proc createChannelGroupItem[T](self: Module[T], channelGroup: ChannelGroupDto):
|
|||
if isCommunity: SectionType.Community else: SectionType.Chat,
|
||||
if isCommunity: channelGroup.name else: conf.CHAT_SECTION_NAME,
|
||||
channelGroup.memberRole,
|
||||
if isCommunity: communityDetails.isControlNode else: false,
|
||||
channelGroup.description,
|
||||
channelGroup.introMessage,
|
||||
channelGroup.outroMessage,
|
||||
|
|
|
@ -26,6 +26,7 @@ type
|
|||
id: string
|
||||
name: string
|
||||
memberRole: MemberRole
|
||||
isControlNode: bool
|
||||
description: string
|
||||
introMessage: string
|
||||
outroMessage: string
|
||||
|
@ -62,6 +63,7 @@ proc initItem*(
|
|||
sectionType: SectionType,
|
||||
name: string,
|
||||
memberRole = MemberRole.None,
|
||||
isControlNode = false,
|
||||
description = "",
|
||||
introMessage = "",
|
||||
outroMessage = "",
|
||||
|
@ -97,6 +99,7 @@ proc initItem*(
|
|||
result.sectionType = sectionType
|
||||
result.name = name
|
||||
result.memberRole = memberRole
|
||||
result.isControlNode = isControlNode
|
||||
result.description = description
|
||||
result.introMessage = introMessage
|
||||
result.outroMessage = outroMessage
|
||||
|
@ -143,6 +146,7 @@ proc `$`*(self: SectionItem): string =
|
|||
sectionType: {self.sectionType.int},
|
||||
name: {self.name},
|
||||
memberRole: {self.memberRole},
|
||||
isControlNode: {self.isControlNode},
|
||||
description: {self.description},
|
||||
introMessage: {self.introMessage},
|
||||
outroMessage: {self.outroMessage},
|
||||
|
@ -189,6 +193,9 @@ proc memberRole*(self: SectionItem): MemberRole {.inline.} =
|
|||
proc `memberRole=`*(self: var SectionItem, value: MemberRole) {.inline.} =
|
||||
self.memberRole = value
|
||||
|
||||
proc isControlNode*(self: SectionItem): bool {.inline.} =
|
||||
self.isControlNode
|
||||
|
||||
proc description*(self: SectionItem): string {.inline.} =
|
||||
self.description
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ type
|
|||
SectionType
|
||||
Name
|
||||
MemberRole
|
||||
IsControlNode
|
||||
Description
|
||||
IntroMessage
|
||||
OutroMessage
|
||||
|
@ -85,6 +86,7 @@ QtObject:
|
|||
ModelRole.SectionType.int:"sectionType",
|
||||
ModelRole.Name.int:"name",
|
||||
ModelRole.MemberRole.int: "memberRole",
|
||||
ModelRole.IsControlNode.int: "isControlNode",
|
||||
ModelRole.Description.int:"description",
|
||||
ModelRole.IntroMessage.int:"introMessage",
|
||||
ModelRole.OutroMessage.int:"outroMessage",
|
||||
|
@ -137,6 +139,8 @@ QtObject:
|
|||
result = newQVariant(item.name)
|
||||
of ModelRole.MemberRole:
|
||||
result = newQVariant(item.memberRole.int)
|
||||
of ModelRole.IsControlNode:
|
||||
result = newQVariant(item.isControlNode)
|
||||
of ModelRole.Description:
|
||||
result = newQVariant(item.description)
|
||||
of ModelRole.IntroMessage:
|
||||
|
@ -273,6 +277,7 @@ QtObject:
|
|||
self.dataChanged(dataIndex, dataIndex, @[
|
||||
ModelRole.Name.int,
|
||||
ModelRole.MemberRole.int,
|
||||
ModelRole.IsControlNode.int,
|
||||
ModelRole.Description.int,
|
||||
ModelRole.IntroMessage.int,
|
||||
ModelRole.OutroMessage.int,
|
||||
|
@ -415,6 +420,7 @@ QtObject:
|
|||
"id": item.id,
|
||||
"name": item.name,
|
||||
"memberRole": item.memberRole.int,
|
||||
"isControlNode": item.isControlNode,
|
||||
"description": item.description,
|
||||
"introMessage": item.introMessage,
|
||||
"outroMessage": item.outroMessage,
|
||||
|
|
|
@ -91,6 +91,7 @@ type CheckPermissionsToJoinResponseDto* = object
|
|||
type CommunityDto* = object
|
||||
id*: string
|
||||
memberRole*: MemberRole
|
||||
isControlNode*: bool
|
||||
verified*: bool
|
||||
joined*: bool
|
||||
spectated*: bool
|
||||
|
@ -304,6 +305,7 @@ proc toCommunityDto*(jsonObj: JsonNode): CommunityDto =
|
|||
result = CommunityDto()
|
||||
discard jsonObj.getProp("id", result.id)
|
||||
discard jsonObj.getProp("memberRole", result.memberRole)
|
||||
discard jsonObj.getProp("isControlNode", result.isControlNode)
|
||||
discard jsonObj.getProp("verified", result.verified)
|
||||
discard jsonObj.getProp("joined", result.joined)
|
||||
discard jsonObj.getProp("spectated", result.spectated)
|
||||
|
|
|
@ -38,6 +38,7 @@ SplitView {
|
|||
joined: true,
|
||||
spectated: false,
|
||||
memberRole: Constants.memberRole.owner,
|
||||
isControlNode: true,
|
||||
image: ModelsData.icons.dribble,
|
||||
color: "yellow",
|
||||
muted: false,
|
||||
|
@ -52,6 +53,7 @@ SplitView {
|
|||
joined: true,
|
||||
spectated: false,
|
||||
memberRole: Constants.memberRole.none,
|
||||
isControlNode: false,
|
||||
image: ModelsData.icons.status,
|
||||
color: "peach",
|
||||
muted: false,
|
||||
|
@ -66,6 +68,7 @@ SplitView {
|
|||
joined: false,
|
||||
spectated: true,
|
||||
memberRole: Constants.memberRole.none,
|
||||
isControlNode: false,
|
||||
image: ModelsData.icons.coinbase,
|
||||
color: "red",
|
||||
muted: false,
|
||||
|
@ -80,6 +83,7 @@ SplitView {
|
|||
joined: true,
|
||||
spectated: false,
|
||||
memberRole: Constants.memberRole.none,
|
||||
isControlNode: false,
|
||||
image: "",
|
||||
color: "whitesmoke",
|
||||
muted: true,
|
||||
|
@ -94,6 +98,7 @@ SplitView {
|
|||
joined: true,
|
||||
spectated: false,
|
||||
memberRole: Constants.memberRole.admin,
|
||||
isControlNode: false,
|
||||
image: ModelsData.icons.socks,
|
||||
color: "green",
|
||||
muted: false,
|
||||
|
@ -108,6 +113,7 @@ SplitView {
|
|||
joined: false,
|
||||
spectated: true,
|
||||
memberRole: Constants.memberRole.none,
|
||||
isControlNode: false,
|
||||
image: ModelsData.icons.spotify,
|
||||
color: "pink",
|
||||
muted: false,
|
||||
|
|
|
@ -175,6 +175,7 @@ SplitView {
|
|||
ListElement {
|
||||
name: "Not the cool gang"
|
||||
memberRole: 0 // Constants.memberRole.none
|
||||
isControlNode: false,
|
||||
description: "Nothing to write home about"
|
||||
color: "indigo"
|
||||
image: ""
|
||||
|
@ -186,6 +187,7 @@ SplitView {
|
|||
ListElement {
|
||||
name: "Awesome bunch"
|
||||
memberRole: 4 // Constants.memberRole.admin
|
||||
isControlNode: false,
|
||||
description: "Where the cool guys hang out & Nothing to write home about"
|
||||
color: "green"
|
||||
image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0BhCExPynn1gWf9bx498P7/
|
||||
|
@ -202,6 +204,7 @@ SplitView {
|
|||
ListElement {
|
||||
name: "Invisible community (should not display!)"
|
||||
memberRole: 1 // Constants.memberRole.owner
|
||||
isControlNode: true,
|
||||
description: "Get outta here"
|
||||
color: "red"
|
||||
image: ""
|
||||
|
|
|
@ -32,6 +32,7 @@ SplitView {
|
|||
name: "Test community",
|
||||
joined: true,
|
||||
memberRole: Constants.memberRole.owner,
|
||||
isControlNode: true,
|
||||
image: ModelsData.icons.dribble,
|
||||
color: "yellow"
|
||||
},
|
||||
|
@ -40,6 +41,7 @@ SplitView {
|
|||
name: "Test community 2",
|
||||
joined: true,
|
||||
memberRole: Constants.memberRole.none,
|
||||
isControlNode: false,
|
||||
image: ModelsData.collectibles.custom,
|
||||
color: "peach"
|
||||
},
|
||||
|
@ -48,6 +50,7 @@ SplitView {
|
|||
name: "Test community invisible",
|
||||
joined: false,
|
||||
memberRole: Constants.memberRole.none,
|
||||
isControlNode: false,
|
||||
image: "",
|
||||
color: "red"
|
||||
},
|
||||
|
@ -56,6 +59,7 @@ SplitView {
|
|||
name: "Test community 3",
|
||||
joined: true,
|
||||
memberRole: Constants.memberRole.none,
|
||||
isControlNode: false,
|
||||
image: "",
|
||||
color: "whitesmoke"
|
||||
},
|
||||
|
@ -64,6 +68,7 @@ SplitView {
|
|||
name: "Test community 4",
|
||||
joined: true,
|
||||
memberRole: Constants.memberRole.admin,
|
||||
isControlNode: false,
|
||||
image: ModelsData.icons.spotify,
|
||||
color: "green"
|
||||
},
|
||||
|
|
|
@ -13,6 +13,8 @@ Column {
|
|||
property alias requestToJoinEnabled: requestToJoinToggle.checked
|
||||
property alias pinMessagesEnabled: pinMessagesToggle.checked
|
||||
|
||||
property alias archiveSupporVisible: archiveSupport.visible
|
||||
|
||||
spacing: 0
|
||||
|
||||
QtObject {
|
||||
|
@ -24,7 +26,7 @@ Column {
|
|||
id: archiveSupport
|
||||
|
||||
width: parent.width
|
||||
height: d.optionHeight
|
||||
height: visible ? d.optionHeight : 0
|
||||
|
||||
StatusBaseText {
|
||||
Layout.fillWidth: true
|
||||
|
|
|
@ -33,6 +33,7 @@ StackLayout {
|
|||
property bool pinMessagesEnabled
|
||||
property string previousPageName: (currentIndex === 1) ? qsTr("Overview") : ""
|
||||
|
||||
property bool archiveSupporVisible: true
|
||||
property bool editable: false
|
||||
property bool owned: false
|
||||
property bool isControlNode: false
|
||||
|
@ -190,6 +191,7 @@ StackLayout {
|
|||
|
||||
options {
|
||||
archiveSupportEnabled: root.archiveSupportEnabled
|
||||
archiveSupporVisible: root.archiveSupporVisible
|
||||
requestToJoinEnabled: root.requestToJoinEnabled
|
||||
pinMessagesEnabled: root.pinMessagesEnabled
|
||||
}
|
||||
|
|
|
@ -442,6 +442,7 @@ StatusStackModal {
|
|||
historyArchiveSupportEnabled: generalViewLayout.options.archiveSupportEnabled,
|
||||
checkedMembership: generalViewLayout.options.requestToJoinEnabled ? Constants.communityChatOnRequestAccess : Constants.communityChatPublicAccess,
|
||||
pinMessagesAllowedForMembers: generalViewLayout.options.pinMessagesEnabled,
|
||||
archiveSupporVisible: true
|
||||
},
|
||||
bannerJsonStr: JSON.stringify({imagePath: String(generalViewLayout.bannerPath).replace("file://", ""), cropRect: generalViewLayout.bannerCropRect})
|
||||
}
|
||||
|
|
|
@ -168,6 +168,7 @@ StatusSectionLayout {
|
|||
tags: root.rootStore.communityTags
|
||||
selectedTags: root.filteredSelectedTags
|
||||
archiveSupportEnabled: root.community.historyArchiveSupportEnabled
|
||||
archiveSupporVisible: root.community.isControlNode
|
||||
requestToJoinEnabled: root.community.access === Constants.communityChatOnRequestAccess
|
||||
pinMessagesEnabled: root.community.pinMessageAllMembersEnabled
|
||||
editable: true
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 42d5d36cf574674d5639cfdfa57810ce2319fa0c
|
||||
Subproject commit 631962ce88b7f8ba6226f49066f823007726c4cf
|
Loading…
Reference in New Issue