[26375] Don't check the type for unloaded work packages (#5944)

https://community.openproject.com/wp/26375

[ci skip]
pull/5949/head
Oliver Günther 7 years ago committed by GitHub
parent 03cb50780a
commit e69cb8b400
  1. 4
      frontend/app/components/wp-fast-table/state/wp-table-relation-columns.service.ts
  2. 2
      spec/features/work_packages/table/context_menu_spec.rb

@ -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;
});
}

@ -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

Loading…
Cancel
Save