Pārlūkot izejas kodu

Use new colors constants

John R. Supplee 4 gadi atpakaļ
vecāks
revīzija
ed6c6e5a25
3 mainītis faili ar 8 papildinājumiem un 54 dzēšanām
  1. 2 2
      models/boards.js
  2. 3 26
      models/lists.js
  3. 3 26
      models/swimlanes.js

+ 2 - 2
models/boards.js

@@ -4,7 +4,7 @@ import {
   TYPE_BOARD,
   TYPE_BOARD,
   TYPE_TEMPLATE_BOARD,
   TYPE_TEMPLATE_BOARD,
   TYPE_TEMPLATE_CONTAINER,
   TYPE_TEMPLATE_CONTAINER,
-} from '../config/const';
+} from '/config/const';
 
 
 const escapeForRegex = require('escape-string-regexp');
 const escapeForRegex = require('escape-string-regexp');
 Boards = new Mongo.Collection('boards');
 Boards = new Mongo.Collection('boards');
@@ -1324,7 +1324,7 @@ Boards.colorMap = () => {
 };
 };
 
 
 Boards.labelColors = () => {
 Boards.labelColors = () => {
-  return _.clone(Boards.simpleSchema()._schema['labels.$.color'].allowedValues);
+  return ALLOWED_COLORS;
 };
 };
 
 
 if (Meteor.isServer) {
 if (Meteor.isServer) {

+ 3 - 26
models/lists.js

@@ -1,3 +1,5 @@
+import { ALLOWED_COLORS } from '/config/const';
+
 Lists = new Mongo.Collection('lists');
 Lists = new Mongo.Collection('lists');
 
 
 /**
 /**
@@ -144,32 +146,7 @@ Lists.attachSchema(
       type: String,
       type: String,
       optional: true,
       optional: true,
       // silver is the default, so it is left out
       // 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: {
     type: {
       /**
       /**

+ 3 - 26
models/swimlanes.js

@@ -1,3 +1,5 @@
+import { ALLOWED_COLORS } from '/config/const';
+
 Swimlanes = new Mongo.Collection('swimlanes');
 Swimlanes = new Mongo.Collection('swimlanes');
 
 
 /**
 /**
@@ -68,32 +70,7 @@ Swimlanes.attachSchema(
       type: String,
       type: String,
       optional: true,
       optional: true,
       // silver is the default, so it is left out
       // 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: {
     updatedAt: {
       /**
       /**