Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Remove dead code now that creation is handled in backend

Oliver Güntherc6b7ec23802d
diff --git a/frontend/src/app/features/boards/board/board-actions/board-action.service.ts b/frontend/src/app/features/boards/board/board-actions/board-action.service.ts
index ba9f234bf20..ef1e4f0e361 100644
--- a/frontend/src/app/features/boards/board/board-actions/board-action.service.ts
+++ b/frontend/src/app/features/boards/board/board-actions/board-action.service.ts
@@ -118,15 +118,6 @@ export abstract class BoardActionService {
return this.require(id);
}
- /**
- * Add initial queries to a new board
- *
- * @param newBoard
- */
- addInitialColumnsForAction(newBoard:Board):Promise<Board> {
- return Promise.resolve(newBoard);
- }
-
/**
* Add a single action query
*/
diff --git a/frontend/src/app/features/boards/board/board-actions/status/status-action.service.ts b/frontend/src/app/features/boards/board/board-actions/status/status-action.service.ts
index 74a23c1f066..41eeb4beec5 100644
--- a/frontend/src/app/features/boards/board/board-actions/status/status-action.service.ts
+++ b/frontend/src/app/features/boards/board/board-actions/status/status-action.service.ts
@@ -29,22 +29,6 @@ export class BoardStatusActionService extends CachedBoardActionService {
return StatusBoardHeaderComponent;
}
- public addInitialColumnsForAction(board:Board):Promise<Board> {
- return this
- .loadValues()
- .toPromise()
- .then((results:StatusResource[]) => Promise.all<unknown>(
- results.map((status:StatusResource) => {
- if (status.isDefault) {
- return this.addColumnWithActionAttribute(board, status);
- }
-
- return Promise.resolve(board);
- }),
- )
- .then(() => board));
- }
-
public warningTextWhenNoOptionsAvailable():Promise<string> {
return Promise.resolve(this.I18n.t('js.boards.add_list_modal.warning.status'));
}
diff --git a/frontend/src/app/features/boards/board/board-actions/version/version-action.service.ts b/frontend/src/app/features/boards/board/board-actions/version/version-action.service.ts
index 49366173519..ab2f6a07e37 100644
--- a/frontend/src/app/features/boards/board/board-actions/version/version-action.service.ts
+++ b/frontend/src/app/features/boards/board/board-actions/version/version-action.service.ts
@@ -59,21 +59,6 @@ export class BoardVersionActionService extends CachedBoardActionService {
return this.writable$;
}
- public addInitialColumnsForAction(board:Board):Promise<Board> {
- return firstValueFrom(this.loadValues())
- .then((results) => Promise.all<unknown>(
- results.map((version:VersionResource) => {
- const definingName = _.get(version, 'definingProject.name', null);
- if (version.isOpen() && definingName && definingName === this.currentProject.name) {
- return this.addColumnWithActionAttribute(board, version);
- }
-
- return Promise.resolve(board);
- }),
- )
- .then(() => board));
- }
-
/**
* Adds an entry to the list menu to edit the version if allowed
* @param {QueryResource} query The active query
diff --git a/frontend/src/app/features/boards/board/board.service.ts b/frontend/src/app/features/boards/board/board.service.ts
index 2c17dd24556..0e4022e93ff 100644
--- a/frontend/src/app/features/boards/board/board.service.ts
+++ b/frontend/src/app/features/boards/board/board.service.ts
@@ -1,28 +1,13 @@
import { Injectable } from '@angular/core';
-import { BoardListsService } from 'core-app/features/boards/board/board-list/board-lists.service';
import { HalResourceService } from 'core-app/features/hal/services/hal-resource.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
import { CurrentProjectService } from 'core-app/core/current-project/current-project.service';
-import {
- Board,
- BoardType,
-} from 'core-app/features/boards/board/board';
+import { Board } from 'core-app/features/boards/board/board';
import { GridWidgetResource } from 'core-app/features/hal/resources/grid-widget-resource';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { BoardActionsRegistryService } from 'core-app/features/boards/board/board-actions/board-actions-registry.service';
-import {
- BehaviorSubject,
- firstValueFrom,
- Observable,
-} from 'rxjs';
+import { BehaviorSubject, firstValueFrom, Observable } from 'rxjs';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
-export interface CreateBoardParams {
- type:BoardType;
- boardName?:string;
- attribute?:string;
-}
-
@Injectable({ providedIn: 'root' })
export class BoardService {
public currentBoard$:BehaviorSubject<string|null> = new BehaviorSubject<string|null>(null);
@@ -36,13 +21,13 @@ export class BoardService {
unnamed_list: this.I18n.t('js.boards.label_unnamed_list'),
};
- constructor(protected apiV3Service:ApiV3Service,
+ constructor(
+ protected apiV3Service:ApiV3Service,
protected PathHelper:PathHelperService,
protected CurrentProject:CurrentProjectService,
protected halResourceService:HalResourceService,
- protected boardActions:BoardActionsRegistryService,
protected I18n:I18nService,
- protected boardsList:BoardListsService) {
+ ) {
}
/**
@@ -82,29 +67,6 @@ export class BoardService {
.save(board);
}
- /**
- * Create a new board
- * @param params
- */
- public async create(params:CreateBoardParams):Promise<Board> {
- const board = await firstValueFrom(
- this
- .apiV3Service
- .boards
- .create(params.type, this.boardName(params), this.CurrentProject.identifier as string, params.attribute),
- );
-
- if (params.type === 'free') {
- await this.boardsList.addFreeQuery(board, { name: this.text.unnamed_list });
- } else {
- await this.boardActions.get(params.attribute as string).addInitialColumnsForAction(board);
- }
-
- await firstValueFrom(this.save(board));
-
- return board;
- }
-
public delete(board:Board):Promise<unknown> {
return firstValueFrom(
this
@@ -115,21 +77,6 @@ export class BoardService {
);
}
- /**
- * Build a default board name
- */
- private boardName(params:CreateBoardParams) {
- if (params.boardName) {
- return params.boardName;
- }
-
- if (params.type === 'action') {
- return this.text.action_board(params.attribute!);
- }
-
- return this.text.unnamed_board;
- }
-
/**
* Reorders the widgets to correspond to the available columns
* @param board