Skip to content

Commit

Permalink
chore[1300]: added back Button
Browse files Browse the repository at this point in the history
  • Loading branch information
ashanmugavel committed Aug 5, 2024
1 parent ea63855 commit 939f181
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha

### Added
- #908 Add owner field to affected parts view in notification details
- #1300 Added back button

### Changed
- #1252 adapt IRS example response for integration tests to reflect current state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
SPDX-License-Identifier: Apache-2.0
-->

<div class="part-relation--header--navigation--container">
<app-button
[color]="'primary'"
onkeydown="this.navigateBack()"
(click)="this.navigateBack()"
>
<div class="flex justify-between items-center">
<mat-icon class="mr-2">arrow_back</mat-icon>
{{ 'actions.goBack' | i18n }}
</div>
</app-button>
</div>

<ng-container *ngIf="this.rootPart$">
<ng-container *viewContainer="this.rootPart$ | async; main: partRelationMainTmp; error: errorTmp; loading: loaderTmp">
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { Location } from '@angular/common';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Expand All @@ -28,7 +29,7 @@ import {
OnInit,
ViewEncapsulation,
} from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import Router.
import { Part } from '@page/parts/model/parts.model';
import { State } from '@shared/model/state';
import { View } from '@shared/model/view.model';
Expand Down Expand Up @@ -57,14 +58,14 @@ export class PartRelationComponent implements OnInit, OnDestroy {
public readonly rootPart$: Observable<View<Part>>;
public readonly resizeTrigger$: Observable<number>;
public readonly htmlId: string;

private _rootPart$ = new State<View<Part>>({ loader: true });
public readonly _resizeTrigger$ = new BehaviorSubject<number>(0);

constructor(
private readonly partDetailsFacade: PartDetailsFacade,
private readonly route: ActivatedRoute,
private readonly cdr: ChangeDetectorRef,
private readonly location: Location,
staticIdService: StaticIdService,
) {
this.resizeTrigger$ = this._resizeTrigger$.pipe(delay(0));
Expand Down Expand Up @@ -99,4 +100,8 @@ export class PartRelationComponent implements OnInit, OnDestroy {
public decreaseSize(): void {
this._resizeTrigger$.next(-0.1);
}

navigateBack() {
this.location.back();
}
}

0 comments on commit 939f181

Please sign in to comment.