mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 13:17:24 +01:00
Notifications v2 and Bailey API (#9716)
* Added initial bailey api
* wip
* implement new panel header
* Fixed lint
* add ability to mark notification as seen
* add notification count, remove top badge from user and add ability to mark multiple notifications as seen
* add support dismissall and mark all as read
* do not dismiss actionable notif
* mark as seen when menu is opened instead of closed
* implement ordering, list of actionable notifications
* add groups messages and fix badges count
* add notifications for received cards
* send card received notification to target not sender
* rename notificaion field
* fix integration tests
* mark cards notifications as read and update tests
* add mystery items notifications
* add unallocated stats points notifications
* fix linting
* simplify code
* refactoring and fixes
* fix dropdown opening
* start splitting notifications into their own component
* add notifications for inbox messages
* fix unit tests
* fix default buttons styles
* add initial bailey support
* add title and tests to new stuff notification
* add notification if a group task needs more work
* add tests and fixes for marking a task as needing more work
* make sure user._v is updated
* remove console.log
* notification: hover status and margins
* start styling notifications, add separate files and basic functionalities
* fix tests
* start adding mystery items notification
* wip card notification
* fix cards text
* initial implementation inbox messages
* initial implementation group messages
* disable inbox notifications until mobile is ready
* wip group chat messages
* finish mystery and card notifications
* add bailey notification and fix a lot of stuff
* start adding guilds and parties invitations
* misc invitation fixes
* fix lint issues
* remove old code and add key to notifications
* fix tests
* remove unused code
* add link for public guilds invite
* starts to implement needs work notification design and feature
* fixes to needs work, add group task approved notification
* finish needs work feature
* lots of fixes
* implement quest notification
* bailey fixes and static page
* routing fixes
* fixes # this.$store.dispatch(guilds:join, {groupId: group.id, type: party});
* read notifications on click
* chat notifications
* fix tests for chat notifications
* fix chat notification test
* fix tests
* fix tests (again)
* try awaiting
* remove only
* more sleep
* add bailey tests
* fix icons alignment
* fix issue with multiple points notifications
* remove merge code
* fix rejecting guild invitation
* make remove area bigger
* fix error with notifications and add migration
* fix migration
* fix typos
* add cleanup migration too
* notifications empty state, new counter color, fix marking messages as seen in guilds
* fixes
* add image and install correct packages
* fix mongoose version
* update bailey
* typo
* make sure chat is marked as read after other requests
This commit is contained in:
@@ -399,9 +399,16 @@ spells.special = {
|
||||
}
|
||||
|
||||
if (!target.items.special.nyeReceived) target.items.special.nyeReceived = [];
|
||||
target.items.special.nyeReceived.push(user.profile.name);
|
||||
const senderName = user.profile.name;
|
||||
target.items.special.nyeReceived.push(senderName);
|
||||
|
||||
if (!target.flags) target.flags = {};
|
||||
if (target.addNotification) target.addNotification('CARD_RECEIVED', {
|
||||
card: 'nye',
|
||||
from: {
|
||||
id: user._id,
|
||||
name: senderName,
|
||||
},
|
||||
});
|
||||
target.flags.cardReceived = true;
|
||||
|
||||
user.stats.gp -= 10;
|
||||
@@ -427,9 +434,16 @@ spells.special = {
|
||||
}
|
||||
|
||||
if (!target.items.special.valentineReceived) target.items.special.valentineReceived = [];
|
||||
target.items.special.valentineReceived.push(user.profile.name);
|
||||
const senderName = user.profile.name;
|
||||
target.items.special.valentineReceived.push(senderName);
|
||||
|
||||
if (!target.flags) target.flags = {};
|
||||
if (target.addNotification) target.addNotification('CARD_RECEIVED', {
|
||||
card: 'valentine',
|
||||
from: {
|
||||
id: user._id,
|
||||
name: senderName,
|
||||
},
|
||||
});
|
||||
target.flags.cardReceived = true;
|
||||
|
||||
user.stats.gp -= 10;
|
||||
@@ -445,6 +459,7 @@ spells.special = {
|
||||
notes: t('greetingCardNotes'),
|
||||
cast (user, target) {
|
||||
if (user === target) {
|
||||
if (!user.achievements.greeting) user.achievements.greeting = 0;
|
||||
user.achievements.greeting++;
|
||||
} else {
|
||||
each([user, target], (u) => {
|
||||
@@ -454,9 +469,16 @@ spells.special = {
|
||||
}
|
||||
|
||||
if (!target.items.special.greetingReceived) target.items.special.greetingReceived = [];
|
||||
target.items.special.greetingReceived.push(user.profile.name);
|
||||
const senderName = user.profile.name;
|
||||
target.items.special.greetingReceived.push(senderName);
|
||||
|
||||
if (!target.flags) target.flags = {};
|
||||
if (target.addNotification) target.addNotification('CARD_RECEIVED', {
|
||||
card: 'greeting',
|
||||
from: {
|
||||
id: user._id,
|
||||
name: senderName,
|
||||
},
|
||||
});
|
||||
target.flags.cardReceived = true;
|
||||
|
||||
user.stats.gp -= 10;
|
||||
@@ -482,9 +504,16 @@ spells.special = {
|
||||
}
|
||||
|
||||
if (!target.items.special.thankyouReceived) target.items.special.thankyouReceived = [];
|
||||
target.items.special.thankyouReceived.push(user.profile.name);
|
||||
const senderName = user.profile.name;
|
||||
target.items.special.thankyouReceived.push(senderName);
|
||||
|
||||
if (!target.flags) target.flags = {};
|
||||
if (target.addNotification) target.addNotification('CARD_RECEIVED', {
|
||||
card: 'thankyou',
|
||||
from: {
|
||||
id: user._id,
|
||||
name: senderName,
|
||||
},
|
||||
});
|
||||
target.flags.cardReceived = true;
|
||||
|
||||
user.stats.gp -= 10;
|
||||
@@ -510,9 +539,16 @@ spells.special = {
|
||||
}
|
||||
|
||||
if (!target.items.special.birthdayReceived) target.items.special.birthdayReceived = [];
|
||||
target.items.special.birthdayReceived.push(user.profile.name);
|
||||
const senderName = user.profile.name;
|
||||
target.items.special.birthdayReceived.push(senderName);
|
||||
|
||||
if (!target.flags) target.flags = {};
|
||||
if (target.addNotification) target.addNotification('CARD_RECEIVED', {
|
||||
card: 'birthday',
|
||||
from: {
|
||||
id: user._id,
|
||||
name: senderName,
|
||||
},
|
||||
});
|
||||
target.flags.cardReceived = true;
|
||||
|
||||
user.stats.gp -= 10;
|
||||
@@ -538,9 +574,16 @@ spells.special = {
|
||||
}
|
||||
|
||||
if (!target.items.special.congratsReceived) target.items.special.congratsReceived = [];
|
||||
target.items.special.congratsReceived.push(user.profile.name);
|
||||
const senderName = user.profile.name;
|
||||
target.items.special.congratsReceived.push(senderName);
|
||||
|
||||
if (!target.flags) target.flags = {};
|
||||
if (target.addNotification) target.addNotification('CARD_RECEIVED', {
|
||||
card: 'congrats',
|
||||
from: {
|
||||
id: user._id,
|
||||
name: senderName,
|
||||
},
|
||||
});
|
||||
target.flags.cardReceived = true;
|
||||
|
||||
user.stats.gp -= 10;
|
||||
@@ -566,9 +609,16 @@ spells.special = {
|
||||
}
|
||||
|
||||
if (!target.items.special.getwellReceived) target.items.special.getwellReceived = [];
|
||||
target.items.special.getwellReceived.push(user.profile.name);
|
||||
const senderName = user.profile.name;
|
||||
target.items.special.getwellReceived.push(senderName);
|
||||
|
||||
if (!target.flags) target.flags = {};
|
||||
if (target.addNotification) target.addNotification('CARD_RECEIVED', {
|
||||
card: 'getwell',
|
||||
from: {
|
||||
id: user._id,
|
||||
name: senderName,
|
||||
},
|
||||
});
|
||||
target.flags.cardReceived = true;
|
||||
|
||||
user.stats.gp -= 10;
|
||||
@@ -594,9 +644,16 @@ spells.special = {
|
||||
}
|
||||
|
||||
if (!target.items.special.goodluckReceived) target.items.special.goodluckReceived = [];
|
||||
target.items.special.goodluckReceived.push(user.profile.name);
|
||||
const senderName = user.profile.name;
|
||||
target.items.special.goodluckReceived.push(senderName);
|
||||
|
||||
if (!target.flags) target.flags = {};
|
||||
if (target.addNotification) target.addNotification('CARD_RECEIVED', {
|
||||
card: 'goodluck',
|
||||
from: {
|
||||
id: user._id,
|
||||
name: senderName,
|
||||
},
|
||||
});
|
||||
target.flags.cardReceived = true;
|
||||
|
||||
user.stats.gp -= 10;
|
||||
|
||||
Reference in New Issue
Block a user