mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Add Feature: Card Settings/Show on card/Activities.
Fix: When in Card Settings hiding Comments, only adding new comment is hidden, not old comments. Thanks to xet7 ! Closes #2925
This commit is contained in:
parent
a58e6be78d
commit
2fce02afbc
6 changed files with 284 additions and 231 deletions
|
@ -8,6 +8,7 @@ template(name="activities")
|
|||
+cardActivities
|
||||
|
||||
template(name="boardActivities")
|
||||
if currentBoard.allowsActivities
|
||||
each currentBoard.activities
|
||||
.activity
|
||||
+userAvatar(userId=user._id)
|
||||
|
@ -132,6 +133,7 @@ template(name="boardActivities")
|
|||
span(title=createdAt).activity-meta {{ moment createdAt }}
|
||||
|
||||
template(name="cardActivities")
|
||||
if currentBoard.allowsComments
|
||||
each currentCard.activities
|
||||
.activity
|
||||
+userAvatar(userId=user._id)
|
||||
|
|
|
@ -261,6 +261,7 @@ template(name="cardDetails")
|
|||
if currentUser.isBoardMember
|
||||
unless currentUser.isNoComments
|
||||
+commentForm
|
||||
if currentBoard.allowsActivities
|
||||
unless currentUser.isNoComments
|
||||
if isLoaded.get
|
||||
if isLinkedCard
|
||||
|
|
|
@ -153,6 +153,12 @@ template(name="boardCardSettingsPopup")
|
|||
span
|
||||
i.fa.fa-comment-o
|
||||
| {{_ 'comment'}}
|
||||
div.check-div
|
||||
a.flex.js-field-has-comments(class="{{#if allowsActivities}}is-checked{{/if}}")
|
||||
.materialCheckBox(class="{{#if allowsActivities}}is-checked{{/if}}")
|
||||
span
|
||||
i.fa.fa-history
|
||||
| {{_ 'activities'}}
|
||||
|
||||
template(name="boardSubtaskSettingsPopup")
|
||||
form.board-subtask-settings
|
||||
|
|
|
@ -882,6 +882,22 @@ BlazeComponent.extendComponent({
|
|||
this.currentBoard.allowsComments,
|
||||
);
|
||||
},
|
||||
'click .js-field-has-activities'(evt) {
|
||||
evt.preventDefault();
|
||||
this.currentBoard.allowsActivities = !this.currentBoard
|
||||
.allowsActivities;
|
||||
this.currentBoard.setAllowsActivities(
|
||||
this.currentBoard.allowsActivities,
|
||||
);
|
||||
$(`.js-field-has-activities ${MCB}`).toggleClass(
|
||||
CKCLS,
|
||||
this.currentBoard.allowsActivities,
|
||||
);
|
||||
$('.js-field-has-activities').toggleClass(
|
||||
CKCLS,
|
||||
this.currentBoard.allowsActivities,
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
},
|
||||
|
|
|
@ -332,6 +332,14 @@ Boards.attachSchema(
|
|||
defaultValue: true,
|
||||
},
|
||||
|
||||
allowsActivities: {
|
||||
/**
|
||||
* Does the board allows comments?
|
||||
*/
|
||||
type: Boolean,
|
||||
defaultValue: true,
|
||||
},
|
||||
|
||||
allowsLabels: {
|
||||
/**
|
||||
* Does the board allows labels?
|
||||
|
@ -1119,6 +1127,10 @@ Boards.mutations({
|
|||
return { $set: { allowsComments } };
|
||||
},
|
||||
|
||||
setAllowsActivities(allowsActivities) {
|
||||
return { $set: { allowsActivities } };
|
||||
},
|
||||
|
||||
setAllowsReceivedDate(allowsReceivedDate) {
|
||||
return { $set: { allowsReceivedDate } };
|
||||
},
|
||||
|
|
|
@ -985,3 +985,19 @@ Migrations.add('add-requested-by-allowed', () => {
|
|||
noValidateMulti,
|
||||
);
|
||||
});
|
||||
|
||||
Migrations.add('add-activities-allowed', () => {
|
||||
Boards.update(
|
||||
{
|
||||
allowsActivities: {
|
||||
$exists: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
$set: {
|
||||
allowsActivities: true,
|
||||
},
|
||||
},
|
||||
noValidateMulti,
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue