feat(ActivityCenter): Review fixes
This commit is contained in:
parent
c5a32ff8cb
commit
bb9d6b3121
|
@ -141,20 +141,20 @@ proc getMessageById*(self: Controller, chatId, messageId: string): MessageDto =
|
|||
return MessageDto()
|
||||
return message
|
||||
|
||||
proc setActiveNotificationGroup*(self: Controller, group: int) =
|
||||
self.activityCenterService.setActiveNotificationGroup(ActivityCenterGroup(group))
|
||||
proc setActiveNotificationGroup*(self: Controller, group: ActivityCenterGroup) =
|
||||
self.activityCenterService.setActiveNotificationGroup(group)
|
||||
self.activityCenterService.resetCursor()
|
||||
let activityCenterNotifications = self.activityCenterService.getActivityCenterNotifications()
|
||||
self.delegate.resetActivityCenterNotifications(activityCenterNotifications)
|
||||
|
||||
proc getActiveNotificationGroup*(self: Controller): int =
|
||||
return self.activityCenterService.getActiveNotificationGroup().int
|
||||
proc getActiveNotificationGroup*(self: Controller): ActivityCenterGroup =
|
||||
return self.activityCenterService.getActiveNotificationGroup()
|
||||
|
||||
proc setActivityCenterReadType*(self: Controller, readType: int) =
|
||||
self.activityCenterService.setActivityCenterReadType(ActivityCenterReadType(readType))
|
||||
proc setActivityCenterReadType*(self: Controller, readType: ActivityCenterReadType) =
|
||||
self.activityCenterService.setActivityCenterReadType(readType)
|
||||
self.activityCenterService.resetCursor()
|
||||
let activityCenterNotifications = self.activityCenterService.getActivityCenterNotifications()
|
||||
self.delegate.resetActivityCenterNotifications(activityCenterNotifications)
|
||||
|
||||
proc getActivityCenterReadType*(self: Controller): int =
|
||||
return self.activityCenterService.getActivityCenterReadType().int
|
||||
proc getActivityCenterReadType*(self: Controller): ActivityCenterReadType =
|
||||
return self.activityCenterService.getActivityCenterReadType()
|
||||
|
|
|
@ -292,13 +292,13 @@ method getChatDetailsAsJson*(self: Module, chatId: string): string =
|
|||
return $jsonObject
|
||||
|
||||
method setActiveNotificationGroup*(self: Module, group: int) =
|
||||
self.controller.setActiveNotificationGroup(group)
|
||||
self.controller.setActiveNotificationGroup(ActivityCenterGroup(group))
|
||||
|
||||
method getActiveNotificationGroup*(self: Module): int =
|
||||
return self.controller.getActiveNotificationGroup()
|
||||
return self.controller.getActiveNotificationGroup().int
|
||||
|
||||
method setActivityCenterReadType*(self: Module, readType: int) =
|
||||
self.controller.setActivityCenterReadType(readType)
|
||||
self.controller.setActivityCenterReadType(ActivityCenterReadType(readType))
|
||||
|
||||
method getActivityCenterReadType*(self: Module): int =
|
||||
return self.controller.getActivityCenterReadType()
|
||||
return self.controller.getActivityCenterReadType().int
|
||||
|
|
|
@ -9,7 +9,7 @@ import StatusQ.Core.Theme 0.1
|
|||
import StatusQ.Controls 0.1
|
||||
import StatusQ.Popups 0.1
|
||||
|
||||
import shared 1.0
|
||||
import "../stores"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
@ -24,7 +24,7 @@ Item {
|
|||
property bool hideReadNotifications: false
|
||||
property int unreadNotificationsCount: 0
|
||||
|
||||
property int activeGroup: Constants.ActivityCenterGroup.All
|
||||
property int activeGroup: ActivityCenterStore.ActivityCenterGroup.All
|
||||
|
||||
property alias errorText: errorText.text
|
||||
|
||||
|
@ -49,15 +49,15 @@ Item {
|
|||
|
||||
Repeater {
|
||||
// NOTE: some entries are hidden until implimentation
|
||||
model: [ { text: qsTr("All"), group: Constants.ActivityCenterGroup.All, visible: true, enabled: true },
|
||||
{ text: qsTr("Admin"), group: Constants.ActivityCenterGroup.Admin, visible: root.hasAdmin, enabled: root.hasAdmin },
|
||||
{ text: qsTr("Mentions"), group: Constants.ActivityCenterGroup.Mentions, visible: true, enabled: root.hasMentions },
|
||||
{ text: qsTr("Replies"), group: Constants.ActivityCenterGroup.Replies, visible: true, enabled: root.hasReplies },
|
||||
{ text: qsTr("Contact requests"), group: Constants.ActivityCenterGroup.ContactRequests, visible: true, enabled: root.hasContactRequests },
|
||||
{ text: qsTr("Identity verification"), group: Constants.ActivityCenterGroup.IdentityVerification, visible: true, enabled: root.hasIdentityRequests },
|
||||
{ text: qsTr("Transactions"), group: Constants.ActivityCenterGroup.Transactions, visible: false, enabled: true },
|
||||
{ text: qsTr("Membership"), group: Constants.ActivityCenterGroup.Membership, visible: true, enabled: root.hasMembership },
|
||||
{ text: qsTr("System"), group: Constants.ActivityCenterGroup.System, visible: false, enabled: true } ]
|
||||
model: [ { text: qsTr("All"), group: ActivityCenterStore.ActivityCenterGroup.All, visible: true, enabled: true },
|
||||
{ text: qsTr("Admin"), group: ActivityCenterStore.ActivityCenterGroup.Admin, visible: root.hasAdmin, enabled: root.hasAdmin },
|
||||
{ text: qsTr("Mentions"), group: ActivityCenterStore.ActivityCenterGroup.Mentions, visible: true, enabled: root.hasMentions },
|
||||
{ text: qsTr("Replies"), group: ActivityCenterStore.ActivityCenterGroup.Replies, visible: true, enabled: root.hasReplies },
|
||||
{ text: qsTr("Contact requests"), group: ActivityCenterStore.ActivityCenterGroup.ContactRequests, visible: true, enabled: root.hasContactRequests },
|
||||
{ text: qsTr("Identity verification"), group: ActivityCenterStore.ActivityCenterGroup.IdentityVerification, visible: true, enabled: root.hasIdentityRequests },
|
||||
{ text: qsTr("Transactions"), group: ActivityCenterStore.ActivityCenterGroup.Transactions, visible: false, enabled: true },
|
||||
{ text: qsTr("Membership"), group: ActivityCenterStore.ActivityCenterGroup.Membership, visible: true, enabled: root.hasMembership },
|
||||
{ text: qsTr("System"), group: ActivityCenterStore.ActivityCenterGroup.System, visible: false, enabled: true } ]
|
||||
|
||||
StatusFlatButton {
|
||||
enabled: modelData.enabled
|
||||
|
@ -66,7 +66,7 @@ Item {
|
|||
size: StatusBaseButton.Size.Small
|
||||
highlighted: modelData.group === root.activeGroup
|
||||
onClicked: root.groupTriggered(modelData.group)
|
||||
onEnabledChanged: if (!enabled && highlighted) root.groupTriggered(Constants.ActivityCenterGroup.All)
|
||||
onEnabledChanged: if (!enabled && highlighted) root.groupTriggered(ActivityCenterStore.ActivityCenterGroup.All)
|
||||
Layout.preferredWidth: visible ? implicitWidth : 0
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,13 +70,13 @@ Popup {
|
|||
hasContactRequests: root.contactRequestsCount > 0
|
||||
hasIdentityRequests: root.identityRequestsCount > 0
|
||||
hasMembership: root.membershipCount > 0
|
||||
hideReadNotifications: activityCenterStore.activityCenterReadType === Constants.ActivityCenterReadType.Unread
|
||||
hideReadNotifications: activityCenterStore.activityCenterReadType === ActivityCenterStore.ActivityCenterReadType.Unread
|
||||
activeGroup: activityCenterStore.activeNotificationGroup
|
||||
onGroupTriggered: activityCenterStore.setActiveNotificationGroup(group)
|
||||
onMarkAllReadClicked: root.activityCenterStore.markAllActivityCenterNotificationsRead()
|
||||
onShowHideReadNotifications: activityCenterStore.setActivityCenterReadType(hideReadNotifications ?
|
||||
Constants.ActivityCenterReadType.Unread :
|
||||
Constants.ActivityCenterReadType.All)
|
||||
ActivityCenterStore.ActivityCenterReadType.Unread :
|
||||
ActivityCenterStore.ActivityCenterReadType.All)
|
||||
}
|
||||
|
||||
StatusListView {
|
||||
|
@ -98,21 +98,21 @@ Popup {
|
|||
|
||||
sourceComponent: {
|
||||
switch (model.notificationType) {
|
||||
case Constants.ActivityCenterNotificationType.Mention:
|
||||
case ActivityCenterStore.ActivityCenterNotificationType.Mention:
|
||||
return mentionNotificationComponent
|
||||
case Constants.ActivityCenterNotificationType.Reply:
|
||||
case ActivityCenterStore.ActivityCenterNotificationType.Reply:
|
||||
return replyNotificationComponent
|
||||
case Constants.ActivityCenterNotificationType.ContactRequest:
|
||||
case ActivityCenterStore.ActivityCenterNotificationType.ContactRequest:
|
||||
return contactRequestNotificationComponent
|
||||
case Constants.ActivityCenterNotificationType.ContactVerification:
|
||||
case ActivityCenterStore.ActivityCenterNotificationType.ContactVerification:
|
||||
return verificationRequestNotificationComponent
|
||||
case Constants.ActivityCenterNotificationType.CommunityInvitation:
|
||||
case ActivityCenterStore.ActivityCenterNotificationType.CommunityInvitation:
|
||||
return communityInvitationNotificationComponent
|
||||
case Constants.ActivityCenterNotificationType.MembershipRequest:
|
||||
case ActivityCenterStore.ActivityCenterNotificationType.MembershipRequest:
|
||||
return membershipRequestNotificationComponent
|
||||
case Constants.ActivityCenterNotificationType.CommunityRequest:
|
||||
case ActivityCenterStore.ActivityCenterNotificationType.CommunityRequest:
|
||||
return communityRequestNotificationComponent
|
||||
case Constants.ActivityCenterNotificationType.CommunityKicked:
|
||||
case ActivityCenterStore.ActivityCenterNotificationType.CommunityKicked:
|
||||
return communityKickedNotificationComponent
|
||||
default:
|
||||
return null
|
||||
|
|
|
@ -5,6 +5,44 @@ import shared 1.0
|
|||
QtObject {
|
||||
id: root
|
||||
|
||||
enum ActivityCenterGroup {
|
||||
All = 0,
|
||||
Mentions = 1,
|
||||
Replies = 2,
|
||||
Membership = 3,
|
||||
Admin = 4,
|
||||
ContactRequests = 5,
|
||||
IdentityVerification = 6,
|
||||
Transactions = 7,
|
||||
System = 8
|
||||
}
|
||||
|
||||
enum ActivityCenterNotificationType {
|
||||
NoType = 0,
|
||||
NewOneToOne = 1,
|
||||
NewPrivateGroupChat = 2,
|
||||
Mention = 3,
|
||||
Reply = 4,
|
||||
ContactRequest = 5,
|
||||
CommunityInvitation = 6,
|
||||
CommunityRequest = 7,
|
||||
CommunityMembershipRequest = 8,
|
||||
CommunityKicked = 9,
|
||||
ContactVerification = 10
|
||||
}
|
||||
|
||||
enum ActivityCenterReadType {
|
||||
Read = 1,
|
||||
Unread = 2,
|
||||
All = 3
|
||||
}
|
||||
|
||||
enum ActivityCenterMembershipStatus {
|
||||
Pending = 1,
|
||||
Accepted = 2,
|
||||
Declined = 3
|
||||
}
|
||||
|
||||
readonly property var activityCenterModuleInst: activityCenterModule
|
||||
readonly property var activityCenterNotifications: activityCenterModuleInst.activityNotificationsModel
|
||||
readonly property int unreadNotificationsCount: activityCenterModuleInst.unreadActivityCenterNotificationsCount
|
||||
|
|
|
@ -12,6 +12,7 @@ import shared.views.chat 1.0
|
|||
|
||||
import "../controls"
|
||||
import "../panels"
|
||||
import "../stores"
|
||||
|
||||
ActivityNotificationMessage {
|
||||
id: root
|
||||
|
@ -46,9 +47,9 @@ ActivityNotificationMessage {
|
|||
}
|
||||
|
||||
ctaComponent: MembershipCta {
|
||||
pending: notification && notification.membershipStatus === Constants.activityCenterMembershipStatusPending
|
||||
accepted: notification && notification.membershipStatus === Constants.activityCenterMembershipStatusAccepted
|
||||
declined: notification && notification.membershipStatus === Constants.activityCenterMembershipStatusDeclined
|
||||
pending: notification && notification.membershipStatus === ActivityCenterStore.ActivityCenterMembershipStatus.Pending
|
||||
accepted: notification && notification.membershipStatus === ActivityCenterStore.ActivityCenterMembershipStatus.Accepted
|
||||
declined: notification && notification.membershipStatus === ActivityCenterStore.ActivityCenterMembershipStatus.Declined
|
||||
onAcceptRequestToJoinCommunity: root.store.acceptRequestToJoinCommunity(notification.id, notification.communityId)
|
||||
onDeclineRequestToJoinCommunity: root.store.declineRequestToJoinCommunity(notification.id, notification.communityId)
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import shared.controls 1.0
|
|||
import utils 1.0
|
||||
|
||||
import "../controls"
|
||||
import "../stores"
|
||||
|
||||
ActivityNotificationBase {
|
||||
id: root
|
||||
|
@ -56,11 +57,11 @@ ActivityNotificationBase {
|
|||
text: {
|
||||
if (!notification)
|
||||
return ""
|
||||
if (notification.membershipStatus === Constants.activityCenterMembershipStatusPending)
|
||||
if (notification.membershipStatus === ActivityCenterStore.ActivityCenterMembershipStatus.Pending)
|
||||
return qsTr("pending")
|
||||
if (notification.membershipStatus === Constants.activityCenterMembershipStatusAccepted)
|
||||
if (notification.membershipStatus === ActivityCenterStore.ActivityCenterMembershipStatus.Accepted)
|
||||
return qsTr("accepted")
|
||||
if (notification.membershipStatus === Constants.activityCenterMembershipStatusDeclined)
|
||||
if (notification.membershipStatus === ActivityCenterStore.ActivityCenterMembershipStatus.Declined)
|
||||
return qsTr("declined")
|
||||
return ""
|
||||
}
|
||||
|
@ -72,7 +73,7 @@ ActivityNotificationBase {
|
|||
}
|
||||
}
|
||||
|
||||
ctaComponent: notification && notification.membershipStatus === Constants.activityCenterMembershipStatusAccepted ?
|
||||
ctaComponent: notification && notification.membershipStatus === ActivityCenterStore.ActivityCenterMembershipStatus.Accepted ?
|
||||
visitComponent : null
|
||||
|
||||
Component {
|
||||
|
|
|
@ -613,42 +613,6 @@ QtObject {
|
|||
readonly property int communityChatInvitationOnlyAccess: 2
|
||||
readonly property int communityChatOnRequestAccess: 3
|
||||
|
||||
enum ActivityCenterGroup {
|
||||
All = 0,
|
||||
Mentions = 1,
|
||||
Replies = 2,
|
||||
Membership = 3,
|
||||
Admin = 4,
|
||||
ContactRequests = 5,
|
||||
IdentityVerification = 6,
|
||||
Transactions = 7,
|
||||
System = 8
|
||||
}
|
||||
|
||||
enum ActivityCenterNotificationType {
|
||||
NoType = 0,
|
||||
NewOneToOne = 1,
|
||||
NewPrivateGroupChat = 2,
|
||||
Mention = 3,
|
||||
Reply = 4,
|
||||
ContactRequest = 5,
|
||||
CommunityInvitation = 6,
|
||||
CommunityRequest = 7,
|
||||
CommunityMembershipRequest = 8,
|
||||
CommunityKicked = 9,
|
||||
ContactVerification = 10
|
||||
}
|
||||
|
||||
enum ActivityCenterReadType {
|
||||
Read = 1,
|
||||
Unread = 2,
|
||||
All = 3
|
||||
}
|
||||
|
||||
readonly property int activityCenterMembershipStatusPending: 1
|
||||
readonly property int activityCenterMembershipStatusAccepted: 2
|
||||
readonly property int activityCenterMembershipStatusDeclined: 3
|
||||
|
||||
readonly property int contactRequestStateNone: 0
|
||||
readonly property int contactRequestStatePending: 1
|
||||
readonly property int contactRequestStateAccepted: 2
|
||||
|
|
Loading…
Reference in New Issue