Compare commits

..

10 Commits

Author SHA1 Message Date
Sabe Jones
2af99d7c65 4.24.5 2018-02-02 19:53:57 +00:00
Keith Holliday
4e01b14874 Removed required fields from user notifications (#9929) 2018-02-02 12:31:52 -07:00
Sabe Jones
a3ddd0746c 4.24.4 2018-02-02 16:55:55 +00:00
SabreCat
94845ec629 fix(event): remove seasonal pinned items 2018-02-02 16:54:25 +00:00
Sabe Jones
7e63856e64 4.24.3 2018-02-02 16:44:09 +00:00
Matteo Pagliazzi
b430b6ccb6 Revert "Mongoose 4.13 (#9926)" (#9927)
This reverts commit 7859f20a40.
2018-02-02 16:36:54 +01:00
Matteo Pagliazzi
7859f20a40 Mongoose 4.13 (#9926)
* update mongoose to ^4.x

* another fix
2018-02-02 16:35:05 +01:00
Sabe Jones
fd1d1da509 Revert "fix(test): update for event"
This reverts commit ede28ac33a.
2018-02-02 12:09:45 +00:00
Matteo Pagliazzi
014b367f56 do not use lodash to find notification 2018-02-02 12:24:43 +01:00
Matteo Pagliazzi
4580b33e43 fix progress bar hidden behind the menu 2018-02-02 09:57:39 +01:00
7 changed files with 26 additions and 23 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "habitica",
"version": "4.24.2",
"version": "4.24.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,7 +1,7 @@
{
"name": "habitica",
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
"version": "4.24.2",
"version": "4.24.5",
"main": "./website/server/index.js",
"dependencies": {
"@slack/client": "^3.8.1",

View File

@@ -13,7 +13,7 @@ import forEach from 'lodash/forEach';
import moment from 'moment';
describe('shared.ops.purchase', () => {
const SEASONAL_FOOD = 'Cake_Base';
const SEASONAL_FOOD = 'Meat';
let user;
let goldPoints = 40;
let gemsBought = 40;

View File

@@ -103,7 +103,7 @@ div
/* Push progress bar above modals */
#nprogress .bar {
z-index: 1043; /* Must stay above nav bar */
z-index: 1043 !important; /* Must stay above nav bar */
}
</style>

View File

@@ -11,10 +11,6 @@ module.exports = {
],
pinnedSets: {
warrior: 'winter2018GiftWrappedSet',
wizard: 'winter2018ConfettiSet',
rogue: 'winter2018ReindeerSet',
healer: 'winter2018MistletoeSet',
},
availableSpells: [

View File

@@ -1,5 +1,4 @@
import { authWithHeaders } from '../../middlewares/auth';
import _ from 'lodash';
import {
NotFound,
} from '../../libs/errors';
@@ -30,8 +29,8 @@ api.readNotification = {
let validationErrors = req.validationErrors();
if (validationErrors) throw validationErrors;
let index = _.findIndex(user.notifications, {
id: req.params.notificationId,
const index = user.notifications.findIndex(n => {
return n.id === req.params.notificationId;
});
if (index === -1) {
@@ -72,10 +71,10 @@ api.readNotifications = {
let validationErrors = req.validationErrors();
if (validationErrors) throw validationErrors;
let notifications = req.body.notificationIds;
for (let notification of notifications) {
let index = _.findIndex(user.notifications, {
id: notification,
let notificationsIds = req.body.notificationIds;
for (let notificationId of notificationsIds) {
const index = user.notifications.findIndex(n => {
return n.id === notificationId;
});
if (index === -1) {
@@ -86,7 +85,7 @@ api.readNotifications = {
}
await user.update({
$pull: { notifications: { id: { $in: notifications } } },
$pull: { notifications: { id: { $in: notificationsIds } } },
}).exec();
// Update the user version field manually,
@@ -122,8 +121,8 @@ api.seeNotification = {
const notificationId = req.params.notificationId;
let notification = _.find(user.notifications, {
id: notificationId,
const notification = user.notifications.find(n => {
return n.id === notificationId;
});
if (!notification) {
@@ -172,8 +171,8 @@ api.seeNotifications = {
let notificationsIds = req.body.notificationIds;
for (let notificationId of notificationsIds) {
let notification = _.find(user.notifications, {
id: notificationId,
const notification = user.notifications.find(n => {
return n.id === notificationId;
});
if (!notification) {

View File

@@ -38,14 +38,22 @@ export let schema = new Schema({
type: String,
default: uuid,
validate: [validator.isUUID, 'Invalid uuid.'],
required: true,
// required: true, // @TODO: Add these back once we figure out the issue with notifications
},
type: {
type: String,
// required: true,
enum: NOTIFICATION_TYPES,
},
type: {type: String, required: true, enum: NOTIFICATION_TYPES},
data: {type: Schema.Types.Mixed, default: () => {
return {};
}},
// A field to mark the notification as seen without deleting it, optional use
seen: {type: Boolean, required: true, default: () => false},
seen: {
type: Boolean,
// required: true,
default: () => false,
},
}, {
strict: true,
minimize: false, // So empty objects are returned