mirror of
https://github.com/plankanban/planka.git
synced 2025-12-27 17:25:02 +03:00
feat: Add ability to hide completed tasks (#1210)
This commit is contained in:
@@ -33,6 +33,9 @@ module.exports = {
|
||||
showOnFrontOfCard: {
|
||||
type: 'boolean',
|
||||
},
|
||||
hideCompletedTasks: {
|
||||
type: 'boolean',
|
||||
},
|
||||
},
|
||||
|
||||
exits: {
|
||||
@@ -64,7 +67,7 @@ module.exports = {
|
||||
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||
}
|
||||
|
||||
const values = _.pick(inputs, ['position', 'name', 'showOnFrontOfCard']);
|
||||
const values = _.pick(inputs, ['position', 'name', 'showOnFrontOfCard', 'hideCompletedTasks']);
|
||||
|
||||
const taskList = await sails.helpers.taskLists.createOne.with({
|
||||
project,
|
||||
|
||||
@@ -32,6 +32,9 @@ module.exports = {
|
||||
showOnFrontOfCard: {
|
||||
type: 'boolean',
|
||||
},
|
||||
hideCompletedTasks: {
|
||||
type: 'boolean',
|
||||
},
|
||||
},
|
||||
|
||||
exits: {
|
||||
@@ -66,7 +69,7 @@ module.exports = {
|
||||
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||
}
|
||||
|
||||
const values = _.pick(inputs, ['position', 'name', 'showOnFrontOfCard']);
|
||||
const values = _.pick(inputs, ['position', 'name', 'showOnFrontOfCard', 'hideCompletedTasks']);
|
||||
|
||||
taskList = await sails.helpers.taskLists.updateOne.with({
|
||||
values,
|
||||
|
||||
@@ -138,7 +138,7 @@ module.exports = {
|
||||
nextTaskListIdByTaskListId[taskList.id] = id;
|
||||
|
||||
return {
|
||||
..._.pick(taskList, ['position', 'name', 'showOnFrontOfCard']),
|
||||
..._.pick(taskList, ['position', 'name', 'showOnFrontOfCard', 'hideCompletedTasks']),
|
||||
id,
|
||||
cardId: card.id,
|
||||
};
|
||||
|
||||
@@ -29,6 +29,11 @@ module.exports = {
|
||||
defaultsTo: true,
|
||||
columnName: 'show_on_front_of_card',
|
||||
},
|
||||
hideCompletedTasks: {
|
||||
type: 'boolean',
|
||||
defaultsTo: false,
|
||||
columnName: 'hide_completed_tasks',
|
||||
},
|
||||
|
||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/*!
|
||||
* Copyright (c) 2024 PLANKA Software GmbH
|
||||
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable('task_list', (table) => {
|
||||
/* Columns */
|
||||
|
||||
table.boolean('hide_completed_tasks').notNullable().defaultTo(false);
|
||||
});
|
||||
|
||||
return knex.schema.alterTable('task_list', (table) => {
|
||||
table.boolean('hide_completed_tasks').notNullable().alter();
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = (knex) =>
|
||||
knex.schema.table('task_list', (table) => {
|
||||
table.dropColumn('hide_completed_tasks');
|
||||
});
|
||||
Reference in New Issue
Block a user