mirror of
https://github.com/wekan/wekan.git
synced 2026-02-06 00:21:48 +01:00
commit
4f9b4059a6
5 changed files with 119 additions and 18 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue