From 2427743d0fc69e67a111ac9d1f3cad1a303e954f Mon Sep 17 00:00:00 2001 From: osiris Date: Sat, 21 Dec 2019 22:13:39 +0800 Subject: [PATCH 1/3] Fix bug in NPC style display --- website/client/src/assets/scss/tiers.scss | 4 ++-- .../client/src/components/settings/subscription.vue | 10 +++++++--- website/client/src/components/userLink.vue | 4 ++-- website/client/src/components/userMenu/inbox.vue | 2 ++ website/server/libs/inbox/index.js | 2 ++ 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/website/client/src/assets/scss/tiers.scss b/website/client/src/assets/scss/tiers.scss index 5c5efdbece..e353b28f44 100644 --- a/website/client/src/assets/scss/tiers.scss +++ b/website/client/src/assets/scss/tiers.scss @@ -71,8 +71,8 @@ } .tierNPC, .npc { - color: #77f4c7; - fill: #77f4c7; + color: #4E4A57; + fill: #4E4A57; stroke: #005737; &:hover, &:active, &:focus { diff --git a/website/client/src/components/settings/subscription.vue b/website/client/src/components/settings/subscription.vue index 3560abbeea..dffdbab6dc 100644 --- a/website/client/src/components/settings/subscription.vue +++ b/website/client/src/components/settings/subscription.vue @@ -3,15 +3,19 @@

{{ $t('subscription') }}

diff --git a/website/client/src/components/userLink.vue b/website/client/src/components/userLink.vue index 4ba9be6c4b..8269f83cb6 100644 --- a/website/client/src/components/userLink.vue +++ b/website/client/src/components/userLink.vue @@ -92,9 +92,9 @@ export default { }, isNPC () { if (this.backer) { - return this.backer.level; + return this.backer.tier; } if (this.user && this.user.backer) { - return this.user.backer.level; + return this.user.backer.tier; } return false; }, diff --git a/website/client/src/components/userMenu/inbox.vue b/website/client/src/components/userMenu/inbox.vue index 72cceb6e11..8476da3814 100644 --- a/website/client/src/components/userMenu/inbox.vue +++ b/website/client/src/components/userMenu/inbox.vue @@ -418,6 +418,7 @@ export default { id: '', text: '', timestamp: new Date(), + backer: this.initiatedConversation.backer, }]; } // Create conversation objects @@ -435,6 +436,7 @@ export default { lastMessageText: recentMessage.text, canLoadMore: true, page: 0, + backer: recentMessage.backer, }; convos.push(convoModel); diff --git a/website/server/libs/inbox/index.js b/website/server/libs/inbox/index.js index e6aa8c057e..39ee053337 100644 --- a/website/server/libs/inbox/index.js +++ b/website/server/libs/inbox/index.js @@ -125,6 +125,7 @@ export async function listConversations (owner) { username: { $last: '$username' }, timestamp: { $last: '$timestamp' }, text: { $last: '$text' }, + npc: { $addToSet: '$backer.npc' }, count: { $sum: 1 }, }, }, @@ -141,6 +142,7 @@ export async function listConversations (owner) { const conversations = conversationsList.map(res => ({ uuid: res._id, ...res, + backer: Array.isArray(res.npc) && res.npc.length > 0 ? { npc: res.npc[0] } : { npc: null }, userStyles: usersMap[res._id].userStyles, contributor: usersMap[res._id].contributor, })); From 98e0e964949518ddb84f509cde6de14d84e26238 Mon Sep 17 00:00:00 2001 From: osiris Date: Wed, 8 Jan 2020 17:17:48 +0800 Subject: [PATCH 2/3] Implemented rework suggestion by adding backer to group aggregation --- website/client/src/assets/scss/tiers.scss | 4 ++-- website/client/src/components/settings/notifications.vue | 7 +++++-- .../client/src/components/shops/quests/buyQuestModal.vue | 5 ++++- website/server/libs/inbox/index.js | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/website/client/src/assets/scss/tiers.scss b/website/client/src/assets/scss/tiers.scss index e353b28f44..2febcffe62 100644 --- a/website/client/src/assets/scss/tiers.scss +++ b/website/client/src/assets/scss/tiers.scss @@ -71,8 +71,8 @@ } .tierNPC, .npc { - color: #4E4A57; - fill: #4E4A57; + color: #4e4a57; + fill: #4e4a57; stroke: #005737; &:hover, &:active, &:focus { diff --git a/website/client/src/components/settings/notifications.vue b/website/client/src/components/settings/notifications.vue index 24a4b46d17..1d1caf25e5 100644 --- a/website/client/src/components/settings/notifications.vue +++ b/website/client/src/components/settings/notifications.vue @@ -38,7 +38,10 @@ {{ $t('push') }} - + {{ $t(notification) }} @@ -55,7 +58,7 @@ type="checkbox" @change="set('pushNotifications', notification)" > - +   diff --git a/website/client/src/components/shops/quests/buyQuestModal.vue b/website/client/src/components/shops/quests/buyQuestModal.vue index d3f75ad702..aa2ce9f84b 100644 --- a/website/client/src/components/shops/quests/buyQuestModal.vue +++ b/website/client/src/components/shops/quests/buyQuestModal.vue @@ -33,7 +33,10 @@
{{ $t('howManyToBuy') }}
-
+
{{ item.addlNotes }}
diff --git a/website/server/libs/inbox/index.js b/website/server/libs/inbox/index.js index 39ee053337..d201b3d52c 100644 --- a/website/server/libs/inbox/index.js +++ b/website/server/libs/inbox/index.js @@ -94,6 +94,7 @@ async function usersMapByConversations (owner, users) { _id: '$uuid', userStyles: { $last: '$userStyles' }, contributor: { $last: '$contributor' }, + backer: { $last: '$backer' }, }, }, ]); @@ -125,7 +126,6 @@ export async function listConversations (owner) { username: { $last: '$username' }, timestamp: { $last: '$timestamp' }, text: { $last: '$text' }, - npc: { $addToSet: '$backer.npc' }, count: { $sum: 1 }, }, }, @@ -142,7 +142,7 @@ export async function listConversations (owner) { const conversations = conversationsList.map(res => ({ uuid: res._id, ...res, - backer: Array.isArray(res.npc) && res.npc.length > 0 ? { npc: res.npc[0] } : { npc: null }, + backer: usersMap[res._id].backer, userStyles: usersMap[res._id].userStyles, contributor: usersMap[res._id].contributor, })); From eb21d27fa2361b9043ebdb44084488dcb01995eb Mon Sep 17 00:00:00 2001 From: osiris Date: Tue, 21 Jan 2020 12:40:16 +0800 Subject: [PATCH 3/3] Make changes to correct problems from merging as requested. --- .../src/components/settings/subscription.vue | 18 ----- website/server/libs/inbox/index.js | 70 ------------------- 2 files changed, 88 deletions(-) diff --git a/website/client/src/components/settings/subscription.vue b/website/client/src/components/settings/subscription.vue index 30d7ac5eda..8907a05bad 100644 --- a/website/client/src/components/settings/subscription.vue +++ b/website/client/src/components/settings/subscription.vue @@ -1,23 +1,5 @@