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

Add a method to check for shared column

Klaus Zanders3602fc2bfca0
diff --git a/frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-columns.service.ts b/frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-columns.service.ts
index 392609ac7f7..089e2987cae 100644
--- a/frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-columns.service.ts
+++ b/frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-columns.service.ts
@@ -73,8 +73,8 @@ export class WorkPackageViewColumnsService extends WorkPackageQueryStateService<
// We can avoid reloading even with relation columns if we only removed columns
const onlyRemoved = _.difference(newColumns, oldColumns).length === 0;
- // Reload the table visibly if adding relation columns.
- return !onlyRemoved && this.hasRelationColumns();
+ // Reload the table visibly if adding relation or share columns.
+ return !onlyRemoved && (this.hasRelationColumns() || this.hasShareColumn());
}
/**
@@ -85,6 +85,13 @@ export class WorkPackageViewColumnsService extends WorkPackageQueryStateService<
return !!_.find(this.getColumns(), (c) => relationColumns.indexOf(c._type) >= 0);
}
+ /**
+ * Returns whether the current set of columns include shares
+ */
+ public hasShareColumn() {
+ return !!_.find(this.getColumns(), (c) => c.id === 'sharedWithUser');
+ }
+
/**
* Retrieve the QueryColumn objects for the selected columns.
* Returns a shallow copy with the original column objects.