mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01: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
|
.card-checklist-attachmentGallery.card-checklists
|
||||||
if currentBoard.allowsChecklists
|
if currentBoard.allowsChecklists
|
||||||
hr
|
hr
|
||||||
+checklists(cardId = _id)
|
+checklists(cardId = _id card = this)
|
||||||
if currentBoard.allowsSubtasks
|
if currentBoard.allowsSubtasks
|
||||||
hr
|
hr
|
||||||
+subtasks(cardId = _id)
|
+subtasks(cardId = _id)
|
||||||
|
|
|
||||||
|
|
@ -376,6 +376,9 @@ BlazeComponent.extendComponent({
|
||||||
'click #toggleShowActivitiesCard'() {
|
'click #toggleShowActivitiesCard'() {
|
||||||
this.data().toggleShowActivities();
|
this.data().toggleShowActivities();
|
||||||
},
|
},
|
||||||
|
'click #toggleHideCheckedChecklistItems'() {
|
||||||
|
this.data().toggleHideCheckedChecklistItems();
|
||||||
|
},
|
||||||
'click #toggleCustomFieldsGridButton'() {
|
'click #toggleCustomFieldsGridButton'() {
|
||||||
Meteor.call('toggleCustomFieldsGrid');
|
Meteor.call('toggleCustomFieldsGrid');
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -12,15 +12,15 @@ template(name="checklists")
|
||||||
if currentUser.isBoardMember
|
if currentUser.isBoardMember
|
||||||
.material-toggle-switch(title="{{_ 'hide-checked-items'}}")
|
.material-toggle-switch(title="{{_ 'hide-checked-items'}}")
|
||||||
//span.toggle-switch-title
|
//span.toggle-switch-title
|
||||||
if hideCheckedItems
|
if card.hideCheckedChecklistItems
|
||||||
input.toggle-switch(type="checkbox" id="toggleHideCheckedItemsButton" checked="checked")
|
input.toggle-switch(type="checkbox" id="toggleHideCheckedChecklistItems" checked="checked")
|
||||||
else
|
else
|
||||||
input.toggle-switch(type="checkbox" id="toggleHideCheckedItemsButton")
|
input.toggle-switch(type="checkbox" id="toggleHideCheckedChecklistItems")
|
||||||
label.toggle-label(for="toggleHideCheckedItemsButton")
|
label.toggle-label(for="toggleHideCheckedChecklistItems")
|
||||||
|
|
||||||
.card-checklist-items
|
.card-checklist-items
|
||||||
each checklist in checklists
|
each checklist in checklists
|
||||||
+checklistDetail(checklist = checklist)
|
+checklistDetail(checklist = checklist card = card)
|
||||||
|
|
||||||
if canModifyCard
|
if canModifyCard
|
||||||
+inlinedForm(autoclose=false classNames="js-add-checklist" cardId = cardId)
|
+inlinedForm(autoclose=false classNames="js-add-checklist" cardId = cardId)
|
||||||
|
|
@ -55,7 +55,7 @@ template(name="checklistDetail")
|
||||||
.checklist-progress-text {{finishedPercent}}%
|
.checklist-progress-text {{finishedPercent}}%
|
||||||
.checklist-progress-bar
|
.checklist-progress-bar
|
||||||
.checklist-progress(style="width:{{finishedPercent}}%")
|
.checklist-progress(style="width:{{finishedPercent}}%")
|
||||||
+checklistItems(checklist = checklist)
|
+checklistItems(checklist = checklist card = card)
|
||||||
|
|
||||||
template(name="checklistDeletePopup")
|
template(name="checklistDeletePopup")
|
||||||
p {{_ 'confirm-checklist-delete-popup'}}
|
p {{_ 'confirm-checklist-delete-popup'}}
|
||||||
|
|
@ -104,7 +104,7 @@ template(name="checklistItems")
|
||||||
+inlinedForm(classNames="js-edit-checklist-item" item = item checklist = checklist)
|
+inlinedForm(classNames="js-edit-checklist-item" item = item checklist = checklist)
|
||||||
+editChecklistItemForm(type = 'item' item = item checklist = checklist)
|
+editChecklistItemForm(type = 'item' item = item checklist = checklist)
|
||||||
else
|
else
|
||||||
+checklistItemDetail(item = item checklist = checklist)
|
+checklistItemDetail(item = item checklist = checklist card = card)
|
||||||
if canModifyCard
|
if canModifyCard
|
||||||
+inlinedForm(autoclose=false classNames="js-add-checklist-item" checklist = checklist)
|
+inlinedForm(autoclose=false classNames="js-add-checklist-item" checklist = checklist)
|
||||||
+addChecklistItemForm(checklist=checklist showNewlineBecomesNewChecklistItem=true)
|
+addChecklistItemForm(checklist=checklist showNewlineBecomesNewChecklistItem=true)
|
||||||
|
|
@ -113,7 +113,7 @@ template(name="checklistItems")
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
template(name='checklistItemDetail')
|
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")
|
role="checkbox" aria-checked="{{#if item.isFinished }}true{{else}}false{{/if}}" tabindex="0")
|
||||||
if canModifyCard
|
if canModifyCard
|
||||||
.check-box-container
|
.check-box-container
|
||||||
|
|
|
||||||
|
|
@ -201,15 +201,8 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
const events = {
|
|
||||||
'click #toggleHideCheckedItemsButton'() {
|
|
||||||
Meteor.call('toggleHideCheckedItems');
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
...events,
|
|
||||||
'click .js-open-checklist-details-menu': Popup.open('checklistActions'),
|
'click .js-open-checklist-details-menu': Popup.open('checklistActions'),
|
||||||
'submit .js-add-checklist': this.addChecklist,
|
'submit .js-add-checklist': this.addChecklist,
|
||||||
'submit .js-edit-checklist-title': this.editChecklist,
|
'submit .js-edit-checklist-title': this.editChecklist,
|
||||||
|
|
@ -274,10 +267,10 @@ Template.checklists.helpers({
|
||||||
const ret = card.checklists();
|
const ret = card.checklists();
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
hideCheckedItems() {
|
hideCheckedChecklistItems() {
|
||||||
const currentUser = ReactiveCache.getCurrentUser();
|
const card = ReactiveCache.getCard(this.cardId);
|
||||||
if (currentUser) return currentUser.hasHideCheckedItems();
|
const ret = card.hideCheckedChecklistItems ?? false;
|
||||||
return false;
|
return ret;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -338,11 +331,6 @@ BlazeComponent.extendComponent({
|
||||||
}).register('editChecklistItemForm');
|
}).register('editChecklistItemForm');
|
||||||
|
|
||||||
Template.checklistItemDetail.helpers({
|
Template.checklistItemDetail.helpers({
|
||||||
hideCheckedItems() {
|
|
||||||
const user = ReactiveCache.getCurrentUser();
|
|
||||||
if (user) return user.hasHideCheckedItems();
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
|
|
|
||||||
|
|
@ -477,6 +477,13 @@ Cards.attachSchema(
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
defaultValue: false,
|
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) {
|
setCustomField(customFieldId, value) {
|
||||||
// todo
|
// todo
|
||||||
const index = this.customFieldIndex(customFieldId);
|
const index = this.customFieldIndex(customFieldId);
|
||||||
|
|
|
||||||
|
|
@ -172,13 +172,6 @@ Users.attachSchema(
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
optional: true,
|
optional: true,
|
||||||
},
|
},
|
||||||
'profile.hideCheckedItems': {
|
|
||||||
/**
|
|
||||||
* does the user want to hide checked checklist items?
|
|
||||||
*/
|
|
||||||
type: Boolean,
|
|
||||||
optional: true,
|
|
||||||
},
|
|
||||||
'profile.cardMaximized': {
|
'profile.cardMaximized': {
|
||||||
/**
|
/**
|
||||||
* has user clicked maximize card?
|
* has user clicked maximize card?
|
||||||
|
|
@ -853,11 +846,6 @@ Users.helpers({
|
||||||
return profile.showDesktopDragHandles || false;
|
return profile.showDesktopDragHandles || false;
|
||||||
},
|
},
|
||||||
|
|
||||||
hasHideCheckedItems() {
|
|
||||||
const profile = this.profile || {};
|
|
||||||
return profile.hideCheckedItems || false;
|
|
||||||
},
|
|
||||||
|
|
||||||
hasCustomFieldsGrid() {
|
hasCustomFieldsGrid() {
|
||||||
const profile = this.profile || {};
|
const profile = this.profile || {};
|
||||||
return profile.customFieldsGrid || false;
|
return profile.customFieldsGrid || false;
|
||||||
|
|
@ -1048,15 +1036,6 @@ Users.mutations({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleHideCheckedItems() {
|
|
||||||
const value = this.hasHideCheckedItems();
|
|
||||||
return {
|
|
||||||
$set: {
|
|
||||||
'profile.hideCheckedItems': !value,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
toggleFieldsGrid(value = false) {
|
toggleFieldsGrid(value = false) {
|
||||||
return {
|
return {
|
||||||
$set: {
|
$set: {
|
||||||
|
|
|
||||||
|
|
@ -1473,3 +1473,19 @@ Migrations.add('remove-user-profile-hiddenSystemMessages', () => {
|
||||||
noValidateMulti,
|
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