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

[#39772] removed unwanted update cycles for query title

Eric Schubert38f0611a8071
diff --git a/frontend/src/app/features/work-packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.ts b/frontend/src/app/features/work-packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.ts
index d3c2ce3b7a2..87047c8de41 100644
--- a/frontend/src/app/features/work-packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.ts
+++ b/frontend/src/app/features/work-packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.ts
@@ -100,9 +100,6 @@ export class PartitionedQuerySpacePageComponent extends WorkPackagesViewBase imp
showToolbarSaveButton:boolean;
/** Listener callbacks */
- // eslint-disable-next-line @typescript-eslint/ban-types
- unRegisterTitleListener:Function;
-
// eslint-disable-next-line @typescript-eslint/ban-types
removeTransitionSubscription:Function;
@@ -149,24 +146,20 @@ export class PartitionedQuerySpacePageComponent extends WorkPackagesViewBase imp
// Load query on URL transitions
this.queryParamListener
.observe$
- .pipe(
- this.untilDestroyed(),
- ).subscribe(() => {
- /** Ensure we reload the query from the changed props */
+ .pipe(this.untilDestroyed())
+ .subscribe(() => {
+ /** Ensure we reload the query from the changed props */
this.currentQuery = undefined;
- this.refresh(true, true);
+ void this.refresh(true, true);
});
- // Update title on entering this state
- this.unRegisterTitleListener = this.$transitions.onSuccess({}, () => {
- this.updateTitle(this.querySpace.query.value);
- });
-
- this.querySpace.query.values$().pipe(
- this.untilDestroyed(),
- ).subscribe((query) => {
- this.onQueryUpdated(query);
- });
+ this.querySpace.query.values$()
+ .pipe(this.untilDestroyed())
+ .subscribe((query) => {
+ // Update the title whenever the query changes
+ this.updateTitle(query);
+ this.currentQuery = query;
+ });
}
/**
@@ -175,11 +168,11 @@ export class PartitionedQuerySpacePageComponent extends WorkPackagesViewBase imp
*
* @param state The current or entering state
*/
- protected setPartition(state:Ng2StateDeclaration) {
+ protected setPartition(state:Ng2StateDeclaration):void {
this.currentPartition = (state.data && state.data.partition) ? state.data.partition : '-split';
}
- protected setupInformationLoadedListener() {
+ protected setupInformationLoadedListener():void {
this
.querySpace
.initialized
@@ -191,17 +184,8 @@ export class PartitionedQuerySpacePageComponent extends WorkPackagesViewBase imp
});
}
- protected onQueryUpdated(query:QueryResource) {
- // Update the title whenever the query changes
- this.updateTitle(query);
- this.currentQuery = query;
-
- this.cdRef.detectChanges();
- }
-
ngOnDestroy():void {
super.ngOnDestroy();
- this.unRegisterTitleListener();
this.removeTransitionSubscription();
this.queryParamListener.removeQueryChangeListener();
}
diff --git a/frontend/src/app/shared/components/op-query-select/op-static-queries.service.ts b/frontend/src/app/shared/components/op-query-select/op-static-queries.service.ts
index 62cc2297c2a..2444b84ee2c 100644
--- a/frontend/src/app/shared/components/op-query-select/op-static-queries.service.ts
+++ b/frontend/src/app/shared/components/op-query-select/op-static-queries.service.ts
@@ -62,7 +62,7 @@ export class StaticQueriesService {
public getStaticName(query:QueryResource):string {
if (this.$state.params.query_props) {
- const queryProps = JSON.parse(this.$state.params.query_props);
+ const queryProps = JSON.parse(this.$state.params.query_props) as { pa:unknown, pp:unknown }&unknown;
delete queryProps.pp;
delete queryProps.pa;
const queryPropsString = JSON.stringify(queryProps);