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

feat: Version 2

Closes #627, closes #1047
This commit is contained in:
Maksim Eltyshev 2025-05-10 02:09:06 +02:00
parent ad7fb51cfa
commit 2ee1166747
1557 changed files with 76832 additions and 47042 deletions

View file

@ -1,3 +1,8 @@
/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
/**
* Card.js
*
@ -5,15 +10,27 @@
* @docs :: https://sailsjs.com/docs/concepts/models-and-orm/models
*/
const Types = {
PROJECT: 'project',
STORY: 'story',
};
module.exports = {
Types,
attributes: {
// ╔═╗╦═╗╦╔╦╗╦╔╦╗╦╦ ╦╔═╗╔═╗
// ╠═╝╠╦╝║║║║║ ║ ║╚╗╔╝║╣ ╚═╗
// ╩ ╩╚═╩╩ ╩╩ ╩ ╩ ╚╝ ╚═╝╚═╝
type: {
type: 'string',
isIn: Object.values(Types),
required: true,
},
position: {
type: 'number',
required: true,
allowNull: true,
},
name: {
type: 'string',
@ -28,14 +45,13 @@ module.exports = {
type: 'ref',
columnName: 'due_date',
},
isDueDateCompleted: {
type: 'boolean',
allowNull: true,
columnName: 'is_due_date_completed',
},
stopwatch: {
type: 'json',
},
listChangedAt: {
type: 'ref',
columnName: 'list_changed_at',
},
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
@ -45,6 +61,7 @@ module.exports = {
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
// Denormalization
boardId: {
model: 'Board',
required: true,
@ -59,6 +76,10 @@ module.exports = {
model: 'User',
columnName: 'creator_user_id',
},
prevListId: {
model: 'List',
columnName: 'prev_list_id',
},
coverAttachmentId: {
model: 'Attachment',
columnName: 'cover_attachment_id',
@ -78,14 +99,18 @@ module.exports = {
via: 'cardId',
through: 'CardLabel',
},
tasks: {
collection: 'Task',
taskLists: {
collection: 'TaskList',
via: 'cardId',
},
attachments: {
collection: 'Attachment',
via: 'cardId',
},
comments: {
collection: 'Comment',
via: 'cardId',
},
actions: {
collection: 'Action',
via: 'cardId',