2024-02-28 12:01:31 +00:00
|
|
|
import QtQml 2.15
|
2024-03-08 09:27:45 +00:00
|
|
|
import QtQml.Models 2.15
|
2024-02-28 12:01:31 +00:00
|
|
|
|
|
|
|
import StatusQ 0.1
|
|
|
|
import StatusQ.Core.Utils 0.1
|
|
|
|
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2024-03-08 09:27:45 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
2024-02-28 12:01:31 +00:00
|
|
|
QObject {
|
|
|
|
id: root
|
|
|
|
|
2024-03-04 22:07:09 +00:00
|
|
|
// Communities input models
|
|
|
|
property alias communitiesSourceModel: communitySFPM.sourceModel
|
|
|
|
property alias communitiesShowcaseModel: communityShowcaseRenaming.sourceModel
|
2024-02-28 12:01:31 +00:00
|
|
|
|
|
|
|
// adapted models
|
2024-03-04 22:07:09 +00:00
|
|
|
readonly property alias adaptedCommunitiesSourceModel: communitySFPM
|
|
|
|
readonly property alias adaptedCommunitiesShowcaseModel: communityShowcaseRenaming
|
2024-02-28 12:01:31 +00:00
|
|
|
|
2024-03-04 22:07:09 +00:00
|
|
|
// Accounts input models
|
|
|
|
property alias accountsSourceModel: accountsSFPM.sourceModel
|
2024-02-28 12:01:31 +00:00
|
|
|
property alias accountsShowcaseModel: accountsRenamingShowcase.sourceModel
|
|
|
|
|
|
|
|
// adapted models
|
2024-03-04 22:07:09 +00:00
|
|
|
readonly property alias adaptedAccountsSourceModel: accountsSFPM
|
2024-02-28 12:01:31 +00:00
|
|
|
readonly property alias adaptedAccountsShowcaseModel: accountsRenamingShowcase
|
|
|
|
|
2024-03-04 22:07:09 +00:00
|
|
|
// Collectibles input models
|
|
|
|
property alias collectiblesSourceModel: collectiblesSFPM.sourceModel
|
2024-02-28 12:01:31 +00:00
|
|
|
property alias collectiblesShowcaseModel: collectiblesRenamingShowcase.sourceModel
|
|
|
|
|
|
|
|
// adapted models
|
2024-03-04 22:07:09 +00:00
|
|
|
readonly property alias adaptedCollectiblesSourceModel: collectiblesSFPM
|
2024-02-28 12:01:31 +00:00
|
|
|
readonly property alias adaptedCollectiblesShowcaseModel: collectiblesRenamingShowcase
|
|
|
|
|
2024-03-08 09:27:45 +00:00
|
|
|
// Social links input models
|
|
|
|
property alias socialLinksSourceModel: socialLinksRoleRenaming.sourceModel
|
|
|
|
|
|
|
|
// adapted models
|
|
|
|
readonly property alias adaptedSocialLinksSourceModel: socialLinksSFPM
|
2024-02-28 12:01:31 +00:00
|
|
|
|
2024-03-04 22:07:09 +00:00
|
|
|
SortFilterProxyModel {
|
|
|
|
id: communitySFPM
|
|
|
|
proxyRoles: [
|
|
|
|
FastExpressionRole {
|
|
|
|
name: "showcaseKey"
|
|
|
|
expression: model.id
|
|
|
|
expectedRoles: ["id"]
|
2024-02-28 12:01:31 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
RolesRenamingModel {
|
2024-03-04 22:07:09 +00:00
|
|
|
id: communityShowcaseRenaming
|
2024-02-28 12:01:31 +00:00
|
|
|
mapping: [
|
|
|
|
RoleRename {
|
|
|
|
from: "id"
|
2024-03-04 22:07:09 +00:00
|
|
|
to: "showcaseKey"
|
2024-02-28 12:01:31 +00:00
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "order"
|
2024-03-04 22:07:09 +00:00
|
|
|
to: "showcasePosition"
|
2024-02-28 12:01:31 +00:00
|
|
|
},
|
|
|
|
// Removing model duplicates
|
|
|
|
// TODO: remove this when the lightweigth model is used
|
|
|
|
// https://github.com/status-im/status-desktop/issues/13688
|
|
|
|
RoleRename {
|
|
|
|
from: "name"
|
|
|
|
to: "_name"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "memberRole"
|
|
|
|
to: "_memberRole"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "image"
|
|
|
|
to: "_image"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "color"
|
|
|
|
to: "_color"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "description"
|
|
|
|
to: "_description"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "membersCount"
|
|
|
|
to: "_membersCount"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "loading"
|
|
|
|
to: "_loading"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2024-03-04 22:07:09 +00:00
|
|
|
SortFilterProxyModel {
|
|
|
|
id: accountsSFPM
|
|
|
|
proxyRoles: [
|
|
|
|
FastExpressionRole {
|
|
|
|
name: "showcaseKey"
|
|
|
|
expression: model.address
|
|
|
|
expectedRoles: ["address"]
|
2024-02-28 12:01:31 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
RolesRenamingModel {
|
|
|
|
id: accountsRenamingShowcase
|
|
|
|
mapping: [
|
|
|
|
RoleRename {
|
|
|
|
from: "address"
|
2024-03-04 22:07:09 +00:00
|
|
|
to: "showcaseKey"
|
2024-02-28 12:01:31 +00:00
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "order"
|
2024-03-04 22:07:09 +00:00
|
|
|
to: "showcasePosition"
|
2024-02-28 12:01:31 +00:00
|
|
|
},
|
|
|
|
// Removing model duplicates
|
|
|
|
// TODO: remove this when the lightweigth model is used
|
|
|
|
// https://github.com/status-im/status-desktop/issues/13688
|
|
|
|
RoleRename {
|
|
|
|
from: "name"
|
|
|
|
to: "_name"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "emoji"
|
|
|
|
to: "_emoji"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "colorId"
|
|
|
|
to: "_colorId"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2024-03-04 22:07:09 +00:00
|
|
|
SortFilterProxyModel {
|
|
|
|
id: collectiblesSFPM
|
|
|
|
proxyRoles: [
|
|
|
|
FastExpressionRole {
|
|
|
|
name: "showcaseKey"
|
|
|
|
expression: model.uid
|
|
|
|
expectedRoles: ["uid"]
|
2024-02-28 12:01:31 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
RolesRenamingModel {
|
|
|
|
id: collectiblesRenamingShowcase
|
|
|
|
mapping: [
|
|
|
|
RoleRename {
|
|
|
|
from: "uid"
|
2024-03-04 22:07:09 +00:00
|
|
|
to: "showcaseKey"
|
2024-02-28 12:01:31 +00:00
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "order"
|
2024-03-04 22:07:09 +00:00
|
|
|
to: "showcasePosition"
|
2024-02-28 12:01:31 +00:00
|
|
|
},
|
|
|
|
// Removing model duplicates
|
|
|
|
// TODO: remove this when the lightweigth model is used
|
|
|
|
// https://github.com/status-im/status-desktop/issues/13688
|
|
|
|
RoleRename {
|
|
|
|
from: "chainId"
|
|
|
|
to: "_chainId"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "contractAddress"
|
|
|
|
to: "_contractAddress"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "tokenId"
|
|
|
|
to: "_tokenId"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "name"
|
|
|
|
to: "_name"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "imageUrl"
|
|
|
|
to: "_imageUrl"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "backgroundColor"
|
|
|
|
to: "_backgroundColor"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "collectionName"
|
|
|
|
to: "_collectionName"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "isLoading"
|
|
|
|
to: "_isLoading"
|
|
|
|
},
|
|
|
|
RoleRename {
|
|
|
|
from: "communityId"
|
|
|
|
to: "_communityId"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2024-03-08 09:27:45 +00:00
|
|
|
|
|
|
|
RolesRenamingModel {
|
|
|
|
id: socialLinksRoleRenaming
|
|
|
|
mapping: [
|
|
|
|
RoleRename {
|
|
|
|
from: "uuid"
|
|
|
|
to: "showcaseKey"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
SortFilterProxyModel {
|
|
|
|
id: socialLinksSFPM
|
|
|
|
sourceModel: socialLinksRoleRenaming
|
|
|
|
proxyRoles: [
|
|
|
|
FastExpressionRole {
|
|
|
|
name: "showcasePosition"
|
|
|
|
expression: index
|
|
|
|
},
|
|
|
|
FastExpressionRole {
|
|
|
|
name: "showcaseVisibility"
|
|
|
|
expression: getShowcaseVisibility()
|
|
|
|
function getShowcaseVisibility() {
|
|
|
|
return Constants.ShowcaseVisibility.Everyone
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|