fix(@desktop/communities): Can't copy to clipboard the link to community

Also fixed some minor bugs in the community popups.

fixes #3959
This commit is contained in:
Khushboo Mehta 2021-11-02 15:11:35 +01:00 committed by Iuri Matias
parent 7fcd280fe0
commit b7bc528552
8 changed files with 35 additions and 7 deletions

View File

@ -98,6 +98,7 @@ Rectangle {
anchors.bottom: parent.bottom
anchors.bottomMargin: Style.current.padding
onClicked: openPopup(communityProfilePopup, {
store: rootStore,
community: root.activeCommunity
})
}

View File

@ -146,7 +146,7 @@ StatusModal {
icon.width: 20
rotation: 180
onClicked: {
openroot(communitiesrootComponent)
openPopup(communitiesPopupComponent)
root.close()
}
}

View File

@ -63,10 +63,11 @@ StatusModal {
onNotificationsButtonClicked: {
root.store.setCommunityMuted(root.community.id, checked);
}
onEditButtonClicked: openroot(editCommunityroot, {
onEditButtonClicked: openPopup(editCommunityPopup, {
store: root.store,
community: root.community
})
onTransferOwnershipButtonClicked: openroot(transferOwnershiproot, {privateKey: root.store.exportCommunity()})
onTransferOwnershipButtonClicked: openPopup(transferOwnershiproot, {privateKey: root.store.exportCommunity()})
onLeaveButtonClicked: {
root.store.leaveCommunity(root.community.id);
root.close();

View File

@ -163,7 +163,7 @@ StatusModal {
icon.name: "delete"
type: StatusListItem.Type.Danger
sensor.onClicked: {
openroot(deleteCategoryConfirmationDialogComponent, {
openPopup(deleteCategoryConfirmationDialogComponent, {
//% "Delete %1 category"
title: qsTrId("delete--1-category").arg(root.contentItem.categoryName.input.text),
//% "Are you sure you want to delete %1 category? Channels inside the category wont be deleted."

View File

@ -88,8 +88,8 @@ QtObject {
chatsModelInst.communities.createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY);
}
function editCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) {
chatsModelInst.communities.editCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY);
function editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) {
chatsModelInst.communities.editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY);
}
function createCommunityCategory(communityId, categoryName, channels) {

View File

@ -40,6 +40,7 @@ Item {
chatInfoButton.icon.color: root.store.chatsModelInst.communities.activeCommunity.communityColor
menuButton.visible: root.store.chatsModelInst.communities.activeCommunity.admin && root.store.chatsModelInst.communities.activeCommunity.canManageUsers
chatInfoButton.onClicked: openPopup(communityProfilePopup, {
store: root.store,
community: root.store.chatsModelInst.communities.activeCommunity
})

View File

@ -6,4 +6,28 @@ QtObject {
property var walletModelInst: walletModel
property var profileModelInst: profileModel
property MessageStore messageStore: MessageStore { }
function setCommunityMuted(communityId, checked) {
chatsModelInst.communities.setCommunityMuted(communityId, checked);
}
function exportCommunity() {
chatsModelInst.communities.exportCommunity();
}
function leaveCommunity(communityId) {
chatsModelInst.communities.leaveCommunity(communityId);
}
function createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) {
chatsModelInst.communities.createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY);
}
function editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) {
chatsModelInst.communities.editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY);
}
function copyToClipboard(text) {
chatsModelInst.copyToClipboard(text);
}
}

View File

@ -258,6 +258,7 @@ Item {
text: qsTrId("view-community")
icon.name: "group-chat"
onTriggered: openPopup(communityProfilePopup, {
store: appMain.rootStore,
community: chatsModel.communities.observedCommunity
})
}
@ -267,7 +268,7 @@ Item {
//% "Edit Community"
text: qsTrId("edit-community")
icon.name: "edit"
onTriggered: openPopup(editCommunityPopup, {community: chatsModel.communities.observedCommunity})
onTriggered: openPopup(editCommunityPopup, {store: appMain.rootStore, community: chatsModel.communities.observedCommunity})
}
StatusMenuSeparator {}