Skip to content

Commit

Permalink
Merge pull request #72 from UST-QuAntiL/fix/keep-url-params
Browse files Browse the repository at this point in the history
fix: keep URL params when navigating
  • Loading branch information
infacc authored Oct 27, 2023
2 parents 9e5e91f + 7e11438 commit 487d430
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/app/components/data-detail/data-detail.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="big-content" *ngIf="data != null">
<div class="title">
<h1 class="t-page-headline">Data</h1>
<a mat-icon-button aria-label="back to data list" [routerLink]="['/experiments', experimentId, 'data']">
<a mat-icon-button aria-label="back to data list" [routerLink]="['/experiments', experimentId, 'data']" queryParamsHandling="merge">
<mat-icon>arrow_back</mat-icon>
</a>
</div>
Expand Down Expand Up @@ -33,7 +33,7 @@ <h1 class="t-page-headline">Data</h1>
<div *ngIf="data?.producedBy != null">
<dt>Created in</dt>
<dd>
<a [routerLink]="['/experiments', experimentId, 'timeline', data.producedBy]">
<a [routerLink]="['/experiments', experimentId, 'timeline', data.producedBy]" queryParamsHandling="merge">
Step {{data.producedBy}}
</a>
</dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h1 class="t-page-headline align-arrow">Experiment Data</h1>
</mat-card>
<mat-card appearance="outlined" class="page-item card" *ngFor="let data of experimentData | async">
<mat-card-title>
<a class="t-headline title-link"
<a class="t-headline title-link" queryParamsHandling="merge"
[routerLink]="['/experiments', experimentId, 'data', data.name, {version: data.version.toString()}]">{{data.name}}</a>
</mat-card-title>
<mat-card-content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h1 class="t-page-headline align-arrow">Experiment Timeline</h1>
<mat-card appearance="outlined" class="page-item card" *ngFor="let step of timelineSteps | async">
<mat-card-title>
<a class="t-headline title-link"
[routerLink]="['/experiments', experimentId, 'timeline', step.sequence]">
[routerLink]="['/experiments', experimentId, 'timeline', step.sequence]" queryParamsHandling="merge">
Step {{step.sequence}} ({{step.processorName}}@{{step.processorVersion}})
</a>
<qhana-step-status [step]="step" [noText]="step.status !== 'PENDING'" [spinner]="0"></qhana-step-status>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ export class ExperimentWorkspaceComponent implements OnInit, OnDestroy {
processorName: plugin.identifier,
processorVersion: plugin.version,
resultLocation: formData.resultUrl,
}).subscribe(timelineStep => this.router.navigate(['/experiments', experimentId, 'timeline', timelineStep.sequence.toString()]));
}).subscribe(timelineStep => this.router.navigate(['/experiments', experimentId, 'timeline', timelineStep.sequence.toString()], { queryParamsHandling: 'preserve' }));
}
}
10 changes: 5 additions & 5 deletions src/app/components/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@
Info
</a>
<a class="navigation-link" mat-button [routerLink]="['/experiments', (experimentId|async), 'workspace']"
[queryParams]="{template: routeTemplateId}" routerLinkActive="active">
queryParamsHandling="merge" routerLinkActive="active">
Workspace
</a>
<a class="navigation-link" mat-button [routerLink]="['/experiments', (experimentId|async), 'data']"
[queryParams]="{template: routeTemplateId}" routerLinkActive="active">
queryParamsHandling="merge" routerLinkActive="active">
Data
</a>
<a class="navigation-link" mat-button [routerLink]="['/experiments', (experimentId|async), 'timeline']"
[queryParams]="{template: routeTemplateId}" routerLinkActive="active">
queryParamsHandling="merge" routerLinkActive="active">
Timeline
</a>
<a class="navigation-link" mat-button
[routerLink]="['/experiments', (experimentId|async), 'extra', tab.resourceKey?.uiTemplateTabId]"
[queryParams]="{template: routeTemplateId}" routerLinkActive="active"
queryParamsHandling="merge" routerLinkActive="active"
*ngFor="let tab of experimentExtraTabs">
{{tab.name}}
</a>
</ng-container>
<ng-container *ngIf="(currentExperiment|async) == null">
<a class="navigation-link" mat-button [routerLink]="['extra', tab.resourceKey?.uiTemplateTabId]"
[queryParams]="{template: routeTemplateId}" routerLinkActive="active" *ngFor="let tab of generalExtraTabs">
queryParamsHandling="merge" routerLinkActive="active" *ngFor="let tab of generalExtraTabs">
{{tab.name}}
</a>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ng-container *ngFor="let data of resolvedDataList; trackBy: trackByFn">
<qhana-data-preview [data]="data">
<a [routerLink]="['/experiments', experimentId, 'data', data.name, {version: data.version}]">
<a [routerLink]="['/experiments', experimentId, 'data', data.name, {version: data.version}]" queryParamsHandling="merge">
<h5>{{data.name}} (version {{data.version}})</h5>
</a>
</qhana-data-preview>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<nav mat-tab-nav-bar class="big-nav-tabs">
<a mat-tab-link [routerLink]="['/experiments', experimentId, 'timeline', timelineStep, 'overview']"
<a mat-tab-link [routerLink]="['/experiments', experimentId, 'timeline', timelineStep, 'overview']" queryParamsHandling="merge"
[active]="active === 'overview'">
Overview
</a>
<a mat-tab-link *ngFor="let tab of tabs"
[routerLink]="['/experiments', experimentId, 'timeline', timelineStep, tab.tabId]"
[routerLink]="['/experiments', experimentId, 'timeline', timelineStep, tab.tabId]" queryParamsHandling="merge"
[active]="active === tab.tabId">
{{tab.name}}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="title">
<h1 class="t-page-headline">Timeline Step {{stepId}}</h1>
<a mat-icon-button aria-label="back to timeline step list"
[routerLink]="['/experiments', experimentId, 'timeline']">
[routerLink]="['/experiments', experimentId, 'timeline']" queryParamsHandling="merge">
<mat-icon>arrow_back</mat-icon>
</a>
</div>
Expand Down

0 comments on commit 487d430

Please sign in to comment.