Hopeful fix for i18n not working in onRendered()

* Remove the i18n initialization code from an `autorun()` block
* Add some console statements to help with debugging production.
* Add functions to `Boards` for label colors and color mapping
This commit is contained in:
John R. Supplee 2021-02-02 17:56:18 +02:00
parent 4fc2d7b935
commit e4f50d4713
4 changed files with 42 additions and 31 deletions

View file

@ -1318,6 +1318,18 @@ Boards.userBoardIds = (userId, archived = false, selector = {}) => {
});
};
Boards.colorMap = () => {
const colors = {};
for (const color of Boards.labelColors()) {
colors[TAPi18n.__(`color-${color}`)] = color;
}
return colors;
};
Boards.labelColors = () => {
return _.clone(Boards.simpleSchema()._schema['labels.$.color'].allowedValues);
};
if (Meteor.isServer) {
Boards.allow({
insert: Meteor.userId,