Only listen to work package update events to skip inline-created cards

pull/8230/head
Oliver Günther 5 years ago
parent 9b33599d0f
commit 0f1c09d74a
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 3
      frontend/src/app/components/wp-card-view/wp-card-view.component.ts
  2. 3
      frontend/src/app/modules/boards/board/board-list/board-list.component.ts

@ -25,7 +25,7 @@ import {StateService} from "@uirouter/core";
import {States} from "core-components/states.service";
import {WorkPackageViewOrderService} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-order.service";
import {PathHelperService} from "core-app/modules/common/path-helper/path-helper.service";
import {filter, withLatestFrom} from 'rxjs/operators';
import {filter, map, withLatestFrom} from 'rxjs/operators';
import {CausedUpdatesService} from "core-app/modules/boards/board/caused-updates/caused-updates.service";
import {WorkPackageViewSelectionService} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-selection.service";
import {CardViewHandlerRegistry} from "core-components/wp-card-view/event-handler/card-view-handler-registry";
@ -128,6 +128,7 @@ export class WorkPackageCardViewComponent extends UntilDestroyedMixin implements
this.halEvents
.aggregated$('WorkPackage')
.pipe(
map(events => events.filter(event => event.eventType === 'update')),
filter(events => {
const wpIds:string[] = this.workPackages.map(el => el.id!.toString());
return !!events.find(event => wpIds.indexOf(event.id) !== -1);

@ -446,6 +446,9 @@ export class BoardListComponent extends AbstractWidgetComponent implements OnIni
.events$
.pipe(
filter(event => event.resourceType === 'WorkPackage'),
// Only allow updates, otherwise this causes an error reloading the list
// before the work package can be added to the query order
filter(event => event.eventType === 'updated'),
map((event:HalEvent) => event.commit?.changes[this.board.actionAttribute!]),
filter(value => !!value),
filter((value:ChangeItem) => {

Loading…
Cancel
Save