From 572aca59064b8dd60fdb7a2a60efd9d1d207e837 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Wed, 13 Mar 2019 09:40:20 +0200 Subject: [PATCH] Moved name to properties schema --- app/imports/api/creature/properties/Actions.js | 5 ----- app/imports/api/creature/properties/Attributes.js | 4 ---- app/imports/api/creature/properties/Buffs.js | 6 ------ app/imports/api/creature/properties/Classes.js | 6 +----- app/imports/api/creature/properties/Effects.js | 4 ---- app/imports/api/creature/properties/Experiences.js | 4 ---- app/imports/api/creature/properties/Features.js | 4 ---- app/imports/api/creature/properties/Folders.js | 6 +----- app/imports/api/creature/properties/Notes.js | 4 ---- app/imports/api/creature/properties/Proficiencies.js | 5 ----- app/imports/api/creature/properties/Skills.js | 4 ---- app/imports/api/creature/properties/SpellLists.js | 4 ---- app/imports/api/creature/properties/Spells.js | 5 ----- app/imports/api/creature/subSchemas/PropertySchema.js | 4 ++++ 14 files changed, 6 insertions(+), 59 deletions(-) diff --git a/app/imports/api/creature/properties/Actions.js b/app/imports/api/creature/properties/Actions.js index 8e0dd4e6..24355ea1 100644 --- a/app/imports/api/creature/properties/Actions.js +++ b/app/imports/api/creature/properties/Actions.js @@ -12,11 +12,6 @@ let Actions = new Mongo.Collection('actions'); * Actions are things a character can do */ let ActionSchema = schema({ - // Overrides the inherited name - name: { - type: String, - optional: true, - }, description: { type: String, optional: true, diff --git a/app/imports/api/creature/properties/Attributes.js b/app/imports/api/creature/properties/Attributes.js index e456ba65..d03da5fb 100644 --- a/app/imports/api/creature/properties/Attributes.js +++ b/app/imports/api/creature/properties/Attributes.js @@ -14,10 +14,6 @@ let Attributes = new Mongo.Collection('attributes'); * Attributes are numbered stats of a character */ let AttributeSchema = schema({ - // The nice-to-read name - name: { - type: String, - }, // The technical, lowercase, single-word name used in formulae variableName: { type: String, diff --git a/app/imports/api/creature/properties/Buffs.js b/app/imports/api/creature/properties/Buffs.js index f4942305..e9ec82ff 100644 --- a/app/imports/api/creature/properties/Buffs.js +++ b/app/imports/api/creature/properties/Buffs.js @@ -7,15 +7,9 @@ import { EffectSchema } from '/imports/api/creature/properties/Effects.js'; let Buffs = new Mongo.Collection('buffs'); let BuffSchema = new SimpleSchema({ - name: { - type: String, - optional: true, - trim: false, - }, description: { type: String, optional: true, - trim: false, }, duration: { type: SimpleSchema.Integer, diff --git a/app/imports/api/creature/properties/Classes.js b/app/imports/api/creature/properties/Classes.js index 4af97c2b..4f3718ad 100644 --- a/app/imports/api/creature/properties/Classes.js +++ b/app/imports/api/creature/properties/Classes.js @@ -5,11 +5,7 @@ import ColorSchema from "/imports/api/creature/subSchemas/ColorSchema.js"; let Classes = new Mongo.Collection("classes"); -let ClassSchema = schema({ - name: { - type: String, - }, -}); +let ClassSchema = schema({}); ClassSchema.extend(ColorSchema); diff --git a/app/imports/api/creature/properties/Effects.js b/app/imports/api/creature/properties/Effects.js index 2a2a4d8d..97349017 100644 --- a/app/imports/api/creature/properties/Effects.js +++ b/app/imports/api/creature/properties/Effects.js @@ -10,10 +10,6 @@ let Effects = new Mongo.Collection('effects'); * that modify their final value or presentation in some way */ let EffectSchema = schema({ - name: { - type: String, - optional: true, - }, operation: { type: String, defaultValue: 'add', diff --git a/app/imports/api/creature/properties/Experiences.js b/app/imports/api/creature/properties/Experiences.js index 2e5d83be..9e9a1ab5 100644 --- a/app/imports/api/creature/properties/Experiences.js +++ b/app/imports/api/creature/properties/Experiences.js @@ -5,10 +5,6 @@ import PropertySchema from '/imports/api/creature/subSchemas/PropertySchema.js'; let Experiences = new Mongo.Collection("experience"); let ExperienceSchema = schema({ - name: { - type: String, - optional: true, - }, // Potentially long description of the event description: { type: String, diff --git a/app/imports/api/creature/properties/Features.js b/app/imports/api/creature/properties/Features.js index f168b700..6565b5db 100644 --- a/app/imports/api/creature/properties/Features.js +++ b/app/imports/api/creature/properties/Features.js @@ -10,10 +10,6 @@ import ColorSchema from '/imports/api/creature/subSchemas/ColorSchema.js'; let Features = new Mongo.Collection('features'); let FeatureSchema = schema({ - name: { - type: String, - optional: true, - }, description: { type: String, optional: true, diff --git a/app/imports/api/creature/properties/Folders.js b/app/imports/api/creature/properties/Folders.js index d7510460..fb2c96ba 100644 --- a/app/imports/api/creature/properties/Folders.js +++ b/app/imports/api/creature/properties/Folders.js @@ -4,11 +4,7 @@ import ChildSchema from '/imports/api/parenting/ChildSchema.js'; let Folders = new Mongo.Collection('folders'); -let FolderSchema = schema({ - name: { - type: String, - }, -}); +let FolderSchema = schema({}); Folders.attachSchema(FolderSchema); Folders.attachSchema(PropertySchema); diff --git a/app/imports/api/creature/properties/Notes.js b/app/imports/api/creature/properties/Notes.js index 1d8a0872..313a222c 100644 --- a/app/imports/api/creature/properties/Notes.js +++ b/app/imports/api/creature/properties/Notes.js @@ -6,10 +6,6 @@ import PropertySchema from '/imports/api/creature/subSchemas/PropertySchema.js'; let Notes = new Mongo.Collection("notes"); let NoteSchema = schema({ - name: { - type: String, - optional: true, - }, description: { type: String, optional: true, diff --git a/app/imports/api/creature/properties/Proficiencies.js b/app/imports/api/creature/properties/Proficiencies.js index 66755029..a4cd577a 100644 --- a/app/imports/api/creature/properties/Proficiencies.js +++ b/app/imports/api/creature/properties/Proficiencies.js @@ -5,11 +5,6 @@ import ChildSchema from '/imports/api/parenting/ChildSchema.js'; let Proficiencies = new Mongo.Collection("proficiencies"); let ProficiencySchema = schema({ - name: { - type: String, - trim: false, - optional: true, - }, // A number representing how proficient the character is value: { type: Number, diff --git a/app/imports/api/creature/properties/Skills.js b/app/imports/api/creature/properties/Skills.js index 79ec7621..c47a7d8a 100644 --- a/app/imports/api/creature/properties/Skills.js +++ b/app/imports/api/creature/properties/Skills.js @@ -11,10 +11,6 @@ let Skills = new Mongo.Collection("skills"); * Skills have an ability score modifier that they use as their basis */ let SkillSchema = schema({ - // The nice-to-read name - name: { - type: String, - }, // The technical, lowercase, single-word name used in formulae variableName: { type: String, diff --git a/app/imports/api/creature/properties/SpellLists.js b/app/imports/api/creature/properties/SpellLists.js index e632e537..a7e2c354 100644 --- a/app/imports/api/creature/properties/SpellLists.js +++ b/app/imports/api/creature/properties/SpellLists.js @@ -6,10 +6,6 @@ import ChildSchema from '/imports/api/parenting/ChildSchema.js'; let SpellLists = new Mongo.Collection("spellLists"); let SpellListSchema = schema({ - name: { - type: String, - optional: true, - }, description: { type: String, optional: true, diff --git a/app/imports/api/creature/properties/Spells.js b/app/imports/api/creature/properties/Spells.js index 3f14c695..17987278 100644 --- a/app/imports/api/creature/properties/Spells.js +++ b/app/imports/api/creature/properties/Spells.js @@ -23,11 +23,6 @@ let SpellSchema = schema({ defaultValue: 'prepared', allowedValues: ['prepared', 'unprepared', 'always'], }, - name: { - type: String, - optional: true, - defaultValue: 'New Spell', - }, description: { type: String, optional: true, diff --git a/app/imports/api/creature/subSchemas/PropertySchema.js b/app/imports/api/creature/subSchemas/PropertySchema.js index b1830511..c1126787 100644 --- a/app/imports/api/creature/subSchemas/PropertySchema.js +++ b/app/imports/api/creature/subSchemas/PropertySchema.js @@ -12,6 +12,10 @@ const PropertySchema = new SimpleSchema({ type: Boolean, defaultValue: true, }, + name: { + type: String, + optional: true, + }, order: { type: SimpleSchema.Integer, index: true,