Migration du client sur Typescript

This commit is contained in:
2020-04-30 13:02:56 +02:00
parent 676df834f7
commit 647c5c0806
41 changed files with 428 additions and 234 deletions

View File

@ -0,0 +1,11 @@
export function selectBoardByUserProjects(boardsByID: any, projectsByName: any) {
const userProjects = Object.keys(projectsByName);
return Object.keys(boardsByID).reduce((filteredBoardsByID: any, boardID: string) => {
const board = boardsByID[boardID];
const hasProject = board.projects.length === 0 || board.projects.some((p: any) => userProjects.indexOf(p) !== -1);
if (hasProject) {
filteredBoardsByID[boardID] = board;
}
return filteredBoardsByID;
}, {});
}