make swimlane height adjustable

This commit is contained in:
mark 2023-06-13 13:43:09 -05:00
parent 0ec9c4c37b
commit 26d2efdedb
8 changed files with 108 additions and 3 deletions

View file

@ -791,6 +791,19 @@ Users.helpers({
}
},
getSwimlaneHeights() {
const { swimlaneHeights = {} } = this.profile || {};
return swimlaneHeights;
},
getSwimlaneHeight(boardId, listId) {
const swimlaneHeights = this.getSwimlaneHeights();
if (swimlaneHeights[boardId] && swimlaneHeights[boardId][listId]) {
return swimlaneHeights[boardId][listId];
} else {
return 270; //TODO(mark-i-m): default?
}
},
/** returns all confirmed move and copy dialog field values
* <li> the board, swimlane and list id is stored for each board
*/
@ -1181,6 +1194,19 @@ Users.mutations({
},
};
},
setSwimlaneHeight(boardId, swimlaneId, height) {
let currentHeights = this.getSwimlaneHeights();
if (!currentHeights[boardId]) {
currentHeights[boardId] = {};
}
currentHeights[boardId][swimlaneId] = height;
return {
$set: {
'profile.swimlaneHeights': currentHeights,
},
};
},
});
Meteor.methods({
@ -1231,6 +1257,13 @@ Meteor.methods({
const user = Meteor.user();
user.setListWidth(boardId, listId, width);
},
applySwimlaneHeight(boardId, swimlaneId, height) {
check(boardId, String);
check(swimlaneId, String);
check(height, Number);
const user = Meteor.user();
user.setSwimlaneHeight(boardId, swimlaneId, height);
},
});
if (Meteor.isServer) {