diff --git a/models/boards.js b/models/boards.js index b54957fb9..5ed06f4d1 100644 --- a/models/boards.js +++ b/models/boards.js @@ -4,7 +4,7 @@ import { TYPE_BOARD, TYPE_TEMPLATE_BOARD, TYPE_TEMPLATE_CONTAINER, -} from '../config/const'; +} from '/config/const'; const escapeForRegex = require('escape-string-regexp'); Boards = new Mongo.Collection('boards'); @@ -1324,7 +1324,7 @@ Boards.colorMap = () => { }; Boards.labelColors = () => { - return _.clone(Boards.simpleSchema()._schema['labels.$.color'].allowedValues); + return ALLOWED_COLORS; }; if (Meteor.isServer) { diff --git a/models/lists.js b/models/lists.js index 49cda140b..29f71eb01 100644 --- a/models/lists.js +++ b/models/lists.js @@ -1,3 +1,5 @@ +import { ALLOWED_COLORS } from '/config/const'; + Lists = new Mongo.Collection('lists'); /** @@ -144,32 +146,7 @@ Lists.attachSchema( type: String, optional: true, // silver is the default, so it is left out - allowedValues: [ - 'white', - 'green', - 'yellow', - 'orange', - 'red', - 'purple', - 'blue', - 'sky', - 'lime', - 'pink', - 'black', - 'peachpuff', - 'crimson', - 'plum', - 'darkgreen', - 'slateblue', - 'magenta', - 'gold', - 'navy', - 'gray', - 'saddlebrown', - 'paleturquoise', - 'mistyrose', - 'indigo', - ], + allowedValues: ALLOWED_COLORS, }, type: { /** diff --git a/models/swimlanes.js b/models/swimlanes.js index 8cb0c8e9c..1c803cdc9 100644 --- a/models/swimlanes.js +++ b/models/swimlanes.js @@ -1,3 +1,5 @@ +import { ALLOWED_COLORS } from '/config/const'; + Swimlanes = new Mongo.Collection('swimlanes'); /** @@ -68,32 +70,7 @@ Swimlanes.attachSchema( type: String, optional: true, // silver is the default, so it is left out - allowedValues: [ - 'white', - 'green', - 'yellow', - 'orange', - 'red', - 'purple', - 'blue', - 'sky', - 'lime', - 'pink', - 'black', - 'peachpuff', - 'crimson', - 'plum', - 'darkgreen', - 'slateblue', - 'magenta', - 'gold', - 'navy', - 'gray', - 'saddlebrown', - 'paleturquoise', - 'mistyrose', - 'indigo', - ], + allowedValues: ALLOWED_COLORS, }, updatedAt: { /**