mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 07:50:12 +01: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
|
+cardActivities
|
||||||
|
|
||||||
template(name="boardActivities")
|
template(name="boardActivities")
|
||||||
|
if currentBoard.allowsActivities
|
||||||
each currentBoard.activities
|
each currentBoard.activities
|
||||||
.activity
|
.activity
|
||||||
+userAvatar(userId=user._id)
|
+userAvatar(userId=user._id)
|
||||||
|
|
@ -132,6 +133,7 @@ template(name="boardActivities")
|
||||||
span(title=createdAt).activity-meta {{ moment createdAt }}
|
span(title=createdAt).activity-meta {{ moment createdAt }}
|
||||||
|
|
||||||
template(name="cardActivities")
|
template(name="cardActivities")
|
||||||
|
if currentBoard.allowsComments
|
||||||
each currentCard.activities
|
each currentCard.activities
|
||||||
.activity
|
.activity
|
||||||
+userAvatar(userId=user._id)
|
+userAvatar(userId=user._id)
|
||||||
|
|
|
||||||
|
|
@ -261,6 +261,7 @@ template(name="cardDetails")
|
||||||
if currentUser.isBoardMember
|
if currentUser.isBoardMember
|
||||||
unless currentUser.isNoComments
|
unless currentUser.isNoComments
|
||||||
+commentForm
|
+commentForm
|
||||||
|
if currentBoard.allowsActivities
|
||||||
unless currentUser.isNoComments
|
unless currentUser.isNoComments
|
||||||
if isLoaded.get
|
if isLoaded.get
|
||||||
if isLinkedCard
|
if isLinkedCard
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,12 @@ template(name="boardCardSettingsPopup")
|
||||||
span
|
span
|
||||||
i.fa.fa-comment-o
|
i.fa.fa-comment-o
|
||||||
| {{_ 'comment'}}
|
| {{_ '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")
|
template(name="boardSubtaskSettingsPopup")
|
||||||
form.board-subtask-settings
|
form.board-subtask-settings
|
||||||
|
|
|
||||||
|
|
@ -882,6 +882,22 @@ BlazeComponent.extendComponent({
|
||||||
this.currentBoard.allowsComments,
|
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,
|
defaultValue: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
allowsActivities: {
|
||||||
|
/**
|
||||||
|
* Does the board allows comments?
|
||||||
|
*/
|
||||||
|
type: Boolean,
|
||||||
|
defaultValue: true,
|
||||||
|
},
|
||||||
|
|
||||||
allowsLabels: {
|
allowsLabels: {
|
||||||
/**
|
/**
|
||||||
* Does the board allows labels?
|
* Does the board allows labels?
|
||||||
|
|
@ -1119,6 +1127,10 @@ Boards.mutations({
|
||||||
return { $set: { allowsComments } };
|
return { $set: { allowsComments } };
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setAllowsActivities(allowsActivities) {
|
||||||
|
return { $set: { allowsActivities } };
|
||||||
|
},
|
||||||
|
|
||||||
setAllowsReceivedDate(allowsReceivedDate) {
|
setAllowsReceivedDate(allowsReceivedDate) {
|
||||||
return { $set: { allowsReceivedDate } };
|
return { $set: { allowsReceivedDate } };
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -985,3 +985,19 @@ Migrations.add('add-requested-by-allowed', () => {
|
||||||
noValidateMulti,
|
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