diff --git a/app/.meteor/packages b/app/.meteor/packages index f3619251..0835a6ba 100644 --- a/app/.meteor/packages +++ b/app/.meteor/packages @@ -32,7 +32,7 @@ standard-minifier-js@2.6.0 shell-server@0.4.0 seba:minifiers-autoprefixer templates:array -ecmascript@0.14.0 +ecmascript@0.14.2 es5-shim@4.8.0 reactive-dict@1.3.0 percolate:synced-cron diff --git a/app/.meteor/release b/app/.meteor/release index c6ae8ec1..8558e149 100644 --- a/app/.meteor/release +++ b/app/.meteor/release @@ -1 +1 @@ -METEOR@1.9 +METEOR@1.9.2 diff --git a/app/.meteor/versions b/app/.meteor/versions index 1d7939f2..5897ef97 100644 --- a/app/.meteor/versions +++ b/app/.meteor/versions @@ -13,7 +13,7 @@ aldeed:collection2@3.0.6 aldeed:schema-index@3.0.0 allow-deny@1.1.0 autoupdate@1.6.0 -babel-compiler@7.5.1 +babel-compiler@7.5.2 babel-runtime@1.5.0 base64@1.0.12 binary-heap@1.0.11 @@ -31,11 +31,11 @@ ddp@1.4.0 ddp-client@2.3.3 ddp-common@1.4.0 ddp-rate-limiter@1.0.7 -ddp-server@2.3.0 +ddp-server@2.3.1 deps@1.0.12 diff-sequence@1.1.1 dynamic-import@0.5.1 -ecmascript@0.14.1 +ecmascript@0.14.2 ecmascript-runtime@0.7.0 ecmascript-runtime-client@0.10.0 ecmascript-runtime-server@0.9.0 @@ -78,7 +78,7 @@ modern-browsers@0.1.5 modules@0.15.0 modules-runtime@0.12.0 momentjs:moment@2.24.0 -mongo@1.8.0 +mongo@1.8.1 mongo-decimal@0.1.1 mongo-dev-server@1.1.0 mongo-id@1.0.7 @@ -105,7 +105,7 @@ service-configuration@1.0.11 session@1.2.0 sha@1.0.9 shell-server@0.4.0 -socket-stream-client@0.2.2 +socket-stream-client@0.2.3 spacebars@1.0.15 spacebars-compiler@1.1.3 splendido:accounts-emails-field@1.2.0 diff --git a/app/imports/api/creature/Creatures.js b/app/imports/api/creature/Creatures.js index 6820a880..7e956967 100644 --- a/app/imports/api/creature/Creatures.js +++ b/app/imports/api/creature/Creatures.js @@ -3,10 +3,6 @@ import deathSaveSchema from "/imports/api/properties/subSchemas/DeathSavesSchema import ColorSchema from "/imports/api/properties/subSchemas/ColorSchema.js"; import SharingSchema from '/imports/api/sharing/SharingSchema.js'; -//Methods -import '/imports/api/creature/insertCreature.js'; -import '/imports/api/creature/removeCreature.js'; - //set up the collection for creatures Creatures = new Mongo.Collection("creatures"); @@ -95,5 +91,27 @@ CreatureSchema.extend(SharingSchema); Creatures.attachSchema(CreatureSchema); +const insertCreature = new ValidatedMethod({ + + name: "Creatures.methods.insertCreature", + + validate: null, + + run() { + if (!this.userId) { + throw new Meteor.Error("Creatures.methods.insert.denied", + "You need to be logged in to insert a creature"); + } + + // Create the creature document + let charId = Creatures.insert({ + owner: this.userId, + }); + this.unblock(); + return charId; + }, + +}); + export default Creatures; -export { CreatureSchema }; +export { CreatureSchema, insertCreature }; diff --git a/app/imports/api/creature/insertCreature.js b/app/imports/api/creature/insertCreature.js deleted file mode 100644 index 119ac2d2..00000000 --- a/app/imports/api/creature/insertCreature.js +++ /dev/null @@ -1,40 +0,0 @@ -import getDefaultCharacterDocs from '/imports/api/creature/getDefaultCharacterDocs.js'; -import Attributes from '/imports/api/properties/Attributes.js'; -import Skills from '/imports/api/properties/Skills.js'; -import DamageMultipliers from '/imports/api/properties/DamageMultipliers.js'; -import Effects from '/imports/api/properties/Effects.js'; -import Containers from '/imports/api/properties/Containers.js'; -import Items from '/imports/api/properties/Items.js'; - -const addDefaultDocs = function(docs){ - Attributes.rawCollection().insert(docs.attributes, {ordered: false}); - Skills.rawCollection().insert(docs.skills, {ordered: false}); - DamageMultipliers.rawCollection().insert(docs.damageMultipliers, {ordered: false}); - Effects.rawCollection().insert(docs.effects, {ordered: false}); - Containers.rawCollection().insert(docs.containers, {ordered: false}); - Items.rawCollection().insert(docs.items, {ordered: false}); -}; - -const insertCreature = new ValidatedMethod({ - - name: "Creatures.methods.insertCreature", - - validate: null, - - run() { - if (!this.userId) { - throw new Meteor.Error("Creatures.methods.insert.denied", - "You need to be logged in to insert a creature"); - } - - // Create the creature document - let charId = Creatures.insert({ - owner: this.userId, - }); - this.unblock(); - return charId; - }, - -}); - -export default insertCreature; diff --git a/app/imports/ui/creature/character/CharacterSheet.vue b/app/imports/ui/creature/character/CharacterSheet.vue index 90621b82..d3c88f60 100644 --- a/app/imports/ui/creature/character/CharacterSheet.vue +++ b/app/imports/ui/creature/character/CharacterSheet.vue @@ -71,8 +71,8 @@ ...mapMutations([ "toggleDrawer", ]), - recompute(creatureId){ - recomputeCreature.call({creatureId}); + recompute(charId){ + recomputeCreature.call({charId}); }, isDarkColor, }, diff --git a/app/imports/ui/layouts/Sidebar.vue b/app/imports/ui/layouts/Sidebar.vue index 45c1c39f..9aebc512 100644 --- a/app/imports/ui/layouts/Sidebar.vue +++ b/app/imports/ui/layouts/Sidebar.vue @@ -97,7 +97,7 @@ links(){ let links = [ {title: "Home", icon: "home", to: "/"}, - {title: "Creatures", icon: "group", to: "/characterList", vif: Meteor.userId()}, + {title: "Characters", icon: "group", to: "/characterList", vif: Meteor.userId()}, {title: "Library", icon: "book", to: "/library", vif: Meteor.userId()}, {title: "Send Feedback", icon: "bug_report", to: "/feedback"}, {title: "Patreon", icon: "", href: "https://www.patreon.com/dicecloud"}, diff --git a/app/imports/ui/pages/CharacterList.vue b/app/imports/ui/pages/CharacterList.vue index 8466525a..8aaafc8d 100644 --- a/app/imports/ui/pages/CharacterList.vue +++ b/app/imports/ui/pages/CharacterList.vue @@ -1,6 +1,6 @@