Skip to content

Commit 939f181

Browse files
author
ashanmugavel
committed
chore[1300]: added back Button
1 parent ea63855 commit 939f181

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha
1010

1111
### Added
1212
- #908 Add owner field to affected parts view in notification details
13+
- #1300 Added back button
1314

1415
### Changed
1516
- #1252 adapt IRS example response for integration tests to reflect current state

frontend/src/app/modules/shared/modules/relations/presentation/part-relation.component.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@
1919
SPDX-License-Identifier: Apache-2.0
2020
-->
2121

22+
<div class="part-relation--header--navigation--container">
23+
<app-button
24+
[color]="'primary'"
25+
onkeydown="this.navigateBack()"
26+
(click)="this.navigateBack()"
27+
>
28+
<div class="flex justify-between items-center">
29+
<mat-icon class="mr-2">arrow_back</mat-icon>
30+
{{ 'actions.goBack' | i18n }}
31+
</div>
32+
</app-button>
33+
</div>
34+
2235
<ng-container *ngIf="this.rootPart$">
2336
<ng-container *viewContainer="this.rootPart$ | async; main: partRelationMainTmp; error: errorTmp; loading: loaderTmp">
2437
</ng-container>

frontend/src/app/modules/shared/modules/relations/presentation/part-relation.component.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* SPDX-License-Identifier: Apache-2.0
2020
********************************************************************************/
2121

22+
import { Location } from '@angular/common';
2223
import {
2324
ChangeDetectionStrategy,
2425
ChangeDetectorRef,
@@ -28,7 +29,7 @@ import {
2829
OnInit,
2930
ViewEncapsulation,
3031
} from '@angular/core';
31-
import { ActivatedRoute } from '@angular/router';
32+
import { ActivatedRoute, Router } from '@angular/router';
3233
import { Part } from '@page/parts/model/parts.model';
3334
import { State } from '@shared/model/state';
3435
import { View } from '@shared/model/view.model';
@@ -57,14 +58,14 @@ export class PartRelationComponent implements OnInit, OnDestroy {
5758
public readonly rootPart$: Observable<View<Part>>;
5859
public readonly resizeTrigger$: Observable<number>;
5960
public readonly htmlId: string;
60-
6161
private _rootPart$ = new State<View<Part>>({ loader: true });
6262
public readonly _resizeTrigger$ = new BehaviorSubject<number>(0);
6363

6464
constructor(
6565
private readonly partDetailsFacade: PartDetailsFacade,
6666
private readonly route: ActivatedRoute,
6767
private readonly cdr: ChangeDetectorRef,
68+
private readonly location: Location,
6869
staticIdService: StaticIdService,
6970
) {
7071
this.resizeTrigger$ = this._resizeTrigger$.pipe(delay(0));
@@ -99,4 +100,8 @@ export class PartRelationComponent implements OnInit, OnDestroy {
99100
public decreaseSize(): void {
100101
this._resizeTrigger$.next(-0.1);
101102
}
103+
104+
navigateBack() {
105+
this.location.back();
106+
}
102107
}

0 commit comments

Comments
 (0)