feat(OwnerToken): Admin view of Tokens home - pre-Owner token minting

- New `Get started` panel for admins in `Tokens` section added.
- Added support in `storybook`.

Part of #11472
This commit is contained in:
Noelia 2023-07-12 16:06:07 +02:00 committed by Noelia
parent a468635ddc
commit c973605831
4 changed files with 19 additions and 10 deletions

View File

@ -80,7 +80,7 @@ SplitView {
id: logsAndControlsPanel id: logsAndControlsPanel
SplitView.minimumHeight: 100 SplitView.minimumHeight: 100
SplitView.preferredHeight: 200 SplitView.preferredHeight: 250
logsView.logText: logs.logText logsView.logText: logs.logText
@ -102,28 +102,28 @@ SplitView {
id: ownerChecked id: ownerChecked
checked: true checked: true
text: "Is owner?" text: "Is Owner? [Owner will be able to create an OWNER and TOKEN MASTER token]"
} }
CheckBox { CheckBox {
id: masterTokenOwnerChecked id: masterTokenOwnerChecked
checked: true checked: true
text: "Is TMaster token owner?" text: "Is TMaster token owner? [TMaster token owner will be able to mint / airdrop tokens once the TMaster is already created]"
} }
CheckBox { CheckBox {
id: adminChecked id: adminChecked
checked: true checked: true
text: "Is admin?" text: "Is admin? [Admis will be able to see token views, but NOT manage them, like creating new artwork or asset]"
} }
CheckBox { CheckBox {
id: editorModelChecked id: editorModelChecked
checked: true checked: true
text: "Empty model" text: "No tokens minted yet"
} }
RowLayout { RowLayout {

View File

@ -13,6 +13,7 @@ Control {
property alias title: titleComponent.text property alias title: titleComponent.text
property alias text: textComponent.text property alias text: textComponent.text
property alias buttonText: button.text property alias buttonText: button.text
property alias buttonVisible: button.visible
signal clicked signal clicked
@ -59,6 +60,8 @@ Control {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
visible: true
onClicked: root.clicked() onClicked: root.clicked()
} }
} }

View File

@ -100,13 +100,13 @@ StackView {
title: qsTr("Tokens") title: qsTr("Tokens")
buttons: DisabledTooltipButton { buttons: DisabledTooltipButton {
property bool onlyAdmin: root.isAdmin && !root.isOwner readonly property bool isAdminOnly: root.isAdmin && !root.isOwner && !root.isTokenMasterOwner
property bool buttonEnabled: (root.isOwner || root.isTokenMasterOwner) && d.isTokenOwnerDeployed readonly property bool buttonEnabled: (root.isOwner || root.isTokenMasterOwner) && d.isTokenOwnerDeployed
buttonType: DisabledTooltipButton.Normal buttonType: DisabledTooltipButton.Normal
aliasedObjectName: "addNewItemButton" aliasedObjectName: "addNewItemButton"
text: qsTr("Mint token") text: qsTr("Mint token")
enabled: onlyAdmin || buttonEnabled enabled: isAdminOnly || buttonEnabled
interactive: buttonEnabled interactive: buttonEnabled
onClicked: root.push(newTokenViewComponent, StackView.Immediate) onClicked: root.push(newTokenViewComponent, StackView.Immediate)
tooltipText: qsTr("In order to mint, you must hodl the TokenMaster token for %1").arg(root.communityName) tooltipText: qsTr("In order to mint, you must hodl the TokenMaster token for %1").arg(root.communityName)
@ -115,6 +115,7 @@ StackView {
contentItem: MintedTokensView { contentItem: MintedTokensView {
model: root.tokensModel model: root.tokensModel
isOwner: root.isOwner isOwner: root.isOwner
isAdmin: root.isAdmin
onItemClicked: root.push(tokenViewComponent, { tokenKey }, StackView.Immediate) onItemClicked: root.push(tokenViewComponent, { tokenKey }, StackView.Immediate)
onMintOwnerTokenClicked: root.push(ownerTokenViewComponent, StackView.Immediate) onMintOwnerTokenClicked: root.push(ownerTokenViewComponent, StackView.Immediate)

View File

@ -16,6 +16,7 @@ StatusScrollView {
id: root id: root
required property bool isOwner required property bool isOwner
required property bool isAdmin
property int viewWidth: 560 // by design property int viewWidth: 560 // by design
property var model property var model
@ -99,13 +100,17 @@ StatusScrollView {
} }
StatusInfoBoxPanel { StatusInfoBoxPanel {
readonly property bool isAdminOnly: root.isAdmin && !root.isOwner
Layout.fillWidth: true Layout.fillWidth: true
Layout.bottomMargin: 20 Layout.bottomMargin: 20
visible: root.isOwner
title: qsTr("Get started") title: qsTr("Get started")
text: qsTr("In order to Mint, Import and Airdrop community tokens, you first need to mint your Owner token which will give you permissions to access the token management features for your community.") text: isAdminOnly ? qsTr("Token minting can only be performed by admins that hodl the Communitys TokenMaster token. If you would like this permission, contact the Community founder (they will need to mint the Community Owner token before they can airdrop this to you)."):
qsTr("In order to Mint, Import and Airdrop community tokens, you first need to mint your Owner token which will give you permissions to access the token management features for your community.")
buttonText: qsTr("Mint Owner token") buttonText: qsTr("Mint Owner token")
buttonVisible: root.isOwner
horizontalPadding: 16 horizontalPadding: 16
verticalPadding: 20 verticalPadding: 20