From 99c72d1e109e041c854473c9f95ca461d86aa6c2 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Thu, 13 Jul 2017 10:39:43 +0200 Subject: [PATCH] Made names optional for all collections closes #92 --- rpg-docs/Model/Character/Actions.js | 2 ++ rpg-docs/Model/Character/Attacks.js | 1 + rpg-docs/Model/Character/Buffs.js | 1 + rpg-docs/Model/Character/Classes.js | 2 +- rpg-docs/Model/Character/Experience.js | 2 +- rpg-docs/Model/Character/Features.js | 2 +- rpg-docs/Model/Character/Notes.js | 2 +- rpg-docs/Model/Character/SpellLists.js | 2 +- rpg-docs/Model/Character/Spells.js | 1 + rpg-docs/Model/Inventory/Containers.js | 2 +- rpg-docs/Model/Inventory/Items.js | 2 +- 11 files changed, 12 insertions(+), 7 deletions(-) diff --git a/rpg-docs/Model/Character/Actions.js b/rpg-docs/Model/Character/Actions.js index a4e2e236..31caa805 100644 --- a/rpg-docs/Model/Character/Actions.js +++ b/rpg-docs/Model/Character/Actions.js @@ -11,10 +11,12 @@ Schemas.Action = new SimpleSchema({ }, name: { type: String, + optional: true, trim: false, }, description: { type: String, + optional: true, trim: false, }, type: { diff --git a/rpg-docs/Model/Character/Attacks.js b/rpg-docs/Model/Character/Attacks.js index 2450439a..4a2dcc72 100644 --- a/rpg-docs/Model/Character/Attacks.js +++ b/rpg-docs/Model/Character/Attacks.js @@ -12,6 +12,7 @@ Schemas.Attack = new SimpleSchema({ name: { type: String, defaultValue: "New Attack", + optional: true, trim: false, }, details: { diff --git a/rpg-docs/Model/Character/Buffs.js b/rpg-docs/Model/Character/Buffs.js index 3d8c41c5..b2a367c2 100644 --- a/rpg-docs/Model/Character/Buffs.js +++ b/rpg-docs/Model/Character/Buffs.js @@ -8,6 +8,7 @@ Schemas.Buff = new SimpleSchema({ }, name: { type: String, + optional: true, trim: false, }, description: { diff --git a/rpg-docs/Model/Character/Classes.js b/rpg-docs/Model/Character/Classes.js index ac036230..52e4df9e 100644 --- a/rpg-docs/Model/Character/Classes.js +++ b/rpg-docs/Model/Character/Classes.js @@ -2,7 +2,7 @@ Classes = new Mongo.Collection("classes"); Schemas.Class = new SimpleSchema({ charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, - name: {type: String, trim: false}, + name: {type: String, optional: true, trim: false}, level: {type: Number}, createdAt: { type: Date, diff --git a/rpg-docs/Model/Character/Experience.js b/rpg-docs/Model/Character/Experience.js index ff6d5932..4dc22b2a 100644 --- a/rpg-docs/Model/Character/Experience.js +++ b/rpg-docs/Model/Character/Experience.js @@ -2,7 +2,7 @@ Experiences = new Mongo.Collection("experience"); Schemas.Experience = new SimpleSchema({ charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, - name: {type: String, defaultValue: "New Experience", trim: false}, + name: {type: String, optional: true, trim: false, defaultValue: "New Experience"}, description: {type: String, optional: true, trim: false}, value: {type: Number, defaultValue: 0}, dateAdded: { diff --git a/rpg-docs/Model/Character/Features.js b/rpg-docs/Model/Character/Features.js index 29b8c7d5..468d6fe3 100644 --- a/rpg-docs/Model/Character/Features.js +++ b/rpg-docs/Model/Character/Features.js @@ -2,7 +2,7 @@ Features = new Mongo.Collection("features"); Schemas.Feature = new SimpleSchema({ charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, - name: {type: String, trim: false}, + name: {type: String, optional: true, trim: false}, description: {type: String, optional: true, trim: false}, uses: {type: String, optional: true, trim: false}, used: {type: Number, defaultValue: 0}, diff --git a/rpg-docs/Model/Character/Notes.js b/rpg-docs/Model/Character/Notes.js index 8d1afdf5..f1ce7aa4 100644 --- a/rpg-docs/Model/Character/Notes.js +++ b/rpg-docs/Model/Character/Notes.js @@ -2,7 +2,7 @@ Notes = new Mongo.Collection("notes"); Schemas.Note = new SimpleSchema({ charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, - name: {type: String, trim: false}, + name: {type: String, optional: true, trim: false}, description: {type: String, optional: true, trim: false}, color: { type: String, diff --git a/rpg-docs/Model/Character/SpellLists.js b/rpg-docs/Model/Character/SpellLists.js index 16aa2dab..982be871 100644 --- a/rpg-docs/Model/Character/SpellLists.js +++ b/rpg-docs/Model/Character/SpellLists.js @@ -2,7 +2,7 @@ SpellLists = new Mongo.Collection("spellLists"); Schemas.SpellLists = new SimpleSchema({ charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, - name: {type: String, trim: false}, + name: {type: String, optional: true, trim: false}, description: {type: String, optional: true, trim: false}, saveDC: {type: String, optional: true, trim: false}, attackBonus: {type: String, optional: true, trim: false}, diff --git a/rpg-docs/Model/Character/Spells.js b/rpg-docs/Model/Character/Spells.js index f04e2fa7..58f21cd2 100644 --- a/rpg-docs/Model/Character/Spells.js +++ b/rpg-docs/Model/Character/Spells.js @@ -9,6 +9,7 @@ Schemas.Spell = new SimpleSchema({ }, name: { type: String, + optional: true, trim: false, defaultValue: "New Spell", }, diff --git a/rpg-docs/Model/Inventory/Containers.js b/rpg-docs/Model/Inventory/Containers.js index 94761c58..2318c930 100644 --- a/rpg-docs/Model/Inventory/Containers.js +++ b/rpg-docs/Model/Inventory/Containers.js @@ -2,7 +2,7 @@ Containers = new Mongo.Collection("containers"); Schemas.Container = new SimpleSchema({ - name: {type: String, trim: false}, + name: {type: String, optional: true, trim: false}, charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, isCarried: {type: Boolean}, weight: {type: Number, min: 0, defaultValue: 0, decimal: true}, diff --git a/rpg-docs/Model/Inventory/Items.js b/rpg-docs/Model/Inventory/Items.js index c626c16f..6c5c00e1 100644 --- a/rpg-docs/Model/Inventory/Items.js +++ b/rpg-docs/Model/Inventory/Items.js @@ -1,7 +1,7 @@ Items = new Mongo.Collection("items"); Schemas.Item = new SimpleSchema({ - name: {type: String, defaultValue: "New Item", trim: false}, + name: {type: String, optional: true, trim: false, defaultValue: "New Item"}, plural: {type: String, optional: true, trim: false}, description:{type: String, optional: true, trim: false}, charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, //id of owner