mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 12:49:43 +02:00
parent
d627a5660a
commit
22ec8707ac
35 changed files with 179 additions and 161 deletions
|
@ -14,7 +14,7 @@ const Errors = {
|
|||
|
||||
const dueDateValidator = (value) => moment(value, moment.ISO_8601, true).isValid();
|
||||
|
||||
const timerValidator = (value) => {
|
||||
const stopwatchValidator = (value) => {
|
||||
if (!_.isPlainObject(value) || _.size(value) !== 2) {
|
||||
return false;
|
||||
}
|
||||
|
@ -57,9 +57,9 @@ module.exports = {
|
|||
type: 'string',
|
||||
custom: dueDateValidator,
|
||||
},
|
||||
timer: {
|
||||
stopwatch: {
|
||||
type: 'json',
|
||||
custom: timerValidator,
|
||||
custom: stopwatchValidator,
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -95,7 +95,7 @@ module.exports = {
|
|||
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||
}
|
||||
|
||||
const values = _.pick(inputs, ['position', 'name', 'description', 'dueDate', 'timer']);
|
||||
const values = _.pick(inputs, ['position', 'name', 'description', 'dueDate', 'stopwatch']);
|
||||
|
||||
const card = await sails.helpers.cards.createOne
|
||||
.with({
|
||||
|
|
|
@ -23,7 +23,7 @@ const Errors = {
|
|||
|
||||
const dueDateValidator = (value) => moment(value, moment.ISO_8601, true).isValid();
|
||||
|
||||
const timerValidator = (value) => {
|
||||
const stopwatchValidator = (value) => {
|
||||
if (!_.isPlainObject(value) || _.size(value) !== 2) {
|
||||
return false;
|
||||
}
|
||||
|
@ -80,9 +80,9 @@ module.exports = {
|
|||
custom: dueDateValidator,
|
||||
allowNull: true,
|
||||
},
|
||||
timer: {
|
||||
stopwatch: {
|
||||
type: 'json',
|
||||
custom: timerValidator,
|
||||
custom: stopwatchValidator,
|
||||
},
|
||||
isSubscribed: {
|
||||
type: 'boolean',
|
||||
|
@ -171,7 +171,7 @@ module.exports = {
|
|||
'name',
|
||||
'description',
|
||||
'dueDate',
|
||||
'timer',
|
||||
'stopwatch',
|
||||
'isSubscribed',
|
||||
]);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ module.exports = {
|
|||
type: 'ref',
|
||||
columnName: 'due_date',
|
||||
},
|
||||
timer: {
|
||||
stopwatch: {
|
||||
type: 'json',
|
||||
},
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
module.exports.up = (knex) =>
|
||||
knex.schema.table('card', (table) => {
|
||||
table.renameColumn('timer', 'stopwatch');
|
||||
});
|
||||
|
||||
module.exports.down = (knex) =>
|
||||
knex.schema.table('card', (table) => {
|
||||
table.renameColumn('stopwatch', 'timer');
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue