Skip to content

Commit

Permalink
fix: mitigate permissions stuck in pending on control node promotion
Browse files Browse the repository at this point in the history
This PR fixes #14023

UI does NOT allow promoting to control node is no Owner token is present
  • Loading branch information
kounkou committed May 9, 2024
1 parent 9ca5fb7 commit 5797225
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import utils 1.0
Control {
id: root

property bool isPromoteSelfToControlNodeEnabled: false
property bool isControlNode: true
property string communityName: ""
property string communityColor: ""
Expand Down Expand Up @@ -45,6 +46,7 @@ Control {
id: mainGrid
columnSpacing: 16
rowSpacing: 16
visible: root.isPromoteSelfToControlNodeEnabled

StatusRoundIcon {
id: icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ StackLayout {
property string pubsubTopic
property string pubsubTopicKey

property bool isTokenDeployed: !!root.ownerToken && root.ownerToken.deployState === Constants.ContractTransactionStatus.Completed

// Community transfer ownership related props:
required property bool isPendingOwnershipRequest
signal finaliseOwnershipClicked
Expand Down Expand Up @@ -198,18 +200,18 @@ StackLayout {
communityColor: root.color
isControlNode: root.isControlNode
isPendingOwnershipRequest: root.isPendingOwnershipRequest
isPromoteSelfToControlNodeEnabled: root.isControlNode || root.isTokenDeployed

onExportControlNodeClicked:{
if(!!root.ownerToken && root.ownerToken.deployState === Constants.ContractTransactionStatus.Completed) {
if(root.isTokenDeployed) {
root.exportControlNodeClicked()
} else {
Global.openPopup(transferOwnershipAlertPopup, { mode: TransferOwnershipAlertPopup.Mode.MoveControlNode })
}
}
onImportControlNodeClicked: root.importControlNodeClicked()
onFinaliseOwnershipTransferClicked: root.finaliseOwnershipClicked()
//TODO update once the domain changes
onLearnMoreClicked: Global.openLink(Constants.statusHelpLinkPrefix + "status-communities/about-the-control-node-in-status-communities")
onLearnMoreClicked: Global.openLink(Constants.statusHelpLinkPrefix + "communities/about-the-control-node-in-status-communities")
}
}

Expand Down

0 comments on commit 5797225

Please sign in to comment.