Merge branch 'develop' into release

This commit is contained in:
Sabe Jones
2019-11-27 15:48:03 -06:00
76 changed files with 1366 additions and 1353 deletions
+101 -40
View File
@@ -1798,9 +1798,9 @@
"integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM="
},
"amplitude-js": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/amplitude-js/-/amplitude-js-5.6.0.tgz",
"integrity": "sha512-XGaM0sTvMOrVYqfHhkKEikjQ/SzhEGbupxYopcrzEpEuNLenSOIBMyB0JycBcFI1hTWR4rGJ2TDRqIeRMmUZvg==",
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/amplitude-js/-/amplitude-js-5.7.0.tgz",
"integrity": "sha512-nKE5oJhfuGTxUlJje4XJ7hpRmCTkM1G4sKRvk9vFxo/SsgHZ2qofd9a5Bvk/OKO2N4P9RMyLRa0byJ9j6NIAeg==",
"requires": {
"@amplitude/ua-parser-js": "0.7.20",
"blueimp-md5": "^2.10.0",
@@ -1825,17 +1825,17 @@
"integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw=="
},
"ansi-escapes": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.2.1.tgz",
"integrity": "sha512-Cg3ymMAdN10wOk/VYfLV7KCQyv7EDirJ64500sU7n9UlmioEtDuU5Gd+hj73hXSU/ex7tHJSssmyftDdkMLO8Q==",
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.0.tgz",
"integrity": "sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg==",
"requires": {
"type-fest": "^0.5.2"
"type-fest": "^0.8.1"
},
"dependencies": {
"type-fest": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.5.2.tgz",
"integrity": "sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw=="
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
"integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA=="
}
}
},
@@ -3283,9 +3283,9 @@
}
},
"core-js": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.4.1.tgz",
"integrity": "sha512-KX/dnuY/J8FtEwbnrzmAjUYgLqtk+cxM86hfG60LGiW3MmltIc2yAmDgBgEkfm0blZhUrdr1Zd84J2Y14mLxzg=="
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.4.2.tgz",
"integrity": "sha512-bUTfqFWtNKWp73oNIfRkqwYZJeNT3lstzZcAkhhiuvDraRSgOH1/+F9ZklbpR4zpdKuo4cpXN8tKP7s61yjX+g=="
},
"core-js-compat": {
"version": "3.3.4",
@@ -4257,9 +4257,9 @@
}
},
"eslint": {
"version": "6.6.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-6.6.0.tgz",
"integrity": "sha512-PpEBq7b6qY/qrOmpYQ/jTMDYfuQMELR4g4WI1M/NaSDDD/bdcMb+dj4Hgks7p41kW2caXsPsEZAEAyAgjVVC0g==",
"version": "6.7.1",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-6.7.1.tgz",
"integrity": "sha512-UWzBS79pNcsDSxgxbdjkmzn/B6BhsXMfUaOHnNwyE8nD+Q6pyT96ow2MccVayUTV4yMid4qLhMiQaywctRkBLA==",
"requires": {
"@babel/code-frame": "^7.0.0",
"ajv": "^6.10.0",
@@ -4276,7 +4276,7 @@
"file-entry-cache": "^5.0.1",
"functional-red-black-tree": "^1.0.1",
"glob-parent": "^5.0.0",
"globals": "^11.7.0",
"globals": "^12.1.0",
"ignore": "^4.0.6",
"import-fresh": "^3.0.0",
"imurmurhash": "^0.1.4",
@@ -4289,7 +4289,7 @@
"minimatch": "^3.0.4",
"mkdirp": "^0.5.1",
"natural-compare": "^1.4.0",
"optionator": "^0.8.2",
"optionator": "^0.8.3",
"progress": "^2.0.0",
"regexpp": "^2.0.1",
"semver": "^6.1.2",
@@ -4317,15 +4317,36 @@
"is-glob": "^4.0.1"
}
},
"globals": {
"version": "12.3.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-12.3.0.tgz",
"integrity": "sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw==",
"requires": {
"type-fest": "^0.8.1"
}
},
"import-fresh": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz",
"integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==",
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz",
"integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==",
"requires": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
}
},
"optionator": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
"integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
"requires": {
"deep-is": "~0.1.3",
"fast-levenshtein": "~2.0.6",
"levn": "~0.3.0",
"prelude-ls": "~1.1.2",
"type-check": "~0.3.2",
"word-wrap": "~1.2.3"
}
},
"resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
@@ -4340,6 +4361,11 @@
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz",
"integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw=="
},
"type-fest": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
"integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA=="
}
}
},
@@ -4568,11 +4594,6 @@
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz",
"integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ=="
},
"acorn-jsx": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz",
"integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw=="
}
}
},
@@ -6343,6 +6364,11 @@
"through": "^2.3.6"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg=="
},
"cli-cursor": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
@@ -6384,13 +6410,23 @@
}
},
"string-width": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.1.0.tgz",
"integrity": "sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ==",
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
"integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^5.2.0"
"strip-ansi": "^6.0.0"
},
"dependencies": {
"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"
}
}
}
}
}
@@ -9779,9 +9815,9 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"sass": {
"version": "1.23.6",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.23.6.tgz",
"integrity": "sha512-awBvj9xrAuiS2TOCcYSUGCmaBV3UW6fVSK4oJ2LHS8IRfnRLc5EJihw90C7ZJ/skcEwFGSf9/XO5NlMiKupBCg==",
"version": "1.23.7",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.23.7.tgz",
"integrity": "sha512-cYgc0fanwIpi0rXisGxl+/wadVQ/HX3RhpdRcjLdj2o2ye/sxUTpAxIhbmJy3PLQgRFbf6Pn8Jsrta2vdXcoOQ==",
"requires": {
"chokidar": ">=2.0.0 <4.0.0"
}
@@ -10090,9 +10126,9 @@
}
},
"smartbanner.js": {
"version": "1.14.6",
"resolved": "https://registry.npmjs.org/smartbanner.js/-/smartbanner.js-1.14.6.tgz",
"integrity": "sha512-yAc7ueVIiQ3kyHrQxOZncZiEFv6ubXxWj5E01xj45njFk8XZ8zG3VpAFPl70Yvmv/H0L/qjxOmQqF3H3T0j/SQ=="
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/smartbanner.js/-/smartbanner.js-1.15.0.tgz",
"integrity": "sha512-a82o2llcEB8KLjMaqeeeZxevRiPSiKbXsUoep1wMunkwggDUStkgXI56c6Qt54Elh9qo3ZrRHJTh5HvVm68o+g=="
},
"snapdragon": {
"version": "0.8.2",
@@ -10653,12 +10689,32 @@
"integrity": "sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q="
},
"svg-url-loader": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/svg-url-loader/-/svg-url-loader-3.0.2.tgz",
"integrity": "sha512-MUJFVU2uuOTZW6Eq6NuXZxhaIyWiuKtZMcT90nCkcvIZPGGc0CYyZWYP/rtXUkja5qagNMpxDwdZ/tuC6ywfWg==",
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/svg-url-loader/-/svg-url-loader-3.0.3.tgz",
"integrity": "sha512-MKGiRNDs8fnHcZcPkhGcw9+130IXyFM9H8m6T7u3ScUuZYEeVzX0vNMru30D4MCF6vMYas5iw/Ru9lwFKBjaGw==",
"requires": {
"file-loader": "~4.2.0",
"file-loader": "~4.3.0",
"loader-utils": "~1.2.3"
},
"dependencies": {
"file-loader": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/file-loader/-/file-loader-4.3.0.tgz",
"integrity": "sha512-aKrYPYjF1yG3oX0kWRrqrSMfgftm7oJW5M+m4owoldH5C51C0RkIwB++JbRvEW3IU6/ZG5n8UvEcdgwOt2UOWA==",
"requires": {
"loader-utils": "^1.2.3",
"schema-utils": "^2.5.0"
}
},
"schema-utils": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.5.0.tgz",
"integrity": "sha512-32ISrwW2scPXHUSusP8qMg5dLUawKkyV+/qIEV9JdXKx+rsM6mi8vZY8khg2M69Qom16rtroWXD3Ybtiws38gQ==",
"requires": {
"ajv": "^6.10.2",
"ajv-keywords": "^3.4.1"
}
}
}
},
"svgo": {
@@ -11820,6 +11876,11 @@
"resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz",
"integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY="
},
"word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ=="
},
"wordwrap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
+6 -6
View File
@@ -17,15 +17,15 @@
"@vue/cli-plugin-unit-mocha": "^4.0.5",
"@vue/cli-service": "^4.0.5",
"@vue/test-utils": "1.0.0-beta.29",
"amplitude-js": "^5.6.0",
"amplitude-js": "^5.7.0",
"axios": "^0.19.0",
"axios-progress-bar": "^1.2.0",
"babel-eslint": "^10.0.1",
"bootstrap": "^4.3.1",
"bootstrap-vue": "^2.1.0",
"chai": "^4.1.2",
"core-js": "^3.4.1",
"eslint": "^6.6.0",
"core-js": "^3.4.2",
"eslint": "^6.7.1",
"eslint-config-habitrpg": "^6.2.0",
"eslint-plugin-mocha": "^5.3.0",
"eslint-plugin-vue": "^6.0.1",
@@ -37,11 +37,11 @@
"lodash": "^4.17.15",
"moment": "^2.24.0",
"nconf": "^0.10.0",
"sass": "^1.23.6",
"sass": "^1.23.7",
"sass-loader": "^8.0.0",
"smartbanner.js": "^1.14.5",
"smartbanner.js": "^1.15.0",
"svg-inline-loader": "^0.8.0",
"svg-url-loader": "^3.0.2",
"svg-url-loader": "^3.0.3",
"svgo": "^1.3.2",
"svgo-loader": "^2.2.1",
"uuid": "^3.3.3",
@@ -151,7 +151,13 @@ export default {
'blackTopFrame', 'blueTopFrame', 'greenTopFrame', 'pinkTopFrame', 'redTopFrame', 'whiteTopFrame', 'yellowTopFrame',
'blackHalfMoon', 'blueHalfMoon', 'greenHalfMoon', 'pinkHalfMoon', 'redHalfMoon', 'whiteHalfMoon', 'yellowHalfMoon',
];
const options = keys.map(key => {
const noneOption = this.createGearItem(0, 'eyewear', 'base');
noneOption.none = true;
const options = [
noneOption,
];
for (const key of keys) {
const newKey = `eyewear_special_${key}`;
const option = {};
option.key = key;
@@ -164,8 +170,9 @@ export default {
return this.equip(newKey, type);
};
return option;
});
options.push(option);
}
return options;
},
freeShirts () {
@@ -179,20 +186,18 @@ export default {
},
headbands () {
const keys = ['blackHeadband', 'blueHeadband', 'greenHeadband', 'pinkHeadband', 'redHeadband', 'whiteHeadband', 'yellowHeadband'];
const options = keys.map(key => {
const newKey = `headAccessory_special_${key}`;
const option = {};
option.key = key;
option.active = this.user.preferences.costume
? this.user.items.gear.costume.headAccessory === newKey
: this.user.items.gear.equipped.headAccessory === newKey;
option.class = `headAccessory_special_${option.key} headband`;
option.click = () => {
const type = this.user.preferences.costume ? 'costume' : 'equipped';
return this.equip(newKey, type);
};
return option;
});
const noneOption = this.createGearItem(0, 'headAccessory', 'base', 'headband');
noneOption.none = true;
const options = [
noneOption,
];
for (const key of keys) {
const option = this.createGearItem(key, 'headAccessory', 'special', 'headband');
options.push(option);
}
return options;
},
chairs () {
@@ -234,7 +239,14 @@ export default {
// user purchases object, this is not recomputed. Hack for now
let backgroundUpdate = this.backgroundUpdate; // eslint-disable-line
const keys = this.animalItemKeys[category];
const options = keys.map(key => {
const noneOption = this.createGearItem(0, category, 'base', category);
noneOption.none = true;
const options = [
noneOption,
];
for (const key of keys) {
const newKey = `${category}_special_${key}`;
const userPurchased = this.user.items.gear.owned[newKey];
@@ -265,8 +277,10 @@ export default {
const type = this.user.preferences.costume ? 'costume' : 'equipped';
return this.equip(newKey, type);
};
return option;
});
options.push(option);
}
return options;
},
animalItemsUnlockString (category) {
@@ -285,6 +299,44 @@ export default {
});
return own;
},
createGearItem (key, gearType, subGearType, additionalClass) {
const newKey = `${gearType}_${subGearType ? `${subGearType}_` : ''}${key}`;
const option = {};
option.key = key;
const visibleGearType = this.user.preferences.costume ? 'costume' : 'equipped';
const currentlyEquippedValue = this.user.items.gear[visibleGearType][gearType];
option.active = currentlyEquippedValue === newKey;
if (key === 0) {
// if key is the "none" option check if a property
// doesn't have a value and mark it as active
option.active = option.active || !currentlyEquippedValue;
}
option.class = `${newKey} ${additionalClass}`;
option.click = () => {
const type = this.user.preferences.costume ? 'costume' : 'equipped';
const currentlyEquipped = this.user.items.gear[type][gearType];
// no need to call api/equip-op if its already selected
if (currentlyEquipped === newKey || (key === 0 && !currentlyEquipped)) {
return;
}
let keyToEquip = newKey;
if (option.none) {
// you need to "equip" the current selected AGAIN in order to un-equip it
// the "none-key" isn't allowed to be sent
keyToEquip = currentlyEquipped;
}
this.equip(keyToEquip, type);
};
return option;
},
},
};
</script>
@@ -1,7 +1,7 @@
<template>
<div class="row">
<challenge-modal @updatedChallenge="updatedChallenge" />
<leave-challenge-modal :challenge-id="challenge._id" />
<leave-challenge-modal :challenge-id="challenge._id" @update-challenge="updateChallenge" />
<close-challenge-modal
:members="members"
:challenge-id="challenge._id"
@@ -493,12 +493,20 @@ export default {
},
async joinChallenge () {
this.user.challenges.push(this.searchId);
await this.$store.dispatch('challenges:joinChallenge', { challengeId: this.searchId });
this.challenge = await this.$store.dispatch('challenges:joinChallenge', { challengeId: this.searchId });
this.members = await this
.loadMembers({ challengeId: this.searchId, includeAllPublicFields: true });
await this.$store.dispatch('tasks:fetchUserTasks', { forceLoad: true });
},
async leaveChallenge () {
this.$root.$emit('bv::show::modal', 'leave-challenge-modal');
},
async updateChallenge () {
this.challenge = await this.$store.dispatch('challenges:getChallenge', { challengeId: this.searchId });
this.members = await this
.loadMembers({ challengeId: this.searchId, includeAllPublicFields: true });
},
closeChallenge () {
this.$root.$emit('bv::show::modal', 'close-challenge-modal');
},
@@ -54,6 +54,7 @@ export default {
this.close();
},
close () {
this.$emit('update-challenge');
this.$root.$emit('bv::hide::modal', 'leave-challenge-modal');
},
},
@@ -1437,6 +1437,10 @@ export default {
this.task.group.sharedCompletion = this.sharedCompletion;
}
if (this.task.type === 'reward' && this.task.value === '') {
this.task.value = 0;
}
if (this.purpose === 'create') {
if (this.challengeId) {
const response = await this.$store.dispatch('tasks:createChallengeTasks', {