1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00
planka/server/api/models/Label.js

79 lines
1.8 KiB
JavaScript
Raw Normal View History

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,
allowNull: true,
2019-08-31 04:07:25 +05:00
},
color: {
type: 'string',
isIn: COLORS,
required: true,
2019-08-31 04:07:25 +05:00
},
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝
// ╔═╗╔═╗╔═╗╔═╗╔═╗╦╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
boardId: {
model: 'Board',
required: true,
columnName: 'board_id',
2019-08-31 04:07:25 +05:00
},
cards: {
collection: 'Card',
via: 'labelId',
through: 'CardLabel',
},
},
2019-08-31 04:07:25 +05:00
};