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

show sidebar based on project custom fields count

Jonas Jabaribeaaa312adc0
diff --git a/app/views/layouts/_common_head.html.erb b/app/views/layouts/_common_head.html.erb
index 429cec0a423..f6e22cb7d1c 100644
--- a/app/views/layouts/_common_head.html.erb
+++ b/app/views/layouts/_common_head.html.erb
@@ -10,7 +10,8 @@
<meta name="current_project"
data-project-name="<%= h @project.name %>"
data-project-id="<%= @project.id %>"
- data-project-identifier="<%= @project.identifier %>"/>
+ data-project-identifier="<%= @project.identifier %>"
+ data-project-custom-fields-count="<%= @project.project_custom_fields.visible.count %>"/>
<% end %>
<meta name="current_user"
data-name="<%= User.current.name %>"
diff --git a/frontend/src/app/core/current-project/current-project.service.ts b/frontend/src/app/core/current-project/current-project.service.ts
index 06a95e4f6b2..14022de0343 100644
--- a/frontend/src/app/core/current-project/current-project.service.ts
+++ b/frontend/src/app/core/current-project/current-project.service.ts
@@ -32,7 +32,7 @@ import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
@Injectable({ providedIn: 'root' })
export class CurrentProjectService {
- private current:{ id:string, identifier:string, name:string };
+ private current:{ id:string, identifier:string, name:string, customFieldsCount:string };
constructor(
private PathHelper:PathHelperService,
@@ -73,7 +73,11 @@ export class CurrentProjectService {
return this.getCurrent('identifier');
}
- private getCurrent(key:'id'|'identifier'|'name') {
+ public get customFieldsCount():string|null {
+ return this.getCurrent('customFieldsCount');
+ }
+
+ private getCurrent(key:'id'|'identifier'|'name'|'customFieldsCount') {
if (this.current && this.current[key]) {
return this.current[key].toString();
}
@@ -91,6 +95,7 @@ export class CurrentProjectService {
id: element.dataset.projectId!,
name: element.dataset.projectName!,
identifier: element.dataset.projectIdentifier!,
+ customFieldsCount: element.dataset.projectCustomFieldsCount!,
};
}
}
diff --git a/frontend/src/app/features/overview/overview.component.ts b/frontend/src/app/features/overview/overview.component.ts
index 9746c96c12a..973df236f68 100644
--- a/frontend/src/app/features/overview/overview.component.ts
+++ b/frontend/src/app/features/overview/overview.component.ts
@@ -14,7 +14,7 @@ export class OverviewComponent extends GridPageComponent {
}
protected isTurboFrameSidebarEnabled():boolean {
- return true;
+ return this.currentProject.customFieldsCount !== '0';
}
protected turboFrameSidebarSrc():string {