fix: unbreak profile showcase
- amISectionAdmin no longer exists - profile section wallet store no longer provided the base assets model
This commit is contained in:
parent
045dfe60a0
commit
38bbd0fb53
|
@ -1,8 +1,11 @@
|
||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
|
|
||||||
|
import utils 1.0
|
||||||
|
|
||||||
ShowcaseDelegate {
|
ShowcaseDelegate {
|
||||||
title: !!showcaseObj && !!showcaseObj.name ? showcaseObj.name : ""
|
title: !!showcaseObj && !!showcaseObj.name ? showcaseObj.name : ""
|
||||||
secondaryTitle: !!showcaseObj && !!showcaseObj.amISectionAdmin ? qsTr("Admin") : qsTr("Member")
|
secondaryTitle: !!showcaseObj && (showcaseObj.memberRole === Constants.memberRole.owner ||
|
||||||
|
showcaseObj.memberRole === Constants.memberRole.admin) ? qsTr("Admin") : qsTr("Member")
|
||||||
hasImage: !!showcaseObj && !!showcaseObj.image
|
hasImage: !!showcaseObj && !!showcaseObj.image
|
||||||
|
|
||||||
icon.name: !!showcaseObj ? showcaseObj.name : ""
|
icon.name: !!showcaseObj ? showcaseObj.name : ""
|
||||||
|
|
|
@ -9,7 +9,7 @@ ProfileShowcasePanel {
|
||||||
|
|
||||||
settingsKey: "communities"
|
settingsKey: "communities"
|
||||||
keyRole: "id"
|
keyRole: "id"
|
||||||
roleNames: ["id", "name", "amISectionAdmin", "image", "color"]
|
roleNames: ["id", "name", "memberRole", "image", "color"]
|
||||||
filterFunc: (modelData) => modelData.joined && !showcaseModel.hasItem(modelData.id)
|
filterFunc: (modelData) => modelData.joined && !showcaseModel.hasItem(modelData.id)
|
||||||
hiddenPlaceholderBanner: qsTr("Communities here will show on your profile")
|
hiddenPlaceholderBanner: qsTr("Communities here will show on your profile")
|
||||||
showcasePlaceholderBanner: qsTr("Communities here will be hidden from your profile")
|
showcasePlaceholderBanner: qsTr("Communities here will be hidden from your profile")
|
||||||
|
|
|
@ -10,7 +10,7 @@ QtObject {
|
||||||
|
|
||||||
property var accountSensitiveSettings: Global.appIsReady? localAccountSensitiveSettings : null
|
property var accountSensitiveSettings: Global.appIsReady? localAccountSensitiveSettings : null
|
||||||
|
|
||||||
property var areTestNetworksEnabled: networksModule.areTestNetworksEnabled
|
readonly property bool areTestNetworksEnabled: networksModule.areTestNetworksEnabled
|
||||||
property var networks: networksModule.networks
|
property var networks: networksModule.networks
|
||||||
|
|
||||||
function toggleTestNetworksEnabled(){
|
function toggleTestNetworksEnabled(){
|
||||||
|
@ -20,7 +20,7 @@ QtObject {
|
||||||
// TODO(alaibe): there should be no access to wallet section, create collectible in profile
|
// TODO(alaibe): there should be no access to wallet section, create collectible in profile
|
||||||
property var overview: walletSectionOverview
|
property var overview: walletSectionOverview
|
||||||
property var flatCollectibles: Global.appIsReady ? walletSectionCollectibles.model : null
|
property var flatCollectibles: Global.appIsReady ? walletSectionCollectibles.model : null
|
||||||
|
property var assets: walletSectionAssets.assets
|
||||||
property var accounts: Global.appIsReady? accountsModule.accounts : null
|
property var accounts: Global.appIsReady? accountsModule.accounts : null
|
||||||
|
|
||||||
function deleteAccount(address) {
|
function deleteAccount(address) {
|
||||||
|
|
|
@ -84,7 +84,7 @@ Control {
|
||||||
}
|
}
|
||||||
sorters: [
|
sorters: [
|
||||||
RoleSorter {
|
RoleSorter {
|
||||||
roleName: "amISectionAdmin"
|
roleName: "memberRole"
|
||||||
sortOrder: Qt.DescendingOrder // admin first
|
sortOrder: Qt.DescendingOrder // admin first
|
||||||
},
|
},
|
||||||
StringSorter {
|
StringSorter {
|
||||||
|
@ -103,7 +103,7 @@ Control {
|
||||||
subTitle: model.description
|
subTitle: model.description
|
||||||
tertiaryTitle: qsTr("%n member(s)", "", model.members.count)
|
tertiaryTitle: qsTr("%n member(s)", "", model.members.count)
|
||||||
asset.name: model.image ?? model.name
|
asset.name: model.image ?? model.name
|
||||||
asset.isImage: asset.name.startsWith("data:image/")
|
asset.isImage: asset.name.startsWith(Constants.dataImagePrefix)
|
||||||
asset.isLetterIdenticon: !model.image
|
asset.isLetterIdenticon: !model.image
|
||||||
asset.color: model.color
|
asset.color: model.color
|
||||||
asset.width: 40
|
asset.width: 40
|
||||||
|
@ -112,7 +112,8 @@ Control {
|
||||||
border.color: Theme.palette.baseColor2
|
border.color: Theme.palette.baseColor2
|
||||||
components: [
|
components: [
|
||||||
StatusIcon {
|
StatusIcon {
|
||||||
visible: model.amISectionAdmin
|
visible: model.memberRole === Constants.memberRole.owner ||
|
||||||
|
model.memberRole === Constants.memberRole.admin
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
icon: "crown"
|
icon: "crown"
|
||||||
color: Theme.palette.directColor1
|
color: Theme.palette.directColor1
|
||||||
|
|
Loading…
Reference in New Issue