fix: Hide ID verification buttons

- temporarily disable all ID verification flows by default for 2.29
- enabled it in StoryBook for testing purposes

Fixes #14954
This commit is contained in:
Lukáš Tinkl 2024-05-29 10:33:36 +02:00 committed by Lukáš Tinkl
parent f4115632c1
commit 6973ccef6b
3 changed files with 14 additions and 8 deletions

View File

@ -336,6 +336,7 @@ SplitView {
implicitWidth: 640 implicitWidth: 640
readOnly: ctrlReadOnly.checked readOnly: ctrlReadOnly.checked
idVerificationFlowsEnabled: true // enabled in SB
publicKey: switchOwnProfile.checked ? "0xdeadbeef" : "0xrandomguy" publicKey: switchOwnProfile.checked ? "0xdeadbeef" : "0xrandomguy"
onCloseRequested: logs.logEvent("closeRequested()") onCloseRequested: logs.logEvent("closeRequested()")

View File

@ -27,6 +27,7 @@ Pane {
id: root id: root
property bool readOnly // inside settings/profile/preview property bool readOnly // inside settings/profile/preview
property bool idVerificationFlowsEnabled: false // disabled temporarily as per https://github.com/status-im/status-desktop/issues/14954
property string publicKey: contactsStore.myPublicKey property string publicKey: contactsStore.myPublicKey
readonly property alias isCurrentUser: d.isCurrentUser readonly property alias isCurrentUser: d.isCurrentUser
@ -318,6 +319,7 @@ Pane {
Loader { Loader {
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
Layout.preferredHeight: menuButton.visible ? menuButton.height : -1 Layout.preferredHeight: menuButton.visible ? menuButton.height : -1
active: root.idVerificationFlowsEnabled
sourceComponent: { sourceComponent: {
if (d.isCurrentUser && !root.readOnly) if (d.isCurrentUser && !root.readOnly)
return btnShareProfile return btnShareProfile
@ -403,7 +405,7 @@ Pane {
StatusAction { StatusAction {
text: qsTr("Mark as ID verified") text: qsTr("Mark as ID verified")
icon.name: "checkmark-circle" icon.name: "checkmark-circle"
enabled: d.isContact && !d.isBlocked && !(d.isTrusted || d.isLocallyTrusted) enabled: root.idVerificationFlowsEnabled && d.isContact && !d.isBlocked && !(d.isTrusted || d.isLocallyTrusted)
onTriggered: Global.openMarkAsIDVerifiedPopup(root.publicKey, d.contactDetails, onTriggered: Global.openMarkAsIDVerifiedPopup(root.publicKey, d.contactDetails,
popup => popup.accepted.connect(d.reload)) popup => popup.accepted.connect(d.reload))
} }
@ -435,7 +437,7 @@ Pane {
text: qsTr("Remove ID verification") text: qsTr("Remove ID verification")
icon.name: "delete" icon.name: "delete"
type: StatusAction.Type.Danger type: StatusAction.Type.Danger
enabled: d.isContact && (d.isTrusted || d.isLocallyTrusted) enabled: root.idVerificationFlowsEnabled && d.isContact && (d.isTrusted || d.isLocallyTrusted)
onTriggered: Global.openRemoveIDVerificationDialog(root.publicKey, d.contactDetails, onTriggered: Global.openRemoveIDVerificationDialog(root.publicKey, d.contactDetails,
popup => popup.accepted.connect(d.reload)) popup => popup.accepted.connect(d.reload))
} }
@ -459,7 +461,7 @@ Pane {
text: qsTr("Cancel ID verification request") text: qsTr("Cancel ID verification request")
icon.name: "delete" icon.name: "delete"
type: StatusAction.Type.Danger type: StatusAction.Type.Danger
enabled: d.isContact && !d.isBlocked && d.isVerificationRequestSent enabled: root.idVerificationFlowsEnabled && d.isContact && !d.isBlocked && d.isVerificationRequestSent
onTriggered: root.contactsStore.cancelVerificationRequest(root.publicKey) onTriggered: root.contactsStore.cancelVerificationRequest(root.publicKey)
} }
StatusAction { StatusAction {

View File

@ -39,6 +39,8 @@ StatusMenu {
} }
readonly property bool isBlockedContact: (!!contactDetails && contactDetails.isBlocked) || false readonly property bool isBlockedContact: (!!contactDetails && contactDetails.isBlocked) || false
readonly property bool idVerificationFlowsEnabled: false // disabled temporarily as per https://github.com/status-im/status-desktop/issues/14954
readonly property int outgoingVerificationStatus: { readonly property int outgoingVerificationStatus: {
if (root.selectedUserPublicKey === "" || root.isMe || !root.isContact) { if (root.selectedUserPublicKey === "" || root.isMe || !root.isContact) {
return 0 return 0
@ -160,7 +162,8 @@ StatusMenu {
text: qsTr("Request ID verification") text: qsTr("Request ID verification")
objectName: "verifyIdentity_StatusItem" objectName: "verifyIdentity_StatusItem"
icon.name: "checkmark-circle" icon.name: "checkmark-circle"
enabled: !root.isMe && root.isContact enabled: idVerificationFlowsEnabled
&& !root.isMe && root.isContact
&& !root.isBlockedContact && !root.isBlockedContact
&& !root.userIsLocallyTrusted && !root.userIsLocallyTrusted
&& root.outgoingVerificationStatus === Constants.verificationStatus.unverified && root.outgoingVerificationStatus === Constants.verificationStatus.unverified
@ -172,7 +175,7 @@ StatusMenu {
text: qsTr("Mark as ID verified") text: qsTr("Mark as ID verified")
objectName: "markAsVerified_StatusItem" objectName: "markAsVerified_StatusItem"
icon.name: "checkmark-circle" icon.name: "checkmark-circle"
enabled: !root.isMe && root.isContact && !root.isBridgedAccount && !root.isBlockedContact && !(root.isTrusted || root.userIsLocallyTrusted) enabled: idVerificationFlowsEnabled && !root.isMe && root.isContact && !root.isBridgedAccount && !root.isBlockedContact && !(root.isTrusted || root.userIsLocallyTrusted)
onTriggered: Global.openMarkAsIDVerifiedPopup(root.selectedUserPublicKey, root.contactDetails, null) onTriggered: Global.openMarkAsIDVerifiedPopup(root.selectedUserPublicKey, root.contactDetails, null)
} }
StatusAction { StatusAction {
@ -188,7 +191,7 @@ StatusMenu {
} }
icon.name: root.isVerificationRequestSent && root.incomingVerificationStatus !== Constants.verificationStatus.verified ? "history" icon.name: root.isVerificationRequestSent && root.incomingVerificationStatus !== Constants.verificationStatus.verified ? "history"
: "checkmark-circle" : "checkmark-circle"
enabled: !root.isMe && root.isContact && !root.isBridgedAccount && !root.isBlockedContact && !(root.isTrusted || root.userIsLocallyTrusted) && enabled: idVerificationFlowsEnabled && !root.isMe && root.isContact && !root.isBridgedAccount && !root.isBlockedContact && !(root.isTrusted || root.userIsLocallyTrusted) &&
(root.hasActiveReceivedVerificationRequestFrom || root.isVerificationRequestSent) (root.hasActiveReceivedVerificationRequestFrom || root.isVerificationRequestSent)
onTriggered: { onTriggered: {
@ -238,7 +241,7 @@ StatusMenu {
text: qsTr("Remove ID verification") text: qsTr("Remove ID verification")
icon.name: "delete" icon.name: "delete"
type: StatusAction.Type.Danger type: StatusAction.Type.Danger
enabled: !root.isMe && root.isContact && !root.isBridgedAccount && (root.isTrusted || root.userIsLocallyTrusted) enabled: idVerificationFlowsEnabled && !root.isMe && root.isContact && !root.isBridgedAccount && (root.isTrusted || root.userIsLocallyTrusted)
onTriggered: Global.openRemoveIDVerificationDialog(root.selectedUserPublicKey, root.contactDetails, null) onTriggered: Global.openRemoveIDVerificationDialog(root.selectedUserPublicKey, root.contactDetails, null)
} }
@ -256,7 +259,7 @@ StatusMenu {
text: qsTr("Cancel ID verification request") text: qsTr("Cancel ID verification request")
icon.name: "delete" icon.name: "delete"
type: StatusAction.Type.Danger type: StatusAction.Type.Danger
enabled: !root.isMe && root.isContact && !root.isBlockedContact && !root.isBridgedAccount && root.isVerificationRequestSent enabled: idVerificationFlowsEnabled && !root.isMe && root.isContact && !root.isBlockedContact && !root.isBridgedAccount && root.isVerificationRequestSent
onTriggered: root.store.contactsStore.cancelVerificationRequest(root.selectedUserPublicKey) onTriggered: root.store.contactsStore.cancelVerificationRequest(root.selectedUserPublicKey)
} }