mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Use hash strategy in demo shell as the other apps (#6402)
* hash startegy * use hash in e2e * trigger build * fix * fix * remove children router overwrite crazynes * Update login.module.ts * revert not needed changes * some fixes * fix * remove fdescribe * fix * fix * Update share-file.e2e.ts * Update lock-file.e2e.ts * Update share-file.e2e.ts * some fix * some other fixes * username as id * fix after rebase * username * fix usernamee * Fix the errorComponent * Attempt to fix unit test - to check * * Fixed circular dependency error while building adf-testing package * * Fixed failing UT * fix * use username * some fixes * some fix * fix Co-authored-by: Maurizio Vitale <maurizio.vitale@alfresco.com> Co-authored-by: Vito Albano <vitoalbano@vitoalbano-mbp-0120.local> Co-authored-by: sivakumar414ram <siva.kumar@muraai.com>
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<div class="adf-error-content">
|
||||
<p class="adf-error-content-code">
|
||||
{{ errorCode }}
|
||||
{{ errorCodeTranslated }}
|
||||
</p>
|
||||
<div class="adf-error-content-shadow"></div>
|
||||
<p class="adf-error-content-title">
|
||||
{{ 'ERROR_CONTENT.' + errorCode + '.TITLE' | translate }}
|
||||
{{ 'ERROR_CONTENT.' + errorCodeTranslated + '.TITLE' | translate }}
|
||||
</p>
|
||||
<p class="adf-error-content-description">
|
||||
{{ 'ERROR_CONTENT.' + errorCode + '.DESCRIPTION' | translate }}
|
||||
{{ 'ERROR_CONTENT.' + errorCodeTranslated + '.DESCRIPTION' | translate }}
|
||||
</p>
|
||||
<ng-content select="[adf-error-content-actions]"></ng-content>
|
||||
</div>
|
||||
|
@@ -123,7 +123,7 @@ describe('ErrorContentComponent', () => {
|
||||
spyOn(translateService, 'instant').and.returnValue(of('404'));
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(errorContentComponent.errorCode).toBe('404');
|
||||
expect(errorContentComponent.errorCodeTranslated).toBe('404');
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
@@ -22,9 +22,8 @@ import {
|
||||
ViewEncapsulation,
|
||||
OnInit
|
||||
} from '@angular/core';
|
||||
import { Params, ActivatedRoute } from '@angular/router';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { TranslationService } from '../../services/translation.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-error-content',
|
||||
templateUrl: './error-content.component.html',
|
||||
@@ -41,16 +40,18 @@ export class ErrorContentComponent implements OnInit {
|
||||
@Input()
|
||||
errorCode: string = ErrorContentComponent.UNKNOWN_ERROR;
|
||||
|
||||
errorCodeTranslated: string;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private translateService: TranslationService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.route) {
|
||||
this.route.params.forEach((params: Params) => {
|
||||
if (params['id']) {
|
||||
this.errorCode = this.checkErrorExists(params['id']) ? params['id'] : ErrorContentComponent.UNKNOWN_ERROR;
|
||||
}
|
||||
this.route.params.subscribe(params => {
|
||||
const code = params['id'] || this.errorCode;
|
||||
const errorHasTranslation = this.checkErrorExists(code);
|
||||
this.errorCodeTranslated = errorHasTranslation ? code : ErrorContentComponent.UNKNOWN_ERROR;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user