diff --git a/storybook/pages/HoldingsDropdownPage.qml b/storybook/pages/HoldingsDropdownPage.qml index 4263f11b54..9e561e63de 100644 --- a/storybook/pages/HoldingsDropdownPage.qml +++ b/storybook/pages/HoldingsDropdownPage.qml @@ -39,10 +39,8 @@ Pane { parent: root anchors.centerIn: root - store: QtObject { - readonly property var collectiblesModel: CollectiblesModel {} - readonly property var assetsModel: AssetsModel {} - } + collectiblesModel: CollectiblesModel {} + assetsModel: AssetsModel {} onOpened: contentItem.parent.parent = root Component.onCompleted: { diff --git a/ui/app/AppLayouts/Chat/ChatLayout.qml b/ui/app/AppLayouts/Chat/ChatLayout.qml index c2480eba9a..debf431817 100644 --- a/ui/app/AppLayouts/Chat/ChatLayout.qml +++ b/ui/app/AppLayouts/Chat/ChatLayout.qml @@ -56,6 +56,8 @@ StackLayout { sourceComponent: CommunitySettingsView { rootStore: root.rootStore + communityStore: CommunitiesStore {} + hasAddedContacts: root.contactsStore.myContactsModel.count > 0 chatCommunitySectionModule: root.rootStore.chatCommunitySectionModule community: root.rootStore.mainModuleInst ? root.rootStore.mainModuleInst.activeSection diff --git a/ui/app/AppLayouts/Chat/controls/community/ExtendedDropdownContent.qml b/ui/app/AppLayouts/Chat/controls/community/ExtendedDropdownContent.qml index d07b90f643..06dbf03de9 100644 --- a/ui/app/AppLayouts/Chat/controls/community/ExtendedDropdownContent.qml +++ b/ui/app/AppLayouts/Chat/controls/community/ExtendedDropdownContent.qml @@ -18,7 +18,9 @@ import SortFilterProxyModel 0.2 Item { id: root - property var store + property var assetsModel + property var collectiblesModel + property var checkedKeys: [] property int type: ExtendedDropdownContent.Type.Assets @@ -139,7 +141,7 @@ Item { PropertyChanges { target: d currentModel: root.type === ExtendedDropdownContent.Type.Assets - ? root.store.assetsModel : root.store.collectiblesModel + ? root.assetsModel : root.collectiblesModel isFilterOptionVisible: false } diff --git a/ui/app/AppLayouts/Chat/controls/community/HoldingsDropdown.qml b/ui/app/AppLayouts/Chat/controls/community/HoldingsDropdown.qml index 2e2261c76c..2fed85ac33 100644 --- a/ui/app/AppLayouts/Chat/controls/community/HoldingsDropdown.qml +++ b/ui/app/AppLayouts/Chat/controls/community/HoldingsDropdown.qml @@ -12,7 +12,9 @@ import AppLayouts.Chat.helpers 1.0 StatusDropdown { id: root - property var store + property var assetsModel + property var collectiblesModel + property var usedTokens: [] property var usedEnsNames: [] @@ -248,7 +250,9 @@ StatusDropdown { ExtendedDropdownContent { id: listPanel - store: root.store + assetsModel: root.assetsModel + collectiblesModel: root.collectiblesModel + checkedKeys: root.usedTokens.map(entry => entry.key) type: d.extendedDropdownType @@ -287,8 +291,8 @@ StatusDropdown { Component.onCompleted: { if(d.extendedDeepNavigation) listPanel.goForward(d.currentItemKey, - CommunityPermissionsHelpers.getTokenNameByKey(store.collectiblesModel, d.currentItemKey), - CommunityPermissionsHelpers.getTokenIconByKey(store.collectiblesModel, d.currentItemKey), + CommunityPermissionsHelpers.getTokenNameByKey(root.collectiblesModel, d.currentItemKey), + CommunityPermissionsHelpers.getTokenIconByKey(root.collectiblesModel, d.currentItemKey), d.currentSubItems) } @@ -318,9 +322,9 @@ StatusDropdown { readonly property real effectiveAmount: amountValid ? amount : 0 - tokenName: CommunityPermissionsHelpers.getTokenNameByKey(store.assetsModel, root.assetKey) - tokenShortName: CommunityPermissionsHelpers.getTokenShortNameByKey(store.assetsModel, root.assetKey) - tokenImage: CommunityPermissionsHelpers.getTokenIconByKey(store.assetsModel, root.assetKey) + tokenName: CommunityPermissionsHelpers.getTokenNameByKey(root.assetsModel, root.assetKey) + tokenShortName: CommunityPermissionsHelpers.getTokenShortNameByKey(root.assetsModel, root.assetKey) + tokenImage: CommunityPermissionsHelpers.getTokenIconByKey(root.assetsModel, root.assetKey) amountText: d.assetAmountText tokenCategoryText: qsTr("Asset") addOrUpdateButtonEnabled: d.assetsReady @@ -353,9 +357,9 @@ StatusDropdown { readonly property real effectiveAmount: amountValid ? amount : 0 - tokenName: CommunityPermissionsHelpers.getTokenNameByKey(store.collectiblesModel, root.collectibleKey) + tokenName: CommunityPermissionsHelpers.getTokenNameByKey(root.collectiblesModel, root.collectibleKey) tokenShortName: "" - tokenImage: CommunityPermissionsHelpers.getTokenIconByKey(store.collectiblesModel, root.collectibleKey) + tokenImage: CommunityPermissionsHelpers.getTokenIconByKey(root.collectiblesModel, root.collectibleKey) amountText: d.collectibleAmountText tokenCategoryText: qsTr("Collectible") addOrUpdateButtonEnabled: d.collectiblesReady diff --git a/ui/app/AppLayouts/Chat/panels/communities/CommunityPermissionsSettingsPanel.qml b/ui/app/AppLayouts/Chat/panels/communities/CommunityPermissionsSettingsPanel.qml index 24bc955979..f05363b4ac 100644 --- a/ui/app/AppLayouts/Chat/panels/communities/CommunityPermissionsSettingsPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/communities/CommunityPermissionsSettingsPanel.qml @@ -12,7 +12,7 @@ SettingsPageLayout { id: root property var rootStore - property var store: CommunitiesStore {} + required property CommunitiesStore store property int viewWidth: 560 // by design function navigateBack() { diff --git a/ui/app/AppLayouts/Chat/views/CommunitySettingsView.qml b/ui/app/AppLayouts/Chat/views/CommunitySettingsView.qml index 7d7d5176c5..4ee25286cc 100644 --- a/ui/app/AppLayouts/Chat/views/CommunitySettingsView.qml +++ b/ui/app/AppLayouts/Chat/views/CommunitySettingsView.qml @@ -44,7 +44,7 @@ StatusSectionLayout { property var rootStore property var community property var chatCommunitySectionModule - property var communityStore: CommunitiesStore {} + required property CommunitiesStore communityStore property bool hasAddedContacts: false property var transactionStore: TransactionStore {} @@ -248,6 +248,8 @@ StatusSectionLayout { CommunityPermissionsSettingsPanel { rootStore: root.rootStore + store: root.communityStore + onPreviousPageNameChanged: root.backButtonName = previousPageName } diff --git a/ui/app/AppLayouts/Chat/views/communities/CommunityNewPermissionView.qml b/ui/app/AppLayouts/Chat/views/communities/CommunityNewPermissionView.qml index 85eb9a5c93..7562985df7 100644 --- a/ui/app/AppLayouts/Chat/views/communities/CommunityNewPermissionView.qml +++ b/ui/app/AppLayouts/Chat/views/communities/CommunityNewPermissionView.qml @@ -13,6 +13,7 @@ import shared.panels 1.0 import AppLayouts.Chat.helpers 1.0 import AppLayouts.Chat.panels.communities 1.0 +import AppLayouts.Chat.stores 1.0 import "../../../Chat/controls/community" @@ -20,7 +21,7 @@ StatusScrollView { id: root property var rootStore - property var store + required property CommunitiesStore store property int viewWidth: 560 // by design property bool isEditState: false @@ -196,7 +197,8 @@ StatusScrollView { HoldingsDropdown { id: dropdown - store: root.store + assetsModel: store.assetsModel + collectiblesModel: store.collectiblesModel function addItem(type, item, amount) { const key = item.key diff --git a/ui/app/AppLayouts/Chat/views/communities/CommunityPermissionsView.qml b/ui/app/AppLayouts/Chat/views/communities/CommunityPermissionsView.qml index 106242b5ec..823d984332 100644 --- a/ui/app/AppLayouts/Chat/views/communities/CommunityPermissionsView.qml +++ b/ui/app/AppLayouts/Chat/views/communities/CommunityPermissionsView.qml @@ -10,12 +10,14 @@ import shared.popups 1.0 import AppLayouts.Chat.controls.community 1.0 import AppLayouts.Chat.helpers 1.0 +import AppLayouts.Chat.stores 1.0 StatusScrollView { id: root property var rootStore - property var store + required property CommunitiesStore store + property int viewWidth: 560 // by design signal editPermissionRequested(int index)