Clean-up demo shell Error component (#6403)

* cleanup error component and fix i18n

* remove fake component
This commit is contained in:
Denys Vuika
2020-12-02 00:00:28 +00:00
committed by GitHub
parent 595bd6cd6e
commit 19748c3aea
9 changed files with 11 additions and 106 deletions

View File

@@ -1,22 +1,7 @@
<div fxLayout="column"
fxLayoutAlign="center center">
<adf-error-content [errorCode]="errorCode">
<div adf-error-content-actions
class="app-error-content-buttons">
<a *ngIf="'ERROR_CONTENT.' + errorCode + '.SECONDARY_BUTTON.TEXT' | translate"
id="adf-secondary-button"
mat-raised-button
color="primary"
(click)="onReportIssue()"
class="app-error-content-description-link">
{{ 'ERROR_CONTENT.' + errorCode + '.SECONDARY_BUTTON.TEXT' | translate | uppercase }}
</a>
<a id="adf-return-button"
mat-raised-button
color="primary"
(click)="onReturnButton()">
{{ 'ERROR_CONTENT.' + errorCode + '.RETURN_BUTTON.TEXT' | translate | uppercase }}
</a>
</div>
</adf-error-content>
</div>
<adf-error-content [errorCode]="errorCode">
<div adf-error-content-actions>
<button mat-raised-button (click)="onReturnButton()">
{{ 'ERROR_CONTENT.RETURN_BUTTON.TEXT' | translate }}
</button>
</div>
</adf-error-content>

View File

@@ -1,9 +0,0 @@
.app-error-content {
&-buttons {
display: flex;
width: 100%;
justify-content: space-evenly;
}
}

View File

@@ -20,7 +20,6 @@ import { ActivatedRoute, Params, Router } from '@angular/router';
@Component({
selector: 'app-demo-error',
styleUrls: ['./demo-error.component.scss'],
templateUrl: './demo-error.component.html'
})
export class DemoErrorComponent implements OnInit {
@@ -32,7 +31,7 @@ export class DemoErrorComponent implements OnInit {
ngOnInit() {
if (this.route) {
this.route.params.forEach((params: Params) => {
this.route.params.subscribe((params: Params) => {
if (params['id']) {
this.errorCode = params['id'];
}
@@ -40,10 +39,6 @@ export class DemoErrorComponent implements OnInit {
}
}
onReportIssue() {
this.router.navigate(['/report-issue']);
}
onReturnButton() {
this.router.navigate(['/']);
}