Merge pull request #3597 from jrsupplee/search

Global Search Updates
This commit is contained in:
Lauri Ojansivu 2021-02-24 15:55:46 +02:00 committed by GitHub
commit 4f9b4059a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 119 additions and 18 deletions

View file

@ -1420,15 +1420,17 @@ if (Meteor.isServer) {
},
myLabelNames() {
let names = [];
Boards.userBoards(Meteor.userId()).forEach(board => {
names = names.concat(
board.labels
.filter(label => !!label.name)
.map(label => {
return label.name;
}),
);
});
Boards.userBoards(Meteor.userId(), false, { type: 'board' }).forEach(
board => {
names = names.concat(
board.labels
.filter(label => !!label.name)
.map(label => {
return label.name;
}),
);
},
);
return _.uniq(names).sort();
},
myBoardNames() {

View file

@ -134,7 +134,10 @@ SessionData.helpers({
SessionData.unpickle = pickle => {
return JSON.parse(pickle, (key, value) => {
if (typeof value === 'object') {
if (value === null) {
return null;
} else if (typeof value === 'object') {
// eslint-disable-next-line no-prototype-builtins
if (value.hasOwnProperty('$$class')) {
if (value.$$class === 'RegExp') {
return new RegExp(value.source, value.flags);
@ -147,7 +150,9 @@ SessionData.unpickle = pickle => {
SessionData.pickle = value => {
return JSON.stringify(value, (key, value) => {
if (typeof value === 'object') {
if (value === null) {
return null;
} else if (typeof value === 'object') {
if (value.constructor.name === 'RegExp') {
return {
$$class: 'RegExp',