More progress on migrating schema

This commit is contained in:
Stefan Zermatten
2018-11-12 16:23:43 +02:00
parent b49ab67390
commit c4984c07bf
12 changed files with 50 additions and 30 deletions

View File

@@ -46,8 +46,8 @@ ddp-rate-limiter@1.0.7
rate-limit@1.0.9
meteortesting:mocha
mdg:validated-method
akryum:vue-component
akryum:vue-router2
static-html
aldeed:collection2@3.0.0
aldeed:schema-index
akryum:vue-component

View File

@@ -49,7 +49,7 @@ google-oauth@1.2.5
hot-code-push@1.0.4
html-tools@1.0.11
htmljs@1.0.11
http@1.4.1
http@1.4.2
id-map@1.1.0
jquery@1.11.11
lai:collection-extensions@0.2.1_1
@@ -75,14 +75,14 @@ mobile-experience@1.0.5
mobile-status-bar@1.0.14
modern-browsers@0.1.2
modules@0.12.2
modules-runtime@0.10.2
modules-runtime@0.10.3
momentjs:moment@2.22.2
mongo@1.5.1
mongo-dev-server@1.1.0
mongo-id@1.0.7
npm-bcrypt@0.9.3
npm-mongo@3.0.11
oauth@1.2.3
oauth@1.2.6
oauth2@1.2.0
observe-sequence@1.0.16
ongoworks:speakingurl@9.0.0

View File

