- {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,
- jsx-a11y/no-static-element-interactions */}
+ {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,
+ jsx-a11y/no-static-element-interactions */}
+
+
+
- {name}
+ {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,
+ jsx-a11y/no-static-element-interactions */}
+
+ {name}
+
{isPersisted && canEdit && (
)}
-
{cardsCountText()}
+
{cardsCountText()}
{
const selectCardIdsByListId = selectors.makeSelectCardIdsByListId();
return (state, { id, index }) => {
- const { name, isPersisted } = selectListById(state, id);
+ const { name, isPersisted, isCollapsed } = selectListById(state, id);
const { cardIds, cardIdsFull, isFiltered } = selectCardIdsByListId(state, id);
const currentUserMembership = selectors.selectCurrentUserMembershipForCurrentBoard(state);
@@ -22,6 +22,7 @@ const makeMapStateToProps = () => {
id,
index,
name,
+ isCollapsed,
isPersisted,
isFiltered,
cardIds,
diff --git a/client/src/models/List.js b/client/src/models/List.js
index 0e7e45e8..6f61416e 100755
--- a/client/src/models/List.js
+++ b/client/src/models/List.js
@@ -10,6 +10,7 @@ export default class extends BaseModel {
id: attr(),
position: attr(),
name: attr(),
+ isCollapsed: attr(),
boardId: fk({
to: 'Board',
as: 'board',
diff --git a/server/api/controllers/lists/create.js b/server/api/controllers/lists/create.js
index 9383f5be..49a9bce3 100755
--- a/server/api/controllers/lists/create.js
+++ b/server/api/controllers/lists/create.js
@@ -22,6 +22,10 @@ module.exports = {
type: 'string',
required: true,
},
+ isCollapsed: {
+ type: 'boolean',
+ required: true,
+ },
},
exits: {
@@ -53,7 +57,7 @@ module.exports = {
throw Errors.NOT_ENOUGH_RIGHTS;
}
- const values = _.pick(inputs, ['position', 'name']);
+ const values = _.pick(inputs, ['position', 'name', 'isCollapsed']);
const list = await sails.helpers.lists.createOne.with({
values: {
diff --git a/server/api/controllers/lists/update.js b/server/api/controllers/lists/update.js
index 2cb34e25..b6e1493c 100755
--- a/server/api/controllers/lists/update.js
+++ b/server/api/controllers/lists/update.js
@@ -21,6 +21,9 @@ module.exports = {
type: 'string',
isNotEmptyString: true,
},
+ isCollapsed: {
+ type: 'boolean',
+ },
},
exits: {
@@ -52,7 +55,7 @@ module.exports = {
throw Errors.NOT_ENOUGH_RIGHTS;
}
- const values = _.pick(inputs, ['position', 'name']);
+ const values = _.pick(inputs, ['position', 'name', 'isCollapsed']);
list = await sails.helpers.lists.updateOne.with({
values,
diff --git a/server/api/models/List.js b/server/api/models/List.js
index ce785b03..e2ee0ec4 100755
--- a/server/api/models/List.js
+++ b/server/api/models/List.js
@@ -19,6 +19,11 @@ module.exports = {
type: 'string',
required: true,
},
+ isCollapsed: {
+ type: 'boolean',
+ required: true,
+ columnName: 'is_collapsed',
+ },
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
diff --git a/server/db/migrations/20230112022500_add_list_isCollapsed.js b/server/db/migrations/20230112022500_add_list_isCollapsed.js
new file mode 100644
index 00000000..00b0a255
--- /dev/null
+++ b/server/db/migrations/20230112022500_add_list_isCollapsed.js
@@ -0,0 +1,9 @@
+module.exports.up = (knex) =>
+ knex.schema.alterTable('list', (table) => {
+ table.boolean('is_collapsed').notNullable().defaultTo(false);
+ });
+
+module.exports.down = (knex) =>
+ knex.schema.alterTable('list', (table) => {
+ table.dropColumn('is_collapsed');
+ });