BoardAdmin and Admin can now set board background image URL.

Thanks to xet7 !

Related #486
This commit is contained in:
Lauri Ojansivu 2023-05-27 03:10:41 -04:00
parent 8b4193149b
commit 49ef80ab6c
6 changed files with 80 additions and 1 deletions

View file

@ -294,6 +294,13 @@ Boards.attachSchema(
}
},
},
backgroundImageURL: {
/**
* The background image URL of the board.
*/
type: String,
optional: true,
},
allowsCardCounterList: {
/**
* Show card counter per list
@ -1266,6 +1273,16 @@ Boards.mutations({
return { $set: { color } };
},
setBackgroundImageURL(backgroundImageURL) {
if(Meteor.user().isBoardAdmin()) {
return { $set: { backgroundImageURL } };
} else if (Meteor.user().isAdmin()) {
return { $set: { backgroundImageURL } };
} else {
return false;
}
},
setVisibility(visibility) {
return { $set: { permission: visibility } };
},
@ -1637,6 +1654,10 @@ if (Meteor.isServer) {
});
Meteor.methods({
getBackgroundImageURL(boardId) {
check(boardId, String);
return Boards.findOne({ boardId: boardId }, {}, { backgroundImageUrl: 1 });
},
quitBoard(boardId) {
check(boardId, String);
const board = Boards.findOne(boardId);