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 8, 2024
1 parent 9ca5fb7 commit 3290c17
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Control {

// Community transfer ownership related props:
required property bool isPendingOwnershipRequest
required property bool isOwnerTokenPresent

signal exportControlNodeClicked
signal importControlNodeClicked
Expand Down Expand Up @@ -103,6 +104,7 @@ Control {
StatusButton {
size: StatusBaseButton.Size.Small
text: d.primaryButtonText
enabled: root.isOwnerTokenPresent
onClicked: d.primaryButtonAction()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,19 @@ StackLayout {
communityColor: root.color
isControlNode: root.isControlNode
isPendingOwnershipRequest: root.isPendingOwnershipRequest
property bool ownerTokenCompleted: !!root.ownerToken && root.ownerToken.deployState === Constants.ContractTransactionStatus.Completed
isOwnerTokenPresent: isControlNode || ownerTokenCompleted

onExportControlNodeClicked:{
if(!!root.ownerToken && root.ownerToken.deployState === Constants.ContractTransactionStatus.Completed) {
if(ownerTokenCompleted) {
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 3290c17

Please sign in to comment.