Skip to content

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

[33109]Arrow next to parent task still shown after removing subtask (#8472)

Behrokh Satarnejadbf8c775f3135
diff --git a/frontend/src/app/components/wp-relations/wp-relations-hierarchy/wp-relations-hierarchy.service.ts b/frontend/src/app/components/wp-relations/wp-relations-hierarchy/wp-relations-hierarchy.service.ts
index c022cdda1bd..d70c54a81ee 100644
--- a/frontend/src/app/components/wp-relations/wp-relations-hierarchy/wp-relations-hierarchy.service.ts
+++ b/frontend/src/app/components/wp-relations/wp-relations-hierarchy/wp-relations-hierarchy.service.ts
@@ -136,9 +136,14 @@ export class WorkPackageRelationsHierarchyService {
lockVersion: childWorkPackage.lockVersion
}).then(wp => {
if (parentWorkPackage) {
- this.wpCacheService.require(parentWorkPackage.id!, true);
+ this.wpCacheService.require(parentWorkPackage.id!, true).then((wp) => {
+ this.halEvents.push(wp, {
+ eventType: 'association',
+ relatedWorkPackage: null,
+ relationType: 'child'
+ });
+ });
}
-
this.wpCacheService.updateWorkPackage(wp);
})
.catch((error) => {
diff --git a/spec/features/work_packages/table/hierarchy/hierarchy_parent_below_spec.rb b/spec/features/work_packages/table/hierarchy/hierarchy_parent_below_spec.rb
index a8460d77076..c2d29d96d0e 100644
--- a/spec/features/work_packages/table/hierarchy/hierarchy_parent_below_spec.rb
+++ b/spec/features/work_packages/table/hierarchy/hierarchy_parent_below_spec.rb
@@ -142,4 +142,28 @@ describe 'Work Package table hierarchy parent below', js: true do
hierarchy.expect_leaf_at(child, child2)
end
end
+
+ describe 'An arrow is beside parent name' do
+ let(:child) { FactoryBot.create(:work_package, subject: 'AA Child WP', project: project, parent: parent) }
+ let(:parent) { FactoryBot.create(:work_package, subject: 'ZZ Parent WP', project: project) }
+ let(:relations) { ::Components::WorkPackages::Relations.new(parent) }
+
+ before do
+ child
+ end
+
+ it 'and it should not be shown when children are removed "#33109"' do
+ wp_table.visit!
+ wp_table.expect_work_package_listed(child, parent)
+
+ expect(page).to have_selector('.wp-table--hierarchy-indicator-icon')
+
+ split_page = wp_table.open_split_view(parent)
+ split_page.visit_tab!("relations")
+ relations.remove_child(child)
+ loading_indicator_saveguard
+
+ expect(page).to have_no_selector('.wp-table--hierarchy-indicator-icon')
+ end
+ end
end