mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 05:07:22 +01:00
chore: update sub-deps and fix lint
This commit is contained in:
@@ -12,7 +12,6 @@ const SLACK_CONFIG = {
|
||||
const LOCALES = './website/common/locales/';
|
||||
const ENGLISH_LOCALE = `${LOCALES}en/`;
|
||||
|
||||
|
||||
function getArrayOfLanguages () {
|
||||
const languages = fs.readdirSync(LOCALES);
|
||||
languages.shift(); // Remove README.md from array of languages
|
||||
|
||||
@@ -32,13 +32,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// CONFIGURATION:
|
||||
// - Change the uuid below to be the user's uuid.
|
||||
// - Change ALL instances of "todos" to "habits"/"dailys"/"rewards" as
|
||||
// needed. Do not miss any of them!
|
||||
|
||||
|
||||
const uuid = '30fb2640-7121-4968-ace5-f385e60ea6c5';
|
||||
|
||||
db.users.aggregate([
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// @authorName = 'TheHollidayInn'; // in case script author needs to know when their ...
|
||||
// @authorUuid = ''; // ... own data is done
|
||||
|
||||
|
||||
/*
|
||||
* This migration moves chat off of groups and into their own model
|
||||
*/
|
||||
@@ -38,7 +37,6 @@ async function moveGroupChatToModel (skip = 0) {
|
||||
return chatpromises;
|
||||
});
|
||||
|
||||
|
||||
const reducedPromises = promises.reduce((acc, curr) => {
|
||||
acc = acc.concat(curr); // eslint-disable-line no-param-reassign
|
||||
return acc;
|
||||
|
||||
@@ -25,7 +25,6 @@ const monk = require('monk'); // eslint-disable-line import/no-extraneous-depend
|
||||
|
||||
const dbUsers = monk(connectionString).get('users', { castIds: false });
|
||||
|
||||
|
||||
function processUsers (lastId) {
|
||||
// specify a query to limit the affected users (empty for all users):
|
||||
const query = {
|
||||
@@ -86,7 +85,6 @@ function updateUser (user) {
|
||||
|
||||
const set = { migration: migrationName, 'flags.armoireEmpty': false };
|
||||
|
||||
|
||||
if (user.flags.armoireEmpty) {
|
||||
// this user believes their armoire has no more items in it
|
||||
if (
|
||||
|
||||
@@ -121,5 +121,4 @@ function exiting (code, msg) {
|
||||
process.exit(code);
|
||||
}
|
||||
|
||||
|
||||
processUsers();
|
||||
|
||||
@@ -9,7 +9,6 @@ const authorUuid = 'ed4c688c-6652-4a92-9d03-a5a79844174a'; // ... own data is do
|
||||
*/
|
||||
const connectionString = 'mongodb://localhost:27017/habitrpg?auto_reconnect=true'; // FOR TEST DATABASE
|
||||
|
||||
|
||||
const dbUsers = monk(connectionString).get('users', { castIds: false });
|
||||
|
||||
function processUsers (lastId) {
|
||||
|
||||
6189
package-lock.json
generated
6189
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -56,7 +56,6 @@ describe('Base model plugin', () => {
|
||||
expect(sanitized).not.to.have.property('usuallySettable');
|
||||
});
|
||||
|
||||
|
||||
it('can make fields private', () => {
|
||||
schema.plugin(baseModel, {
|
||||
private: ['amPrivate'],
|
||||
|
||||
@@ -7,7 +7,6 @@ import amzLib from '../../../../../../website/server/libs/payments/amazon';
|
||||
import payments from '../../../../../../website/server/libs/payments/payments';
|
||||
import common from '../../../../../../website/common';
|
||||
|
||||
|
||||
describe('#upgradeGroupPlan', () => {
|
||||
let spy; let data; let user; let group; let
|
||||
uuidString;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import path from 'path';
|
||||
import nconf from 'nconf';
|
||||
import setupNconf from '../../../../website/server/libs/setupNconf';
|
||||
|
||||
@@ -16,7 +16,6 @@ describe('response middleware', () => {
|
||||
next = generateNext();
|
||||
});
|
||||
|
||||
|
||||
it('attaches respond method to res', () => {
|
||||
responseMiddleware(req, res, next);
|
||||
|
||||
|
||||
@@ -769,7 +769,6 @@ describe('Group Model', () => {
|
||||
expect(res.t).to.not.be.called;
|
||||
});
|
||||
|
||||
|
||||
it('does not throw an error if only user ids are passed in', async () => {
|
||||
await Group.validateInvitations({ uuids: ['user-id', 'user-id2'] }, res);
|
||||
expect(res.t).to.not.be.called;
|
||||
|
||||
@@ -432,7 +432,6 @@ describe('User Model', () => {
|
||||
user = new User();
|
||||
});
|
||||
|
||||
|
||||
it('returns false if user does not have customer id', () => {
|
||||
expect(user.isSubscribed()).to.be.undefined;
|
||||
});
|
||||
@@ -558,7 +557,6 @@ describe('User Model', () => {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
context('hasCancelled', () => {
|
||||
let user;
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -299,7 +299,6 @@ describe('Webhook Model', () => {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
context('type is globalActivity', () => {
|
||||
let config;
|
||||
|
||||
|
||||
@@ -179,7 +179,6 @@ describe('GET /tasks/user', () => {
|
||||
expect(dailys2[0].isDue).to.be.false;
|
||||
});
|
||||
|
||||
|
||||
xit('returns dailies with isDue for the date specified and will add CDS offset if time is not supplied and assumes timezones', async () => {
|
||||
const timezone = 240;
|
||||
await user.update({
|
||||
|
||||
@@ -687,7 +687,6 @@ describe('POST /tasks/user', () => {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
it('can create checklists', async () => {
|
||||
const task = await user.post('/tasks/user', {
|
||||
text: 'test daily',
|
||||
|
||||
@@ -147,7 +147,6 @@ describe('PUT /tasks/:id', () => {
|
||||
notes: 'some new notes',
|
||||
});
|
||||
|
||||
|
||||
const memberTasks = await member.get('/tasks/user');
|
||||
const syncedTask = find(memberTasks, findAssignedTask);
|
||||
|
||||
@@ -191,7 +190,6 @@ describe('PUT /tasks/:id', () => {
|
||||
notes: 'some new notes',
|
||||
});
|
||||
|
||||
|
||||
const memberTasks = await member.get('/tasks/user');
|
||||
const syncedTask = find(memberTasks, findAssignedTask);
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import { v4 as generateUUID } from 'uuid';
|
||||
import { find } from 'lodash';
|
||||
import {
|
||||
@@ -325,7 +324,6 @@ describe('POST /user/class/cast/:spellId', () => {
|
||||
expect(result.user.stats.mp).to.equal(10);
|
||||
});
|
||||
|
||||
|
||||
// TODO find a way to have sinon working in integration tests
|
||||
// it doesn't work when tests are running separately from server
|
||||
it('passes correct target to spell when targetType === \'tasks\'');
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-integration/v3';
|
||||
|
||||
|
||||
describe('PUT /user', () => {
|
||||
let user;
|
||||
|
||||
@@ -53,7 +52,6 @@ describe('PUT /user', () => {
|
||||
expect(user.tags.length).to.be.eql(userTags.length + 1);
|
||||
});
|
||||
|
||||
|
||||
it('validates profile.name', async () => {
|
||||
await expect(user.put('/user', {
|
||||
'profile.name': ' ', // string should be trimmed
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
sha1Encrypt as sha1EncryptPassword,
|
||||
} from '../../../../../../website/server/libs/password';
|
||||
|
||||
|
||||
describe('POST /user/auth/local/login', () => {
|
||||
let api;
|
||||
let user;
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
sha1Encrypt as sha1EncryptPassword,
|
||||
} from '../../../../../../website/server/libs/password';
|
||||
|
||||
|
||||
const ENDPOINT = '/user/auth/update-email';
|
||||
|
||||
describe('PUT /user/auth/update-email', () => {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import { v4 as generateUUID } from 'uuid';
|
||||
import { find } from 'lodash';
|
||||
import {
|
||||
@@ -310,7 +309,6 @@ describe('POST /user/class/cast/:spellId', () => {
|
||||
expect(result.user.stats.mp).to.equal(10);
|
||||
});
|
||||
|
||||
|
||||
// TODO find a way to have sinon working in integration tests
|
||||
// it doesn't work when tests are running separately from server
|
||||
it('passes correct target to spell when targetType === \'tasks\'');
|
||||
|
||||
@@ -130,7 +130,6 @@ describe('POST /user/reset', () => {
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
await hero.post('/user/reset');
|
||||
|
||||
const heroRes = await admin.get(`/hall/heroes/${hero.auth.local.username}`);
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
translate as t,
|
||||
} from '../../../helpers/api-integration/v4';
|
||||
|
||||
|
||||
describe('PUT /user', () => {
|
||||
let user;
|
||||
|
||||
@@ -53,7 +52,6 @@ describe('PUT /user', () => {
|
||||
expect(user.tags.length).to.be.eql(userTags.length + 1);
|
||||
});
|
||||
|
||||
|
||||
it('profile.name cannot be an empty string or null', async () => {
|
||||
await expect(user.put('/user', {
|
||||
'profile.name': ' ', // string should be trimmed
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import {
|
||||
generateUser,
|
||||
} from '../../helpers/common.helper';
|
||||
@@ -36,7 +35,6 @@ describe('getDebuffPotionItems', () => {
|
||||
user.stats.buffs.snowball = true;
|
||||
user.stats.buffs.shinySeed = true;
|
||||
|
||||
|
||||
const result = getDebuffPotionItems(user);
|
||||
|
||||
expect(result).to.be.an('array').that.deep.include.members([
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import {
|
||||
generateUser,
|
||||
} from '../../helpers/common.helper';
|
||||
@@ -27,7 +26,6 @@ describe('setDebuffPotionItems', () => {
|
||||
const firstSetResult = [...setDebuffPotionItems(user).pinnedItems];
|
||||
const secondSetResult = [...setDebuffPotionItems(user).pinnedItems];
|
||||
|
||||
|
||||
expect(firstSetResult).to.be.deep.equal(secondSetResult);
|
||||
});
|
||||
|
||||
|
||||
@@ -90,7 +90,6 @@ describe('shops', () => {
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
const shopWizardItems = shared.shops.getMarketGearCategories(userWithItems).find(x => x.identifier === 'wizard').items.filter(x => x.klass === 'wizard' && (x.owned === false || x.owned === undefined));
|
||||
expect(shopWizardItems.length).to.eql(0);
|
||||
});
|
||||
@@ -122,7 +121,6 @@ describe('shops', () => {
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
const shopWizardItems = shared.shops.getMarketGearCategories(userWithItems).find(x => x.identifier === 'wizard').items.filter(x => x.klass === 'wizard' && (x.owned === false || x.owned === undefined));
|
||||
expect(shopWizardItems.find(item => item.key === 'weapon_wizard_5').locked).to.eql(false);
|
||||
expect(shopWizardItems.find(item => item.key === 'weapon_wizard_6').locked).to.eql(true);
|
||||
|
||||
@@ -75,7 +75,6 @@ describe('shared.ops.buyGem', () => {
|
||||
expect(user.stats.gp).to.equal(goldPoints - planGemLimits.convRate * 2);
|
||||
});
|
||||
|
||||
|
||||
context('Failure conditions', () => {
|
||||
it('returns an error when key is not provided', done => {
|
||||
try {
|
||||
|
||||
@@ -141,7 +141,6 @@ describe('shared.ops.buyQuest', () => {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
it('does not buy Gem-premium Quests', done => {
|
||||
user.stats.gp = 9999;
|
||||
try {
|
||||
|
||||
@@ -43,7 +43,6 @@ describe('shared.ops.purchase', () => {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
it('returns error when unknown type is provided', done => {
|
||||
try {
|
||||
purchase(user, { params: { type: 'randomType', key: 'gem' } });
|
||||
@@ -96,7 +95,6 @@ describe('shared.ops.purchase', () => {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
it('returns error when item is not found', done => {
|
||||
const params = { key: 'notExisting', type: 'food' };
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ describe('shared.ops.reset', () => {
|
||||
tasksToRemove = [habit, todo, daily, reward];
|
||||
});
|
||||
|
||||
|
||||
it('resets a user', () => {
|
||||
const [, message] = reset(user);
|
||||
|
||||
|
||||
@@ -377,7 +377,6 @@ describe('shouldDo', () => {
|
||||
m: false,
|
||||
};
|
||||
|
||||
|
||||
[0, 1, 2, 3, 4, 5, 6].forEach(weekday => {
|
||||
day = moment().add(1, 'weeks').day(weekday).toDate();
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import express from 'express';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import bodyParser from 'body-parser';
|
||||
import http from 'http';
|
||||
|
||||
const app = express();
|
||||
const server = require('http').createServer(app);
|
||||
const server = http.createServer(app);
|
||||
|
||||
const PORT = process.env.TEST_WEBHOOK_APP_PORT || 3099; // eslint-disable-line no-process-env
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
|
||||
export { translate } from './translate';
|
||||
|
||||
|
||||
export function generateUser (options = {}) {
|
||||
const user = new User(options).toObject();
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import i18n from '../../website/common/script/i18n';
|
||||
import { translations } from '../../website/server/libs/i18n';
|
||||
|
||||
i18n.translations = require('../../website/server/libs/i18n').translations;
|
||||
i18n.translations = translations;
|
||||
|
||||
const STRING_ERROR_MSG = 'Error processing the string. Please see Help > Report a Bug.';
|
||||
const STRING_DOES_NOT_EXIST_MSG = /^String '.*' not found.$/;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
const glob = require('glob').sync;
|
||||
import { sync as glob } from 'glob';
|
||||
|
||||
describe('Locales files', () => {
|
||||
it('do not contain duplicates of any keys', () => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
const glob = require('glob').sync;
|
||||
const readFile = require('fs').readFileSync;
|
||||
import { sync as glob } from 'glob';
|
||||
import { readFileSync as readFile } from 'fs';
|
||||
|
||||
const IMPORT_REGEX = /(import|require).*common\/script/;
|
||||
|
||||
|
||||
40
website/client/package-lock.json
generated
40
website/client/package-lock.json
generated
@@ -5528,46 +5528,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@vue/cli-shared-utils": {
|
||||
"version": "4.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@vue/cli-shared-utils/-/cli-shared-utils-4.4.4.tgz",
|
||||
"integrity": "sha512-ccMZtTMSutR35V5nrU/eyj+zRMomTRGBTLwJPmaJ2sRiW/93MTggQGXDWC8JRAA8yiU1N8xza8mjBxS0O2wIAA==",
|
||||
"requires": {
|
||||
"@hapi/joi": "^15.0.1",
|
||||
"chalk": "^2.4.2",
|
||||
"execa": "^1.0.0",
|
||||
"launch-editor": "^2.2.1",
|
||||
"lru-cache": "^5.1.1",
|
||||
"node-ipc": "^9.1.1",
|
||||
"open": "^6.3.0",
|
||||
"ora": "^3.4.0",
|
||||
"read-pkg": "^5.1.1",
|
||||
"request": "^2.88.2",
|
||||
"request-promise-native": "^1.0.8",
|
||||
"semver": "^6.1.0",
|
||||
"strip-ansi": "^6.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-regex": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
|
||||
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg=="
|
||||
},
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
|
||||
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
|
||||
"requires": {
|
||||
"ansi-regex": "^5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@vue/component-compiler-utils": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-3.1.2.tgz",
|
||||
|
||||
@@ -227,7 +227,6 @@
|
||||
:popover-position="'top'"
|
||||
:show-popover="true"
|
||||
@click="selectMount(item)"
|
||||
|
||||
>
|
||||
<span slot="popoverContent">
|
||||
<h4 class="popover-content-title">{{ item.name }}</h4>
|
||||
|
||||
@@ -78,9 +78,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<draggable
|
||||
v-if="taskList.length > 0"
|
||||
ref="tasksList"
|
||||
class="sortable-tasks"
|
||||
v-if="taskList.length > 0"
|
||||
:options="{disabled: activeFilter.label === 'scheduled' || !isUser, scrollSensitivity: 64}"
|
||||
:delay-on-touch-only="true"
|
||||
:delay="100"
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<template>
|
||||
<div class="checklist-component">
|
||||
<label v-once class="mb-1">{{ $t('checklist') }}</label>
|
||||
<label
|
||||
v-once
|
||||
class="mb-1"
|
||||
>{{ $t('checklist') }}</label>
|
||||
<br>
|
||||
<draggable
|
||||
v-model="checklist"
|
||||
@@ -17,17 +20,19 @@
|
||||
class="inline-edit-input-group checklist-group input-group"
|
||||
>
|
||||
<span
|
||||
v-if="!disabled"
|
||||
class="grippy"
|
||||
v-html="icons.grip"
|
||||
v-if="!disabled"
|
||||
>
|
||||
</span>
|
||||
|
||||
<checkbox :checked.sync="item.completed"
|
||||
<checkbox
|
||||
:id="`checklist-${item.id}`"
|
||||
:checked.sync="item.completed"
|
||||
:disabled="disabled"
|
||||
class="input-group-prepend"
|
||||
:class="{'cursor-auto': disabled}"
|
||||
:id="`checklist-${item.id}`"/>
|
||||
/>
|
||||
|
||||
<input
|
||||
v-model="item.text"
|
||||
@@ -36,11 +41,12 @@
|
||||
:disabled="disabled"
|
||||
>
|
||||
<span
|
||||
class="input-group-append"
|
||||
v-if="!disabled"
|
||||
class="input-group-append"
|
||||
@click="removeChecklistItem($index)"
|
||||
>
|
||||
<div v-once
|
||||
<div
|
||||
v-once
|
||||
class="svg-icon destroy-icon"
|
||||
v-html="icons.destroy"
|
||||
>
|
||||
@@ -49,12 +55,14 @@
|
||||
</div>
|
||||
</draggable>
|
||||
<div
|
||||
class="inline-edit-input-group checklist-group input-group new-checklist"
|
||||
v-if="!disabled"
|
||||
class="inline-edit-input-group checklist-group input-group new-checklist"
|
||||
>
|
||||
<span class="input-group-prepend new-icon"
|
||||
<span
|
||||
v-once
|
||||
v-html="icons.positive">
|
||||
class="input-group-prepend new-icon"
|
||||
v-html="icons.positive"
|
||||
>
|
||||
</span>
|
||||
|
||||
<input
|
||||
@@ -82,11 +90,19 @@ import gripIcon from '@/assets/svg/grip.svg';
|
||||
import checkbox from '@/components/ui/checkbox';
|
||||
|
||||
export default {
|
||||
name: 'Checklist',
|
||||
components: {
|
||||
draggable,
|
||||
checkbox,
|
||||
},
|
||||
name: 'checklist',
|
||||
props: {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
},
|
||||
items: {
|
||||
type: Array,
|
||||
},
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
checklist: this.items,
|
||||
@@ -100,14 +116,6 @@ export default {
|
||||
}),
|
||||
};
|
||||
},
|
||||
props: {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
},
|
||||
items: {
|
||||
type: Array,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
updateChecklist () {
|
||||
this.$emit('update:items', this.checklist);
|
||||
|
||||
@@ -34,14 +34,14 @@
|
||||
@click="submit()"
|
||||
>
|
||||
<div
|
||||
class="m-auto"
|
||||
v-if="purpose === 'edit'"
|
||||
class="m-auto"
|
||||
>
|
||||
{{ $t('save') }}
|
||||
</div>
|
||||
<div
|
||||
class="m-auto"
|
||||
v-if="purpose === 'create'"
|
||||
class="m-auto"
|
||||
>
|
||||
{{ $t('create') }}
|
||||
</div>
|
||||
@@ -135,8 +135,8 @@
|
||||
<div
|
||||
class="habit-option-container no-transition
|
||||
d-flex flex-column justify-content-center align-items-center"
|
||||
@click="toggleUpDirection()"
|
||||
:class="!task.up ? cssClass('habit-control-disabled') : ''"
|
||||
@click="toggleUpDirection()"
|
||||
>
|
||||
<div
|
||||
class="habit-option-button no-transition
|
||||
@@ -159,8 +159,8 @@
|
||||
<div
|
||||
class="habit-option-container no-transition
|
||||
d-flex flex-column justify-content-center align-items-center"
|
||||
@click="toggleDownDirection()"
|
||||
:class="!task.down ? cssClass('habit-control-disabled') : ''"
|
||||
@click="toggleDownDirection()"
|
||||
>
|
||||
<div
|
||||
class="habit-option-button no-transition
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
>
|
||||
<error404 />
|
||||
</div>
|
||||
<div class="profile" v-else-if="userLoaded">
|
||||
<div
|
||||
v-else-if="userLoaded"
|
||||
class="profile"
|
||||
>
|
||||
<div class="header">
|
||||
<span
|
||||
class="close-icon svg-icon inline icon-10"
|
||||
@@ -42,7 +45,8 @@
|
||||
class="btn btn-secondary block-icon"
|
||||
@click="blockUser()"
|
||||
>
|
||||
<div v-once
|
||||
<div
|
||||
v-once
|
||||
class="svg-icon block-icon"
|
||||
v-html="icons.block"
|
||||
></div>
|
||||
|
||||
@@ -21,7 +21,6 @@ forOwn(backgrounds, (value, key) => {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
const appearances = {
|
||||
hair,
|
||||
shirt: shirts,
|
||||
|
||||
@@ -91,7 +91,6 @@ api.armoire = {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
---------------------------------------------------------------
|
||||
Classes
|
||||
@@ -100,7 +99,6 @@ api.armoire = {
|
||||
|
||||
api.classes = CLASSES;
|
||||
|
||||
|
||||
/*
|
||||
---------------------------------------------------------------
|
||||
Gear Types
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
// { path: '', type: '', canShow?: (user) => boolean }
|
||||
|
||||
export default [];
|
||||
|
||||
@@ -87,7 +87,6 @@ import updateTask from './ops/updateTask';
|
||||
// TODO under api.libs.statHelpers?
|
||||
import * as statHelpers from './statHelpers';
|
||||
|
||||
|
||||
const api = {};
|
||||
api.content = content;
|
||||
api.errors = errors;
|
||||
|
||||
@@ -8,7 +8,6 @@ import isPinned from './isPinned';
|
||||
import isFreeRebirth from './isFreeRebirth';
|
||||
import getOfficialPinnedItems from './getOfficialPinnedItems';
|
||||
|
||||
|
||||
function lockQuest (quest, user) {
|
||||
if (quest.key === 'lostMasterclasser1') return !(user.achievements.quests.dilatoryDistress3 && user.achievements.quests.mayhemMistiflying3 && user.achievements.quests.stoikalmCalamity3 && user.achievements.quests.taskwoodsTerror3);
|
||||
if (quest.lvl && user.stats.lvl < quest.lvl) return true;
|
||||
|
||||
@@ -4,7 +4,6 @@ function clearDebuffPotion (user) {
|
||||
return user.pinnedItems.filter(item => item.type !== 'debuffPotion');
|
||||
}
|
||||
|
||||
|
||||
export default function setDebuffPotionItems (user) {
|
||||
user.pinnedItems = clearDebuffPotion(user);
|
||||
|
||||
|
||||
@@ -398,7 +398,6 @@ shops.getTimeTravelersCategories = function getTimeTravelersCategories (user, la
|
||||
return categories;
|
||||
};
|
||||
|
||||
|
||||
/* Seasonal */
|
||||
|
||||
const flatGearArray = toArray(content.gear.flat);
|
||||
|
||||
@@ -19,7 +19,6 @@ export class BuyHourglassMountOperation extends AbstractHourglassItemOperation {
|
||||
const { key } = this;
|
||||
if (!key) throw new BadRequest(this.i18n('missingKeyParam'));
|
||||
|
||||
|
||||
if (!includes(keys(content.timeTravelStable.mounts), key)) {
|
||||
throw new NotAuthorized(this.i18n('notAllowedHourglass'));
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ export default function feed (user, req = {}, analytics) {
|
||||
throw new NotFound(errorMessage('invalidFoodName', req.language));
|
||||
}
|
||||
|
||||
|
||||
if (!user.items.pets[pet.key]) {
|
||||
throw new NotFound(i18n.t('messagePetNotFound', req.language));
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import i18n from '../i18n';
|
||||
import getItemByPathAndType from '../libs/getItemByPathAndType';
|
||||
import getOfficialPinnedItems from '../libs/getOfficialPinnedItems';
|
||||
|
||||
|
||||
const sortOrder = reduce(content.gearTypes, (accumulator, val, key) => {
|
||||
accumulator[val] = key;
|
||||
return accumulator;
|
||||
@@ -145,7 +144,6 @@ export function togglePinnedItem (user, { item, type, path }, req = {}) {
|
||||
getItemInfo(user, type, item, officialPinnedItems, req.language);
|
||||
}
|
||||
|
||||
|
||||
if (path === 'armoire' || path === 'potion' || type === 'debuffPotion') {
|
||||
// @TODO: take into considertation debuffPotion type in message
|
||||
throw new BadRequest(i18n.t('cannotUnpinItem', req.language));
|
||||
|
||||
@@ -23,7 +23,6 @@ function markNotificationAsRead (user, cardType) {
|
||||
if (indexToRemove !== -1) user.notifications.splice(indexToRemove, 1);
|
||||
}
|
||||
|
||||
|
||||
export default function readCard (user, req = {}) {
|
||||
const cardType = get(req.params, 'cardType');
|
||||
|
||||
|
||||
@@ -114,7 +114,6 @@ function getSet (setType, firstPath, req) {
|
||||
paths: mustachePaths,
|
||||
} = getItemsAndPathsForSet(set, mustache, mustachePrefix);
|
||||
|
||||
|
||||
const { beard } = content.appearances.hair;
|
||||
const beardPrefix = 'hair.beard';
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
// This file defines some globals for use in the API Doc comments
|
||||
|
||||
/**
|
||||
|
||||
@@ -92,7 +92,6 @@ function getBannedWordsFromText (message) {
|
||||
return getMatchesByWordArray(message, bannedWords);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @api {post} /api/v3/groups/:groupId/chat Post chat message to a group
|
||||
* @apiName PostChat
|
||||
@@ -248,7 +247,6 @@ api.postChat = {
|
||||
toSave.push(user.save());
|
||||
}
|
||||
|
||||
|
||||
await Promise.all(toSave);
|
||||
|
||||
const analyticsObject = {
|
||||
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
castItemVal,
|
||||
} from '../../libs/items/utils';
|
||||
|
||||
|
||||
const api = {};
|
||||
|
||||
/**
|
||||
|
||||
@@ -786,5 +786,4 @@ api.transferGems = {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
export default api;
|
||||
|
||||
@@ -283,7 +283,6 @@ api.rejectQuest = {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @api {post} /api/v3/groups/:groupId/quests/force-start Force-start a pending quest
|
||||
* @apiName ForceQuestStart
|
||||
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
* belonging to the user.
|
||||
*/
|
||||
|
||||
|
||||
const api = {};
|
||||
|
||||
/**
|
||||
|
||||
@@ -54,7 +54,6 @@ export const { NotFound } = common.errors;
|
||||
*/
|
||||
export const { Forbidden } = common.errors;
|
||||
|
||||
|
||||
/**
|
||||
* @apiDefine NotificationNotFound
|
||||
* @apiError NotificationNotFound The notification was not found.
|
||||
|
||||
@@ -245,7 +245,6 @@ api.cancelSubscription = async function cancelSubscription (options = {}) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const subscriptionBlock = common.content.subscriptionBlocks[planId];
|
||||
const subscriptionLength = subscriptionBlock.months * 30;
|
||||
|
||||
@@ -346,7 +345,6 @@ api.subscribe = async function subscribe (options) {
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
api.chargeForAdditionalGroupMember = async function chargeForAdditionalGroupMember (group) {
|
||||
// @TODO: Can we get this from the content plan?
|
||||
const priceForNewMember = 3;
|
||||
|
||||
@@ -276,5 +276,4 @@ api.cancelSubscribe = async function cancelSubscribe (user, headers) {
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export default api;
|
||||
|
||||
@@ -215,7 +215,6 @@ api.noRenewSubscribe = async function noRenewSubscribe (options) {
|
||||
return googleRes;
|
||||
};
|
||||
|
||||
|
||||
api.cancelSubscribe = async function cancelSubscribe (user, headers) {
|
||||
const { plan } = user.purchased;
|
||||
|
||||
@@ -255,5 +254,4 @@ api.cancelSubscribe = async function cancelSubscribe (user, headers) {
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export default api;
|
||||
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
NotFound,
|
||||
} from '../errors';
|
||||
|
||||
|
||||
const BASE_URL = nconf.get('BASE_URL');
|
||||
const { i18n } = shared;
|
||||
|
||||
@@ -97,14 +96,12 @@ api.checkout = async function checkout (options = {}) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!gift || gift.type === 'gems') {
|
||||
const receiver = gift ? gift.member : user;
|
||||
const receiverCanGetGems = await receiver.canGetGems();
|
||||
if (!receiverCanGetGems) throw new NotAuthorized(shared.i18n.t('groupPolicyCannotGetGems', receiver.preferences.language));
|
||||
}
|
||||
|
||||
|
||||
const createPayment = {
|
||||
intent: 'sale',
|
||||
payer: { payment_method: this.constants.PAYMENT_METHOD },
|
||||
|
||||
@@ -240,5 +240,4 @@ api.handleWebhooks = async function handleWebhooks (options, stripeInc) {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export default api;
|
||||
|
||||
@@ -46,7 +46,6 @@ export function setNextDue (task, user, dueDateOption) {
|
||||
now = dateTaskIsDue;
|
||||
}
|
||||
|
||||
|
||||
const optionsForShouldDo = user.preferences.toObject();
|
||||
optionsForShouldDo.now = now;
|
||||
task.isDue = shared.shouldDo(dateTaskIsDue, task, optionsForShouldDo);
|
||||
|
||||
@@ -165,7 +165,6 @@ export async function update (req, res, { isV3 = false }) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
await Promise.all([user.save()].concat(promisesForTagsRemoval));
|
||||
|
||||
let userToJSON = user;
|
||||
|
||||
@@ -74,7 +74,6 @@ export function setUserStyles (newMessage, user) {
|
||||
userStyles.items.currentPet = userCopy.items.currentPet;
|
||||
}
|
||||
|
||||
|
||||
if (userCopy.preferences) {
|
||||
userStyles.preferences = {};
|
||||
if (userCopy.preferences.style) userStyles.preferences.style = userCopy.preferences.style;
|
||||
|
||||
@@ -45,5 +45,4 @@ schema.statics.cleanupCorruptData = function cleanupCorruptPushDevicesData (push
|
||||
return filteredPushDevices;
|
||||
};
|
||||
|
||||
|
||||
export const model = mongoose.model('PushDevice', schema);
|
||||
|
||||
@@ -108,7 +108,6 @@ schema.methods.getObjectionsToInteraction = function getObjectionsToInteraction
|
||||
)(checks);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Sends a message to a user. Archives a copy in sender's inbox.
|
||||
*
|
||||
@@ -251,7 +250,6 @@ schema.methods.addAchievement = function addAchievement (achievement) {
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Adds an achievement and a related notification to the user, saving it directly to the database
|
||||
* To be used when the user object is not loaded or we don't want to use `user.save`
|
||||
|
||||
Reference in New Issue
Block a user