fix(@desktop/community) add delete button to edit channel popup
- update labels in edit channel popup Fixes #6732
This commit is contained in:
parent
6c562580ba
commit
0e7e541a62
|
@ -21,6 +21,7 @@ StatusDialog {
|
|||
height: 509
|
||||
|
||||
property bool isEdit: false
|
||||
property bool isDeleteable: false
|
||||
property string chatId: ""
|
||||
property string categoryId: ""
|
||||
property string channelName: ""
|
||||
|
@ -37,6 +38,7 @@ StatusDialog {
|
|||
|
||||
signal createCommunityChannel(string chName, string chDescription, string chEmoji, string chColor, string chCategoryId)
|
||||
signal editCommunityChannel(string chName, string chDescription, string chEmoji, string chColor, string chCategoryId)
|
||||
signal deleteCommunityChannel()
|
||||
|
||||
title: qsTr("New channel")
|
||||
|
||||
|
@ -277,12 +279,21 @@ StatusDialog {
|
|||
|
||||
footer: StatusDialogFooter {
|
||||
rightButtons: ObjectModel {
|
||||
StatusButton {
|
||||
objectName: "deleteCommunityChannelBtn"
|
||||
visible: isEdit && isDeleteable
|
||||
text: qsTr("Delete channel")
|
||||
type: StatusBaseButton.Type.Danger
|
||||
onClicked: {
|
||||
root.deleteCommunityChannel()
|
||||
}
|
||||
}
|
||||
StatusButton {
|
||||
objectName: "createOrEditCommunityChannelBtn"
|
||||
enabled: isFormValid()
|
||||
text: isEdit ?
|
||||
qsTr("Save") :
|
||||
qsTr("Create")
|
||||
qsTr("Save changes") :
|
||||
qsTr("Create channel")
|
||||
onClicked: {
|
||||
if (!isFormValid()) {
|
||||
scrollView.scrollBackUp()
|
||||
|
|
|
@ -189,6 +189,7 @@ StatusPopupMenu {
|
|||
CreateChannelPopup {
|
||||
anchors.centerIn: parent
|
||||
isEdit: true
|
||||
isDeleteable: root.isCommunityChat
|
||||
emojiPopup: root.emojiPopup
|
||||
onCreateCommunityChannel: {
|
||||
root.createCommunityChannel(root.chatId, chName, chDescription, chEmoji, chColor);
|
||||
|
@ -197,6 +198,10 @@ StatusPopupMenu {
|
|||
root.editCommunityChannel(root.chatId, chName, chDescription, chEmoji, chColor,
|
||||
chCategoryId);
|
||||
}
|
||||
onDeleteCommunityChannel: {
|
||||
Global.openPopup(deleteChatConfirmationDialogComponent)
|
||||
close()
|
||||
}
|
||||
onClosed: {
|
||||
destroy()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue