mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
fix: Fix styles, refactoring
This commit is contained in:
parent
c4c6d738a5
commit
545b3d711d
20 changed files with 229 additions and 202 deletions
|
@ -56,9 +56,11 @@ module.exports = {
|
|||
dueDate: {
|
||||
type: 'string',
|
||||
custom: dueDateValidator,
|
||||
allowNull: true,
|
||||
},
|
||||
dueCompleted: {
|
||||
isDueDateCompleted: {
|
||||
type: 'boolean',
|
||||
allowNull: true,
|
||||
},
|
||||
stopwatch: {
|
||||
type: 'json',
|
||||
|
@ -103,7 +105,7 @@ module.exports = {
|
|||
'name',
|
||||
'description',
|
||||
'dueDate',
|
||||
'dueCompleted',
|
||||
'isDueDateCompleted',
|
||||
'stopwatch',
|
||||
]);
|
||||
|
||||
|
|
|
@ -80,8 +80,9 @@ module.exports = {
|
|||
custom: dueDateValidator,
|
||||
allowNull: true,
|
||||
},
|
||||
dueCompleted: {
|
||||
isDueDateCompleted: {
|
||||
type: 'boolean',
|
||||
allowNull: true,
|
||||
},
|
||||
stopwatch: {
|
||||
type: 'json',
|
||||
|
@ -176,7 +177,7 @@ module.exports = {
|
|||
'name',
|
||||
'description',
|
||||
'dueDate',
|
||||
'dueCompleted',
|
||||
'isDueDateCompleted',
|
||||
'stopwatch',
|
||||
'isSubscribed',
|
||||
]);
|
||||
|
|
|
@ -49,6 +49,14 @@ module.exports = {
|
|||
throw 'positionMustBeInValues';
|
||||
}
|
||||
|
||||
if (values.dueDate) {
|
||||
if (_.isNil(values.isDueDateCompleted)) {
|
||||
values.isDueDateCompleted = false;
|
||||
}
|
||||
} else {
|
||||
delete values.isDueDateCompleted;
|
||||
}
|
||||
|
||||
const cards = await sails.helpers.lists.getCards(values.list.id);
|
||||
|
||||
const { position, repositions } = sails.helpers.utils.insertToPositionables(
|
||||
|
|
|
@ -77,7 +77,7 @@ module.exports = {
|
|||
'name',
|
||||
'description',
|
||||
'dueDate',
|
||||
'dueCompleted',
|
||||
'isDueDateCompleted',
|
||||
'stopwatch',
|
||||
]),
|
||||
...values,
|
||||
|
|
|
@ -135,6 +135,20 @@ module.exports = {
|
|||
});
|
||||
}
|
||||
|
||||
const dueDate = _.isUndefined(values.dueDate) ? inputs.record.dueDate : values.dueDate;
|
||||
|
||||
if (dueDate) {
|
||||
const isDueDateCompleted = _.isUndefined(values.isDueDateCompleted)
|
||||
? inputs.record.isDueDateCompleted
|
||||
: values.isDueDateCompleted;
|
||||
|
||||
if (_.isNull(isDueDateCompleted)) {
|
||||
values.isDueDateCompleted = false;
|
||||
}
|
||||
} else {
|
||||
values.isDueDateCompleted = null;
|
||||
}
|
||||
|
||||
let card;
|
||||
if (_.isEmpty(values)) {
|
||||
card = inputs.record;
|
||||
|
|
|
@ -28,10 +28,10 @@ module.exports = {
|
|||
type: 'ref',
|
||||
columnName: 'due_date',
|
||||
},
|
||||
dueCompleted: {
|
||||
isDueDateCompleted: {
|
||||
type: 'boolean',
|
||||
defaultsTo: false,
|
||||
columnName: 'due_completed',
|
||||
allowNull: true,
|
||||
columnName: 'is_due_date_completed',
|
||||
},
|
||||
stopwatch: {
|
||||
type: 'json',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue