added comment section on card details to avoid loading the card comment activities from the server

- and added to show only the activities a card

- to display the card comments a connection to the server was needed to get the activities of the card comments, now, it's not necessary
- also performance relevant. until now there were a lot of activities loaded, now only of the current card
This commit is contained in:
Martin Filser 2023-03-17 21:26:40 +01:00
parent 0196f46094
commit 8a446de3e9
21 changed files with 329 additions and 266 deletions

View file

@ -569,25 +569,34 @@ template(name="cardDetails")
+attachmentGallery
hr
unless currentUser.isNoComments
.comment-title
h3.card-details-item-title
i.fa.fa-comment-o
| {{_ 'comments'}}
if currentBoard.allowsComments
if currentUser.isBoardMember
unless currentUser.isNoComments
+commentForm
+comments
hr
.card-details-right
unless currentUser.isNoComments
.activity-title
h3.card-details-item-title
i.fa.fa-history
| {{ _ 'activity'}}
| {{ _ 'activities'}}
if currentUser.isBoardMember
.material-toggle-switch(title="{{_ 'hide-system-messages'}}")
//span.toggle-switch-title
if hiddenSystemMessages
input.toggle-switch(type="checkbox" id="toggleButton" checked="checked")
.material-toggle-switch(title="{{_ 'show-activities'}}")
if showActivities
input.toggle-switch(type="checkbox" id="toggleShowActivitiesCard" checked="checked")
else
input.toggle-switch(type="checkbox" id="toggleButton")
label.toggle-label(for="toggleButton")
if currentBoard.allowsComments
if currentUser.isBoardMember
unless currentUser.isNoComments
+commentForm
input.toggle-switch(type="checkbox" id="toggleShowActivitiesCard")
label.toggle-label(for="toggleShowActivitiesCard")
unless currentUser.isNoComments
if isLoaded.get
if isLinkedCard

View file

@ -63,10 +63,6 @@ BlazeComponent.extendComponent({
return card.findWatcher(Meteor.userId());
},
hiddenSystemMessages() {
return ReactiveCache.getCurrentUser().hasHiddenSystemMessages();
},
customFieldsGrid() {
return ReactiveCache.getCurrentUser().hasCustomFieldsGrid();
},
@ -377,8 +373,8 @@ BlazeComponent.extendComponent({
Session.set('cardDetailsIsDragging', false);
Session.set('cardDetailsIsMouseDown', false);
},
'click #toggleButton'() {
Meteor.call('toggleSystemMessages');
'click #toggleShowActivitiesCard'() {
this.data().toggleShowActivities();
},
'click #toggleCustomFieldsGridButton'() {
Meteor.call('toggleCustomFieldsGrid');