From 76a76dcf4d3e6eb501a0a9b185ed6bff0da2ae86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Mon, 25 Mar 2024 19:39:45 +0100 Subject: [PATCH] fix(Shared Addresses): Requirements check pending indicator - update shared addresses dialog to avoid small jumps when selecting/unselecting accounts due to requirements check text displayed - display the pending text and spinner next to the Permissions header Fixes #14103 --- .../CommunityMembershipSetupDialogPage.qml | 55 +++++++++---------- .../panels/SharedAddressesPanel.qml | 11 +--- .../SharedAddressesPermissionsPanel.qml | 17 ++++++ 3 files changed, 43 insertions(+), 40 deletions(-) diff --git a/storybook/pages/CommunityMembershipSetupDialogPage.qml b/storybook/pages/CommunityMembershipSetupDialogPage.qml index ce098bfb5a..5dbdf35dd9 100644 --- a/storybook/pages/CommunityMembershipSetupDialogPage.qml +++ b/storybook/pages/CommunityMembershipSetupDialogPage.qml @@ -46,6 +46,7 @@ SplitView { modal: false closePolicy: Popup.NoAutoClose + isEditMode: ctrlIsEditMode.checked communityName: "Status" communityIcon: ModelsData.icons.status introMessage: "%1 sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. @@ -56,8 +57,10 @@ SplitView { 4. Dolore eu fugiat nulla pariatur 5. 🚗 consectetur adipiscing elit -Nemo enim 😋 ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.".arg(dialog.name) - requirementsCheckPending: false +Nemo enim 😋 ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.".arg(dialog.communityName) + + isInvitationPending: ctrlIsInvitationPending.checked + requirementsCheckPending: ctrlRequirementsCheckPending.checked walletAccountsModel: WalletAccountsModel {} walletAssetsModel: root.walletAssetStore.groupedAccountAssetsModel @@ -71,7 +74,7 @@ Nemo enim 😋 ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, onPrepareForSigning: logs.logEvent("CommunityMembershipSetupDialog::onPrepareForSigning", ["airdropAddress", "sharedAddresses"], arguments) onJoinCommunity: logs.logEvent("CommunityMembershipSetupDialog::onJoinCommunity") onEditRevealedAddresses: logs.logEvent("CommunityMembershipSetupDialog::editRevealedAddresses") - onSignProfileKeypairAndAllNonKeycardKeypairs: logs.logEvent("CommunityMembershipSetupDialog::editRevealedAddresses") + onSignProfileKeypairAndAllNonKeycardKeypairs: logs.logEvent("CommunityMembershipSetupDialog::onSignProfileKeypairAndAllNonKeycardKeypairs") onSignSharedAddressesForKeypair: logs.logEvent("CommunityMembershipSetupDialog::onSignSharedAddressesForKeypair", ["keyUid"], arguments) onSharedAddressesUpdated: logs.logEvent("CommunityMembershipSetupDialog::onSharedAddressesUpdated", ["sharedAddresses"], arguments) getCurrencyAmount: function (balance, symbol) { @@ -110,8 +113,8 @@ Nemo enim 😋 ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, TextField { Layout.fillWidth: true - text: dialog.name - onTextChanged: dialog.name = text + text: dialog.communityName + onTextChanged: dialog.communityName = text } Label { @@ -130,36 +133,36 @@ Nemo enim 😋 ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, Label { Layout.fillWidth: true text: "Icon:" + font.weight: Font.Bold } RadioButton { checked: true text: "Status" - onCheckedChanged: if(checked) dialog.imageSrc = ModelsData.icons.status + onCheckedChanged: if(checked) dialog.communityIcon = ModelsData.icons.status } RadioButton { text: "Crypto Punks" - onCheckedChanged: if(checked) dialog.imageSrc = ModelsData.icons.cryptPunks + onCheckedChanged: if(checked) dialog.communityIcon = ModelsData.icons.cryptPunks } RadioButton { text: "Rarible" - onCheckedChanged: if(checked) dialog.imageSrc = ModelsData.icons.rarible + onCheckedChanged: if(checked) dialog.communityIcon = ModelsData.icons.rarible } RadioButton { text: "None" - onCheckedChanged: if(checked) dialog.imageSrc = "" + onCheckedChanged: if(checked) dialog.communityIcon = "" } } - ColumnLayout { - Label { - Layout.fillWidth: true - text: "Is invitation pending:" - } + CheckBox { + id: ctrlIsInvitationPending + text: "Is invitation pending" + } - CheckBox { - checked: dialog.isInvitationPending - onCheckedChanged: dialog.isInvitationPending = checked - } + CheckBox { + id: ctrlIsEditMode + visible: !dialog.isInvitationPending + text: "Is edit mode" } ColumnLayout { @@ -180,18 +183,10 @@ Nemo enim 😋 ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, } } - ColumnLayout { - visible: dialog.accessType == Constants.communityChatOnRequestAccess && !dialog.isInvitationPending - Label { - Layout.fillWidth: true - text: "Login type" - } - - ComboBox { - id: ctrlLoginType - Layout.fillWidth: true - model: ["Password","Biometrics","Keycard"] - } + CheckBox { + id: ctrlRequirementsCheckPending + visible: !dialog.isInvitationPending && dialog.accessType == Constants.communityChatOnRequestAccess + text: "Requirements check pending" } Item { diff --git a/ui/app/AppLayouts/Communities/panels/SharedAddressesPanel.qml b/ui/app/AppLayouts/Communities/panels/SharedAddressesPanel.qml index fa84e7c42d..b4e23e01be 100644 --- a/ui/app/AppLayouts/Communities/panels/SharedAddressesPanel.qml +++ b/ui/app/AppLayouts/Communities/panels/SharedAddressesPanel.qml @@ -207,16 +207,6 @@ Control { } } - RequirementsCheckPendingLoader { - visible: root.requirementsCheckPending - Layout.alignment: Qt.AlignHCenter - } - - Item { - Layout.fillWidth: true - Layout.preferredHeight: Style.current.padding - } - // divider with top rounded corners + drop shadow Rectangle { Layout.fillWidth: true @@ -244,6 +234,7 @@ Control { permissionsModel: root.permissionsModel assetsModel: root.assetsModel collectiblesModel: root.collectiblesModel + requirementsCheckPending: root.requirementsCheckPending communityName: root.communityName communityIcon: root.communityIcon diff --git a/ui/app/AppLayouts/Communities/panels/SharedAddressesPermissionsPanel.qml b/ui/app/AppLayouts/Communities/panels/SharedAddressesPermissionsPanel.qml index 76dafa9c0b..77d8fe8746 100644 --- a/ui/app/AppLayouts/Communities/panels/SharedAddressesPermissionsPanel.qml +++ b/ui/app/AppLayouts/Communities/panels/SharedAddressesPermissionsPanel.qml @@ -27,6 +27,8 @@ Rectangle { property var assetsModel property var collectiblesModel + property bool requirementsCheckPending + readonly property bool lostPermissionToJoin: d.lostPermissionToJoin readonly property bool lostChannelPermissions: d.lostChannelPermissions @@ -143,6 +145,21 @@ Rectangle { font.weight: Font.Medium text: qsTr("Permissions") } + Item { Layout.fillWidth: true } + RowLayout { + Layout.rightMargin: Style.current.halfPadding + spacing: 4 + visible: root.requirementsCheckPending + StatusBaseText { + text: qsTr("Updating eligibility") + font.pixelSize: Style.current.tertiaryTextFontSize + color: Theme.palette.baseColor1 + } + StatusLoadingIndicator { + Layout.preferredWidth: 12 + Layout.preferredHeight: 12 + } + } } // permission types