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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Allow referencing work packages in action boards
Oliver Güntherc4648f65b340
diff --git a/frontend/src/app/modules/boards/board/board-list/board-list.component.html b/frontend/src/app/modules/boards/board/board-list/board-list.component.htmlindex af746af270b..72423db3368 100644--- a/frontend/src/app/modules/boards/board/board-list/board-list.component.html+++ b/frontend/src/app/modules/boards/board/board-list/board-list.component.html@@ -34,15 +34,7 @@[ngClass]="{ '-with-create-button': board.isAction || showAddButton }"><div class="board-list--button-container"><button [title]="text.addCard"- *ngIf="board.isAction"- (accessibleClick)="addNewCard()"- [disabled]="!showAddButton"- class="board-list--add-button board-list--card-add-button button">- <op-icon icon-classes="icon-{{buttonPlaceholder ? buttonPlaceholder.icon : 'add'}}"></op-icon>- <span *ngIf="buttonPlaceholder"> {{ buttonPlaceholder.text }} </span>- </button>- <button [title]="text.addCard"- *ngIf="!board.isAction && showAddButton"+ *ngIf="showAddButton"class="board-list--add-button board-list--card-dropdown-button button"addCardDropdown><op-icon icon-classes="icon-small icon-add"></op-icon>diff --git a/frontend/src/app/modules/boards/board/board-list/board-list.component.ts b/frontend/src/app/modules/boards/board/board-list/board-list.component.tsindex 0ba8d1733e2..2d2901af424 100644--- a/frontend/src/app/modules/boards/board/board-list/board-list.component.ts+++ b/frontend/src/app/modules/boards/board/board-list/board-list.component.ts@@ -447,7 +447,7 @@ export class BoardListComponent extends AbstractWidgetComponent implements OnIni// Only allow updates, otherwise this causes an error reloading the list// before the work package can be added to the query orderfilter(event => event.eventType === 'updated'),- map((event:HalEvent) => event.commit?.changes[this.board.actionAttribute!]),+ map((event:HalEvent) => event.commit?.changes[this.actionService!.filterName]),filter(value => !!value),filter((value:ChangeItem) => {diff --git a/frontend/src/app/modules/boards/board/inline-add/board-inline-add-autocompleter.component.ts b/frontend/src/app/modules/boards/board/inline-add/board-inline-add-autocompleter.component.tsindex 4ecb7ed3515..9dc6c8883bc 100644--- a/frontend/src/app/modules/boards/board/inline-add/board-inline-add-autocompleter.component.ts+++ b/frontend/src/app/modules/boards/board/inline-add/board-inline-add-autocompleter.component.ts@@ -66,7 +66,7 @@ export class BoardInlineAddAutocompleterComponent implements AfterViewInit {placeholder: this.I18n.t('js.relations_autocomplete.placeholder')};- @Input() appendToContainer:string = '.work-packages-partitioned-query-space--container';+ @Input() appendToContainer:string = 'body';@ViewChild(NgSelectComponent) public ngSelectComponent:NgSelectComponent;@Output() onCancel = new EventEmitter<undefined>();@@ -127,6 +127,17 @@ export class BoardInlineAddAutocompleterComponent implements AfterViewInit {}}+ public opened() {+ // Force reposition as a workaround for BUG+ // https://github.com/ng-select/ng-select/issues/1259+ setTimeout(() => {+ const component = this.ngSelectComponent as any;+ if (component && component.dropdownPanel) {+ component.dropdownPanel._updatePosition();+ }+ }, 25);+ }+private autocompleteWorkPackages(searchString:string):Observable<WorkPackageResource[]> {// Return when the search string is emptyif (searchString.length === 0) {diff --git a/frontend/src/app/modules/boards/board/inline-add/board-inline-add-autocompleter.html b/frontend/src/app/modules/boards/board/inline-add/board-inline-add-autocompleter.htmlindex 0aa475dba37..aa38007e212 100644--- a/frontend/src/app/modules/boards/board/inline-add/board-inline-add-autocompleter.html+++ b/frontend/src/app/modules/boards/board/inline-add/board-inline-add-autocompleter.html@@ -5,6 +5,7 @@[loading]="isLoading"[typeahead]="searchInput$"[closeOnSelect]="false"+ (open)="opened()"(close)="cancel()"(change)="addWorkPackageToQuery($event)"><ng-template ng-label-tmp let-item="item">diff --git a/modules/boards/spec/features/action_boards/assignee_board_spec.rb b/modules/boards/spec/features/action_boards/assignee_board_spec.rbindex 7fdd9e61a3f..cf8d5ebb0bf 100644--- a/modules/boards/spec/features/action_boards/assignee_board_spec.rb+++ b/modules/boards/spec/features/action_boards/assignee_board_spec.rb@@ -177,6 +177,11 @@ describe 'Assignee action board',board_page.expect_card('Foo Bar', 'Some Task', present: true)board_page.expect_card('Grouped', 'Some Task', present: false)++ # Reassign to grouped+ board_page.reference 'Grouped', work_package+ board_page.expect_card('Grouped', 'Some Task', present: true)+ board_page.expect_card('Foo Bar', 'Some Task', present: false)endenddiff --git a/modules/boards/spec/features/action_boards/status_board_spec.rb b/modules/boards/spec/features/action_boards/status_board_spec.rbindex 0bb3778d241..833fdecdcc9 100644--- a/modules/boards/spec/features/action_boards/status_board_spec.rb+++ b/modules/boards/spec/features/action_boards/status_board_spec.rb@@ -205,8 +205,8 @@ describe 'Status action board', type: :feature, js: true doexpect(queries.last.name).to eq 'Closed'expect(queries.first.ordered_work_packages).to be_empty- subjects = WorkPackage.where(id: second.ordered_work_packages.pluck(:work_package_id)).pluck(:subject, :status_id)- expect(subjects).to match_array [['Task 1', closed_status.id]]+ subjects = WorkPackage.where(id: second.ordered_work_packages.pluck(:work_package_id))+ expect(subjects.pluck(:subject, :status_id)).to match_array [['Task 1', closed_status.id]]# Open remaining in split viewwp = second.ordered_work_packages.first.work_package@@ -221,6 +221,12 @@ describe 'Status action board', type: :feature, js: true doboard_page.expect_card('Open', 'Task 1', present: true)board_page.expect_card('Closed', 'Task 1', present: false)++ # Re-add task 1 to closed+ board_page.reference('Closed', subjects.first)++ board_page.expect_card('Open', 'Task 1', present: false)+ board_page.expect_card('Closed', 'Task 1', present: true)endendenddiff --git a/modules/boards/spec/features/action_boards/subtasks_board_spec.rb b/modules/boards/spec/features/action_boards/subtasks_board_spec.rbindex 532634968b3..7e04776f80f 100644--- a/modules/boards/spec/features/action_boards/subtasks_board_spec.rb+++ b/modules/boards/spec/features/action_boards/subtasks_board_spec.rb@@ -148,6 +148,12 @@ describe 'Subtasks action board', type: :feature, js: true dowp = WorkPackage.where(id: second.ordered_work_packages.pluck(:work_package_id)).firstexpect(wp.parent_id).to eq other_wp.id++ # Reference back+ board_page.reference('Parent WP', wp)++ board_page.expect_card('Parent WP', 'Second child', present: true)+ board_page.expect_card('Other WP', 'Second child', present: false)endendenddiff --git a/modules/boards/spec/features/action_boards/version_board_spec.rb b/modules/boards/spec/features/action_boards/version_board_spec.rbindex d995506f7da..aee40cad462 100644--- a/modules/boards/spec/features/action_boards/version_board_spec.rb+++ b/modules/boards/spec/features/action_boards/version_board_spec.rb@@ -292,6 +292,13 @@ describe 'Version action board', type: :feature, js: true doboard_page.expect_card('Open version', 'Closed', present: true)board_page.expect_card('Closed version', 'Closed', present: false)board_page.expect_card('Closed version', 'Foo', present: false)++ # We can reference the work package back+ board_page.reference('A second version', work_package)++ board_page.expect_card('A second version', 'Foo', present: true)+ board_page.expect_card('Open version', 'Foo', present: false)+ board_page.expect_card('Closed version', 'Foo', present: false)endenddiff --git a/modules/boards/spec/features/support/board_page.rb b/modules/boards/spec/features/support/board_page.rbindex 350cd0b431d..928510b2af1 100644--- a/modules/boards/spec/features/support/board_page.rb+++ b/modules/boards/spec/features/support/board_page.rb@@ -75,13 +75,11 @@ module Pagesdef add_card(list_name, card_title)within_list(list_name) do- page.find('.board-list--add-button ').click+ page.find('.board-list--add-button').clickend- unless action?- # Add item in dropdown- page.find('.menu-item', text: 'Add new card').click- end+ # Add item in dropdown+ page.find('.menu-item', text: 'Add new card').clicksubject = page.find('#wp-new-inline-edit--field-subject')subject.set card_title@@ -107,7 +105,7 @@ module Pagesselect_autocomplete(page.find('.wp-inline-create--reference-autocompleter'),query: work_package.subject,- results_selector: '.work-packages-partitioned-query-space--container',+ results_selector: 'body',select_text: "##{work_package.id}")expect_card(list_name, work_package.subject)@@ -290,8 +288,7 @@ module Pagesdef expect_editable_list(editable)# Add list buttonif action?- expect(page).to have_conditional_selector(!editable, '.board-list--add-button[disabled]')- expect(page).to have_conditional_selector(editable, '.board-list--add-button:not([disabled])')+ expect(page).to have_conditional_selector(editable, '.board-list--add-button')elseexpect(page).to have_conditional_selector(editable, '.board-list--card-dropdown-button')end