mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3324] added redirect to 404 page when the shared link is invalid (#3749)
* [ADF-3324] added redirect to 404 page when the shared link is invalid * [ADF-3324] removed fdescribe * [ADF-3324] fixed documentation adding the new event
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<ng-container *ngIf="sharedLinkId">
|
||||
<adf-viewer
|
||||
(invalidSharedLink)="redirectTo404()"
|
||||
[sharedLinkId]="sharedLinkId"
|
||||
[allowGoBack]="false">
|
||||
</adf-viewer>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-shared-link-view',
|
||||
@@ -30,7 +30,7 @@ export class SharedLinkViewComponent implements OnInit {
|
||||
|
||||
sharedLinkId: string = null;
|
||||
|
||||
constructor(private route: ActivatedRoute) {}
|
||||
constructor(private route: ActivatedRoute, private router: Router) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.params.subscribe(params => {
|
||||
@@ -38,4 +38,8 @@ export class SharedLinkViewComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
redirectTo404() {
|
||||
this.router.navigate(['error/404']);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user