From e69cb8b4002258b7de3a501e787f8af13c5f42d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 20 Sep 2017 10:49:59 +0200 Subject: [PATCH] [26375] Don't check the type for unloaded work packages (#5944) https://community.openproject.com/wp/26375 [ci skip] --- .../wp-fast-table/state/wp-table-relation-columns.service.ts | 4 ++-- spec/features/work_packages/table/context_menu_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/app/components/wp-fast-table/state/wp-table-relation-columns.service.ts b/frontend/app/components/wp-fast-table/state/wp-table-relation-columns.service.ts index e1258fe9e6..81221a0a71 100644 --- a/frontend/app/components/wp-fast-table/state/wp-table-relation-columns.service.ts +++ b/frontend/app/components/wp-fast-table/state/wp-table-relation-columns.service.ts @@ -117,9 +117,9 @@ export class WorkPackageTableRelationColumnsService extends WorkPackageTableBase return _.filter(relations, (relation:RelationResource) => { const denormalized = relation.denormalized(workPackage); - const target = this.states.workPackages.get(denormalized.targetId).value!; + const target = this.states.workPackages.get(denormalized.targetId).value; - return target.type.href === typeHref; + return _.get(target, 'type.href') === typeHref; }); } diff --git a/spec/features/work_packages/table/context_menu_spec.rb b/spec/features/work_packages/table/context_menu_spec.rb index 7428840bd9..7b3e23870a 100644 --- a/spec/features/work_packages/table/context_menu_spec.rb +++ b/spec/features/work_packages/table/context_menu_spec.rb @@ -52,7 +52,7 @@ describe 'Work package table context menu', js: true do goto_context_menu menu.choose('Copy') # Split view open in copy state - expect(page).to have_selector('.wp-new-top-row', text: "#{work_package.status.name} #{work_package.type}") + expect(page).to have_selector('.wp-new-top-row', text: "#{work_package.status.name.capitalize} #{work_package.type}") expect(page).to have_field('wp-new-inline-edit--field-subject', with: work_package.subject) # Open Delete