mirror of
https://github.com/wekan/wekan.git
synced 2025-04-24 05:57:13 -04:00
hide checklist-items per card now
- performance relevant - more granular setting
This commit is contained in:
parent
d949753d54
commit
9fa36c3991
7 changed files with 47 additions and 46 deletions
|
@ -549,7 +549,7 @@ template(name="cardDetails")
|
|||
.card-checklist-attachmentGallery.card-checklists
|
||||
if currentBoard.allowsChecklists
|
||||
hr
|
||||
+checklists(cardId = _id)
|
||||
+checklists(cardId = _id card = this)
|
||||
if currentBoard.allowsSubtasks
|
||||
hr
|
||||
+subtasks(cardId = _id)
|
||||
|
|
|
@ -376,6 +376,9 @@ BlazeComponent.extendComponent({
|
|||
'click #toggleShowActivitiesCard'() {
|
||||
this.data().toggleShowActivities();
|
||||
},
|
||||
'click #toggleHideCheckedChecklistItems'() {
|
||||
this.data().toggleHideCheckedChecklistItems();
|
||||
},
|
||||
'click #toggleCustomFieldsGridButton'() {
|
||||
Meteor.call('toggleCustomFieldsGrid');
|
||||
},
|
||||
|
|
|
@ -12,15 +12,15 @@ template(name="checklists")
|
|||
if currentUser.isBoardMember
|
||||
.material-toggle-switch(title="{{_ 'hide-checked-items'}}")
|
||||
//span.toggle-switch-title
|
||||
if hideCheckedItems
|
||||
input.toggle-switch(type="checkbox" id="toggleHideCheckedItemsButton" checked="checked")
|
||||
if card.hideCheckedChecklistItems
|
||||
input.toggle-switch(type="checkbox" id="toggleHideCheckedChecklistItems" checked="checked")
|
||||
else
|
||||
input.toggle-switch(type="checkbox" id="toggleHideCheckedItemsButton")
|
||||
label.toggle-label(for="toggleHideCheckedItemsButton")
|
||||
input.toggle-switch(type="checkbox" id="toggleHideCheckedChecklistItems")
|
||||
label.toggle-label(for="toggleHideCheckedChecklistItems")
|
||||
|
||||
.card-checklist-items
|
||||
each checklist in checklists
|
||||
+checklistDetail(checklist = checklist)
|
||||
+checklistDetail(checklist = checklist card = card)
|
||||
|
||||
if canModifyCard
|
||||
+inlinedForm(autoclose=false classNames="js-add-checklist" cardId = cardId)
|
||||
|
@ -55,7 +55,7 @@ template(name="checklistDetail")
|
|||
.checklist-progress-text {{finishedPercent}}%
|
||||
.checklist-progress-bar
|
||||
.checklist-progress(style="width:{{finishedPercent}}%")
|
||||
+checklistItems(checklist = checklist)
|
||||
+checklistItems(checklist = checklist card = card)
|
||||
|
||||
template(name="checklistDeletePopup")
|
||||
p {{_ 'confirm-checklist-delete-popup'}}
|
||||
|
@ -104,7 +104,7 @@ template(name="checklistItems")
|
|||
+inlinedForm(classNames="js-edit-checklist-item" item = item checklist = checklist)
|
||||
+editChecklistItemForm(type = 'item' item = item checklist = checklist)
|
||||
else
|
||||
+checklistItemDetail(item = item checklist = checklist)
|
||||
+checklistItemDetail(item = item checklist = checklist card = card)
|
||||
if canModifyCard
|
||||
+inlinedForm(autoclose=false classNames="js-add-checklist-item" checklist = checklist)
|
||||
+addChecklistItemForm(checklist=checklist showNewlineBecomesNewChecklistItem=true)
|
||||
|
@ -113,7 +113,7 @@ template(name="checklistItems")
|
|||
i.fa.fa-plus
|
||||
|
||||
template(name='checklistItemDetail')
|
||||
.js-checklist-item.checklist-item(class="{{#if item.isFinished }}is-checked{{#if hideCheckedItems}} invisible{{/if}}{{/if}}"
|
||||
.js-checklist-item.checklist-item(class="{{#if item.isFinished }}is-checked{{#if card.hideCheckedChecklistItems}} invisible{{/if}}{{/if}}"
|
||||
role="checkbox" aria-checked="{{#if item.isFinished }}true{{else}}false{{/if}}" tabindex="0")
|
||||
if canModifyCard
|
||||
.check-box-container
|
||||
|
|
|
@ -201,15 +201,8 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
events() {
|
||||
const events = {
|
||||
'click #toggleHideCheckedItemsButton'() {
|
||||
Meteor.call('toggleHideCheckedItems');
|
||||
},
|
||||
};
|
||||
|
||||
return [
|
||||
{
|
||||
...events,
|
||||
'click .js-open-checklist-details-menu': Popup.open('checklistActions'),
|
||||
'submit .js-add-checklist': this.addChecklist,
|
||||
'submit .js-edit-checklist-title': this.editChecklist,
|
||||
|
@ -274,10 +267,10 @@ Template.checklists.helpers({
|
|||
const ret = card.checklists();
|
||||
return ret;
|
||||
},
|
||||
hideCheckedItems() {
|
||||
const currentUser = ReactiveCache.getCurrentUser();
|
||||
if (currentUser) return currentUser.hasHideCheckedItems();
|
||||
return false;
|
||||
hideCheckedChecklistItems() {
|
||||
const card = ReactiveCache.getCard(this.cardId);
|
||||
const ret = card.hideCheckedChecklistItems ?? false;
|
||||
return ret;
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -338,11 +331,6 @@ BlazeComponent.extendComponent({
|
|||
}).register('editChecklistItemForm');
|
||||
|
||||
Template.checklistItemDetail.helpers({
|
||||
hideCheckedItems() {
|
||||
const user = ReactiveCache.getCurrentUser();
|
||||
if (user) return user.hasHideCheckedItems();
|
||||
return false;
|
||||
},
|
||||
});
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
|
|
|
@ -477,6 +477,13 @@ Cards.attachSchema(
|
|||
type: Boolean,
|
||||
defaultValue: false,
|
||||
},
|
||||
hideCheckedChecklistItems: {
|
||||
/**
|
||||
* hide the checked checklist-items?
|
||||
*/
|
||||
type: Boolean,
|
||||
optional: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
|
@ -2179,6 +2186,14 @@ Cards.mutations({
|
|||
};
|
||||
},
|
||||
|
||||
toggleHideCheckedChecklistItems() {
|
||||
return {
|
||||
$set: {
|
||||
hideCheckedChecklistItems: !this.hideCheckedChecklistItems,
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
setCustomField(customFieldId, value) {
|
||||
// todo
|
||||
const index = this.customFieldIndex(customFieldId);
|
||||
|
|
|
@ -172,13 +172,6 @@ Users.attachSchema(
|
|||
type: Boolean,
|
||||
optional: true,
|
||||
},
|
||||
'profile.hideCheckedItems': {
|
||||
/**
|
||||
* does the user want to hide checked checklist items?
|
||||
*/
|
||||
type: Boolean,
|
||||
optional: true,
|
||||
},
|
||||
'profile.cardMaximized': {
|
||||
/**
|
||||
* has user clicked maximize card?
|
||||
|
@ -853,11 +846,6 @@ Users.helpers({
|
|||
return profile.showDesktopDragHandles || false;
|
||||
},
|
||||
|
||||
hasHideCheckedItems() {
|
||||
const profile = this.profile || {};
|
||||
return profile.hideCheckedItems || false;
|
||||
},
|
||||
|
||||
hasCustomFieldsGrid() {
|
||||
const profile = this.profile || {};
|
||||
return profile.customFieldsGrid || false;
|
||||
|
@ -1048,15 +1036,6 @@ Users.mutations({
|
|||
};
|
||||
},
|
||||
|
||||
toggleHideCheckedItems() {
|
||||
const value = this.hasHideCheckedItems();
|
||||
return {
|
||||
$set: {
|
||||
'profile.hideCheckedItems': !value,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
toggleFieldsGrid(value = false) {
|
||||
return {
|
||||
$set: {
|
||||
|
|
|
@ -1473,3 +1473,19 @@ Migrations.add('remove-user-profile-hiddenSystemMessages', () => {
|
|||
noValidateMulti,
|
||||
);
|
||||
});
|
||||
|
||||
Migrations.add('remove-user-profile-hideCheckedItems', () => {
|
||||
Users.update(
|
||||
{
|
||||
"profile.hideCheckedItems": {
|
||||
$exists: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$unset: {
|
||||
"profile.hideCheckedItems": 1,
|
||||
},
|
||||
},
|
||||
noValidateMulti,
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue