mirror of
https://github.com/plankanban/planka.git
synced 2025-07-24 15:49:46 +02:00
Code formatting with prettier, change eslint config for the server
This commit is contained in:
parent
b7f37f0f96
commit
a11f6260c0
191 changed files with 4321 additions and 2880 deletions
|
@ -18,11 +18,11 @@ module.exports = {
|
|||
type: {
|
||||
type: 'string',
|
||||
isIn: TYPES,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
data: {
|
||||
type: 'json',
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
|
||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||
|
@ -36,12 +36,12 @@ module.exports = {
|
|||
cardId: {
|
||||
model: 'Card',
|
||||
required: true,
|
||||
columnName: 'card_id'
|
||||
columnName: 'card_id',
|
||||
},
|
||||
userId: {
|
||||
model: 'User',
|
||||
required: true,
|
||||
columnName: 'user_id'
|
||||
}
|
||||
}
|
||||
columnName: 'user_id',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -14,18 +14,18 @@ module.exports = {
|
|||
fromModel: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
columnName: 'from_model'
|
||||
columnName: 'from_model',
|
||||
},
|
||||
originalRecordId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
columnName: 'original_record_id'
|
||||
columnName: 'original_record_id',
|
||||
},
|
||||
originalRecord: {
|
||||
type: 'json',
|
||||
required: true,
|
||||
columnName: 'original_record'
|
||||
}
|
||||
columnName: 'original_record',
|
||||
},
|
||||
|
||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
|
||||
|
@ -36,5 +36,5 @@ module.exports = {
|
|||
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
},
|
||||
|
||||
archiveModelIdentity: false
|
||||
archiveModelIdentity: false,
|
||||
};
|
||||
|
|
|
@ -13,11 +13,11 @@ module.exports = {
|
|||
|
||||
position: {
|
||||
type: 'number',
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
|
||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||
|
@ -31,15 +31,15 @@ module.exports = {
|
|||
projectId: {
|
||||
model: 'Project',
|
||||
required: true,
|
||||
columnName: 'project_id'
|
||||
columnName: 'project_id',
|
||||
},
|
||||
lists: {
|
||||
collection: 'List',
|
||||
via: 'boardId'
|
||||
via: 'boardId',
|
||||
},
|
||||
labels: {
|
||||
collection: 'Label',
|
||||
via: 'boardId'
|
||||
}
|
||||
}
|
||||
via: 'boardId',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -13,23 +13,23 @@ module.exports = {
|
|||
|
||||
position: {
|
||||
type: 'number',
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
isNotEmptyString: true,
|
||||
allowNull: true
|
||||
allowNull: true,
|
||||
},
|
||||
dueDate: {
|
||||
type: 'ref',
|
||||
columnName: 'due_date'
|
||||
columnName: 'due_date',
|
||||
},
|
||||
timer: {
|
||||
type: 'json'
|
||||
type: 'json',
|
||||
},
|
||||
|
||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||
|
@ -43,31 +43,31 @@ module.exports = {
|
|||
listId: {
|
||||
model: 'List',
|
||||
required: true,
|
||||
columnName: 'list_id'
|
||||
columnName: 'list_id',
|
||||
},
|
||||
boardId: {
|
||||
model: 'Board',
|
||||
required: true,
|
||||
columnName: 'board_id'
|
||||
columnName: 'board_id',
|
||||
},
|
||||
subscriptionUsers: {
|
||||
collection: 'User',
|
||||
via: 'cardId',
|
||||
through: 'CardSubscription'
|
||||
through: 'CardSubscription',
|
||||
},
|
||||
membershipUsers: {
|
||||
collection: 'User',
|
||||
via: 'cardId',
|
||||
through: 'CardMembership'
|
||||
through: 'CardMembership',
|
||||
},
|
||||
labels: {
|
||||
collection: 'Label',
|
||||
via: 'cardId',
|
||||
through: 'CardLabel'
|
||||
through: 'CardLabel',
|
||||
},
|
||||
tasks: {
|
||||
collection: 'Task',
|
||||
via: 'cardId'
|
||||
}
|
||||
}
|
||||
via: 'cardId',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -22,14 +22,14 @@ module.exports = {
|
|||
cardId: {
|
||||
model: 'Card',
|
||||
required: true,
|
||||
columnName: 'card_id'
|
||||
columnName: 'card_id',
|
||||
},
|
||||
labelId: {
|
||||
model: 'Label',
|
||||
required: true,
|
||||
columnName: 'label_id'
|
||||
}
|
||||
columnName: 'label_id',
|
||||
},
|
||||
},
|
||||
|
||||
tableName: 'card_label'
|
||||
tableName: 'card_label',
|
||||
};
|
||||
|
|
|
@ -22,14 +22,14 @@ module.exports = {
|
|||
cardId: {
|
||||
model: 'Card',
|
||||
required: true,
|
||||
columnName: 'card_id'
|
||||
columnName: 'card_id',
|
||||
},
|
||||
userId: {
|
||||
model: 'User',
|
||||
required: true,
|
||||
columnName: 'user_id'
|
||||
}
|
||||
columnName: 'user_id',
|
||||
},
|
||||
},
|
||||
|
||||
tableName: 'card_membership'
|
||||
tableName: 'card_membership',
|
||||
};
|
||||
|
|
|
@ -14,7 +14,7 @@ module.exports = {
|
|||
isPermanent: {
|
||||
type: 'boolean',
|
||||
defaultsTo: true,
|
||||
columnName: 'is_permanent'
|
||||
columnName: 'is_permanent',
|
||||
},
|
||||
|
||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||
|
@ -28,14 +28,14 @@ module.exports = {
|
|||
cardId: {
|
||||
model: 'Card',
|
||||
required: true,
|
||||
columnName: 'card_id'
|
||||
columnName: 'card_id',
|
||||
},
|
||||
userId: {
|
||||
model: 'User',
|
||||
required: true,
|
||||
columnName: 'user_id'
|
||||
}
|
||||
columnName: 'user_id',
|
||||
},
|
||||
},
|
||||
|
||||
tableName: 'card_subscription'
|
||||
tableName: 'card_subscription',
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ const COLORS = [
|
|||
'sky',
|
||||
'lime',
|
||||
'pink',
|
||||
'black'
|
||||
'black',
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
|
@ -29,12 +29,12 @@ module.exports = {
|
|||
name: {
|
||||
type: 'string',
|
||||
isNotEmptyString: true,
|
||||
allowNull: true
|
||||
allowNull: true,
|
||||
},
|
||||
color: {
|
||||
type: 'string',
|
||||
isIn: COLORS,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
|
||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||
|
@ -48,12 +48,12 @@ module.exports = {
|
|||
boardId: {
|
||||
model: 'Board',
|
||||
required: true,
|
||||
columnName: 'board_id'
|
||||
columnName: 'board_id',
|
||||
},
|
||||
cards: {
|
||||
collection: 'Card',
|
||||
via: 'labelId',
|
||||
through: 'CardLabel'
|
||||
}
|
||||
}
|
||||
through: 'CardLabel',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -13,11 +13,11 @@ module.exports = {
|
|||
|
||||
position: {
|
||||
type: 'number',
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
|
||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||
|
@ -31,11 +31,11 @@ module.exports = {
|
|||
boardId: {
|
||||
model: 'Board',
|
||||
required: true,
|
||||
columnName: 'board_id'
|
||||
columnName: 'board_id',
|
||||
},
|
||||
cards: {
|
||||
collection: 'Card',
|
||||
via: 'listId'
|
||||
}
|
||||
}
|
||||
via: 'listId',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -14,7 +14,7 @@ module.exports = {
|
|||
isRead: {
|
||||
type: 'boolean',
|
||||
defaultsTo: false,
|
||||
columnName: 'is_read'
|
||||
columnName: 'is_read',
|
||||
},
|
||||
|
||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||
|
@ -28,17 +28,17 @@ module.exports = {
|
|||
userId: {
|
||||
model: 'User',
|
||||
required: true,
|
||||
columnName: 'user_id'
|
||||
columnName: 'user_id',
|
||||
},
|
||||
actionId: {
|
||||
model: 'Action',
|
||||
required: true,
|
||||
columnName: 'action_id'
|
||||
columnName: 'action_id',
|
||||
},
|
||||
cardId: {
|
||||
model: 'Card',
|
||||
required: true,
|
||||
columnName: 'card_id'
|
||||
}
|
||||
}
|
||||
columnName: 'card_id',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@ module.exports = {
|
|||
|
||||
name: {
|
||||
type: 'string',
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
|
||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||
|
@ -27,11 +27,11 @@ module.exports = {
|
|||
membershipUsers: {
|
||||
collection: 'User',
|
||||
via: 'projectId',
|
||||
through: 'ProjectMembership'
|
||||
through: 'ProjectMembership',
|
||||
},
|
||||
boards: {
|
||||
collection: 'Board',
|
||||
via: 'projectId'
|
||||
}
|
||||
}
|
||||
via: 'projectId',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -22,14 +22,14 @@ module.exports = {
|
|||
projectId: {
|
||||
model: 'Project',
|
||||
required: true,
|
||||
columnName: 'project_id'
|
||||
columnName: 'project_id',
|
||||
},
|
||||
userId: {
|
||||
model: 'User',
|
||||
required: true,
|
||||
columnName: 'user_id'
|
||||
}
|
||||
columnName: 'user_id',
|
||||
},
|
||||
},
|
||||
|
||||
tableName: 'project_membership'
|
||||
tableName: 'project_membership',
|
||||
};
|
||||
|
|
|
@ -13,12 +13,12 @@ module.exports = {
|
|||
|
||||
name: {
|
||||
type: 'string',
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
isCompleted: {
|
||||
type: 'boolean',
|
||||
defaultsTo: false,
|
||||
columnName: 'is_completed'
|
||||
columnName: 'is_completed',
|
||||
},
|
||||
|
||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||
|
@ -32,7 +32,7 @@ module.exports = {
|
|||
cardId: {
|
||||
model: 'Card',
|
||||
required: true,
|
||||
columnName: 'card_id'
|
||||
}
|
||||
}
|
||||
columnName: 'card_id',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -14,29 +14,29 @@ module.exports = {
|
|||
email: {
|
||||
type: 'string',
|
||||
isEmail: true,
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
password: {
|
||||
type: 'string',
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
isAdmin: {
|
||||
type: 'boolean',
|
||||
defaultsTo: false,
|
||||
columnName: 'is_admin'
|
||||
columnName: 'is_admin',
|
||||
},
|
||||
name: {
|
||||
type: 'string',
|
||||
required: true
|
||||
required: true,
|
||||
},
|
||||
avatar: {
|
||||
type: 'string',
|
||||
isNotEmptyString: true,
|
||||
allowNull: true
|
||||
allowNull: true,
|
||||
},
|
||||
deletedAt: {
|
||||
type: 'ref',
|
||||
columnName: 'deleted_at'
|
||||
columnName: 'deleted_at',
|
||||
},
|
||||
|
||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||
|
@ -50,24 +50,24 @@ module.exports = {
|
|||
membershipProjects: {
|
||||
collection: 'Project',
|
||||
via: 'userId',
|
||||
through: 'ProjectMembership'
|
||||
through: 'ProjectMembership',
|
||||
},
|
||||
subscriptionCards: {
|
||||
collection: 'Card',
|
||||
via: 'userId',
|
||||
through: 'CardSubscription'
|
||||
through: 'CardSubscription',
|
||||
},
|
||||
membershipCards: {
|
||||
collection: 'Card',
|
||||
via: 'userId',
|
||||
through: 'CardMembership'
|
||||
}
|
||||
through: 'CardMembership',
|
||||
},
|
||||
},
|
||||
|
||||
customToJSON: function() {
|
||||
customToJSON() {
|
||||
return {
|
||||
..._.omit(this, 'password'),
|
||||
avatar: this.avatar && `${sails.config.custom.uploadsUrl}/${this.avatar}`
|
||||
avatar: this.avatar && `${sails.config.custom.uploadsUrl}/${this.avatar}`,
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue