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 service method to disable timestamps / reset to defaults

Oliver Güntherda905eb4d2c1
diff --git a/frontend/src/app/features/work-packages/components/wp-baseline/baseline/baseline.component.ts b/frontend/src/app/features/work-packages/components/wp-baseline/baseline/baseline.component.ts
index 11d8697cb04..4baf1bdbe2b 100644
--- a/frontend/src/app/features/work-packages/components/wp-baseline/baseline/baseline.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-baseline/baseline/baseline.component.ts
@@ -157,8 +157,13 @@ export class OpBaselineComponent extends UntilDestroyedMixin implements OnInit {
public onSubmit(e:Event):void {
e.preventDefault();
- const filterString = `${this.selectedFilter}@${this.selectedTime}`;
- this.wpTableBaseline.update([filterString, DEFAULT_TIMESTAMP]);
+ if (this.selectedFilter === '-') {
+ this.wpTableBaseline.disable();
+ } else {
+ const filterString = `${this.selectedFilter}@${this.selectedTime}`;
+ this.wpTableBaseline.update([filterString, DEFAULT_TIMESTAMP]);
+ }
+
this.submitted.emit();
}
diff --git a/frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-baseline.service.ts b/frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-baseline.service.ts
index b66372a4e12..33dcac302a6 100644
--- a/frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-baseline.service.ts
+++ b/frontend/src/app/features/work-packages/routing/wp-view-base/view-services/wp-view-baseline.service.ts
@@ -69,6 +69,10 @@ export class WorkPackageViewBaselineService extends WorkPackageQueryStateService
return true;
}
+ public disable() {
+ this.update([DEFAULT_TIMESTAMP]);
+ }
+
public get current():string[] {
return this.lastUpdatedState.getValueOr([DEFAULT_TIMESTAMP]);
}