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

@ -200,11 +200,7 @@ Meteor.publish('globalSearch', function(sessionId, queryParams) {
comments: [],
};
this.colorMap = {};
for (const color of Boards.simpleSchema()._schema['labels.$.color']
.allowedValues) {
this.colorMap[TAPi18n.__(`color-${color}`)] = color;
}
this.colorMap = Boards.colorMap();
}
hasErrors() {
@ -234,7 +230,11 @@ Meteor.publish('globalSearch', function(sessionId, queryParams) {
});
});
this.notFound.labels.forEach(label => {
messages.push({ tag: 'label-not-found', value: label, color: true });
messages.push({
tag: 'label-not-found',
value: label,
color: Boards.labelColors().includes(label),
});
});
this.notFound.users.forEach(user => {
messages.push({ tag: 'user-username-not-found', value: user });