2025-05-10 02:09:06 +02:00
|
|
|
/*!
|
|
|
|
|
* Copyright (c) 2024 PLANKA Software GmbH
|
|
|
|
|
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
|
|
|
|
*/
|
|
|
|
|
|
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
|
|
|
|
|
*/
|
|
|
|
|
|
2025-09-08 16:20:27 +02:00
|
|
|
/**
|
|
|
|
|
* @swagger
|
|
|
|
|
* components:
|
|
|
|
|
* schemas:
|
|
|
|
|
* Label:
|
|
|
|
|
* type: object
|
|
|
|
|
* required:
|
|
|
|
|
* - boardId
|
|
|
|
|
* - position
|
|
|
|
|
* - color
|
|
|
|
|
* properties:
|
|
|
|
|
* id:
|
|
|
|
|
* type: string
|
|
|
|
|
* description: Unique identifier for the label
|
|
|
|
|
* example: 1357158568008091264
|
|
|
|
|
* boardId:
|
|
|
|
|
* type: string
|
|
|
|
|
* description: ID of the board the label belongs to
|
|
|
|
|
* example: 1357158568008091265
|
|
|
|
|
* position:
|
|
|
|
|
* type: number
|
|
|
|
|
* description: Position of the label within the board
|
|
|
|
|
* example: 65536
|
|
|
|
|
* name:
|
|
|
|
|
* type: string
|
|
|
|
|
* nullable: true
|
|
|
|
|
* description: Name/title of the label
|
|
|
|
|
* example: Bug
|
|
|
|
|
* color:
|
|
|
|
|
* type: string
|
|
|
|
|
* enum: [muddy-grey, autumn-leafs, morning-sky, antique-blue, egg-yellow, desert-sand, dark-granite, fresh-salad, lagoon-blue, midnight-blue, light-orange, pumpkin-orange, light-concrete, sunny-grass, navy-blue, lilac-eyes, apricot-red, orange-peel, silver-glint, bright-moss, deep-ocean, summer-sky, berry-red, light-cocoa, grey-stone, tank-green, coral-green, sugar-plum, pink-tulip, shady-rust, wet-rock, wet-moss, turquoise-sea, lavender-fields, piggy-red, light-mud, gun-metal, modern-green, french-coast, sweet-lilac, red-burgundy, pirate-gold]
|
|
|
|
|
* description: Color of the label
|
|
|
|
|
* example: berry-red
|
|
|
|
|
* createdAt:
|
|
|
|
|
* type: string
|
|
|
|
|
* format: date-time
|
|
|
|
|
* nullable: true
|
|
|
|
|
* description: When the label was created
|
|
|
|
|
* example: 2024-01-01T00:00:00.000Z
|
|
|
|
|
* updatedAt:
|
|
|
|
|
* type: string
|
|
|
|
|
* format: date-time
|
|
|
|
|
* nullable: true
|
|
|
|
|
* description: When the label was last updated
|
|
|
|
|
* example: 2024-01-01T00:00:00.000Z
|
|
|
|
|
*/
|
|
|
|
|
|
2019-08-31 04:07:25 +05:00
|
|
|
const COLORS = [
|
2025-05-10 02:09:06 +02:00
|
|
|
'muddy-grey',
|
|
|
|
|
'autumn-leafs',
|
|
|
|
|
'morning-sky',
|
2020-03-31 03:00:58 +05:00
|
|
|
'antique-blue',
|
2025-05-10 02:09:06 +02:00
|
|
|
'egg-yellow',
|
|
|
|
|
'desert-sand',
|
2020-03-31 03:00:58 +05:00
|
|
|
'dark-granite',
|
2025-05-10 02:09:06 +02:00
|
|
|
'fresh-salad',
|
|
|
|
|
'lagoon-blue',
|
2020-03-31 03:00:58 +05:00
|
|
|
'midnight-blue',
|
2025-05-10 02:09:06 +02:00
|
|
|
'light-orange',
|
|
|
|
|
'pumpkin-orange',
|
2020-03-31 03:00:58 +05:00
|
|
|
'light-concrete',
|
2025-05-10 02:09:06 +02:00
|
|
|
'sunny-grass',
|
2020-03-31 03:00:58 +05:00
|
|
|
'navy-blue',
|
2025-05-10 02:09:06 +02:00
|
|
|
'lilac-eyes',
|
|
|
|
|
'apricot-red',
|
|
|
|
|
'orange-peel',
|
|
|
|
|
'silver-glint',
|
|
|
|
|
'bright-moss',
|
|
|
|
|
'deep-ocean',
|
|
|
|
|
'summer-sky',
|
|
|
|
|
'berry-red',
|
2020-03-31 03:00:58 +05:00
|
|
|
'light-cocoa',
|
2025-05-10 02:09:06 +02:00
|
|
|
'grey-stone',
|
|
|
|
|
'tank-green',
|
|
|
|
|
'coral-green',
|
|
|
|
|
'sugar-plum',
|
|
|
|
|
'pink-tulip',
|
|
|
|
|
'shady-rust',
|
|
|
|
|
'wet-rock',
|
|
|
|
|
'wet-moss',
|
|
|
|
|
'turquoise-sea',
|
|
|
|
|
'lavender-fields',
|
|
|
|
|
'piggy-red',
|
|
|
|
|
'light-mud',
|
|
|
|
|
'gun-metal',
|
|
|
|
|
'modern-green',
|
|
|
|
|
'french-coast',
|
|
|
|
|
'sweet-lilac',
|
|
|
|
|
'red-burgundy',
|
|
|
|
|
'pirate-gold',
|
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
|
|
|
};
|