diff --git a/storybook/pages/CommunityInfoEditor.qml b/storybook/pages/CommunityInfoEditor.qml index 266c451d30..715739a878 100644 --- a/storybook/pages/CommunityInfoEditor.qml +++ b/storybook/pages/CommunityInfoEditor.qml @@ -20,7 +20,7 @@ ColumnLayout { readonly property bool shardingEnabled: ctrlShardingEnabled.checked property alias shardIndex: ctrlShardIndex.value - spacing: 24 + spacing: 12 ColumnLayout { Label { diff --git a/storybook/pages/OverviewSettingsFooterPage.qml b/storybook/pages/OverviewSettingsFooterPage.qml index e0037df41e..bee7ddaaaf 100644 --- a/storybook/pages/OverviewSettingsFooterPage.qml +++ b/storybook/pages/OverviewSettingsFooterPage.qml @@ -44,24 +44,19 @@ SplitView { SplitView.preferredHeight: 150 logsView.logText: logs.logText - } - } - - Pane { - SplitView.preferredWidth: 300 - SplitView.fillHeight: true - ColumnLayout { - Switch { - id: controlNodeSwitch - text: "Control node on/off" - checked: true - } + ColumnLayout { + Switch { + id: controlNodeSwitch + text: "Control node on/off" + checked: true + } - Switch { - id: pendingOwnershipSwitch - text: "Is there a pending transfer ownership request?" - checked: true + Switch { + id: pendingOwnershipSwitch + text: "Is there a pending transfer ownership request?" + checked: true + } } } } diff --git a/storybook/pages/OverviewSettingsPanelPage.qml b/storybook/pages/OverviewSettingsPanelPage.qml index 920eeda800..7ee23018ff 100644 --- a/storybook/pages/OverviewSettingsPanelPage.qml +++ b/storybook/pages/OverviewSettingsPanelPage.qml @@ -2,12 +2,19 @@ import QtQuick 2.14 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 +import mainui 1.0 import AppLayouts.Communities.panels 1.0 SplitView { id: root SplitView.fillWidth: true + Popups { + popupParent: root + rootStore: QtObject {} + communityTokensStore: QtObject {} + } + OverviewSettingsPanel { SplitView.fillWidth: true SplitView.fillHeight: true @@ -18,8 +25,11 @@ SplitView { color: communityEditor.color bannerImageData: communityEditor.banner - editable: communityEditor.isCommunityEditable isOwner: communityEditor.amISectionAdmin + isAdmin: ctrlIsAdmin.checked + isTokenMaster: ctrlIsTM.checked + + editable: communityEditor.isCommunityEditable communitySettingsDisabled: !editable shardingEnabled: communityEditor.shardingEnabled @@ -32,16 +42,27 @@ SplitView { SplitView.minimumWidth: 300 SplitView.preferredWidth: 300 - ColumnLayout { - CommunityInfoEditor{ - id: communityEditor - anchors.fill: parent - } + ScrollView { + anchors.fill: parent + contentWidth: availableWidth - Switch { - id: pendingOwnershipSwitch - text: "Is there a pending transfer ownership request?" - checked: true + CommunityInfoEditor { + id: communityEditor + + Switch { + id: pendingOwnershipSwitch + text: "Pending transfer ownership request?" + } + + Switch { + id: ctrlIsAdmin + text: "Is admin?" + } + + Switch { + id: ctrlIsTM + text: "Is token master?" + } } } } diff --git a/ui/app/AppLayouts/Communities/panels/OverviewSettingsFooter.qml b/ui/app/AppLayouts/Communities/panels/OverviewSettingsFooter.qml index 67637e6012..1d9b67e5a4 100644 --- a/ui/app/AppLayouts/Communities/panels/OverviewSettingsFooter.qml +++ b/ui/app/AppLayouts/Communities/panels/OverviewSettingsFooter.qml @@ -13,7 +13,7 @@ import utils 1.0 Control { id: root - property bool isControlNode: true + property bool isControlNode: true property string communityName: "" property string communityColor: "" diff --git a/ui/app/AppLayouts/Communities/panels/OverviewSettingsPanel.qml b/ui/app/AppLayouts/Communities/panels/OverviewSettingsPanel.qml index 892974c118..92f54d6380 100644 --- a/ui/app/AppLayouts/Communities/panels/OverviewSettingsPanel.qml +++ b/ui/app/AppLayouts/Communities/panels/OverviewSettingsPanel.qml @@ -22,6 +22,9 @@ StackLayout { id: root required property bool isOwner + required property bool isAdmin + required property bool isTokenMaster + property string communityId property string name property string description @@ -176,7 +179,7 @@ StackLayout { Rectangle { Layout.fillWidth: true - + visible: mainSettingsPage.footer.active implicitHeight: 1 color: Theme.palette.statusMenu.separatorColor } @@ -223,6 +226,7 @@ StackLayout { } SettingsPage { + id: mainSettingsPage Layout.fillWidth: !root.communitySettingsDisabled Layout.preferredWidth: root.communitySettingsDisabled ? 560 + leftPadding + rightPadding : -1 Layout.fillHeight: !root.communitySettingsDisabled @@ -236,7 +240,13 @@ StackLayout { footer: Loader { sourceComponent: overviewSettingsFooterComp - active: !root.communitySettingsDisabled + active: { + if (root.communitySettingsDisabled) + return false + if (root.isAdmin || root.isTokenMaster) + return root.isPendingOwnershipRequest // not allowed for admin or TM unless there's the pending request + return true + } } } @@ -329,6 +339,7 @@ StackLayout { active: !!editSettingsPanelLoader.item && editSettingsPanelLoader.item.dirty + visible: active saveChangesButtonEnabled: !!editSettingsPanelLoader.item && diff --git a/ui/app/AppLayouts/Communities/popups/ManageShardingPopup.qml b/ui/app/AppLayouts/Communities/popups/ManageShardingPopup.qml index 8d6c7edeb8..ea3c95ad9e 100644 --- a/ui/app/AppLayouts/Communities/popups/ManageShardingPopup.qml +++ b/ui/app/AppLayouts/Communities/popups/ManageShardingPopup.qml @@ -82,6 +82,7 @@ StatusDialog { ConfirmationDialog { id: confirmationPopup + width: root.width - root.margins anchors.centerIn: parent headerSettings.title: qsTr("Are you sure you want to disable sharding?") showCancelButton: true diff --git a/ui/app/AppLayouts/Communities/views/CommunitySettingsView.qml b/ui/app/AppLayouts/Communities/views/CommunitySettingsView.qml index a7487bef7b..4aec824cae 100644 --- a/ui/app/AppLayouts/Communities/views/CommunitySettingsView.qml +++ b/ui/app/AppLayouts/Communities/views/CommunitySettingsView.qml @@ -168,6 +168,8 @@ StatusSectionLayout { readonly property bool sectionEnabled: true isOwner: root.isOwner + isAdmin: root.isAdmin + isTokenMaster: root.isTokenMasterOwner communityId: root.community.id name: root.community.name description: root.community.description @@ -187,7 +189,7 @@ StatusSectionLayout { isControlNode: root.isControlNode communitySettingsDisabled: root.communitySettingsDisabled overviewChartData: rootStore.overviewChartData - shardingEnabled: localAppSettings.wakuV2ShardedCommunitiesEnabled ?? false + shardingEnabled: !isAdmin && !isTokenMaster && localAppSettings.wakuV2ShardedCommunitiesEnabled shardIndex: root.community.shardIndex shardingInProgress: root.chatCommunitySectionModule.shardingInProgress pubsubTopic: root.community.pubsubTopic