Fixed per-card and per-board settings of showing checkist at minicard.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2025-10-11 11:31:57 +03:00
parent ea24010298
commit fc32a89292
11 changed files with 102 additions and 2 deletions

View file

@ -695,6 +695,14 @@ template(name="cardDetailsActionsPopup")
a.js-set-card-color a.js-set-card-color
i.fa.fa-paint-brush i.fa.fa-paint-brush
| {{_ 'setCardColorPopup-title'}} | {{_ '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 hr
ul.pop-over-list ul.pop-over-list
li li

View file

@ -657,6 +657,10 @@ Template.cardDetailsActionsPopup.helpers({
isBoardAdmin() { isBoardAdmin() {
return ReactiveCache.getCurrentUser().isBoardAdmin(); return ReactiveCache.getCurrentUser().isBoardAdmin();
}, },
showListOnMinicard() {
return this.showListOnMinicard;
},
}); });
Template.cardDetailsActionsPopup.events({ Template.cardDetailsActionsPopup.events({
@ -702,6 +706,12 @@ Template.cardDetailsActionsPopup.events({
if (!err && ret) Popup.close(); 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({ BlazeComponent.extendComponent({

View file

@ -588,3 +588,18 @@
transform: scale(1.02); transform: scale(1.02);
transition: all 0.2s ease; 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;
}

View file

@ -72,6 +72,10 @@ template(name="minicard")
span.card-number span.card-number
| ##{getCardNumber} | ##{getCardNumber}
= getTitle = getTitle
if shouldShowListOnMinicard
.minicard-list-name
i.fa.fa-list
| {{ listName }}
if $eq 'subtext-with-full-path' currentBoard.presentParentTask if $eq 'subtext-with-full-path' currentBoard.presentParentTask
.parent-subtext .parent-subtext
| {{ parentString ' > ' }} | {{ parentString ' > ' }}

View file

@ -196,6 +196,17 @@ Template.minicard.helpers({
}, },
uploadCount() { uploadCount() {
return uploadProgressManager.getUploadCountForCard(this._id); 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;
} }
}); });

View file

@ -284,6 +284,12 @@ template(name="boardCardSettingsPopup")
span span
i.fa.fa-tags i.fa.fa-tags
| {{_ 'labels'}} | {{_ '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 div.check-div
a.flex.js-field-has-card-number(class="{{#if allowsCardNumber}}is-checked{{/if}}") a.flex.js-field-has-card-number(class="{{#if allowsCardNumber}}is-checked{{/if}}")
.materialCheckBox(class="{{#if allowsCardNumber}}is-checked{{/if}}") .materialCheckBox(class="{{#if allowsCardNumber}}is-checked{{/if}}")

View file

@ -996,10 +996,15 @@ BlazeComponent.extendComponent({
return this.currentBoard.allowsShowLists; return this.currentBoard.allowsShowLists;
}, },
allowsLabels() { allowsLabels() {
return this.currentBoard.allowsLabels; return this.currentBoard.allowsLabels;
}, },
allowsShowListsOnMinicard() {
return this.currentBoard.allowsShowListsOnMinicard;
},
allowsChecklists() { allowsChecklists() {
return this.currentBoard.allowsChecklists; return this.currentBoard.allowsChecklists;
}, },
@ -1282,13 +1287,29 @@ BlazeComponent.extendComponent({
this.currentBoard.setAllowsLabels(this.currentBoard.allowsLabels); this.currentBoard.setAllowsLabels(this.currentBoard.allowsLabels);
$(`.js-field-has-labels ${MCB}`).toggleClass( $(`.js-field-has-labels ${MCB}`).toggleClass(
CKCLS, CKCLS,
this.currentBoard.allowsAssignee, this.currentBoard.allowsLabels,
); );
$('.js-field-has-labels').toggleClass( $('.js-field-has-labels').toggleClass(
CKCLS, CKCLS,
this.currentBoard.allowsLabels, 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) { 'click .js-field-has-description-title'(evt) {
evt.preventDefault(); evt.preventDefault();
this.currentBoard.allowsDescriptionTitle = !this.currentBoard this.currentBoard.allowsDescriptionTitle = !this.currentBoard

View file

@ -83,5 +83,8 @@
"monitoring-export-failed": "Failed to export monitoring data", "monitoring-export-failed": "Failed to export monitoring data",
"filesystem-storage": "Filesystem", "filesystem-storage": "Filesystem",
"gridfs-storage": "GridFS", "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"
} }

View file

@ -512,6 +512,7 @@ Boards.attachSchema(
defaultValue: true, defaultValue: true,
}, },
allowsAssignedBy: { allowsAssignedBy: {
/** /**
* Does the board allows requested by? * Does the board allows requested by?
@ -519,6 +520,13 @@ Boards.attachSchema(
type: Boolean, type: Boolean,
defaultValue: true, defaultValue: true,
}, },
allowsShowListsOnMinicard: {
/**
* Does the board allow showing list names on all minicards?
*/
type: Boolean,
defaultValue: false,
},
allowsReceivedDate: { allowsReceivedDate: {
/** /**
@ -1464,6 +1472,10 @@ Boards.mutations({
return { $set: { allowsAssignedBy } }; return { $set: { allowsAssignedBy } };
}, },
setAllowsShowListsOnMinicard(allowsShowListsOnMinicard) {
return { $set: { allowsShowListsOnMinicard } };
},
setAllowsRequestedBy(allowsRequestedBy) { setAllowsRequestedBy(allowsRequestedBy) {
return { $set: { allowsRequestedBy } }; return { $set: { allowsRequestedBy } };
}, },
@ -1476,6 +1488,7 @@ Boards.mutations({
return { $set: { allowsShowLists } }; return { $set: { allowsShowLists } };
}, },
setAllowsAttachments(allowsAttachments) { setAllowsAttachments(allowsAttachments) {
return { $set: { allowsAttachments } }; return { $set: { allowsAttachments } };
}, },

View file

@ -484,6 +484,14 @@ Cards.attachSchema(
type: Boolean, type: Boolean,
optional: true, optional: true,
}, },
showListOnMinicard: {
/**
* show list name on minicard?
*/
type: Boolean,
optional: true,
defaultValue: false,
},
}), }),
); );

View file

@ -1141,6 +1141,7 @@ Migrations.add('add-description-text-allowed-on-minicard', () => {
); );
}); });
Migrations.add('add-sort-field-to-boards', () => { Migrations.add('add-sort-field-to-boards', () => {
Boards.find().forEach((board, index) => { Boards.find().forEach((board, index) => {
if (!board.hasOwnProperty('sort')) { if (!board.hasOwnProperty('sort')) {