chore(contact-request): remove old contact request button and popup

Fixes #9072

I made clicking on the OS notification open the AC instead of the old popup
This commit is contained in:
Jonathan Rainville 2023-01-12 14:06:18 -05:00
parent c16fc0d088
commit f8c4682885
5 changed files with 8 additions and 134 deletions

View File

@ -861,7 +861,7 @@ method displayWindowsOsNotification*[T](self: Module[T], title: string,
method osNotificationClicked*[T](self: Module[T], details: NotificationDetails) =
if(details.notificationType == NotificationType.NewContactRequest):
self.controller.switchTo(details.sectionId, "", "")
self.view.emitOpenContactRequestsPopupSignal()
self.view.emitOpenActivityCenterSignal()
elif(details.notificationType == NotificationType.JoinCommunityRequest):
self.controller.switchTo(details.sectionId, "", "")
self.view.emitOpenCommunityMembershipRequestsPopupSignal(details.sectionId)

View File

@ -197,9 +197,9 @@ QtObject:
proc emitResolvedENSSignal*(self: View, resolvedPubKey: string, resolvedAddress: string, uuid: string) =
self.resolvedENS(resolvedPubKey, resolvedAddress, uuid)
proc openContactRequestsPopup*(self: View) {.signal.}
proc emitOpenContactRequestsPopupSignal*(self: View) =
self.openContactRequestsPopup()
proc openActivityCenter*(self: View) {.signal.}
proc emitOpenActivityCenterSignal*(self: View) =
self.openActivityCenter()
proc openCommunityMembershipRequestsPopup*(self: View, sectionId: string) {.signal.}
proc emitOpenCommunityMembershipRequestsPopupSignal*(self: View, sectionId: string) =

View File

@ -1,97 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13
import StatusQ.Core 0.1
import StatusQ.Controls 0.1
import utils 1.0
import shared.popups 1.0
import "../panels"
// TODO: Replace with StatusModal
ModalPopup {
id: popup
property var store
title: qsTr("Contact requests")
StatusListView {
id: contactList
anchors.fill: parent
anchors.leftMargin: -Style.current.halfPadding
anchors.rightMargin: -Style.current.halfPadding
model: popup.store.contactRequestsModel
delegate: ContactRequestPanel {
contactPubKey: model.pubKey
contactName: model.displayName
contactIcon: model.icon
onOpenProfilePopup: {
Global.openProfilePopup(model.pubKey)
}
onBlockContactActionTriggered: {
Global.blockContactRequested(model.pubKey, model.displayName)
}
onAcceptClicked: {
popup.store.acceptContactRequest(model.pubKey)
}
onDeclineClicked: {
popup.store.dismissContactRequest(model.pubKey)
}
}
}
footer: Item {
width: parent.width
height: children[0].height
ConfirmationDialog {
id: declineAllDialog
header.title: qsTr("Decline all contacts")
confirmationText: qsTr("Are you sure you want to decline all these contact requests")
onConfirmButtonClicked: {
popup.store.dismissAllContactRequests()
declineAllDialog.close()
popup.close()
}
}
ConfirmationDialog {
id: acceptAllDialog
header.title: qsTr("Accept all contacts")
confirmationText: qsTr("Are you sure you want to accept all these contact requests")
onConfirmButtonClicked: {
popup.store.acceptAllContactRequests()
acceptAllDialog.close()
popup.close()
}
}
StatusButton {
id: blockBtn
enabled: contactList.count > 0
anchors.right: addToContactsButton.left
anchors.rightMargin: Style.current.padding
anchors.bottom: parent.bottom
type: StatusBaseButton.Type.Danger
text: qsTr("Decline all")
onClicked: declineAllDialog.open()
}
StatusButton {
id: addToContactsButton
enabled: contactList.count > 0
anchors.right: parent.right
text: qsTr("Accept all")
anchors.bottom: parent.bottom
onClicked: acceptAllDialog.open()
}
}
}

View File

@ -127,21 +127,6 @@ Item {
}
}
// contact requests
StatusContactRequestsIndicatorListItem {
id: contactRequests
Layout.fillWidth: true
Layout.preferredHeight: visible ? implicitHeight : 0
readonly property int nbRequests: root.store.contactRequestsModel.count
visible: nbRequests > 0
title: qsTr("Contact requests")
requestsCount: nbRequests
onClicked: Global.openPopup(contactRequestsPopup)
}
Item {
Layout.fillWidth: true
Layout.fillHeight: true
@ -309,16 +294,6 @@ Item {
}
}
Component {
id: contactRequestsPopup
ContactRequestsPopup {
store: root.store
onClosed: {
destroy()
}
}
}
Connections {
target: root.store
function onImportingCommunityStateChanged(communityId, state, errorMsg) {
@ -353,12 +328,4 @@ Item {
"")
}
}
Connections {
target: root.store.mainModuleInst
function onOpenContactRequestsPopup() {
Global.openPopup(contactRequestsPopup)
}
}
}

View File

@ -74,6 +74,10 @@ Item {
onActiveSectionChanged: {
createChatView.opened = false
}
onOpenActivityCenter: {
Global.openPopup(activityCenterPopupComponent)
}
}
Popups {