Copy Checklist added to checklist action popup

Relates to: #4306
This commit is contained in:
Martin Filser 2022-01-30 12:32:52 +01:00
parent 95ebf3bda8
commit 3a2b50720e
4 changed files with 133 additions and 28 deletions

View file

@ -254,7 +254,7 @@ Users.attachSchema(
},
'profile.moveChecklistDialog' : {
/**
* move and copy card dialog
* move checklist dialog
*/
type: Object,
optional: true,
@ -284,6 +284,38 @@ Users.attachSchema(
*/
type: String,
},
'profile.copyChecklistDialog' : {
/**
* copy checklist dialog
*/
type: Object,
optional: true,
blackbox: true,
},
'profile.copyChecklistDialog.$.boardId': {
/**
* last selected board id
*/
type: String,
},
'profile.copyChecklistDialog.$.swimlaneId': {
/**
* last selected swimlane id
*/
type: String,
},
'profile.copyChecklistDialog.$.listId': {
/**
* last selected list id
*/
type: String,
},
'profile.copyChecklistDialog.$.cardId': {
/**
* last selected card id
*/
type: String,
},
'profile.notifications': {
/**
* enabled notifications for the user
@ -696,6 +728,17 @@ Users.helpers({
return _ret;
},
/** returns all confirmed copy checklist dialog field values
* <li> the board, swimlane, list and card id is stored for each board
*/
getCopyChecklistDialogOptions() {
let _ret = {}
if (this.profile && this.profile.copyChecklistDialog) {
_ret = this.profile.copyChecklistDialog;
}
return _ret;
},
hasTag(tag) {
const { tags = [] } = this.profile || {};
return _.contains(tags, tag);
@ -824,7 +867,7 @@ Users.mutations({
},
};
},
/** set the confirmed board id/swimlane id/list id/card id of a board
/** set the confirmed board id/swimlane id/list id/card id of a board (move checklist)
* @param boardId the current board id
* @param options an object with the confirmed field values
*/
@ -837,6 +880,19 @@ Users.mutations({
},
};
},
/** set the confirmed board id/swimlane id/list id/card id of a board (copy checklist)
* @param boardId the current board id
* @param options an object with the confirmed field values
*/
setCopyChecklistDialogOption(boardId, options) {
let currentOptions = this.getCopyChecklistDialogOptions();
currentOptions[boardId] = options;
return {
$set: {
'profile.copyChecklistDialog': currentOptions,
},
};
},
toggleBoardStar(boardId) {
const queryKind = this.hasStarred(boardId) ? '$pull' : '$addToSet';
return {