diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 67d22bc47..d70571517 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -10,6 +10,7 @@ import { MaterialModule } from './common/material.module';
import { AppComponent } from './app.component';
import { APP_ROUTES } from './app.routes';
+import { GenericErrorComponent } from './components/generic-error/generic-error.component';
import { LoginComponent } from './components/login/login.component';
import { PreviewComponent } from './components/preview/preview.component';
import { FilesComponent } from './components/files/files.component';
@@ -37,6 +38,7 @@ import { SidenavComponent } from './components/sidenav/sidenav.component';
],
declarations: [
AppComponent,
+ GenericErrorComponent,
LoginComponent,
LayoutComponent,
HeaderComponent,
diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts
index 2cd07aba1..57829dd67 100644
--- a/src/app/app.routes.ts
+++ b/src/app/app.routes.ts
@@ -29,8 +29,20 @@ import { TrashcanComponent } from './components/trashcan/trashcan.component';
import { LoginComponent } from './components/login/login.component';
import { PreviewComponent } from './components/preview/preview.component';
+import { GenericErrorComponent } from './components/generic-error/generic-error.component';
export const APP_ROUTES: Routes = [
+ {
+ path: 'preview/:nodeId',
+ component: PreviewComponent
+ },
+ {
+ path: 'login',
+ component: LoginComponent,
+ data: {
+ title: 'Sign in'
+ }
+ },
{
path: '',
component: LayoutComponent,
@@ -101,26 +113,15 @@ export const APP_ROUTES: Routes = [
i18nTitle: 'APP.BROWSE.TRASHCAN.TITLE'
}
}
+ ,
+ {
+ path: '**',
+ component: GenericErrorComponent
+ }
],
canActivate: [
AuthGuardEcm
]
- },
- {
- path: 'preview/:nodeId',
- component: PreviewComponent
- },
- {
- path: '**',
- redirectTo: '/login',
- pathMatch: 'full'
- },
- {
- path: 'login',
- component: LoginComponent,
- data: {
- title: 'Sign in'
- }
}
];
diff --git a/src/app/components/files/files.component.html b/src/app/components/files/files.component.html
index cd8d27264..aa12696b3 100644
--- a/src/app/components/files/files.component.html
+++ b/src/app/components/files/files.component.html
@@ -78,7 +78,19 @@
-
+
+
+
{
@@ -48,7 +49,8 @@ describe('FilesComponent', () => {
CommonModule
],
declarations: [
- FilesComponent
+ FilesComponent,
+ GenericErrorComponent
]
}).compileComponents()
.then(() => {
diff --git a/src/app/components/files/files.component.ts b/src/app/components/files/files.component.ts
index 0ff4f37a0..4efdb5fad 100644
--- a/src/app/components/files/files.component.ts
+++ b/src/app/components/files/files.component.ts
@@ -32,6 +32,7 @@ import { PageComponent } from '../page.component';
})
export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
private routeData: any = {};
+ isValidPath = true;
private onCopyNode: Subscription;
private onRemoveItem: Subscription;
@@ -69,12 +70,16 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
this.fetchNode(nodeId)
.do((node) => this.updateCurrentNode(node))
- .flatMap((node) => {
- return this.fetchNodes(node.id);
- })
+ .flatMap((node) => this.fetchNodes(node.id))
.subscribe(
- (page) => this.onPageLoaded(page),
- error => this.onFetchError(error)
+ (page) => {
+ this.isValidPath = true;
+ this.onPageLoaded(page);
+ },
+ error => {
+ this.isValidPath = false;
+ this.onFetchError(error);
+ }
);
});
diff --git a/src/app/components/generic-error/generic-error.component.html b/src/app/components/generic-error/generic-error.component.html
new file mode 100644
index 000000000..1525e9ba3
--- /dev/null
+++ b/src/app/components/generic-error/generic-error.component.html
@@ -0,0 +1,4 @@
+
+
ic_error
+
This file / folder no longer exists or you don't have permission to view it.
+
\ No newline at end of file
diff --git a/src/app/components/generic-error/generic-error.component.scss b/src/app/components/generic-error/generic-error.component.scss
new file mode 100644
index 000000000..dfe6c6039
--- /dev/null
+++ b/src/app/components/generic-error/generic-error.component.scss
@@ -0,0 +1,23 @@
+@import 'variables';
+
+.generic-error {
+ color: $alfresco-secondary-text-color;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ width: 100%;
+ height: 100%;
+
+ &__title {
+ font-size: 16px;
+ }
+
+ mat-icon {
+ color: $alfresco-warn-color--hue-2;
+ direction: rtl;
+ font-size: 52px;
+ height: 52px;
+ width: 52px;
+ }
+ }
diff --git a/src/app/components/generic-error/generic-error.component.ts b/src/app/components/generic-error/generic-error.component.ts
new file mode 100644
index 000000000..7e5923263
--- /dev/null
+++ b/src/app/components/generic-error/generic-error.component.ts
@@ -0,0 +1,9 @@
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'app-generic-error',
+ styleUrls: ['./generic-error.component.scss'],
+ templateUrl: './generic-error.component.html'
+})
+export class GenericErrorComponent {}
+
diff --git a/src/app/ui/_layout.scss b/src/app/ui/_layout.scss
index e72873f94..26e9c5b12 100644
--- a/src/app/ui/_layout.scss
+++ b/src/app/ui/_layout.scss
@@ -61,8 +61,20 @@ $app-inner-layout--footer-height: 48px;
overflow: hidden;
}
+ &__content--hide {
+ display: none;
+ }
+
+ &__content--show {
+ display: flex;
+ }
+
&__footer {
flex-basis: $app-inner-layout--footer-height;
border-top: 1px solid $alfresco-divider-color;
}
+
+ app-generic-error {
+ height: 100%;
+ }
}