From 0ee0c8ddd4e89673237ed0a36bd526aef26d2a2a Mon Sep 17 00:00:00 2001 From: Khushboo Mehta Date: Thu, 5 May 2022 17:01:54 +0200 Subject: [PATCH] feat(@desktop/wallet): Add has activity to the derived addresses in wallet fix #5655 --- src/backend/accounts.nim | 4 ++-- .../Wallet/panels/DerivedAddressesPanel.qml | 18 ++++++++++++++++-- vendor/status-go | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/backend/accounts.nim b/src/backend/accounts.nim index 29e794ab8b..3d25f633a1 100644 --- a/src/backend/accounts.nim +++ b/src/backend/accounts.nim @@ -291,8 +291,8 @@ proc setDisplayName*(displayName: string): RpcResponse[JsonNode] {.raises: [Exce proc getDerivedAddressList*(password: string, derivedFrom: string, path: string, pageSize: int = 0, pageNumber: int = 6,): RpcResponse[JsonNode] {.raises: [Exception].} = let payload = %* [password, derivedFrom, path, pageSize, pageNumber ] - result = core.callPrivateRPC("accounts_getDerivedAddressesForPath", payload) + result = core.callPrivateRPC("wallet_getDerivedAddressesForPath", payload) proc getDerivedAddressListForMnemonic*(mnemonic: string, path: string, pageSize: int = 0, pageNumber: int = 6,): RpcResponse[JsonNode] {.raises: [Exception].} = let payload = %* [mnemonic, path, pageSize, pageNumber ] - result = core.callPrivateRPC("accounts_getDerivedAddressesForMenominicWithPath", payload) + result = core.callPrivateRPC("wallet_getDerivedAddressesForMenominicWithPath", payload) diff --git a/ui/app/AppLayouts/Wallet/panels/DerivedAddressesPanel.qml b/ui/app/AppLayouts/Wallet/panels/DerivedAddressesPanel.qml index ba38137382..895652bd69 100644 --- a/ui/app/AppLayouts/Wallet/panels/DerivedAddressesPanel.qml +++ b/ui/app/AppLayouts/Wallet/panels/DerivedAddressesPanel.qml @@ -35,6 +35,7 @@ Item { stackLayout.currentIndex = nextSelectableAddressIndex/_internal.pageSize if(nextSelectableAddressIndex >= 0 && nextSelectableAddressIndex < RootStore.derivedAddressesList.count) { selectedDerivedAddress.title = RootStore.getDerivedAddressData(nextSelectableAddressIndex) + selectedDerivedAddress.hasActivity = RootStore.getDerivedAddressHasActivityData(nextSelectableAddressIndex) selectedDerivedAddress.subTitle = RootStore.getDerivedAddressHasActivityData(nextSelectableAddressIndex) ? qsTr("Has Activity"): qsTr("No Activity") selectedDerivedAddress.enabled = !RootStore.getDerivedAddressAlreadyCreatedData(nextSelectableAddressIndex) selectedDerivedAddress.pathSubFix = nextSelectableAddressIndex @@ -70,12 +71,14 @@ Item { StatusListItem { id: selectedDerivedAddress property int pathSubFix: 0 + property bool hasActivity: false implicitWidth: parent.width color: "transparent" border.width: 1 border.color: Theme.palette.baseColor2 title: "---" - subTitle: qsTr("No activity") + subTitle: selectedDerivedAddress.hasActivity ? qsTr("Has Activity"): qsTr("No Activity") + statusListItemSubTitle.color: selectedDerivedAddress.hasActivity ? Theme.palette.primaryColor1 : Theme.palette.baseColor1 statusListItemTitle.wrapMode: Text.NoWrap statusListItemTitle.width: _internal.maxAddressWidth statusListItemTitle.elide: Qt.ElideMiddle @@ -115,6 +118,7 @@ Item { delegate: StatusListItem { id: element property int actualIndex: index + (stackLayout.currentIndex* _internal.pageSize) + property bool hasActivity: RootStore.getDerivedAddressHasActivityData(actualIndex) implicitWidth: derivedAddressPopup.width statusListItemTitle.wrapMode: Text.NoWrap statusListItemTitle.width: _internal.maxAddressWidth @@ -122,19 +126,29 @@ Item { statusListItemTitle.anchors.left: undefined statusListItemTitle.anchors.right: undefined title: RootStore.getDerivedAddressData(actualIndex) - subTitle: RootStore.getDerivedAddressHasActivityData(actualIndex) ? qsTr("Has Activity"): qsTr("No Activity") + subTitle: element.hasActivity ? qsTr("Has Activity"): qsTr("No Activity") + statusListItemSubTitle.color: element.hasActivity ? Theme.palette.primaryColor1 : Theme.palette.baseColor1 enabled: !RootStore.getDerivedAddressAlreadyCreatedData(actualIndex) components: [ StatusBaseText { text: element.actualIndex font.pixelSize: 15 color: Theme.palette.baseColor1 + }, + Rectangle { + radius: width/2 + height: 5 + width: 5 + color: Theme.palette.primaryColor1 + visible: element.hasActivity + anchors.verticalCenter: parent.verticalCenter } ] onClicked: { selectedDerivedAddress.title = title selectedDerivedAddress.subTitle = subTitle selectedDerivedAddress.pathSubFix = actualIndex + selectedDerivedAddress.hasActivity = element.hasActivity derivedAddressPopup.close() } } diff --git a/vendor/status-go b/vendor/status-go index 4018e4334b..15e5584ed2 160000 --- a/vendor/status-go +++ b/vendor/status-go @@ -1 +1 @@ -Subproject commit 4018e4334beaaa5243a8a6e6450ecd5aeb3addef +Subproject commit 15e5584ed2cd82e5f14ab0edff2a22af0bf83744