chore: update sub-deps and fix lint

This commit is contained in:
Matteo Pagliazzi
2020-07-01 18:20:18 +02:00
parent b9d42bf0bc
commit 3d5630d5a2
72 changed files with 2519 additions and 3931 deletions

View File

@@ -12,7 +12,6 @@ const SLACK_CONFIG = {
const LOCALES = './website/common/locales/'; const LOCALES = './website/common/locales/';
const ENGLISH_LOCALE = `${LOCALES}en/`; const ENGLISH_LOCALE = `${LOCALES}en/`;
function getArrayOfLanguages () { function getArrayOfLanguages () {
const languages = fs.readdirSync(LOCALES); const languages = fs.readdirSync(LOCALES);
languages.shift(); // Remove README.md from array of languages languages.shift(); // Remove README.md from array of languages

View File

@@ -32,13 +32,11 @@
* *
*/ */
// CONFIGURATION: // CONFIGURATION:
// - Change the uuid below to be the user's uuid. // - Change the uuid below to be the user's uuid.
// - Change ALL instances of "todos" to "habits"/"dailys"/"rewards" as // - Change ALL instances of "todos" to "habits"/"dailys"/"rewards" as
// needed. Do not miss any of them! // needed. Do not miss any of them!
const uuid = '30fb2640-7121-4968-ace5-f385e60ea6c5'; const uuid = '30fb2640-7121-4968-ace5-f385e60ea6c5';
db.users.aggregate([ db.users.aggregate([

View File

@@ -2,7 +2,6 @@
// @authorName = 'TheHollidayInn'; // in case script author needs to know when their ... // @authorName = 'TheHollidayInn'; // in case script author needs to know when their ...
// @authorUuid = ''; // ... own data is done // @authorUuid = ''; // ... own data is done
/* /*
* This migration moves chat off of groups and into their own model * This migration moves chat off of groups and into their own model
*/ */
@@ -38,7 +37,6 @@ async function moveGroupChatToModel (skip = 0) {
return chatpromises; return chatpromises;
}); });
const reducedPromises = promises.reduce((acc, curr) => { const reducedPromises = promises.reduce((acc, curr) => {
acc = acc.concat(curr); // eslint-disable-line no-param-reassign acc = acc.concat(curr); // eslint-disable-line no-param-reassign
return acc; return acc;

View File

@@ -25,7 +25,6 @@ const monk = require('monk'); // eslint-disable-line import/no-extraneous-depend
const dbUsers = monk(connectionString).get('users', { castIds: false }); const dbUsers = monk(connectionString).get('users', { castIds: false });
function processUsers (lastId) { function processUsers (lastId) {
// specify a query to limit the affected users (empty for all users): // specify a query to limit the affected users (empty for all users):
const query = { const query = {
@@ -86,7 +85,6 @@ function updateUser (user) {
const set = { migration: migrationName, 'flags.armoireEmpty': false }; const set = { migration: migrationName, 'flags.armoireEmpty': false };
if (user.flags.armoireEmpty) { if (user.flags.armoireEmpty) {
// this user believes their armoire has no more items in it // this user believes their armoire has no more items in it
if ( if (

View File

@@ -121,5 +121,4 @@ function exiting (code, msg) {
process.exit(code); process.exit(code);
} }
processUsers(); processUsers();

View File

@@ -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 connectionString = 'mongodb://localhost:27017/habitrpg?auto_reconnect=true'; // FOR TEST DATABASE
const dbUsers = monk(connectionString).get('users', { castIds: false }); const dbUsers = monk(connectionString).get('users', { castIds: false });
function processUsers (lastId) { function processUsers (lastId) {

6233
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -56,7 +56,6 @@ describe('Base model plugin', () => {
expect(sanitized).not.to.have.property('usuallySettable'); expect(sanitized).not.to.have.property('usuallySettable');
}); });
it('can make fields private', () => { it('can make fields private', () => {
schema.plugin(baseModel, { schema.plugin(baseModel, {
private: ['amPrivate'], private: ['amPrivate'],

View File

@@ -7,7 +7,6 @@ import amzLib from '../../../../../../website/server/libs/payments/amazon';
import payments from '../../../../../../website/server/libs/payments/payments'; import payments from '../../../../../../website/server/libs/payments/payments';
import common from '../../../../../../website/common'; import common from '../../../../../../website/common';
describe('#upgradeGroupPlan', () => { describe('#upgradeGroupPlan', () => {
let spy; let data; let user; let group; let let spy; let data; let user; let group; let
uuidString; uuidString;

View File

@@ -1,4 +1,3 @@
import path from 'path'; import path from 'path';
import nconf from 'nconf'; import nconf from 'nconf';
import setupNconf from '../../../../website/server/libs/setupNconf'; import setupNconf from '../../../../website/server/libs/setupNconf';

View File

@@ -16,7 +16,6 @@ describe('response middleware', () => {
next = generateNext(); next = generateNext();
}); });
it('attaches respond method to res', () => { it('attaches respond method to res', () => {
responseMiddleware(req, res, next); responseMiddleware(req, res, next);

View File

@@ -769,7 +769,6 @@ describe('Group Model', () => {
expect(res.t).to.not.be.called; expect(res.t).to.not.be.called;
}); });
it('does not throw an error if only user ids are passed in', async () => { it('does not throw an error if only user ids are passed in', async () => {
await Group.validateInvitations({ uuids: ['user-id', 'user-id2'] }, res); await Group.validateInvitations({ uuids: ['user-id', 'user-id2'] }, res);
expect(res.t).to.not.be.called; expect(res.t).to.not.be.called;

View File

@@ -432,7 +432,6 @@ describe('User Model', () => {
user = new User(); user = new User();
}); });
it('returns false if user does not have customer id', () => { it('returns false if user does not have customer id', () => {
expect(user.isSubscribed()).to.be.undefined; expect(user.isSubscribed()).to.be.undefined;
}); });
@@ -558,7 +557,6 @@ describe('User Model', () => {
}); });
}); });
context('hasCancelled', () => { context('hasCancelled', () => {
let user; let user;
beforeEach(() => { beforeEach(() => {

View File

@@ -299,7 +299,6 @@ describe('Webhook Model', () => {
}); });
}); });
context('type is globalActivity', () => { context('type is globalActivity', () => {
let config; let config;

View File

@@ -179,7 +179,6 @@ describe('GET /tasks/user', () => {
expect(dailys2[0].isDue).to.be.false; 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 () => { 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; const timezone = 240;
await user.update({ await user.update({

View File

@@ -687,7 +687,6 @@ describe('POST /tasks/user', () => {
}); });
}); });
it('can create checklists', async () => { it('can create checklists', async () => {
const task = await user.post('/tasks/user', { const task = await user.post('/tasks/user', {
text: 'test daily', text: 'test daily',

View File

@@ -147,7 +147,6 @@ describe('PUT /tasks/:id', () => {
notes: 'some new notes', notes: 'some new notes',
}); });
const memberTasks = await member.get('/tasks/user'); const memberTasks = await member.get('/tasks/user');
const syncedTask = find(memberTasks, findAssignedTask); const syncedTask = find(memberTasks, findAssignedTask);
@@ -191,7 +190,6 @@ describe('PUT /tasks/:id', () => {
notes: 'some new notes', notes: 'some new notes',
}); });
const memberTasks = await member.get('/tasks/user'); const memberTasks = await member.get('/tasks/user');
const syncedTask = find(memberTasks, findAssignedTask); const syncedTask = find(memberTasks, findAssignedTask);

View File

@@ -1,4 +1,3 @@
import { v4 as generateUUID } from 'uuid'; import { v4 as generateUUID } from 'uuid';
import { find } from 'lodash'; import { find } from 'lodash';
import { import {
@@ -325,7 +324,6 @@ describe('POST /user/class/cast/:spellId', () => {
expect(result.user.stats.mp).to.equal(10); expect(result.user.stats.mp).to.equal(10);
}); });
// TODO find a way to have sinon working in integration tests // TODO find a way to have sinon working in integration tests
// it doesn't work when tests are running separately from server // it doesn't work when tests are running separately from server
it('passes correct target to spell when targetType === \'tasks\''); it('passes correct target to spell when targetType === \'tasks\'');

View File

@@ -4,7 +4,6 @@ import {
translate as t, translate as t,
} from '../../../../helpers/api-integration/v3'; } from '../../../../helpers/api-integration/v3';
describe('PUT /user', () => { describe('PUT /user', () => {
let user; let user;
@@ -53,7 +52,6 @@ describe('PUT /user', () => {
expect(user.tags.length).to.be.eql(userTags.length + 1); expect(user.tags.length).to.be.eql(userTags.length + 1);
}); });
it('validates profile.name', async () => { it('validates profile.name', async () => {
await expect(user.put('/user', { await expect(user.put('/user', {
'profile.name': ' ', // string should be trimmed 'profile.name': ' ', // string should be trimmed

View File

@@ -10,7 +10,6 @@ import {
sha1Encrypt as sha1EncryptPassword, sha1Encrypt as sha1EncryptPassword,
} from '../../../../../../website/server/libs/password'; } from '../../../../../../website/server/libs/password';
describe('POST /user/auth/local/login', () => { describe('POST /user/auth/local/login', () => {
let api; let api;
let user; let user;

View File

@@ -9,7 +9,6 @@ import {
sha1Encrypt as sha1EncryptPassword, sha1Encrypt as sha1EncryptPassword,
} from '../../../../../../website/server/libs/password'; } from '../../../../../../website/server/libs/password';
const ENDPOINT = '/user/auth/update-email'; const ENDPOINT = '/user/auth/update-email';
describe('PUT /user/auth/update-email', () => { describe('PUT /user/auth/update-email', () => {

View File

@@ -1,4 +1,3 @@
import { v4 as generateUUID } from 'uuid'; import { v4 as generateUUID } from 'uuid';
import { find } from 'lodash'; import { find } from 'lodash';
import { import {
@@ -310,7 +309,6 @@ describe('POST /user/class/cast/:spellId', () => {
expect(result.user.stats.mp).to.equal(10); expect(result.user.stats.mp).to.equal(10);
}); });
// TODO find a way to have sinon working in integration tests // TODO find a way to have sinon working in integration tests
// it doesn't work when tests are running separately from server // it doesn't work when tests are running separately from server
it('passes correct target to spell when targetType === \'tasks\''); it('passes correct target to spell when targetType === \'tasks\'');

View File

@@ -130,7 +130,6 @@ describe('POST /user/reset', () => {
}, },
}); });
await hero.post('/user/reset'); await hero.post('/user/reset');
const heroRes = await admin.get(`/hall/heroes/${hero.auth.local.username}`); const heroRes = await admin.get(`/hall/heroes/${hero.auth.local.username}`);

View File

@@ -4,7 +4,6 @@ import {
translate as t, translate as t,
} from '../../../helpers/api-integration/v4'; } from '../../../helpers/api-integration/v4';
describe('PUT /user', () => { describe('PUT /user', () => {
let user; let user;
@@ -53,7 +52,6 @@ describe('PUT /user', () => {
expect(user.tags.length).to.be.eql(userTags.length + 1); expect(user.tags.length).to.be.eql(userTags.length + 1);
}); });
it('profile.name cannot be an empty string or null', async () => { it('profile.name cannot be an empty string or null', async () => {
await expect(user.put('/user', { await expect(user.put('/user', {
'profile.name': ' ', // string should be trimmed 'profile.name': ' ', // string should be trimmed

View File

@@ -1,4 +1,3 @@
import { import {
generateUser, generateUser,
} from '../../helpers/common.helper'; } from '../../helpers/common.helper';
@@ -36,7 +35,6 @@ describe('getDebuffPotionItems', () => {
user.stats.buffs.snowball = true; user.stats.buffs.snowball = true;
user.stats.buffs.shinySeed = true; user.stats.buffs.shinySeed = true;
const result = getDebuffPotionItems(user); const result = getDebuffPotionItems(user);
expect(result).to.be.an('array').that.deep.include.members([ expect(result).to.be.an('array').that.deep.include.members([

View File

@@ -1,4 +1,3 @@
import { import {
generateUser, generateUser,
} from '../../helpers/common.helper'; } from '../../helpers/common.helper';
@@ -27,7 +26,6 @@ describe('setDebuffPotionItems', () => {
const firstSetResult = [...setDebuffPotionItems(user).pinnedItems]; const firstSetResult = [...setDebuffPotionItems(user).pinnedItems];
const secondSetResult = [...setDebuffPotionItems(user).pinnedItems]; const secondSetResult = [...setDebuffPotionItems(user).pinnedItems];
expect(firstSetResult).to.be.deep.equal(secondSetResult); expect(firstSetResult).to.be.deep.equal(secondSetResult);
}); });

View File

@@ -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)); 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); 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)); 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_5').locked).to.eql(false);
expect(shopWizardItems.find(item => item.key === 'weapon_wizard_6').locked).to.eql(true); expect(shopWizardItems.find(item => item.key === 'weapon_wizard_6').locked).to.eql(true);

View File

@@ -75,7 +75,6 @@ describe('shared.ops.buyGem', () => {
expect(user.stats.gp).to.equal(goldPoints - planGemLimits.convRate * 2); expect(user.stats.gp).to.equal(goldPoints - planGemLimits.convRate * 2);
}); });
context('Failure conditions', () => { context('Failure conditions', () => {
it('returns an error when key is not provided', done => { it('returns an error when key is not provided', done => {
try { try {

View File

@@ -141,7 +141,6 @@ describe('shared.ops.buyQuest', () => {
} }
}); });
it('does not buy Gem-premium Quests', done => { it('does not buy Gem-premium Quests', done => {
user.stats.gp = 9999; user.stats.gp = 9999;
try { try {

View File

@@ -43,7 +43,6 @@ describe('shared.ops.purchase', () => {
} }
}); });
it('returns error when unknown type is provided', done => { it('returns error when unknown type is provided', done => {
try { try {
purchase(user, { params: { type: 'randomType', key: 'gem' } }); purchase(user, { params: { type: 'randomType', key: 'gem' } });
@@ -96,7 +95,6 @@ describe('shared.ops.purchase', () => {
} }
}); });
it('returns error when item is not found', done => { it('returns error when item is not found', done => {
const params = { key: 'notExisting', type: 'food' }; const params = { key: 'notExisting', type: 'food' };

View File

@@ -29,7 +29,6 @@ describe('shared.ops.reset', () => {
tasksToRemove = [habit, todo, daily, reward]; tasksToRemove = [habit, todo, daily, reward];
}); });
it('resets a user', () => { it('resets a user', () => {
const [, message] = reset(user); const [, message] = reset(user);

View File

@@ -377,7 +377,6 @@ describe('shouldDo', () => {
m: false, m: false,
}; };
[0, 1, 2, 3, 4, 5, 6].forEach(weekday => { [0, 1, 2, 3, 4, 5, 6].forEach(weekday => {
day = moment().add(1, 'weeks').day(weekday).toDate(); day = moment().add(1, 'weeks').day(weekday).toDate();

View File

@@ -1,9 +1,10 @@
import express from 'express'; import express from 'express';
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
import bodyParser from 'body-parser'; import bodyParser from 'body-parser';
import http from 'http';
const app = express(); 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 const PORT = process.env.TEST_WEBHOOK_APP_PORT || 3099; // eslint-disable-line no-process-env

View File

@@ -10,7 +10,6 @@ import {
export { translate } from './translate'; export { translate } from './translate';
export function generateUser (options = {}) { export function generateUser (options = {}) {
const user = new User(options).toObject(); const user = new User(options).toObject();

View File

@@ -1,6 +1,7 @@
import i18n from '../../website/common/script/i18n'; 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_ERROR_MSG = 'Error processing the string. Please see Help > Report a Bug.';
const STRING_DOES_NOT_EXIST_MSG = /^String '.*' not found.$/; const STRING_DOES_NOT_EXIST_MSG = /^String '.*' not found.$/;

View File

@@ -1,5 +1,4 @@
import { sync as glob } from 'glob';
const glob = require('glob').sync;
describe('Locales files', () => { describe('Locales files', () => {
it('do not contain duplicates of any keys', () => { it('do not contain duplicates of any keys', () => {

View File

@@ -1,6 +1,5 @@
import { sync as glob } from 'glob';
const glob = require('glob').sync; import { readFileSync as readFile } from 'fs';
const readFile = require('fs').readFileSync;
const IMPORT_REGEX = /(import|require).*common\/script/; const IMPORT_REGEX = /(import|require).*common\/script/;

View File

@@ -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": { "@vue/component-compiler-utils": {
"version": "3.1.2", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-3.1.2.tgz", "resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-3.1.2.tgz",

View File

@@ -227,7 +227,6 @@
:popover-position="'top'" :popover-position="'top'"
:show-popover="true" :show-popover="true"
@click="selectMount(item)" @click="selectMount(item)"
> >
<span slot="popoverContent"> <span slot="popoverContent">
<h4 class="popover-content-title">{{ item.name }}</h4> <h4 class="popover-content-title">{{ item.name }}</h4>

View File

@@ -78,9 +78,9 @@
</div> </div>
</div> </div>
<draggable <draggable
v-if="taskList.length > 0"
ref="tasksList" ref="tasksList"
class="sortable-tasks" class="sortable-tasks"
v-if="taskList.length > 0"
:options="{disabled: activeFilter.label === 'scheduled' || !isUser, scrollSensitivity: 64}" :options="{disabled: activeFilter.label === 'scheduled' || !isUser, scrollSensitivity: 64}"
:delay-on-touch-only="true" :delay-on-touch-only="true"
:delay="100" :delay="100"

View File

@@ -1,6 +1,9 @@
<template> <template>
<div class="checklist-component"> <div class="checklist-component">
<label v-once class="mb-1">{{ $t('checklist') }}</label> <label
v-once
class="mb-1"
>{{ $t('checklist') }}</label>
<br> <br>
<draggable <draggable
v-model="checklist" v-model="checklist"
@@ -17,17 +20,19 @@
class="inline-edit-input-group checklist-group input-group" class="inline-edit-input-group checklist-group input-group"
> >
<span <span
v-if="!disabled"
class="grippy" class="grippy"
v-html="icons.grip" v-html="icons.grip"
v-if="!disabled"
> >
</span> </span>
<checkbox :checked.sync="item.completed" <checkbox
:disabled="disabled" :id="`checklist-${item.id}`"
class="input-group-prepend" :checked.sync="item.completed"
:class="{'cursor-auto': disabled}" :disabled="disabled"
:id="`checklist-${item.id}`"/> class="input-group-prepend"
:class="{'cursor-auto': disabled}"
/>
<input <input
v-model="item.text" v-model="item.text"
@@ -36,25 +41,28 @@
:disabled="disabled" :disabled="disabled"
> >
<span <span
class="input-group-append"
v-if="!disabled" v-if="!disabled"
class="input-group-append"
@click="removeChecklistItem($index)" @click="removeChecklistItem($index)"
> >
<div v-once <div
class="svg-icon destroy-icon" v-once
v-html="icons.destroy" class="svg-icon destroy-icon"
v-html="icons.destroy"
> >
</div> </div>
</span> </span>
</div> </div>
</draggable> </draggable>
<div <div
class="inline-edit-input-group checklist-group input-group new-checklist"
v-if="!disabled" 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-once
v-html="icons.positive"> class="input-group-prepend new-icon"
v-html="icons.positive"
>
</span> </span>
<input <input
@@ -82,11 +90,19 @@ import gripIcon from '@/assets/svg/grip.svg';
import checkbox from '@/components/ui/checkbox'; import checkbox from '@/components/ui/checkbox';
export default { export default {
name: 'Checklist',
components: { components: {
draggable, draggable,
checkbox, checkbox,
}, },
name: 'checklist', props: {
disabled: {
type: Boolean,
},
items: {
type: Array,
},
},
data () { data () {
return { return {
checklist: this.items, checklist: this.items,
@@ -100,14 +116,6 @@ export default {
}), }),
}; };
}, },
props: {
disabled: {
type: Boolean,
},
items: {
type: Array,
},
},
methods: { methods: {
updateChecklist () { updateChecklist () {
this.$emit('update:items', this.checklist); this.$emit('update:items', this.checklist);

View File

@@ -34,14 +34,14 @@
@click="submit()" @click="submit()"
> >
<div <div
class="m-auto"
v-if="purpose === 'edit'" v-if="purpose === 'edit'"
class="m-auto"
> >
{{ $t('save') }} {{ $t('save') }}
</div> </div>
<div <div
class="m-auto"
v-if="purpose === 'create'" v-if="purpose === 'create'"
class="m-auto"
> >
{{ $t('create') }} {{ $t('create') }}
</div> </div>
@@ -135,8 +135,8 @@
<div <div
class="habit-option-container no-transition class="habit-option-container no-transition
d-flex flex-column justify-content-center align-items-center" d-flex flex-column justify-content-center align-items-center"
@click="toggleUpDirection()"
:class="!task.up ? cssClass('habit-control-disabled') : ''" :class="!task.up ? cssClass('habit-control-disabled') : ''"
@click="toggleUpDirection()"
> >
<div <div
class="habit-option-button no-transition class="habit-option-button no-transition
@@ -159,8 +159,8 @@
<div <div
class="habit-option-container no-transition class="habit-option-container no-transition
d-flex flex-column justify-content-center align-items-center" d-flex flex-column justify-content-center align-items-center"
@click="toggleDownDirection()"
:class="!task.down ? cssClass('habit-control-disabled') : ''" :class="!task.down ? cssClass('habit-control-disabled') : ''"
@click="toggleDownDirection()"
> >
<div <div
class="habit-option-button no-transition class="habit-option-button no-transition

View File

@@ -1,10 +1,13 @@
<template> <template>
<div <div
v-if="!user && userLoaded" v-if="!user && userLoaded"
> >
<error404 /> <error404 />
</div> </div>
<div class="profile" v-else-if="userLoaded"> <div
v-else-if="userLoaded"
class="profile"
>
<div class="header"> <div class="header">
<span <span
class="close-icon svg-icon inline icon-10" class="close-icon svg-icon inline icon-10"
@@ -42,9 +45,10 @@
class="btn btn-secondary block-icon" class="btn btn-secondary block-icon"
@click="blockUser()" @click="blockUser()"
> >
<div v-once <div
class="svg-icon block-icon" v-once
v-html="icons.block" class="svg-icon block-icon"
v-html="icons.block"
></div> ></div>
</button> </button>
<button <button

View File

@@ -21,7 +21,6 @@ forOwn(backgrounds, (value, key) => {
}); });
}); });
const appearances = { const appearances = {
hair, hair,
shirt: shirts, shirt: shirts,

View File

@@ -91,7 +91,6 @@ api.armoire = {
}, },
}; };
/* /*
--------------------------------------------------------------- ---------------------------------------------------------------
Classes Classes
@@ -100,7 +99,6 @@ api.armoire = {
api.classes = CLASSES; api.classes = CLASSES;
/* /*
--------------------------------------------------------------- ---------------------------------------------------------------
Gear Types Gear Types

View File

@@ -1,4 +1,3 @@
// { path: '', type: '', canShow?: (user) => boolean } // { path: '', type: '', canShow?: (user) => boolean }
export default []; export default [];

View File

@@ -87,7 +87,6 @@ import updateTask from './ops/updateTask';
// TODO under api.libs.statHelpers? // TODO under api.libs.statHelpers?
import * as statHelpers from './statHelpers'; import * as statHelpers from './statHelpers';
const api = {}; const api = {};
api.content = content; api.content = content;
api.errors = errors; api.errors = errors;

View File

@@ -8,7 +8,6 @@ import isPinned from './isPinned';
import isFreeRebirth from './isFreeRebirth'; import isFreeRebirth from './isFreeRebirth';
import getOfficialPinnedItems from './getOfficialPinnedItems'; import getOfficialPinnedItems from './getOfficialPinnedItems';
function lockQuest (quest, user) { 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.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; if (quest.lvl && user.stats.lvl < quest.lvl) return true;

View File

@@ -4,7 +4,6 @@ function clearDebuffPotion (user) {
return user.pinnedItems.filter(item => item.type !== 'debuffPotion'); return user.pinnedItems.filter(item => item.type !== 'debuffPotion');
} }
export default function setDebuffPotionItems (user) { export default function setDebuffPotionItems (user) {
user.pinnedItems = clearDebuffPotion(user); user.pinnedItems = clearDebuffPotion(user);

View File

@@ -398,7 +398,6 @@ shops.getTimeTravelersCategories = function getTimeTravelersCategories (user, la
return categories; return categories;
}; };
/* Seasonal */ /* Seasonal */
const flatGearArray = toArray(content.gear.flat); const flatGearArray = toArray(content.gear.flat);

View File

@@ -19,7 +19,6 @@ export class BuyHourglassMountOperation extends AbstractHourglassItemOperation {
const { key } = this; const { key } = this;
if (!key) throw new BadRequest(this.i18n('missingKeyParam')); if (!key) throw new BadRequest(this.i18n('missingKeyParam'));
if (!includes(keys(content.timeTravelStable.mounts), key)) { if (!includes(keys(content.timeTravelStable.mounts), key)) {
throw new NotAuthorized(this.i18n('notAllowedHourglass')); throw new NotAuthorized(this.i18n('notAllowedHourglass'));
} }

View File

@@ -52,7 +52,6 @@ export default function feed (user, req = {}, analytics) {
throw new NotFound(errorMessage('invalidFoodName', req.language)); throw new NotFound(errorMessage('invalidFoodName', req.language));
} }
if (!user.items.pets[pet.key]) { if (!user.items.pets[pet.key]) {
throw new NotFound(i18n.t('messagePetNotFound', req.language)); throw new NotFound(i18n.t('messagePetNotFound', req.language));
} }

View File

@@ -9,7 +9,6 @@ import i18n from '../i18n';
import getItemByPathAndType from '../libs/getItemByPathAndType'; import getItemByPathAndType from '../libs/getItemByPathAndType';
import getOfficialPinnedItems from '../libs/getOfficialPinnedItems'; import getOfficialPinnedItems from '../libs/getOfficialPinnedItems';
const sortOrder = reduce(content.gearTypes, (accumulator, val, key) => { const sortOrder = reduce(content.gearTypes, (accumulator, val, key) => {
accumulator[val] = key; accumulator[val] = key;
return accumulator; return accumulator;
@@ -145,7 +144,6 @@ export function togglePinnedItem (user, { item, type, path }, req = {}) {
getItemInfo(user, type, item, officialPinnedItems, req.language); getItemInfo(user, type, item, officialPinnedItems, req.language);
} }
if (path === 'armoire' || path === 'potion' || type === 'debuffPotion') { if (path === 'armoire' || path === 'potion' || type === 'debuffPotion') {
// @TODO: take into considertation debuffPotion type in message // @TODO: take into considertation debuffPotion type in message
throw new BadRequest(i18n.t('cannotUnpinItem', req.language)); throw new BadRequest(i18n.t('cannotUnpinItem', req.language));

View File

@@ -23,7 +23,6 @@ function markNotificationAsRead (user, cardType) {
if (indexToRemove !== -1) user.notifications.splice(indexToRemove, 1); if (indexToRemove !== -1) user.notifications.splice(indexToRemove, 1);
} }
export default function readCard (user, req = {}) { export default function readCard (user, req = {}) {
const cardType = get(req.params, 'cardType'); const cardType = get(req.params, 'cardType');

View File

@@ -114,7 +114,6 @@ function getSet (setType, firstPath, req) {
paths: mustachePaths, paths: mustachePaths,
} = getItemsAndPathsForSet(set, mustache, mustachePrefix); } = getItemsAndPathsForSet(set, mustache, mustachePrefix);
const { beard } = content.appearances.hair; const { beard } = content.appearances.hair;
const beardPrefix = 'hair.beard'; const beardPrefix = 'hair.beard';

View File

@@ -1,4 +1,3 @@
// This file defines some globals for use in the API Doc comments // This file defines some globals for use in the API Doc comments
/** /**

View File

@@ -92,7 +92,6 @@ function getBannedWordsFromText (message) {
return getMatchesByWordArray(message, bannedWords); return getMatchesByWordArray(message, bannedWords);
} }
/** /**
* @api {post} /api/v3/groups/:groupId/chat Post chat message to a group * @api {post} /api/v3/groups/:groupId/chat Post chat message to a group
* @apiName PostChat * @apiName PostChat
@@ -248,7 +247,6 @@ api.postChat = {
toSave.push(user.save()); toSave.push(user.save());
} }
await Promise.all(toSave); await Promise.all(toSave);
const analyticsObject = { const analyticsObject = {

View File

@@ -12,7 +12,6 @@ import {
castItemVal, castItemVal,
} from '../../libs/items/utils'; } from '../../libs/items/utils';
const api = {}; const api = {};
/** /**

View File

@@ -786,5 +786,4 @@ api.transferGems = {
}, },
}; };
export default api; export default api;

View File

@@ -283,7 +283,6 @@ api.rejectQuest = {
}, },
}; };
/** /**
* @api {post} /api/v3/groups/:groupId/quests/force-start Force-start a pending quest * @api {post} /api/v3/groups/:groupId/quests/force-start Force-start a pending quest
* @apiName ForceQuestStart * @apiName ForceQuestStart

View File

@@ -19,7 +19,6 @@ import {
* belonging to the user. * belonging to the user.
*/ */
const api = {}; const api = {};
/** /**

View File

@@ -54,7 +54,6 @@ export const { NotFound } = common.errors;
*/ */
export const { Forbidden } = common.errors; export const { Forbidden } = common.errors;
/** /**
* @apiDefine NotificationNotFound * @apiDefine NotificationNotFound
* @apiError NotificationNotFound The notification was not found. * @apiError NotificationNotFound The notification was not found.

View File

@@ -245,7 +245,6 @@ api.cancelSubscription = async function cancelSubscription (options = {}) {
}); });
} }
const subscriptionBlock = common.content.subscriptionBlocks[planId]; const subscriptionBlock = common.content.subscriptionBlocks[planId];
const subscriptionLength = subscriptionBlock.months * 30; const subscriptionLength = subscriptionBlock.months * 30;
@@ -346,7 +345,6 @@ api.subscribe = async function subscribe (options) {
}); });
}; };
api.chargeForAdditionalGroupMember = async function chargeForAdditionalGroupMember (group) { api.chargeForAdditionalGroupMember = async function chargeForAdditionalGroupMember (group) {
// @TODO: Can we get this from the content plan? // @TODO: Can we get this from the content plan?
const priceForNewMember = 3; const priceForNewMember = 3;

View File

@@ -276,5 +276,4 @@ api.cancelSubscribe = async function cancelSubscribe (user, headers) {
}); });
}; };
export default api; export default api;

View File

@@ -215,7 +215,6 @@ api.noRenewSubscribe = async function noRenewSubscribe (options) {
return googleRes; return googleRes;
}; };
api.cancelSubscribe = async function cancelSubscribe (user, headers) { api.cancelSubscribe = async function cancelSubscribe (user, headers) {
const { plan } = user.purchased; const { plan } = user.purchased;
@@ -255,5 +254,4 @@ api.cancelSubscribe = async function cancelSubscribe (user, headers) {
}); });
}; };
export default api; export default api;

View File

@@ -20,7 +20,6 @@ import {
NotFound, NotFound,
} from '../errors'; } from '../errors';
const BASE_URL = nconf.get('BASE_URL'); const BASE_URL = nconf.get('BASE_URL');
const { i18n } = shared; const { i18n } = shared;
@@ -97,14 +96,12 @@ api.checkout = async function checkout (options = {}) {
} }
} }
if (!gift || gift.type === 'gems') { if (!gift || gift.type === 'gems') {
const receiver = gift ? gift.member : user; const receiver = gift ? gift.member : user;
const receiverCanGetGems = await receiver.canGetGems(); const receiverCanGetGems = await receiver.canGetGems();
if (!receiverCanGetGems) throw new NotAuthorized(shared.i18n.t('groupPolicyCannotGetGems', receiver.preferences.language)); if (!receiverCanGetGems) throw new NotAuthorized(shared.i18n.t('groupPolicyCannotGetGems', receiver.preferences.language));
} }
const createPayment = { const createPayment = {
intent: 'sale', intent: 'sale',
payer: { payment_method: this.constants.PAYMENT_METHOD }, payer: { payment_method: this.constants.PAYMENT_METHOD },

View File

@@ -240,5 +240,4 @@ api.handleWebhooks = async function handleWebhooks (options, stripeInc) {
} }
}; };
export default api; export default api;

View File

@@ -46,7 +46,6 @@ export function setNextDue (task, user, dueDateOption) {
now = dateTaskIsDue; now = dateTaskIsDue;
} }
const optionsForShouldDo = user.preferences.toObject(); const optionsForShouldDo = user.preferences.toObject();
optionsForShouldDo.now = now; optionsForShouldDo.now = now;
task.isDue = shared.shouldDo(dateTaskIsDue, task, optionsForShouldDo); task.isDue = shared.shouldDo(dateTaskIsDue, task, optionsForShouldDo);

View File

@@ -165,7 +165,6 @@ export async function update (req, res, { isV3 = false }) {
} }
}); });
await Promise.all([user.save()].concat(promisesForTagsRemoval)); await Promise.all([user.save()].concat(promisesForTagsRemoval));
let userToJSON = user; let userToJSON = user;

View File

@@ -74,7 +74,6 @@ export function setUserStyles (newMessage, user) {
userStyles.items.currentPet = userCopy.items.currentPet; userStyles.items.currentPet = userCopy.items.currentPet;
} }
if (userCopy.preferences) { if (userCopy.preferences) {
userStyles.preferences = {}; userStyles.preferences = {};
if (userCopy.preferences.style) userStyles.preferences.style = userCopy.preferences.style; if (userCopy.preferences.style) userStyles.preferences.style = userCopy.preferences.style;

View File

@@ -45,5 +45,4 @@ schema.statics.cleanupCorruptData = function cleanupCorruptPushDevicesData (push
return filteredPushDevices; return filteredPushDevices;
}; };
export const model = mongoose.model('PushDevice', schema); export const model = mongoose.model('PushDevice', schema);

View File

@@ -108,7 +108,6 @@ schema.methods.getObjectionsToInteraction = function getObjectionsToInteraction
)(checks); )(checks);
}; };
/** /**
* Sends a message to a user. Archives a copy in sender's inbox. * 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 * 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` * To be used when the user object is not loaded or we don't want to use `user.save`