1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 12:49:43 +02:00

fix: Rename timer to stopwatch

Closes #392
This commit is contained in:
Maksim Eltyshev 2023-02-27 19:09:51 +01:00
parent d627a5660a
commit 22ec8707ac
35 changed files with 179 additions and 161 deletions

View file

@ -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({

View file

@ -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',
]);

View file

@ -28,7 +28,7 @@ module.exports = {
type: 'ref',
columnName: 'due_date',
},
timer: {
stopwatch: {
type: 'json',
},

View file

@ -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');
});