feat: Colorize due date and make it toggleable (#845)

This commit is contained in:
Arkadiusz Dzięgiel
2024-08-12 18:29:50 +02:00
committed by GitHub
parent 198518a51a
commit c4c6d738a5
12 changed files with 207 additions and 38 deletions
+11 -1
View File
@@ -57,6 +57,9 @@ module.exports = {
type: 'string',
custom: dueDateValidator,
},
dueCompleted: {
type: 'boolean',
},
stopwatch: {
type: 'json',
custom: stopwatchValidator,
@@ -95,7 +98,14 @@ module.exports = {
throw Errors.NOT_ENOUGH_RIGHTS;
}
const values = _.pick(inputs, ['position', 'name', 'description', 'dueDate', 'stopwatch']);
const values = _.pick(inputs, [
'position',
'name',
'description',
'dueDate',
'dueCompleted',
'stopwatch',
]);
const card = await sails.helpers.cards.createOne
.with({
+4
View File
@@ -80,6 +80,9 @@ module.exports = {
custom: dueDateValidator,
allowNull: true,
},
dueCompleted: {
type: 'boolean',
},
stopwatch: {
type: 'json',
custom: stopwatchValidator,
@@ -173,6 +176,7 @@ module.exports = {
'name',
'description',
'dueDate',
'dueCompleted',
'stopwatch',
'isSubscribed',
]);
@@ -77,6 +77,7 @@ module.exports = {
'name',
'description',
'dueDate',
'dueCompleted',
'stopwatch',
]),
...values,
+5
View File
@@ -28,6 +28,11 @@ module.exports = {
type: 'ref',
columnName: 'due_date',
},
dueCompleted: {
type: 'boolean',
defaultsTo: false,
columnName: 'due_completed',
},
stopwatch: {
type: 'json',
},
@@ -0,0 +1,12 @@
module.exports.up = async (knex) =>
knex.schema.table('card', (table) => {
/* Columns */
table.boolean('due_completed').notNullable().defaultTo(false);
});
module.exports.down = async (knex) => {
await knex.schema.table('card', (table) => {
table.dropColumn('due_completed');
});
};