From a7cbbd4679385a91770237416f1fc88b657d847f Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Thu, 22 Sep 2022 16:19:44 -0400 Subject: [PATCH 1/3] Add a 404 error page --- ui/src/app/app.module.ts | 3 ++- .../pagenotfound/pagenotfound.component.css | 12 ++++++++++ .../pagenotfound/pagenotfound.component.html | 4 ++++ .../pagenotfound.component.spec.ts | 23 +++++++++++++++++++ .../pagenotfound/pagenotfound.component.ts | 15 ++++++++++++ 5 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 ui/src/app/pagenotfound/pagenotfound.component.css create mode 100644 ui/src/app/pagenotfound/pagenotfound.component.html create mode 100644 ui/src/app/pagenotfound/pagenotfound.component.spec.ts create mode 100644 ui/src/app/pagenotfound/pagenotfound.component.ts diff --git a/ui/src/app/app.module.ts b/ui/src/app/app.module.ts index 04f6c0ff..c634da56 100644 --- a/ui/src/app/app.module.ts +++ b/ui/src/app/app.module.ts @@ -16,6 +16,7 @@ import { JobDetailsModule } from './job-details/job-details.module'; import { JobListModule } from './job-list/job-list.module'; import { ProjectsModule } from './projects/projects.module'; import { SignInModule } from './sign-in/sign-in.module'; +import { PagenotfoundComponent } from './pagenotfound/pagenotfound.component'; @NgModule({ imports: [ @@ -37,7 +38,7 @@ import { SignInModule } from './sign-in/sign-in.module'; NgxJsonViewerModule ], providers: [CustomIconService], - declarations: [AppComponent], + declarations: [AppComponent, PagenotfoundComponent], // This specifies the top-level component, to load first. bootstrap: [AppComponent] }) diff --git a/ui/src/app/pagenotfound/pagenotfound.component.css b/ui/src/app/pagenotfound/pagenotfound.component.css new file mode 100644 index 00000000..f798937f --- /dev/null +++ b/ui/src/app/pagenotfound/pagenotfound.component.css @@ -0,0 +1,12 @@ +.error-message { + position: relative; + top: 90px; + bottom: 0; + padding-left: 20px; + padding-right: 20px; +} + +p { + font-size: 0.8rem; + margin: 1rem 0; +} diff --git a/ui/src/app/pagenotfound/pagenotfound.component.html b/ui/src/app/pagenotfound/pagenotfound.component.html new file mode 100644 index 00000000..71553a7c --- /dev/null +++ b/ui/src/app/pagenotfound/pagenotfound.component.html @@ -0,0 +1,4 @@ +
+

404 Error

+

Page not found

+
diff --git a/ui/src/app/pagenotfound/pagenotfound.component.spec.ts b/ui/src/app/pagenotfound/pagenotfound.component.spec.ts new file mode 100644 index 00000000..ca4b2943 --- /dev/null +++ b/ui/src/app/pagenotfound/pagenotfound.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PagenotfoundComponent } from './pagenotfound.component'; + +describe('PagenotfoundComponent', () => { + let component: PagenotfoundComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PagenotfoundComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(PagenotfoundComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ui/src/app/pagenotfound/pagenotfound.component.ts b/ui/src/app/pagenotfound/pagenotfound.component.ts new file mode 100644 index 00000000..c67ec400 --- /dev/null +++ b/ui/src/app/pagenotfound/pagenotfound.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-pagenotfound', + templateUrl: './pagenotfound.component.html', + styleUrls: ['./pagenotfound.component.css'] +}) +export class PagenotfoundComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} From edf204039213942b76ad1a12c1947f0ef62d1dc4 Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Thu, 22 Sep 2022 16:20:00 -0400 Subject: [PATCH 2/3] Send job list requests to 404 --- ui/src/app/app-routing.module.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ui/src/app/app-routing.module.ts b/ui/src/app/app-routing.module.ts index 3fb09749..55cfa219 100644 --- a/ui/src/app/app-routing.module.ts +++ b/ui/src/app/app-routing.module.ts @@ -11,6 +11,7 @@ import {JobDetailsResolver} from './job-details/job-details-resolver.service'; import {JobListResolver} from './job-list/job-list-resolver.service'; import { DashboardResolver } from './dashboard/dashboard.resolver.service'; import {JobListComponent} from './job-list/job-list.component'; +import {PagenotfoundComponent} from './pagenotfound/pagenotfound.component'; import {SignInComponent} from './sign-in/sign-in.component'; import {ProjectsComponent} from './projects/projects.component' import {RouteReuse} from './route-reuse.service'; @@ -23,8 +24,7 @@ import {DashboardComponent} from "./dashboard/dashboard.component"; const routes: Routes = [ { path: '', - redirectTo: 'jobs', - pathMatch: 'full' + component: PagenotfoundComponent }, { path: 'sign_in', @@ -49,11 +49,7 @@ const routes: Routes = [ }, { path: 'jobs', - component: JobListComponent, - canActivate: [CapabilitiesActivator], - resolve: { - stream: JobListResolver - } + component: PagenotfoundComponent }, { path: 'jobs/:id', @@ -63,6 +59,10 @@ const routes: Routes = [ job: JobDetailsResolver } }, + { + path: '**', + component: PagenotfoundComponent + }, ]; @NgModule({ From eea483eb325c497aaea304cf0527e7c5fb9ffc7e Mon Sep 17 00:00:00 2001 From: Janet Gainer-Dewar Date: Thu, 22 Sep 2022 16:20:30 -0400 Subject: [PATCH 3/3] Say a sad goodbye to this ascii art --- .../core/initial-error/initial-error.component.html | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ui/src/app/core/initial-error/initial-error.component.html b/ui/src/app/core/initial-error/initial-error.component.html index 05950160..86d34f71 100644 --- a/ui/src/app/core/initial-error/initial-error.component.html +++ b/ui/src/app/core/initial-error/initial-error.component.html @@ -1,15 +1,4 @@
- - _ _ __ __ - | | | | | \/ | - | | ___ | |__ | \ / | __ _ _ __ __ _ __ _ ___ _ __ - _ | |/ _ \| '_ \ | |\/| |/ _` | '_ \ / _` |/ _` |/ _ \ '__| - | |__| | (_) | |_) | | | | | (_| | | | | (_| | (_| | __/ | - \____/ \___/|_.__/ |_| |_|\__,_|_| |_|\__,_|\__, |\___|_| - __/ | - |___/ -
-

Job Manager is running but encountered a problem getting data from its workflow server.

{{ linkText }}

{{errorMessage}}