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

Disable the option to turn off the Gantt chart in the Gantt module

Henriette Dargebb2fb7f876b7
diff --git a/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/tabs/timelines-tab.component.html b/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/tabs/timelines-tab.component.html
index afb35ae3e7f..f2ee269acdf 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/tabs/timelines-tab.component.html
+++ b/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/tabs/timelines-tab.component.html
@@ -9,6 +9,7 @@
<input type="checkbox"
(change)="timelineVisible = !timelineVisible"
[checked]="timelineVisible"
+ [disabled]="timelineToggleDisabled()"
id="display_timelines_switch"
name="display_timelines_switch">
</div>
@@ -28,7 +29,6 @@
<select
id="modal-timelines-zoomlevel"
- [attr.disabled]="autoZoom === true ? 'disabled' : undefined"
(change)="zoomLevel = $event.target.value"
class="form--select">
<option *ngFor="let level of availableZoomLevels"
diff --git a/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/tabs/timelines-tab.component.ts b/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/tabs/timelines-tab.component.ts
index 546fb17f78f..dddbe1a91cc 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/tabs/timelines-tab.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/tabs/timelines-tab.component.ts
@@ -1,4 +1,8 @@
-import { Component, Injector } from '@angular/core';
+import {
+ Component,
+ Injector,
+ OnInit,
+} from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { TabComponent } from 'core-app/features/work-packages/components/wp-table/configuration-modal/tab-portal-outlet';
import { WorkPackageViewTimelineService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-timeline.service';
@@ -6,11 +10,12 @@ import { WorkPackageViewColumnsService } from 'core-app/features/work-packages/r
import { QueryColumn } from 'core-app/features/work-packages/components/wp-query/query-column';
import { zoomLevelOrder } from 'core-app/features/work-packages/components/wp-table/timeline/wp-timeline';
import { TimelineLabels, TimelineZoomLevel } from 'core-app/features/hal/resources/query-resource';
+import { StateService } from '@uirouter/angular';
@Component({
templateUrl: './timelines-tab.component.html',
})
-export class WpTableConfigurationTimelinesTabComponent implements TabComponent {
+export class WpTableConfigurationTimelinesTabComponent implements TabComponent, OnInit {
public timelineVisible = false;
public availableAttributes:{ id:string, name:string }[];
@@ -50,10 +55,13 @@ export class WpTableConfigurationTimelinesTabComponent implements TabComponent {
},
};
- constructor(readonly injector:Injector,
+ constructor(
+ readonly injector:Injector,
readonly I18n:I18nService,
readonly wpTableTimeline:WorkPackageViewTimelineService,
- readonly wpTableColumns:WorkPackageViewColumnsService) {
+ readonly wpTableColumns:WorkPackageViewColumnsService,
+ readonly $state:StateService,
+ ) {
}
public onSave() {
@@ -91,4 +99,8 @@ export class WpTableConfigurationTimelinesTabComponent implements TabComponent {
this.availableAttributes = [{ id: '', name: this.text.labels.none }].concat(availableColumns);
}
+
+ timelineToggleDisabled():boolean {
+ return !!this.$state.current.name?.includes('gantt');
+ }
}