Add list constraint support in set-width popup

This commit is contained in:
Nadav Tasher 2024-12-07 18:59:01 +02:00
parent fb34dd6114
commit efe50a65ee
3 changed files with 40 additions and 3 deletions

View file

@ -347,14 +347,20 @@ BlazeComponent.extendComponent({
.val(),
10,
);
const constraint = parseInt(
Template.instance()
.$('.list-constraint-value')
.val(),
10,
);
// FIXME(mark-i-m): where do we put constants?
if (width < 100 || !width) {
if (width < 100 || !width || constraint < 100 || !constraint) {
Template.instance()
.$('.list-width-error')
.click();
} else {
Meteor.call('applyListWidth', board, list._id, width);
Meteor.call('applyListWidth', board, list._id, width, constraint);
Popup.back();
}
},
@ -365,6 +371,12 @@ BlazeComponent.extendComponent({
return ReactiveCache.getCurrentUser().getListWidth(board, list._id);
},
listConstraintValue() {
const list = Template.currentData();
const board = list.boardId;
return ReactiveCache.getCurrentUser().getListConstraint(board, list._id);
},
events() {
return [
{