@@ -80,7 +80,7 @@ attributeSchema = new SimpleSchema({
Attributes.attachSchema(attributeSchema);
Attributes.attachSchema(ColorSchema);
Attributes.attachBehaviour("softRemovable");
//Attributes.attachBehaviour("softRemovable");
makeChild(Attributes, ["enabled"]); //children of lots of things
export default Attributes;

View File

@@ -1,4 +1,5 @@
import SimpleSchema from 'simpl-schema';
import {makeChild} from "/imports/api/parenting.js";
Proficiencies = new Mongo.Collection("proficiencies");

View File

@@ -1,5 +1,7 @@
import SimpleSchema from 'simpl-schema';
import Attributes from "/imports/api/creature/Attributes.js";
import ColorSchema from "/imports/api/creature/subSchemas/ColorSchema.js";
import {makeParent} from "/imports/api/parenting.js";
let SpellLists = new Mongo.Collection("spellLists");
@@ -10,7 +12,6 @@ let spellListSchema = new SimpleSchema({
saveDC: {type: String, optional: true, trim: false},
attackBonus: {type: String, optional: true, trim: false},
maxPrepared: {type: String, optional: true, trim: false},
"settings.showUnprepared": {type: Boolean, defaultValue: true},
});
SpellLists.attachSchema(spellListSchema);

View File

@@ -1,5 +1,17 @@
import ColorSchema from "/imports/api/creature/subSchemas/ColorSchema.js";
import SimpleSchema from 'simpl-schema';
import {makeParent, makeChild} from "/imports/api/parenting.js";
const magicSchools = [
"Abjuration",
"Conjuration",
"Divination",
"Enchantment",
"Evocation",
"Illusion",
"Necromancy",
"Transmutation",
];
let Spells = new Mongo.Collection("spells");
@@ -38,6 +50,7 @@ let spellSchema = new SimpleSchema({
trim: false,
defaultValue: "Instantaneous",
},
components: Object,
"components.verbal": {type: Boolean, defaultValue: false},
"components.somatic": {type: Boolean, defaultValue: false},
"components.concentration": {type: Boolean, defaultValue: false},
@@ -58,7 +71,7 @@ let spellSchema = new SimpleSchema({
});
Spells.attachSchema(spellSchema);
Attributes.attachSchema(ColorSchema);
Spells.attachSchema(ColorSchema);
//Spells.attachBehaviour("softRemovable");
makeChild(Spells); //children of spell lists

View File

@@ -1,5 +1,6 @@
import SimpleSchema from 'simpl-schema';
import {makeParent} from "/imports/api/parenting.js";
import ColorSchema from "/imports/api/creature/subSchemas/ColorSchema.js";
//set up the collection for containers
let Containers = new Mongo.Collection("containers");
@@ -11,14 +12,10 @@ let containerSchema = new SimpleSchema({
weight: {type: Number, min: 0, defaultValue: 0},
value: {type: Number, min: 0, defaultValue: 0},
description:{type: String, optional: true, trim: false},
color: {
type: String,
allowedValues: _.pluck(colorOptions, "key"),
defaultValue: "q",
},
});
Containers.attachSchema(containerSchema);
Containers.attachSchema(ColorSchema);
Containers.helpers({
contentsValue: function(){

View File

@@ -1,5 +1,6 @@
import SimpleSchema from 'simpl-schema';
import {makeParent, makeChild} from "/imports/api/parenting.js";
import ColorSchema from "/imports/api/creature/subSchemas/ColorSchema.js";
Items = new Mongo.Collection("items");
@@ -14,14 +15,10 @@ Schemas.Item = new SimpleSchema({
enabled: {type: Boolean, defaultValue: false},
requiresAttunement: {type: Boolean, defaultValue: false},
"settings.showIncrement": {type: Boolean, defaultValue: false},
color: {
type: String,
allowedValues: _.pluck(colorOptions, "key"),
defaultValue: "q",
},
});
Items.attachSchema(Schemas.Item);
Items.attachSchema(ColorSchema);
var checkMovePermission = function(itemId, parent) {
var item = Items.findOne(itemId);

View File

@@ -1,10 +0,0 @@
magicSchools = [
"Abjuration",
"Conjuration",
"Divination",
"Enchantment",
"Evocation",
"Illusion",
"Necromancy",
"Transmutation",
];

21
app/package-lock.json generated
View File

@@ -36,6 +36,7 @@
},
"ansi-regex": {
"version": "2.1.1",
"resolved": false,
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
},
"aproba": {
@@ -105,6 +106,7 @@
},
"block-stream": {
"version": "0.0.9",
"resolved": false,
"integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=",
"requires": {
"inherits": "~2.0.0"
@@ -174,6 +176,7 @@
},
"code-point-at": {
"version": "1.1.0",
"resolved": false,
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
},
"combined-stream": {
@@ -419,6 +422,7 @@
},
"graceful-fs": {
"version": "4.1.11",
"resolved": false,
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg="
},
"har-schema": {
@@ -466,6 +470,7 @@
},
"inherits": {
"version": "2.0.3",
"resolved": false,
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"ini": {
@@ -493,6 +498,7 @@
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": false,
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"requires": {
"number-is-nan": "^1.0.0"
@@ -1300,6 +1306,11 @@
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
"integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI="
},
"process-nextick-args": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
},
"public-encrypt": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz",
@@ -1527,6 +1538,11 @@
"inherits": "2.0.1"
}
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"vm-browserify": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
@@ -1664,6 +1680,7 @@
},
"number-is-nan": {
"version": "1.0.1",
"resolved": false,
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
},
"oauth-sign": {
@@ -1842,6 +1859,7 @@
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": false,
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
}
}
@@ -1946,6 +1964,7 @@
},
"set-blocking": {
"version": "2.0.0",
"resolved": false,
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
},
"shebang-command": {
@@ -1963,6 +1982,7 @@
},
"signal-exit": {
"version": "3.0.2",
"resolved": false,
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
},
"simpl-schema": {
@@ -2064,6 +2084,7 @@
},
"strip-ansi": {
"version": "3.0.1",
"resolved": false,
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"requires": {
"ansi-regex": "^2.0.0"

View File

@@ -13,7 +13,7 @@
"test": "meteor test --driver-package meteortesting:mocha"
},
"dependencies": {
"@babel/runtime": "7.0.0-beta.55",
"@babel/runtime": "^7.0.0-beta.55",
"animejs": "^2.2.0",
"bcrypt": "^1.0.3",
"bower": "^1.7.9",

View File

@@ -9,8 +9,8 @@ import Notes from "/imports/api/creature/Notes.js";
import Proficiencies from "/imports/api/creature/Proficiencies.js";
import SpellLists from "/imports/api/creature/SpellLists.js";
import Spells from "/imports/api/creature/Spells.js";
import Containers from "/imports/api/creature/Containers.js";
import Items from "/imports/api/creature/Items.js";
import Containers from "/imports/api/inventory/Containers.js";
import Items from "/imports/api/inventory/Items.js";
Meteor.startup(() => {
const collections = [