2019-08-31 04:07:25 +05:00
|
|
|
/**
|
|
|
|
* Label.js
|
|
|
|
*
|
|
|
|
* @description :: A model definition represents a database table/collection.
|
|
|
|
* @docs :: https://sailsjs.com/docs/concepts/models-and-orm/models
|
|
|
|
*/
|
|
|
|
|
|
|
|
const COLORS = [
|
2020-03-31 03:00:58 +05:00
|
|
|
'berry-red',
|
|
|
|
'pumpkin-orange',
|
|
|
|
'lagoon-blue',
|
|
|
|
'pink-tulip',
|
|
|
|
'light-mud',
|
|
|
|
'orange-peel',
|
|
|
|
'bright-moss',
|
|
|
|
'antique-blue',
|
|
|
|
'dark-granite',
|
|
|
|
'lagune-blue',
|
|
|
|
'sunny-grass',
|
|
|
|
'morning-sky',
|
|
|
|
'light-orange',
|
|
|
|
'midnight-blue',
|
|
|
|
'tank-green',
|
|
|
|
'gun-metal',
|
|
|
|
'wet-moss',
|
|
|
|
'red-burgundy',
|
|
|
|
'light-concrete',
|
|
|
|
'apricot-red',
|
|
|
|
'desert-sand',
|
|
|
|
'navy-blue',
|
|
|
|
'egg-yellow',
|
|
|
|
'coral-green',
|
|
|
|
'light-cocoa',
|
2019-08-31 04:07:25 +05:00
|
|
|
];
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
COLORS,
|
|
|
|
|
|
|
|
attributes: {
|
|
|
|
// ╔═╗╦═╗╦╔╦╗╦╔╦╗╦╦ ╦╔═╗╔═╗
|
|
|
|
// ╠═╝╠╦╝║║║║║ ║ ║╚╗╔╝║╣ ╚═╗
|
|
|
|
// ╩ ╩╚═╩╩ ╩╩ ╩ ╩ ╚╝ ╚═╝╚═╝
|
|
|
|
|
2023-01-09 12:17:06 +01:00
|
|
|
position: {
|
|
|
|
type: 'number',
|
|
|
|
required: true,
|
|
|
|
},
|
2019-08-31 04:07:25 +05:00
|
|
|
name: {
|
|
|
|
type: 'string',
|
2019-10-09 18:48:19 +05:00
|
|
|
isNotEmptyString: true,
|
2019-11-05 18:01:42 +05:00
|
|
|
allowNull: true,
|
2019-08-31 04:07:25 +05:00
|
|
|
},
|
|
|
|
color: {
|
|
|
|
type: 'string',
|
|
|
|
isIn: COLORS,
|
2019-11-05 18:01:42 +05:00
|
|
|
required: true,
|
2019-08-31 04:07:25 +05:00
|
|
|
},
|
|
|
|
|
|
|
|
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
|
|
|
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
|
|
|
|
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝
|
|
|
|
|
|
|
|
// ╔═╗╔═╗╔═╗╔═╗╔═╗╦╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
|
|
|
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
|
|
|
|
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
|
|
|
|
|
|
|
|
boardId: {
|
|
|
|
model: 'Board',
|
|
|
|
required: true,
|
2019-11-05 18:01:42 +05:00
|
|
|
columnName: 'board_id',
|
2019-08-31 04:07:25 +05:00
|
|
|
},
|
|
|
|
cards: {
|
|
|
|
collection: 'Card',
|
|
|
|
via: 'labelId',
|
2019-11-05 18:01:42 +05:00
|
|
|
through: 'CardLabel',
|
|
|
|
},
|
|
|
|
},
|
2019-08-31 04:07:25 +05:00
|
|
|
};
|