diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade index b00582807..043eca308 100644 --- a/client/components/cards/cardDetails.jade +++ b/client/components/cards/cardDetails.jade @@ -695,6 +695,14 @@ template(name="cardDetailsActionsPopup") a.js-set-card-color i.fa.fa-paint-brush | {{_ 'setCardColorPopup-title'}} + li + a.js-toggle-show-list-on-minicard + if showListOnMinicard + i.fa.fa-eye + | {{_ 'hide-list-on-minicard'}} + else + i.fa.fa-eye-slash + | {{_ 'show-list-on-minicard'}} hr ul.pop-over-list li diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index d114fcd3b..b6e62c740 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -657,6 +657,10 @@ Template.cardDetailsActionsPopup.helpers({ isBoardAdmin() { return ReactiveCache.getCurrentUser().isBoardAdmin(); }, + + showListOnMinicard() { + return this.showListOnMinicard; + }, }); Template.cardDetailsActionsPopup.events({ @@ -702,6 +706,12 @@ Template.cardDetailsActionsPopup.events({ if (!err && ret) Popup.close(); }); }, + 'click .js-toggle-show-list-on-minicard'() { + const currentCard = this; + const newValue = !currentCard.showListOnMinicard; + Cards.update(currentCard._id, { $set: { showListOnMinicard: newValue } }); + Popup.close(); + }, }); BlazeComponent.extendComponent({ diff --git a/client/components/cards/minicard.css b/client/components/cards/minicard.css index cedc26527..11fe181ad 100644 --- a/client/components/cards/minicard.css +++ b/client/components/cards/minicard.css @@ -588,3 +588,18 @@ transform: scale(1.02); transition: all 0.2s ease; } + +/* List name display on minicard */ +.minicard-list-name { + font-size: 0.75em; + color: #8c8c8c; + margin-top: 0.2vh; + display: flex; + align-items: center; + gap: 0.3vw; +} + +.minicard-list-name i.fa { + font-size: 0.8em; + opacity: 0.7; +} diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade index df262e3be..5eefb6da1 100644 --- a/client/components/cards/minicard.jade +++ b/client/components/cards/minicard.jade @@ -72,6 +72,10 @@ template(name="minicard") span.card-number | ##{getCardNumber} = getTitle +if shouldShowListOnMinicard + .minicard-list-name + i.fa.fa-list + | {{ listName }} if $eq 'subtext-with-full-path' currentBoard.presentParentTask .parent-subtext | {{ parentString ' > ' }} diff --git a/client/components/cards/minicard.js b/client/components/cards/minicard.js index a95c41d83..54898e4b5 100644 --- a/client/components/cards/minicard.js +++ b/client/components/cards/minicard.js @@ -196,6 +196,17 @@ Template.minicard.helpers({ }, uploadCount() { return uploadProgressManager.getUploadCountForCard(this._id); + }, + listName() { + const list = this.list(); + return list ? list.title : ''; + }, + + shouldShowListOnMinicard() { + // Show list name if either: + // 1. Board-wide setting is enabled, OR + // 2. This specific card has the setting enabled + return this.currentBoard.allowsShowListsOnMinicard || this.showListOnMinicard; } }); diff --git a/client/components/sidebar/sidebar.jade b/client/components/sidebar/sidebar.jade index f648b69bb..96d4f818e 100644 --- a/client/components/sidebar/sidebar.jade +++ b/client/components/sidebar/sidebar.jade @@ -284,6 +284,12 @@ template(name="boardCardSettingsPopup") span i.fa.fa-tags | {{_ 'labels'}} + div.check-div + a.flex.js-field-has-card-show-lists-on-minicard(class="{{#if allowsShowListsOnMinicard}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsShowListsOnMinicard}}is-checked{{/if}}") + span + i.fa.fa-list + | {{_ 'card-show-lists-on-minicard'}} div.check-div a.flex.js-field-has-card-number(class="{{#if allowsCardNumber}}is-checked{{/if}}") .materialCheckBox(class="{{#if allowsCardNumber}}is-checked{{/if}}") diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js index e03fcac65..693007021 100644 --- a/client/components/sidebar/sidebar.js +++ b/client/components/sidebar/sidebar.js @@ -996,10 +996,15 @@ BlazeComponent.extendComponent({ return this.currentBoard.allowsShowLists; }, + allowsLabels() { return this.currentBoard.allowsLabels; }, + allowsShowListsOnMinicard() { + return this.currentBoard.allowsShowListsOnMinicard; + }, + allowsChecklists() { return this.currentBoard.allowsChecklists; }, @@ -1282,13 +1287,29 @@ BlazeComponent.extendComponent({ this.currentBoard.setAllowsLabels(this.currentBoard.allowsLabels); $(`.js-field-has-labels ${MCB}`).toggleClass( CKCLS, - this.currentBoard.allowsAssignee, + this.currentBoard.allowsLabels, ); $('.js-field-has-labels').toggleClass( CKCLS, this.currentBoard.allowsLabels, ); }, + 'click .js-field-has-card-show-lists-on-minicard'(evt) { + evt.preventDefault(); + this.currentBoard.allowsShowListsOnMinicard = !this.currentBoard + .allowsShowListsOnMinicard; + this.currentBoard.setAllowsShowListsOnMinicard( + this.currentBoard.allowsShowListsOnMinicard, + ); + $(`.js-field-has-card-show-lists-on-minicard ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsShowListsOnMinicard, + ); + $('.js-field-has-card-show-lists-on-minicard').toggleClass( + CKCLS, + this.currentBoard.allowsShowListsOnMinicard, + ); + }, 'click .js-field-has-description-title'(evt) { evt.preventDefault(); this.currentBoard.allowsDescriptionTitle = !this.currentBoard diff --git a/imports/i18n/en.i18n.json b/imports/i18n/en.i18n.json index 055212807..f54b3a327 100644 --- a/imports/i18n/en.i18n.json +++ b/imports/i18n/en.i18n.json @@ -83,5 +83,8 @@ "monitoring-export-failed": "Failed to export monitoring data", "filesystem-storage": "Filesystem", "gridfs-storage": "GridFS", - "s3-storage": "S3" + "s3-storage": "S3", + "card-show-lists-on-minicard": "Show Lists on Minicard", + "show-list-on-minicard": "Show List on Minicard", + "hide-list-on-minicard": "Hide List on Minicard" } diff --git a/models/boards.js b/models/boards.js index 3329b7747..55a97c297 100644 --- a/models/boards.js +++ b/models/boards.js @@ -512,6 +512,7 @@ Boards.attachSchema( defaultValue: true, }, + allowsAssignedBy: { /** * Does the board allows requested by? @@ -519,6 +520,13 @@ Boards.attachSchema( type: Boolean, defaultValue: true, }, + allowsShowListsOnMinicard: { + /** + * Does the board allow showing list names on all minicards? + */ + type: Boolean, + defaultValue: false, + }, allowsReceivedDate: { /** @@ -1464,6 +1472,10 @@ Boards.mutations({ return { $set: { allowsAssignedBy } }; }, + setAllowsShowListsOnMinicard(allowsShowListsOnMinicard) { + return { $set: { allowsShowListsOnMinicard } }; + }, + setAllowsRequestedBy(allowsRequestedBy) { return { $set: { allowsRequestedBy } }; }, @@ -1476,6 +1488,7 @@ Boards.mutations({ return { $set: { allowsShowLists } }; }, + setAllowsAttachments(allowsAttachments) { return { $set: { allowsAttachments } }; }, diff --git a/models/cards.js b/models/cards.js index 4374576b6..7dca82b66 100644 --- a/models/cards.js +++ b/models/cards.js @@ -484,6 +484,14 @@ Cards.attachSchema( type: Boolean, optional: true, }, + showListOnMinicard: { + /** + * show list name on minicard? + */ + type: Boolean, + optional: true, + defaultValue: false, + }, }), ); diff --git a/server/migrations.js b/server/migrations.js index ee6ba687f..8367f2562 100644 --- a/server/migrations.js +++ b/server/migrations.js @@ -1141,6 +1141,7 @@ Migrations.add('add-description-text-allowed-on-minicard', () => { ); }); + Migrations.add('add-sort-field-to-boards', () => { Boards.find().forEach((board, index) => { if (!board.hasOwnProperty('sort')) {