From ce525890eb6b985e1baa12bd5141f582e67d251d Mon Sep 17 00:00:00 2001 From: Alexandra Betouni <31625338+alexandraB99@users.noreply.github.com> Date: Fri, 22 Mar 2024 15:05:19 +0200 Subject: [PATCH] fix[StatusChatMenu]: updated menu options as per designs Closes #13393 --- .../src/StatusQ/Popups/StatusAction.qml | 4 +- .../chat/menuItems/MuteChatMenuItem.qml | 9 ++- .../shared/views/chat/ChatContextMenuView.qml | 62 +++++++++++++------ ui/imports/utils/Constants.qml | 3 +- vendor/status-go | 2 +- 5 files changed, 54 insertions(+), 26 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Popups/StatusAction.qml b/ui/StatusQ/src/StatusQ/Popups/StatusAction.qml index 42d1429137..6eab67e136 100644 --- a/ui/StatusQ/src/StatusQ/Popups/StatusAction.qml +++ b/ui/StatusQ/src/StatusQ/Popups/StatusAction.qml @@ -1,5 +1,5 @@ -import QtQuick 2.13 -import QtQuick.Controls 2.13 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import StatusQ.Core 0.1 import StatusQ.Core.Theme 0.1 diff --git a/ui/imports/shared/controls/chat/menuItems/MuteChatMenuItem.qml b/ui/imports/shared/controls/chat/menuItems/MuteChatMenuItem.qml index dc79f5edbd..56e4fe2d0a 100644 --- a/ui/imports/shared/controls/chat/menuItems/MuteChatMenuItem.qml +++ b/ui/imports/shared/controls/chat/menuItems/MuteChatMenuItem.qml @@ -1,5 +1,5 @@ -import QtQuick 2.14 -import QtQuick.Controls 2.14 +import QtQuick 2.15 +import QtQuick.Controls 2.15 import utils 1.0 @@ -31,6 +31,11 @@ StatusMenu { onTriggered: muteTriggered(Constants.MutingVariations.For8hr) } + StatusAction { + text: qsTr("For 24 hours") + onTriggered: muteTriggered(Constants.MutingVariations.For24hr) + } + StatusAction { text: qsTr("For 7 days") onTriggered: muteTriggered(Constants.MutingVariations.For1week) diff --git a/ui/imports/shared/views/chat/ChatContextMenuView.qml b/ui/imports/shared/views/chat/ChatContextMenuView.qml index 20f0a8e97d..70ebde710b 100644 --- a/ui/imports/shared/views/chat/ChatContextMenuView.qml +++ b/ui/imports/shared/views/chat/ChatContextMenuView.qml @@ -54,6 +54,15 @@ StatusMenu { onTriggered: root.displayProfilePopup(root.chatId) } + StatusAction { + text: qsTr("View Members") + icon.name: "group-chat" + enabled: root.chatType === Constants.chatType.privateGroupChat + onTriggered: { + localAccountSensitiveSettings.expandUsersList = !localAccountSensitiveSettings.expandUsersList; + } + } + StatusAction { text: root.amIChatAdmin ? qsTr("Add / remove from group") : qsTr("Add to group") icon.name: "add-to-dm" @@ -92,6 +101,7 @@ StatusMenu { Component { id: renameGroupPopupComponent RenameGroupPopup { + destroyOnClose: true onUpdateGroupChatDetails: { root.updateGroupChatDetails(root.chatId, groupName, groupColor, groupImage) close() @@ -126,7 +136,16 @@ StatusMenu { } } - + StatusAction { + objectName: "editChannelMenuItem" + text: qsTr("Edit Channel") + icon.name: "edit" + enabled: root.isCommunityChat && root.amIChatAdmin + onTriggered: { + root.displayEditChannelPopup(root.chatId); + } + } + StatusMenu { title: qsTr("Debug actions") enabled: root.showDebugOptions @@ -147,16 +166,6 @@ StatusMenu { } } - StatusAction { - objectName: "editChannelMenuItem" - text: qsTr("Edit Channel") - icon.name: "edit" - enabled: root.isCommunityChat && root.amIChatAdmin - onTriggered: { - root.displayEditChannelPopup(root.chatId); - } - } - StatusAction { text: qsTr("Download") enabled: localAccountSensitiveSettings.downloadChannelMessagesEnabled @@ -165,15 +174,16 @@ StatusMenu { } StatusMenuSeparator { - visible: clearHistoryMenuItem.enabled || deleteOrLeaveMenuItem.enabled + visible: clearHistoryGroupMenuItem.enabled || deleteOrLeaveMenuItem.enabled } StatusAction { - id: clearHistoryMenuItem - objectName: "clearHistoryMenuItem" + id: clearHistoryGroupMenuItem + objectName: "clearHistoryGroupMenuItem" + enabled: (root.chatType !== Constants.chatType.oneToOne) text: qsTr("Clear History") - icon.name: "close-circle" - type: deleteOrLeaveMenuItem.enabled ? StatusAction.Type.Normal : StatusAction.Type.Danger + icon.name: "delete" + type: StatusAction.Type.Danger onTriggered: { Global.openPopup(clearChatConfirmationDialogComponent); } @@ -193,7 +203,7 @@ StatusMenu { qsTr("Close Chat") : qsTr("Leave Chat") } - icon.name: root.chatType === Constants.chatType.oneToOne || root.isCommunityChat ? "delete" : "arrow-left" + icon.name: root.chatType === Constants.chatType.oneToOne || root.isCommunityChat ? "close-circle" : "arrow-left" icon.width: root.chatType === Constants.chatType.oneToOne || root.isCommunityChat ? 18 : 14 type: StatusAction.Type.Danger @@ -208,6 +218,18 @@ StatusMenu { enabled: !root.isCommunityChat || root.amIChatAdmin } + StatusAction { + id: clearHistoryMenuItem + objectName: "clearHistoryMenuItem" + enabled: (root.chatType === Constants.chatType.oneToOne) + text: qsTr("Clear History") + icon.name: "delete" + type: StatusAction.Type.Danger + onTriggered: { + Global.openPopup(clearChatConfirmationDialogComponent); + } + } + FileDialog { id: downloadDialog acceptLabel: qsTr("Save") @@ -226,8 +248,8 @@ StatusMenu { ConfirmationDialog { confirmButtonObjectName: "clearChatConfirmationDialogClearButton" headerSettings.title: qsTr("Clear chat history") - confirmationText: qsTr("Are you sure you want to clear chat history for %1?").arg(root.chatName) - confirmButtonLabel: qsTr("Clear") + confirmationText: qsTr("Are you sure you want to clear your chat history with %1? All messages will be deleted on your side and will be unrecoverable.").arg(root.chatName) + confirmButtonLabel: qsTr("Clear chat history") showCancelButton: true cancelBtnType: "normal" @@ -278,7 +300,7 @@ StatusMenu { confirmButtonLabel: root.isCommunityChat ? qsTr("Delete") : headerSettings.title confirmationText: root.isCommunityChat ? qsTr("Are you sure you want to delete #%1 channel?").arg(root.chatName) : root.chatType === Constants.chatType.oneToOne ? - qsTr("Are you sure you want to close this chat?"): + qsTr("Are you sure you want to close this chat? This will remove the chat from the list. Your chat history will be retained and shown the next time you message each other."): qsTr("Are you sure you want to leave this chat?") showCancelButton: true cancelBtnType: "normal" diff --git a/ui/imports/utils/Constants.qml b/ui/imports/utils/Constants.qml index aeaa97aa25..b36fb08079 100644 --- a/ui/imports/utils/Constants.qml +++ b/ui/imports/utils/Constants.qml @@ -1385,7 +1385,8 @@ QtObject { For1week = 4, TillUnmuted = 5, For1min = 6, - Unmuted = 7 + Unmuted = 7, + For24hr = 8 } enum LinkPreviewType { diff --git a/vendor/status-go b/vendor/status-go index 970119af78..45c6a80c0a 160000 --- a/vendor/status-go +++ b/vendor/status-go @@ -1 +1 @@ -Subproject commit 970119af7812d24e67d046871eefba7eb60e9db4 +Subproject commit 45c6a80c0a659e5c2ee004ea418fb7fce34d99e6