Added reasonable storage limits to most string and array schemas

This commit is contained in:
Stefan Zermatten
2021-08-10 18:12:55 +02:00
parent 4c2155d8ff
commit e21586e9ce
45 changed files with 245 additions and 204 deletions

View File

@@ -1,21 +1,25 @@
import SimpleSchema from 'simpl-schema';
import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js';
import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js';
let ClassLevelSchema = new SimpleSchema({
name: {
type: String,
optional: true,
max: STORAGE_LIMITS.name,
},
// Only used by slot filling dialog, not computed
description: {
type: String,
optional: true,
max: STORAGE_LIMITS.description,
},
// The name of this class level's variable
variableName: {
type: String,
min: 2,
regEx: VARIABLE_NAME_REGEX,
max: STORAGE_LIMITS.variableName,
},
level: {
type: SimpleSchema.Integer,
@@ -32,6 +36,7 @@ let ClassLevelSchema = new SimpleSchema({
slotFillerCondition: {
type: String,
optional: true,
max: STORAGE_LIMITS.calculation,
},
});