status-desktop/ui/app/AppLayouts/Communities/popups/ManageShardingPopup.qml
Lukáš Tinkl 6260519e66 fix(CommunitySettingsView): hide control node functionality for admins and token masters
- hide the footer when the user is an admin or token master, unless
there is a pending ownership request (`isPendingOwnershipRequest`)
- similarly, hide the sharding section in `CommunityInfoEditor`
- do not cover the shard button with the `SettingsDirtyToastMessage`
- some SB page cleanups and additions
2024-04-18 22:22:40 +02:00

100 lines
2.7 KiB
QML

import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtQml.Models 2.15
import QtQml 2.15
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import StatusQ.Components 0.1
import StatusQ.Popups.Dialog 0.1
import shared.controls 1.0
import shared.popups 1.0
import utils 1.0
StatusDialog {
id: root
required property string communityName
required property int shardIndex
required property string pubsubTopic
signal disableShardingRequested()
signal editShardIndexRequested()
title: qsTr("Manage community sharding for %1").arg(communityName)
width: 640
footer: StatusDialogFooter {
rightButtons: ObjectModel {
StatusFlatButton {
type: StatusBaseButton.Type.Danger
text: qsTr("Disable community sharding")
onClicked: confirmationPopup.open()
}
StatusButton {
text: qsTr("Edit shard number")
onClicked: {
root.editShardIndexRequested()
root.close()
}
}
}
}
contentItem: ColumnLayout {
spacing: Style.current.halfPadding
StatusBaseText {
text: qsTr("Shard number")
}
StatusTextArea {
Layout.fillWidth: true
readOnly: true
text: root.shardIndex
}
StatusBaseText {
Layout.topMargin: Style.current.halfPadding
text: qsTr("Pub/Sub topic")
}
StatusTextArea {
Layout.fillWidth: true
Layout.preferredHeight: 138
readOnly: true
text: root.pubsubTopic
rightPadding: 48
wrapMode: TextEdit.Wrap
CopyButton {
anchors.right: parent.right
anchors.top: parent.top
anchors.rightMargin: 12
anchors.topMargin: 10
textToCopy: parent.text
}
}
}
ConfirmationDialog {
id: confirmationPopup
width: root.width - root.margins
anchors.centerIn: parent
headerSettings.title: qsTr("Are you sure you want to disable sharding?")
showCancelButton: true
cancelBtnType: ""
confirmationText: qsTr("Are you sure you want to disable community sharding? Your community will automatically revert to using the general shared Waku network.")
confirmButtonLabel: qsTr("Disable community sharding")
onCancelButtonClicked: close()
onConfirmButtonClicked: {
close()
root.disableShardingRequested()
root.close()
}
}
}