mirror of
https://github.com/wekan/wekan.git
synced 2026-01-04 16:48:49 +01:00
Add list constraint support in set-width popup
This commit is contained in:
parent
fb34dd6114
commit
efe50a65ee
3 changed files with 40 additions and 3 deletions
|
|
@ -417,6 +417,15 @@ Users.attachSchema(
|
|||
defaultValue: {},
|
||||
blackbox: true,
|
||||
},
|
||||
'profile.listConstraints': {
|
||||
/**
|
||||
* User-specified constraint of each list (or nothing if default).
|
||||
* profile[boardId][listId] = constraint;
|
||||
*/
|
||||
type: Object,
|
||||
defaultValue: {},
|
||||
blackbox: true,
|
||||
},
|
||||
'profile.autoWidthBoards': {
|
||||
/**
|
||||
* User-specified flag for enabling auto-width for boards (false is the default).
|
||||
|
|
@ -1173,6 +1182,19 @@ Users.mutations({
|
|||
};
|
||||
},
|
||||
|
||||
setListConstraint(boardId, listId, constraint) {
|
||||
let currentConstraints = this.getListConstraints();
|
||||
if (!currentConstraints[boardId]) {
|
||||
currentConstraints[boardId] = {};
|
||||
}
|
||||
currentConstraints[boardId][listId] = constraint;
|
||||
return {
|
||||
$set: {
|
||||
'profile.listConstraints': currentConstraints,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
setSwimlaneHeight(boardId, swimlaneId, height) {
|
||||
let currentHeights = this.getSwimlaneHeights();
|
||||
if (!currentHeights[boardId]) {
|
||||
|
|
@ -1224,12 +1246,14 @@ Meteor.methods({
|
|||
check(startDay, Number);
|
||||
ReactiveCache.getCurrentUser().setStartDayOfWeek(startDay);
|
||||
},
|
||||
applyListWidth(boardId, listId, width) {
|
||||
applyListWidth(boardId, listId, width, constraint) {
|
||||
check(boardId, String);
|
||||
check(listId, String);
|
||||
check(width, Number);
|
||||
check(constraint, Number);
|
||||
const user = ReactiveCache.getCurrentUser();
|
||||
user.setListWidth(boardId, listId, width);
|
||||
user.setListConstraint(boardId, listId, constraint);
|
||||
},
|
||||
applySwimlaneHeight(boardId, swimlaneId, height) {
|
||||
check(boardId, String);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue