From 8aca6ccf4872399fb7e56ffa2eaf8a57d8f97b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Tue, 22 Mar 2022 14:28:53 +0100 Subject: [PATCH 1/2] Make basic boards a CE feature --- .../board-actions-registry.service.ts | 17 +++- .../board-list-container.component.html | 8 -- .../board-list-container.component.ts | 10 --- .../boards-sidebar/boards-menu.component.ts | 5 +- .../boards-index-page.component.html | 33 +------- .../index-page/boards-index-page.component.ts | 37 ++------ .../new-board-modal.component.ts | 40 +++++++-- .../new-board-modal/new-board-modal.html | 19 +++-- .../boards/tile-view/tile-view.component.html | 16 ++-- .../boards/tile-view/tile-view.component.sass | 75 +++++++++-------- .../tile-view/tile-view.component.spec.ts | 6 +- .../boards/tile-view/tile-view.component.ts | 5 +- .../enterprise-banner.component.ts | 16 ++-- modules/boards/config/locales/js-en.yml | 4 +- .../spec/features/board_enterprise_spec.rb | 84 +++++++++++++++++++ .../spec/features/support/board_index_page.rb | 7 +- 16 files changed, 224 insertions(+), 158 deletions(-) create mode 100644 modules/boards/spec/features/board_enterprise_spec.rb diff --git a/frontend/src/app/features/boards/board/board-actions/board-actions-registry.service.ts b/frontend/src/app/features/boards/board/board-actions/board-actions-registry.service.ts index 095fa61588..4e44482669 100644 --- a/frontend/src/app/features/boards/board/board-actions/board-actions-registry.service.ts +++ b/frontend/src/app/features/boards/board/board-actions/board-actions-registry.service.ts @@ -1,17 +1,28 @@ import { Injectable } from '@angular/core'; import { BoardActionService } from 'core-app/features/boards/board/board-actions/board-action.service'; +import { ITileViewEntry } from 'core-app/features/boards/tile-view/tile-view.component'; +import { BannersService } from 'core-app/core/enterprise/banners.service'; @Injectable({ providedIn: 'root' }) export class BoardActionsRegistryService { + constructor( + private bannersService:BannersService, + ) {} + private mapping:{ [attribute:string]:BoardActionService } = {}; - public add(attribute:string, service:BoardActionService) { + public add(attribute:string, service:BoardActionService):void { this.mapping[attribute] = service; } - public available() { + public available():ITileViewEntry[] { return _.map(this.mapping, (service:BoardActionService, attribute:string) => ({ - attribute, text: service.localizedName, icon: '', description: '', image: '', + attribute, + text: service.localizedName, + icon: '', + description: '', + image: '', + disabled: this.bannersService.eeShowBanners, })); } diff --git a/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.html b/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.html index e42d7ecf4e..0ed5572e12 100644 --- a/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.html +++ b/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.html @@ -2,7 +2,6 @@
- - - \ No newline at end of file diff --git a/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.ts b/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.ts index a03488024f..ed483ff677 100644 --- a/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.ts +++ b/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.ts @@ -39,8 +39,6 @@ export class BoardListContainerComponent extends UntilDestroyedMixin implements updateSuccessful: this.I18n.t('js.notice_successful_update'), loadingError: 'No such board found', addList: this.I18n.t('js.boards.add_list'), - upsaleBoards: this.I18n.t('js.boards.upsale.teaser_text'), - upsaleCheckOutLink: this.I18n.t('js.work_packages.table_configuration.upsale.check_out_link'), unnamedList: this.I18n.t('js.boards.label_unnamed_list'), hiddenListWarning: this.I18n.t('js.boards.text_hidden_list_warning'), }; @@ -150,14 +148,6 @@ export class BoardListContainerComponent extends UntilDestroyedMixin implements } } - showBoardListView() { - return !this.Banner.eeShowBanners; - } - - opReferrer(board:Board) { - return board.isFree ? 'boards#free' : 'boards#status'; - } - saveBoard(board:Board):void { this.boardComponent.boardSaver.request(board); } diff --git a/frontend/src/app/features/boards/boards-sidebar/boards-menu.component.ts b/frontend/src/app/features/boards/boards-sidebar/boards-menu.component.ts index 9ce01c7810..9d6ac18bb9 100644 --- a/frontend/src/app/features/boards/boards-sidebar/boards-menu.component.ts +++ b/frontend/src/app/features/boards/boards-sidebar/boards-menu.component.ts @@ -31,14 +31,11 @@ export const boardsMenuSelector = 'boards-menu'; export class BoardsMenuComponent extends UntilDestroyedMixin implements OnInit { @HostBinding('class.op-sidebar') className = true; - selectedBoardId:string; - boardOptions$:Observable = this .apiV3Service .boards .observeAll() .pipe( - skip(1), map((boards:Board[]) => { const menuItems:IOpSidemenuItem[] = boards.map((board) => ({ title: board.name, @@ -88,7 +85,7 @@ export class BoardsMenuComponent extends UntilDestroyedMixin implements OnInit { .onActivate('board_view') .subscribe(() => { this.focusBackArrow(); - this.boardService.loadAllBoards(); + void this.boardService.loadAllBoards(); }); } diff --git a/frontend/src/app/features/boards/index-page/boards-index-page.component.html b/frontend/src/app/features/boards/index-page/boards-index-page.component.html index 8c4b354f17..982b58ae47 100644 --- a/frontend/src/app/features/boards/index-page/boards-index-page.component.html +++ b/frontend/src/app/features/boards/index-page/boards-index-page.component.html @@ -3,8 +3,7 @@

-