mirror of
https://github.com/wekan/wekan.git
synced 2026-02-20 23:14:07 +01:00
Update ReactiveCache call sites to use async/await for Meteor 3.0
Part 3 of ReactiveCache async migration: - Add await before all ReactiveCache.getX() calls - Make functions containing ReactiveCache calls async - Convert forEach/map/filter loops with async callbacks to for...of - Update model helpers, Meteor methods, JsonRoutes handlers - Update collection hooks (.before/.after insert/update/remove) - Update .allow() callbacks to async Files updated across models/ and server/ directories: - Model files: cards, boards, lists, swimlanes, activities, users, checklists, checklistItems, customFields, attachments, integrations, cardComments, settings files, creators, exporters, and more - Server files: publications, methods, notifications, routes, migrations
This commit is contained in:
parent
2f6e34c5f5
commit
71eb01e233
81 changed files with 2218 additions and 2148 deletions
|
|
@ -247,7 +247,7 @@ export class CsvCreator {
|
|||
this.swimlane = swimlaneId;
|
||||
}
|
||||
|
||||
createLists(csvData, boardId) {
|
||||
async createLists(csvData, boardId) {
|
||||
let numOfCreatedLists = 0;
|
||||
for (let i = 1; i < csvData.length; i++) {
|
||||
const listToCreate = {
|
||||
|
|
@ -256,7 +256,7 @@ export class CsvCreator {
|
|||
createdAt: this._now(),
|
||||
};
|
||||
if (csvData[i][this.fieldIndex.stage]) {
|
||||
const existingList = ReactiveCache.getLists({
|
||||
const existingList = await ReactiveCache.getLists({
|
||||
title: csvData[i][this.fieldIndex.stage],
|
||||
boardId,
|
||||
});
|
||||
|
|
@ -279,7 +279,7 @@ export class CsvCreator {
|
|||
}
|
||||
}
|
||||
|
||||
createCards(csvData, boardId) {
|
||||
async createCards(csvData, boardId) {
|
||||
for (let i = 1; i < csvData.length; i++) {
|
||||
const cardToCreate = {
|
||||
archived: false,
|
||||
|
|
@ -321,7 +321,7 @@ export class CsvCreator {
|
|||
}
|
||||
// add the labels
|
||||
if (csvData[i][this.fieldIndex.labels]) {
|
||||
const board = ReactiveCache.getBoard(boardId);
|
||||
const board = await ReactiveCache.getBoard(boardId);
|
||||
for (const importedLabel of csvData[i][this.fieldIndex.labels].split(
|
||||
' ',
|
||||
)) {
|
||||
|
|
@ -388,15 +388,15 @@ export class CsvCreator {
|
|||
Meteor.settings.public &&
|
||||
Meteor.settings.public.sandstorm;
|
||||
if (isSandstorm && currentBoardId) {
|
||||
const currentBoard = ReactiveCache.getBoard(currentBoardId);
|
||||
const currentBoard = await ReactiveCache.getBoard(currentBoardId);
|
||||
await currentBoard.archive();
|
||||
}
|
||||
this.mapHeadertoCardFieldIndex(board[0]);
|
||||
const boardId = this.createBoard(board);
|
||||
this.createLists(board, boardId);
|
||||
await this.createLists(board, boardId);
|
||||
this.createSwimlanes(boardId);
|
||||
this.createCustomFields(boardId);
|
||||
this.createCards(board, boardId);
|
||||
await this.createCards(board, boardId);
|
||||
return boardId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue