[32778] Ensure we get the current work package in card view

https://community.openproject.com/wp/32778
pull/8210/head
Oliver Günther 5 years ago
parent 0f6bb7316e
commit b732f63b6c
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 10
      frontend/src/app/modules/work_packages/routing/wp-view-base/view-services/wp-view-order.service.ts

@ -27,7 +27,7 @@
// ++
import {QueryResource} from 'core-app/modules/hal/resources/query-resource';
import {Injectable, Optional} from '@angular/core';
import {Injectable} from '@angular/core';
import {WorkPackageQueryStateService} from './wp-view-base.service';
import {IsolatedQuerySpace} from "core-app/modules/work_packages/query-space/isolated-query-space";
import {PathHelperService} from "core-app/modules/common/path-helper/path-helper.service";
@ -36,12 +36,10 @@ import {States} from "core-components/states.service";
import {QuerySchemaResource} from "core-app/modules/hal/resources/query-schema-resource";
import {WorkPackageCollectionResource} from "core-app/modules/hal/resources/wp-collection-resource";
import {MAX_ORDER, ReorderDeltaBuilder} from "core-app/modules/common/drag-and-drop/reorder-delta-builder";
import {debugLog} from "core-app/helpers/debug_output";
import {QueryOrder, QueryOrderDmService} from "core-app/modules/hal/dm-services/query-order-dm.service";
import {take} from "rxjs/operators";
import {InputState} from "reactivestates";
import {WorkPackageViewSortByService} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-sort-by.service";
import {from} from "rxjs";
import {CausedUpdatesService} from "core-app/modules/boards/board/caused-updates/caused-updates.service";
@ -194,7 +192,11 @@ export class WorkPackageViewOrderService extends WorkPackageQueryStateService<Qu
* Return ordered work packages
*/
orderedWorkPackages():WorkPackageResource[] {
const upstreamOrder = this.querySpace.results.value!.elements;
const upstreamOrder = this.querySpace
.results
.value!
.elements
.map(wp => this.states.workPackages.get(wp.id!).getValueOr(wp));
if (this.currentQuery.persisted || this.positions.isPristine()) {
return upstreamOrder;

Loading…
Cancel
Save