diff --git a/projects/nshmp-apps/src/app/dev/dashboard/app.component.html b/projects/nshmp-apps/src/app/dev/dashboard/app.component.html index 6f4c9fe7c54551bdb0dfab21166edcfa4eb98424..19568f897d61cb473a96cce4fb377258535caec2 100644 --- a/projects/nshmp-apps/src/app/dev/dashboard/app.component.html +++ b/projects/nshmp-apps/src/app/dev/dashboard/app.component.html @@ -2,9 +2,9 @@ <!-- Dashboard --> <nshmp-lib-ng-dashboard [sections]="sections"> <nshmp-lib-ng-dashboard-title> - USGS Earthquake + USGS Development <br /> - Development + Earthquake <br /> Hazard Toolbox </nshmp-lib-ng-dashboard-title> diff --git a/projects/nshmp-apps/src/app/dev/dashboard/app.component.ts b/projects/nshmp-apps/src/app/dev/dashboard/app.component.ts index 28957cbc6c6725d3896d6cab826b2369d53f2b85..fc22fe0f0c64b4113fa9748666f4008dd26221ef 100644 --- a/projects/nshmp-apps/src/app/dev/dashboard/app.component.ts +++ b/projects/nshmp-apps/src/app/dev/dashboard/app.component.ts @@ -34,24 +34,16 @@ export class AppComponent { /** Navigation list for menu */ navigationList = nav.devNavigation(); - /** AWS applications */ - private awsApps = nav.devAwsApps(); /** Main development applications */ private mainApps = nav.devMainApps(); sections: ApplicationSections[] = [ { + gridClass: 'grid-col-10', sections: [ { applications: this.mainApps.map(navigation => ({navigation})), - }, - ], - }, - { - sections: [ - { - applications: this.awsApps.map(navigation => ({navigation})), - title: 'AWS', + gridClass: 'grid-col-12 tablet-lg:grid-col-8 grid-offset-1', }, ], }, diff --git a/projects/nshmp-apps/src/app/dev/gmm/dashboard/app.component.html b/projects/nshmp-apps/src/app/dev/gmm/dashboard/app.component.html new file mode 100644 index 0000000000000000000000000000000000000000..389a2c0fdcf728e3193e7472f0deb41ebd34c4a2 --- /dev/null +++ b/projects/nshmp-apps/src/app/dev/gmm/dashboard/app.component.html @@ -0,0 +1,21 @@ +<nshmp-lib-ng-template #template [navigationList]="navigationList" [title]=""> + <!-- Dashboard --> + <nshmp-lib-ng-dashboard [sections]="sections"> + <nshmp-lib-ng-dashboard-title> + USGS Development + <br /> + Earthquake Hazard Toolbox: + <br /> + Ground Motion Model Applications + </nshmp-lib-ng-dashboard-title> + <nshmp-lib-ng-dashboard-description /> + </nshmp-lib-ng-dashboard> + + <!-- About page --> + <nshmp-lib-ng-about-page> + <nshmp-lib-ng-about-content + [showSavingSettingPanel]="false" + [showUsingApplicationPanel]="false" + /> + </nshmp-lib-ng-about-page> +</nshmp-lib-ng-template> diff --git a/projects/nshmp-apps/src/app/dev/gmm/dashboard/app.component.scss b/projects/nshmp-apps/src/app/dev/gmm/dashboard/app.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/projects/nshmp-apps/src/app/dev/gmm/dashboard/app.component.spec.ts b/projects/nshmp-apps/src/app/dev/gmm/dashboard/app.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..10ce8a0027da801bcb011e66163c0de975d46b49 --- /dev/null +++ b/projects/nshmp-apps/src/app/dev/gmm/dashboard/app.component.spec.ts @@ -0,0 +1,30 @@ +import {provideHttpClient} from '@angular/common/http'; +import {ComponentFixture, TestBed} from '@angular/core/testing'; +import {provideNoopAnimations} from '@angular/platform-browser/animations'; +import {provideRouter} from '@angular/router'; + +import {AppComponent} from './app.component'; + +describe('AppComponent', () => { + let component: AppComponent; + let fixture: ComponentFixture<AppComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [AppComponent], + providers: [ + provideHttpClient(), + provideNoopAnimations(), + provideRouter([]), + ], + }).compileComponents(); + + fixture = TestBed.createComponent(AppComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/projects/nshmp-apps/src/app/dev/gmm/dashboard/app.component.ts b/projects/nshmp-apps/src/app/dev/gmm/dashboard/app.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..f7275a6cdd22b5560f1a63ab313e848b4518eaa6 --- /dev/null +++ b/projects/nshmp-apps/src/app/dev/gmm/dashboard/app.component.ts @@ -0,0 +1,47 @@ +import {Component} from '@angular/core'; +import { + NshmpLibNgAboutContentComponent, + NshmpLibNgAboutPageComponent, +} from '@ghsc/nshmp-lib-ng/about'; +import { + ApplicationSections, + NshmpLibNgDashboardComponent, + NshmpLibNgDashboardDescriptionComponent, + NshmpLibNgDashboardTitleComponent, + NshmpLibNgTemplateComponent, +} from '@ghsc/nshmp-lib-ng/nshmp'; +import { + devGmmApps, + devNavigation, +} from 'projects/nshmp-apps/src/shared/utils/navigation.utils'; + +@Component({ + imports: [ + NshmpLibNgTemplateComponent, + NshmpLibNgAboutPageComponent, + NshmpLibNgDashboardComponent, + NshmpLibNgDashboardTitleComponent, + NshmpLibNgDashboardDescriptionComponent, + NshmpLibNgAboutContentComponent, + ], + selector: 'app-app', + standalone: true, + styleUrl: './app.component.scss', + templateUrl: './app.component.html', +}) +export class AppComponent { + /** Navigation list for menu */ + navigationList = devNavigation(); + + sections: ApplicationSections[] = [ + { + gridClass: 'grid-col-10', + sections: [ + { + applications: devGmmApps().map(navigation => ({navigation})), + gridClass: 'grid-col-12 tablet-lg:grid-col-8 grid-offset-1', + }, + ], + }, + ]; +} diff --git a/projects/nshmp-apps/src/app/dev/gmm/gmm.routes.ts b/projects/nshmp-apps/src/app/dev/gmm/gmm.routes.ts index 2535e4b485a8ab2fc24ade03ba70dde0efa02051..8cf6b0c4c4d5415c6cd5f015952d9e885e82b9df 100644 --- a/projects/nshmp-apps/src/app/dev/gmm/gmm.routes.ts +++ b/projects/nshmp-apps/src/app/dev/gmm/gmm.routes.ts @@ -2,6 +2,11 @@ import {Routes} from '@angular/router'; /** Routes for dev GMM applications */ const routes: Routes = [ + { + loadComponent: () => + import('./dashboard/app.component').then(com => com.AppComponent), + path: '', + }, { loadComponent: () => import('./hanging-wall-effects/app.component').then( diff --git a/projects/nshmp-apps/src/app/dev/hazard/dashboard/app.component.html b/projects/nshmp-apps/src/app/dev/hazard/dashboard/app.component.html new file mode 100644 index 0000000000000000000000000000000000000000..389d2a21b6a519e7dcffea32e4e9fb05f75f8064 --- /dev/null +++ b/projects/nshmp-apps/src/app/dev/hazard/dashboard/app.component.html @@ -0,0 +1,21 @@ +<nshmp-lib-ng-template #template [navigationList]="navigationList" [title]=""> + <!-- Dashboard --> + <nshmp-lib-ng-dashboard [sections]="sections"> + <nshmp-lib-ng-dashboard-title> + USGS Development + <br /> + Earthquake Hazard Toolbox: + <br /> + Hazard Applications + </nshmp-lib-ng-dashboard-title> + <nshmp-lib-ng-dashboard-description /> + </nshmp-lib-ng-dashboard> + + <!-- About page --> + <nshmp-lib-ng-about-page> + <nshmp-lib-ng-about-content + [showSavingSettingPanel]="false" + [showUsingApplicationPanel]="false" + /> + </nshmp-lib-ng-about-page> +</nshmp-lib-ng-template> diff --git a/projects/nshmp-apps/src/app/dev/hazard/dashboard/app.component.scss b/projects/nshmp-apps/src/app/dev/hazard/dashboard/app.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/projects/nshmp-apps/src/app/dev/hazard/dashboard/app.component.spec.ts b/projects/nshmp-apps/src/app/dev/hazard/dashboard/app.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..10ce8a0027da801bcb011e66163c0de975d46b49 --- /dev/null +++ b/projects/nshmp-apps/src/app/dev/hazard/dashboard/app.component.spec.ts @@ -0,0 +1,30 @@ +import {provideHttpClient} from '@angular/common/http'; +import {ComponentFixture, TestBed} from '@angular/core/testing'; +import {provideNoopAnimations} from '@angular/platform-browser/animations'; +import {provideRouter} from '@angular/router'; + +import {AppComponent} from './app.component'; + +describe('AppComponent', () => { + let component: AppComponent; + let fixture: ComponentFixture<AppComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [AppComponent], + providers: [ + provideHttpClient(), + provideNoopAnimations(), + provideRouter([]), + ], + }).compileComponents(); + + fixture = TestBed.createComponent(AppComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/projects/nshmp-apps/src/app/dev/hazard/dashboard/app.component.ts b/projects/nshmp-apps/src/app/dev/hazard/dashboard/app.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..6c827f6c1f7870aed51cb846af146f98848d0659 --- /dev/null +++ b/projects/nshmp-apps/src/app/dev/hazard/dashboard/app.component.ts @@ -0,0 +1,47 @@ +import {Component} from '@angular/core'; +import { + NshmpLibNgAboutContentComponent, + NshmpLibNgAboutPageComponent, +} from '@ghsc/nshmp-lib-ng/about'; +import { + ApplicationSections, + NshmpLibNgDashboardComponent, + NshmpLibNgDashboardDescriptionComponent, + NshmpLibNgDashboardTitleComponent, + NshmpLibNgTemplateComponent, +} from '@ghsc/nshmp-lib-ng/nshmp'; +import { + devHazardApps, + devNavigation, +} from 'projects/nshmp-apps/src/shared/utils/navigation.utils'; + +@Component({ + imports: [ + NshmpLibNgTemplateComponent, + NshmpLibNgAboutPageComponent, + NshmpLibNgDashboardComponent, + NshmpLibNgDashboardTitleComponent, + NshmpLibNgDashboardDescriptionComponent, + NshmpLibNgAboutContentComponent, + ], + selector: 'app-app', + standalone: true, + styleUrl: './app.component.scss', + templateUrl: './app.component.html', +}) +export class AppComponent { + /** Navigation list for menu */ + navigationList = devNavigation(); + + sections: ApplicationSections[] = [ + { + gridClass: 'grid-col-10', + sections: [ + { + applications: devHazardApps().map(navigation => ({navigation})), + gridClass: 'grid-col-12 tablet-lg:grid-col-8 grid-offset-1', + }, + ], + }, + ]; +} diff --git a/projects/nshmp-apps/src/app/dev/hazard/hazard.routes.ts b/projects/nshmp-apps/src/app/dev/hazard/hazard.routes.ts index 5e7bea6247cfd40f5d9165367d3cae50b7e445bf..8b81c2fb12be005c071b24373c9e9796e04f7fe4 100644 --- a/projects/nshmp-apps/src/app/dev/hazard/hazard.routes.ts +++ b/projects/nshmp-apps/src/app/dev/hazard/hazard.routes.ts @@ -5,6 +5,11 @@ import {DynamicHazardCompareGuard} from './dynamic-compare/guards/dynamic-hazard /** Routes for dev hazard applications */ const routes: Routes = [ + { + loadComponent: () => + import('./dashboard/app.component').then(com => com.AppComponent), + path: '', + }, { canActivate: [() => inject(DynamicHazardCompareGuard).canActivate()], loadComponent: () => diff --git a/projects/nshmp-apps/src/app/dev/math/dashboard/app.component.html b/projects/nshmp-apps/src/app/dev/math/dashboard/app.component.html new file mode 100644 index 0000000000000000000000000000000000000000..56569f555f18ce131d8497a4bdff82c980f01160 --- /dev/null +++ b/projects/nshmp-apps/src/app/dev/math/dashboard/app.component.html @@ -0,0 +1,21 @@ +<nshmp-lib-ng-template #template [navigationList]="navigationList" [title]=""> + <!-- Dashboard --> + <nshmp-lib-ng-dashboard [sections]="sections"> + <nshmp-lib-ng-dashboard-title> + USGS Development + <br /> + Earthquake Hazard Toolbox: + <br /> + Math Applications + </nshmp-lib-ng-dashboard-title> + <nshmp-lib-ng-dashboard-description /> + </nshmp-lib-ng-dashboard> + + <!-- About page --> + <nshmp-lib-ng-about-page> + <nshmp-lib-ng-about-content + [showSavingSettingPanel]="false" + [showUsingApplicationPanel]="false" + /> + </nshmp-lib-ng-about-page> +</nshmp-lib-ng-template> diff --git a/projects/nshmp-apps/src/app/dev/math/dashboard/app.component.scss b/projects/nshmp-apps/src/app/dev/math/dashboard/app.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/projects/nshmp-apps/src/app/dev/math/dashboard/app.component.spec.ts b/projects/nshmp-apps/src/app/dev/math/dashboard/app.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..10ce8a0027da801bcb011e66163c0de975d46b49 --- /dev/null +++ b/projects/nshmp-apps/src/app/dev/math/dashboard/app.component.spec.ts @@ -0,0 +1,30 @@ +import {provideHttpClient} from '@angular/common/http'; +import {ComponentFixture, TestBed} from '@angular/core/testing'; +import {provideNoopAnimations} from '@angular/platform-browser/animations'; +import {provideRouter} from '@angular/router'; + +import {AppComponent} from './app.component'; + +describe('AppComponent', () => { + let component: AppComponent; + let fixture: ComponentFixture<AppComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [AppComponent], + providers: [ + provideHttpClient(), + provideNoopAnimations(), + provideRouter([]), + ], + }).compileComponents(); + + fixture = TestBed.createComponent(AppComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/projects/nshmp-apps/src/app/dev/math/dashboard/app.component.ts b/projects/nshmp-apps/src/app/dev/math/dashboard/app.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..9ecce1d8a5c240c168ede347467a98795a37ec69 --- /dev/null +++ b/projects/nshmp-apps/src/app/dev/math/dashboard/app.component.ts @@ -0,0 +1,47 @@ +import {Component} from '@angular/core'; +import { + NshmpLibNgAboutContentComponent, + NshmpLibNgAboutPageComponent, +} from '@ghsc/nshmp-lib-ng/about'; +import { + ApplicationSections, + NshmpLibNgDashboardComponent, + NshmpLibNgDashboardDescriptionComponent, + NshmpLibNgDashboardTitleComponent, + NshmpLibNgTemplateComponent, +} from '@ghsc/nshmp-lib-ng/nshmp'; +import { + devMathApps, + devNavigation, +} from 'projects/nshmp-apps/src/shared/utils/navigation.utils'; + +@Component({ + imports: [ + NshmpLibNgTemplateComponent, + NshmpLibNgAboutPageComponent, + NshmpLibNgDashboardComponent, + NshmpLibNgDashboardTitleComponent, + NshmpLibNgDashboardDescriptionComponent, + NshmpLibNgAboutContentComponent, + ], + selector: 'app-app', + standalone: true, + styleUrl: './app.component.scss', + templateUrl: './app.component.html', +}) +export class AppComponent { + /** Navigation list for menu */ + navigationList = devNavigation(); + + sections: ApplicationSections[] = [ + { + gridClass: 'grid-col-10', + sections: [ + { + applications: devMathApps().map(navigation => ({navigation})), + gridClass: 'grid-col-12 tablet-lg:grid-col-8 grid-offset-1', + }, + ], + }, + ]; +} diff --git a/projects/nshmp-apps/src/app/dev/math/exceedance-explorer/app.component.ts b/projects/nshmp-apps/src/app/dev/math/exceedance-explorer/app.component.ts index 6fe0117fb816c6108fe8b50393385d60f049c6c4..9040ede33913c0edc4eaf313b8a09df7ddc4434e 100644 --- a/projects/nshmp-apps/src/app/dev/math/exceedance-explorer/app.component.ts +++ b/projects/nshmp-apps/src/app/dev/math/exceedance-explorer/app.component.ts @@ -42,5 +42,5 @@ export class AppComponent { /** Navigation list for menu */ navigationList = devNavigation(); /** Application title */ - title = devApps().exceedanceExplorer.display; + title = devApps().math.exceedanceExplorer.display; } diff --git a/projects/nshmp-apps/src/app/dev/math/math.routes.ts b/projects/nshmp-apps/src/app/dev/math/math.routes.ts index ce59f47f59015c626730f7554c4d1b23600a7397..864c1b0afa667f76e57eb52764ca88c67b0e089f 100644 --- a/projects/nshmp-apps/src/app/dev/math/math.routes.ts +++ b/projects/nshmp-apps/src/app/dev/math/math.routes.ts @@ -2,6 +2,11 @@ import {Routes} from '@angular/router'; /** Routes for math applications */ const routes: Routes = [ + { + loadComponent: () => + import('./dashboard/app.component').then(com => com.AppComponent), + path: '', + }, { loadComponent: () => import('./exceedance-explorer/app.component').then( diff --git a/projects/nshmp-apps/src/app/internal/aws/aws.routes.ts b/projects/nshmp-apps/src/app/internal/aws/aws.routes.ts index 66c5a618c323a781b5a10e01dbf85860a905f1d3..966d2a81faf6ad99956ce7c36266050dc0f69e17 100644 --- a/projects/nshmp-apps/src/app/internal/aws/aws.routes.ts +++ b/projects/nshmp-apps/src/app/internal/aws/aws.routes.ts @@ -1,6 +1,11 @@ import {Routes} from '@angular/router'; const routes: Routes = [ + { + loadComponent: () => + import('./dashboard/app.component').then(com => com.AppComponent), + path: '', + }, { loadComponent: () => import('./check-haz-jobs/app.component').then(com => com.AppComponent), diff --git a/projects/nshmp-apps/src/app/internal/aws/check-haz-jobs/app.component.ts b/projects/nshmp-apps/src/app/internal/aws/check-haz-jobs/app.component.ts index 12aa73e9c28f2fc9d3eaf14e5ce751c29509efb4..d6f700a2a7dd10257708e884731b2c62915bcb65 100644 --- a/projects/nshmp-apps/src/app/internal/aws/check-haz-jobs/app.component.ts +++ b/projects/nshmp-apps/src/app/internal/aws/check-haz-jobs/app.component.ts @@ -6,8 +6,8 @@ import { NshmpTemplateControlPanelComponent, NshmpTemplatePlotContentComponent, } from '@ghsc/nshmp-template'; -import {devApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; -import {devNavigation} from 'projects/nshmp-apps/src/shared/utils/navigation.utils'; +import {internalApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; +import {internalNavigation} from 'projects/nshmp-apps/src/shared/utils/navigation.utils'; import {AboutComponent} from './components/about/about.component'; import {ContentComponent} from './components/content/content.component'; @@ -40,9 +40,9 @@ import {AppService} from './services/app.service'; }) export class AppComponent implements OnInit { /** Navigation list for menu */ - navigationList = devNavigation(); + navigationList = internalNavigation(); /** Application title */ - title = devApps().aws.checkHazJobs.display; + title = internalApps().aws.checkHazJobs.display; constructor(private service: AppService) {} diff --git a/projects/nshmp-apps/src/app/internal/aws/check-haz-jobs/services/app.service.ts b/projects/nshmp-apps/src/app/internal/aws/check-haz-jobs/services/app.service.ts index 27a493a70e2f42ded42dab4cdf3e3aeaad032de2..b7777715c06beb97d67441c702b34bae690fa5a9 100644 --- a/projects/nshmp-apps/src/app/internal/aws/check-haz-jobs/services/app.service.ts +++ b/projects/nshmp-apps/src/app/internal/aws/check-haz-jobs/services/app.service.ts @@ -13,7 +13,7 @@ import {Response} from '@ghsc/nshmp-utils-ts/libs/nshmp-ws-utils'; import {EC2} from 'aws-sdk'; import {environment} from 'projects/nshmp-apps/src/environments/environment'; import {AppServiceModel} from 'projects/nshmp-apps/src/shared/models/app-service.model'; -import {devApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; +import {internalApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; import {catchError} from 'rxjs'; import {ControlForm} from '../models/control-form.model'; @@ -242,7 +242,7 @@ export class AppService implements AppServiceModel<AppState, ControlForm> { }; this.router - .navigate([devApps().aws.checkHazJobs.routerLink], { + .navigate([internalApps().aws.checkHazJobs.routerLink], { queryParams: { ...query, }, diff --git a/projects/nshmp-apps/src/app/internal/aws/dashboard/app.component.html b/projects/nshmp-apps/src/app/internal/aws/dashboard/app.component.html new file mode 100644 index 0000000000000000000000000000000000000000..d8f47ed31380dce4a26be2450f95b20328625dd0 --- /dev/null +++ b/projects/nshmp-apps/src/app/internal/aws/dashboard/app.component.html @@ -0,0 +1,21 @@ +<nshmp-lib-ng-template #template [navigationList]="navigationList" [title]=""> + <!-- Dashboard --> + <nshmp-lib-ng-dashboard [sections]="sections"> + <nshmp-lib-ng-dashboard-title> + USGS Internal + <br /> + Earthquake Hazard Toolbox: + <br /> + AWS Applications + </nshmp-lib-ng-dashboard-title> + <nshmp-lib-ng-dashboard-description /> + </nshmp-lib-ng-dashboard> + + <!-- About page --> + <nshmp-lib-ng-about-page> + <nshmp-lib-ng-about-content + [showSavingSettingPanel]="false" + [showUsingApplicationPanel]="false" + /> + </nshmp-lib-ng-about-page> +</nshmp-lib-ng-template> diff --git a/projects/nshmp-apps/src/app/internal/aws/dashboard/app.component.scss b/projects/nshmp-apps/src/app/internal/aws/dashboard/app.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/projects/nshmp-apps/src/app/internal/aws/dashboard/app.component.spec.ts b/projects/nshmp-apps/src/app/internal/aws/dashboard/app.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..10ce8a0027da801bcb011e66163c0de975d46b49 --- /dev/null +++ b/projects/nshmp-apps/src/app/internal/aws/dashboard/app.component.spec.ts @@ -0,0 +1,30 @@ +import {provideHttpClient} from '@angular/common/http'; +import {ComponentFixture, TestBed} from '@angular/core/testing'; +import {provideNoopAnimations} from '@angular/platform-browser/animations'; +import {provideRouter} from '@angular/router'; + +import {AppComponent} from './app.component'; + +describe('AppComponent', () => { + let component: AppComponent; + let fixture: ComponentFixture<AppComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [AppComponent], + providers: [ + provideHttpClient(), + provideNoopAnimations(), + provideRouter([]), + ], + }).compileComponents(); + + fixture = TestBed.createComponent(AppComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/projects/nshmp-apps/src/app/internal/aws/dashboard/app.component.ts b/projects/nshmp-apps/src/app/internal/aws/dashboard/app.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..f0f2cf4a2e0a1772271925e042b504adde79ded4 --- /dev/null +++ b/projects/nshmp-apps/src/app/internal/aws/dashboard/app.component.ts @@ -0,0 +1,47 @@ +import {Component} from '@angular/core'; +import { + NshmpLibNgAboutContentComponent, + NshmpLibNgAboutPageComponent, +} from '@ghsc/nshmp-lib-ng/about'; +import { + ApplicationSections, + NshmpLibNgDashboardComponent, + NshmpLibNgDashboardDescriptionComponent, + NshmpLibNgDashboardTitleComponent, + NshmpLibNgTemplateComponent, +} from '@ghsc/nshmp-lib-ng/nshmp'; +import { + internalAwsApps, + internalNavigation, +} from 'projects/nshmp-apps/src/shared/utils/navigation.utils'; + +@Component({ + imports: [ + NshmpLibNgTemplateComponent, + NshmpLibNgAboutPageComponent, + NshmpLibNgDashboardComponent, + NshmpLibNgDashboardTitleComponent, + NshmpLibNgDashboardDescriptionComponent, + NshmpLibNgAboutContentComponent, + ], + selector: 'app-app', + standalone: true, + styleUrl: './app.component.scss', + templateUrl: './app.component.html', +}) +export class AppComponent { + /** Navigation list for menu */ + navigationList = internalNavigation(); + + sections: ApplicationSections[] = [ + { + gridClass: 'grid-col-10', + sections: [ + { + applications: internalAwsApps().map(navigation => ({navigation})), + gridClass: 'grid-col-12 tablet-lg:grid-col-8 grid-offset-1', + }, + ], + }, + ]; +} diff --git a/projects/nshmp-apps/src/app/internal/aws/haz-job-history/app.component.ts b/projects/nshmp-apps/src/app/internal/aws/haz-job-history/app.component.ts index d490449fd723d99e6afe00f36a2b9c61f1bad140..ff4fecffe3bf40f1ba3bb78f0135b6a626e5a0d7 100644 --- a/projects/nshmp-apps/src/app/internal/aws/haz-job-history/app.component.ts +++ b/projects/nshmp-apps/src/app/internal/aws/haz-job-history/app.component.ts @@ -6,8 +6,8 @@ import { NshmpTemplateControlPanelComponent, NshmpTemplatePlotContentComponent, } from '@ghsc/nshmp-template'; -import {devApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; -import {devNavigation} from 'projects/nshmp-apps/src/shared/utils/navigation.utils'; +import {internalApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; +import {internalNavigation} from 'projects/nshmp-apps/src/shared/utils/navigation.utils'; import {AboutComponent} from './components/about/about.component'; import {ContentComponent} from './components/content/content.component'; @@ -38,9 +38,9 @@ import {AppService} from './services/app.service'; }) export class AppComponent implements OnInit { /** Navigation list for menu */ - navigationList = devNavigation(); + navigationList = internalNavigation(); /** Application title */ - title = devApps().aws.hazJobHistory.display; + title = internalApps().aws.hazJobHistory.display; constructor(private service: AppService) {} diff --git a/projects/nshmp-apps/src/app/internal/aws/haz-job-history/services/app.service.ts b/projects/nshmp-apps/src/app/internal/aws/haz-job-history/services/app.service.ts index cff795551780f9b63b6ad89c4baf2b5e87d71df3..7971407954ace37ac44265221a3234f468a889a1 100644 --- a/projects/nshmp-apps/src/app/internal/aws/haz-job-history/services/app.service.ts +++ b/projects/nshmp-apps/src/app/internal/aws/haz-job-history/services/app.service.ts @@ -6,7 +6,7 @@ import {NshmpService, nshmpUtils} from '@ghsc/nshmp-lib-ng/nshmp'; import {DynamoDBItem} from '@ghsc/nshmp-utils-ts/libs/aws/run-nshmp-haz'; import {environment} from 'projects/nshmp-apps/src/environments/environment'; import {AppServiceModel} from 'projects/nshmp-apps/src/shared/models/app-service.model'; -import {devApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; +import {internalApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; import {ControlForm} from '../models/control-form.model'; import {AppState} from '../models/state.model'; @@ -170,7 +170,7 @@ export class AppService implements AppServiceModel<AppState, ControlForm> { }; this.router - .navigate([devApps().aws.hazJobHistory.routerLink], { + .navigate([internalApps().aws.hazJobHistory.routerLink], { queryParams: { ...query, }, diff --git a/projects/nshmp-apps/src/app/internal/aws/submit-haz-jobs/app.component.ts b/projects/nshmp-apps/src/app/internal/aws/submit-haz-jobs/app.component.ts index 4ec472351653712283ed17a600386312efe7f2d7..d9967b88e14a5e7231cccc707276a52319d7154c 100644 --- a/projects/nshmp-apps/src/app/internal/aws/submit-haz-jobs/app.component.ts +++ b/projects/nshmp-apps/src/app/internal/aws/submit-haz-jobs/app.component.ts @@ -1,8 +1,8 @@ import {Component, OnInit} from '@angular/core'; import {NshmpLibNgAboutPageComponent} from '@ghsc/nshmp-lib-ng/about'; import {NshmpLibNgTemplateComponent} from '@ghsc/nshmp-lib-ng/nshmp'; -import {devApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; -import {devNavigation} from 'projects/nshmp-apps/src/shared/utils/navigation.utils'; +import {internalApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; +import {internalNavigation} from 'projects/nshmp-apps/src/shared/utils/navigation.utils'; import {AboutComponent} from './components/about/about.component'; import {ContentComponent} from './components/content/content.component'; @@ -29,9 +29,9 @@ import {AppService} from './services/app.service'; }) export class AppComponent implements OnInit { /** Navigation list for menu */ - navigationList = devNavigation(); + navigationList = internalNavigation(); /** Application title */ - title = devApps().aws.submitHazJobs.display; + title = internalApps().aws.submitHazJobs.display; constructor(private service: AppService) {} diff --git a/projects/nshmp-apps/src/app/internal/aws/submit-haz-jobs/components/history/history.component.ts b/projects/nshmp-apps/src/app/internal/aws/submit-haz-jobs/components/history/history.component.ts index 2438bb00d7c2ee131255f8ebef3fb6ea9440e1eb..aba858c61d13e57be49eb52826105dec77498da8 100644 --- a/projects/nshmp-apps/src/app/internal/aws/submit-haz-jobs/components/history/history.component.ts +++ b/projects/nshmp-apps/src/app/internal/aws/submit-haz-jobs/components/history/history.component.ts @@ -24,7 +24,7 @@ import { RunNshmpHazResponseData, } from '@ghsc/nshmp-utils-ts/libs/aws/run-nshmp-haz'; import {Response} from '@ghsc/nshmp-utils-ts/libs/nshmp-ws-utils'; -import {devApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; +import {internalApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; import {AppService} from '../../services/app.service'; @@ -53,7 +53,7 @@ import {AppService} from '../../services/app.service'; templateUrl: './history.component.html', }) export class HistoryComponent { - awsLinks = devApps().aws; + awsLinks = internalApps().aws; history = this.service.history; diff --git a/projects/nshmp-apps/src/app/internal/aws/submit-haz-jobs/components/job-submitted/job-submitted.component.ts b/projects/nshmp-apps/src/app/internal/aws/submit-haz-jobs/components/job-submitted/job-submitted.component.ts index c0989f62c6041ad02d396a4aefdf0ff77182dcb7..ddc0532a752d169de15770a658ce66936983e8de 100644 --- a/projects/nshmp-apps/src/app/internal/aws/submit-haz-jobs/components/job-submitted/job-submitted.component.ts +++ b/projects/nshmp-apps/src/app/internal/aws/submit-haz-jobs/components/job-submitted/job-submitted.component.ts @@ -13,7 +13,7 @@ import {MatExpansionModule} from '@angular/material/expansion'; import {Router} from '@angular/router'; import {YamlPipe} from '@ghsc/nshmp-lib-ng/aws'; import {RunNshmpHazResponseData} from '@ghsc/nshmp-utils-ts/libs/aws/run-nshmp-haz'; -import {devApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; +import {internalApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; import {AppService} from '../../services/app.service'; @@ -52,7 +52,7 @@ export class JobSubmittedComponent { this.router.createUrlTree( [ this.location.prepareExternalUrl( - devApps().aws.checkHazJobs.routerLink + internalApps().aws.checkHazJobs.routerLink ), ], { diff --git a/projects/nshmp-apps/src/app/internal/aws/terminate-haz-jobs/app.component.ts b/projects/nshmp-apps/src/app/internal/aws/terminate-haz-jobs/app.component.ts index a3180091c818ddba0ee1e0bd5cbfd699c270f6f0..5e3984abaac4b11eb53970285ffe595476982f51 100644 --- a/projects/nshmp-apps/src/app/internal/aws/terminate-haz-jobs/app.component.ts +++ b/projects/nshmp-apps/src/app/internal/aws/terminate-haz-jobs/app.component.ts @@ -1,8 +1,8 @@ import {Component, OnInit} from '@angular/core'; import {NshmpLibNgAboutPageComponent} from '@ghsc/nshmp-lib-ng/about'; import {NshmpLibNgTemplateComponent} from '@ghsc/nshmp-lib-ng/nshmp'; -import {devApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; -import {devNavigation} from 'projects/nshmp-apps/src/shared/utils/navigation.utils'; +import {internalApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; +import {internalNavigation} from 'projects/nshmp-apps/src/shared/utils/navigation.utils'; import {AboutComponent} from './components/about/about.component'; import {ContentComponent} from './components/content/content.component'; @@ -29,9 +29,9 @@ import {AppService} from './services/app.service'; }) export class AppComponent implements OnInit { /** Navigation list for menu */ - navigationList = devNavigation(); + navigationList = internalNavigation(); /** Application title */ - title = devApps().aws.terminateHazJobs.display; + title = internalApps().aws.terminateHazJobs.display; constructor(private service: AppService) {} diff --git a/projects/nshmp-apps/src/app/internal/aws/terminate-haz-jobs/services/app.service.ts b/projects/nshmp-apps/src/app/internal/aws/terminate-haz-jobs/services/app.service.ts index 0516aa9fb22947c68dc4688b25c62cca89e53413..8b5b4b56adb616605af73de0c6042617e1beaeec 100644 --- a/projects/nshmp-apps/src/app/internal/aws/terminate-haz-jobs/services/app.service.ts +++ b/projects/nshmp-apps/src/app/internal/aws/terminate-haz-jobs/services/app.service.ts @@ -13,7 +13,7 @@ import {Response} from '@ghsc/nshmp-utils-ts/libs/nshmp-ws-utils'; import {EC2} from 'aws-sdk'; import {environment} from 'projects/nshmp-apps/src/environments/environment'; import {AppServiceModel} from 'projects/nshmp-apps/src/shared/models/app-service.model'; -import {devApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; +import {internalApps} from 'projects/nshmp-apps/src/shared/utils/applications.utils'; import {AppState} from '../models/state.model'; @@ -155,7 +155,7 @@ export class AppService implements AppServiceModel<AppState, IdForm> { }; this.router - .navigate([devApps().aws.terminateHazJobs.routerLink], { + .navigate([internalApps().aws.terminateHazJobs.routerLink], { queryParams: { ...query, }, diff --git a/projects/nshmp-apps/src/app/internal/dashboard/app.component.html b/projects/nshmp-apps/src/app/internal/dashboard/app.component.html index ba0728ed002fc40d1b8bdf8eef71bb819b3f973f..2384d26ae35e3c78c73bcc2c37f069e6bc6a1d45 100644 --- a/projects/nshmp-apps/src/app/internal/dashboard/app.component.html +++ b/projects/nshmp-apps/src/app/internal/dashboard/app.component.html @@ -2,7 +2,7 @@ <!-- Dashboard --> <nshmp-lib-ng-dashboard [sections]="sections"> <nshmp-lib-ng-dashboard-title> - USGS Earthquake + USGS Internal Earthquake <br /> Hazard Toolbox: <br /> diff --git a/projects/nshmp-apps/src/app/internal/dashboard/app.component.ts b/projects/nshmp-apps/src/app/internal/dashboard/app.component.ts index 51c6803040c302d59ff4bd9265d03c334e21a947..42fbf69187601c51eae73de510a7ed9a56cab5cc 100644 --- a/projects/nshmp-apps/src/app/internal/dashboard/app.component.ts +++ b/projects/nshmp-apps/src/app/internal/dashboard/app.component.ts @@ -34,16 +34,17 @@ import {AuthService} from '../shared/services/auth.service'; }) export class AppComponent implements OnInit, OnDestroy { /** Navigation list for menu */ - navigationList = nav.devNavigation(); + navigationList = nav.internalNavigation(); /** AWS applications */ - private awsApps = nav.devAwsApps(); + private awsApps = nav.internalAwsApps(); sections: ApplicationSections[] = []; private sub: Subscription; constructor(private authService: AuthService) {} + ngOnInit(): void { this.sub = this.authService.isAuthorized().subscribe(() => { this.sections = [ diff --git a/projects/nshmp-apps/src/shared/models/applications.model.ts b/projects/nshmp-apps/src/shared/models/applications.model.ts index e308e0beaf0deae6f01015b312c107283b61c787..001335a719662706812db148de6bc24cd901cd2f 100644 --- a/projects/nshmp-apps/src/shared/models/applications.model.ts +++ b/projects/nshmp-apps/src/shared/models/applications.model.ts @@ -26,6 +26,8 @@ export interface Applications { export interface AwsApplications { /** Check hazard jobs application */ checkHazJobs: Navigation; + /** Dashboard */ + dashboard: Navigation; /** Hazard run job history application */ hazJobHistory: Navigation; /** Submit hazard run jobs application */ @@ -38,22 +40,36 @@ export interface AwsApplications { * Development applications navigation config. */ export interface DevApplications { - /** AWS applications */ - aws: AwsApplications; /** Dev dashboard */ dashboard: Navigation; - /** Exceedance explorer applications */ - exceedanceExplorer: Navigation; /** Dev GMM applications */ gmm: DevGmmApplications; /** Dev hazard applications */ hazard: DevHazardApplications; + /** Dev math applications */ + math: DevMathApplications; +} + +export interface DevMathApplications { + /** Math dashboard */ + dashboard: Navigation; + /** Exceedance explorer applications */ + exceedanceExplorer: Navigation; +} + +export interface InternalApplications { + /** AWS applications */ + aws: AwsApplications; + /** Internal dashboard */ + dashboard: Navigation; } /** * Development GMM applications. */ export interface DevGmmApplications { + /** Dev GMM dashboard */ + dashboard: Navigation; /** Hanging wall effects application */ hangingWallEffects: Navigation; } @@ -62,6 +78,8 @@ export interface DevGmmApplications { * Development hazard applications. */ export interface DevHazardApplications { + /** Dev harad dashboard */ + dashboard: Navigation; /** Dynamic compare hazard applicaiton */ dynamicCompare: Navigation; } diff --git a/projects/nshmp-apps/src/shared/utils/applications.utils.ts b/projects/nshmp-apps/src/shared/utils/applications.utils.ts index 64c22fdcd6ab4d1e8cf5b1b30363bd097b8fbc53..1cbaa5e1738cb4150beef255ffe59da324529849 100644 --- a/projects/nshmp-apps/src/shared/utils/applications.utils.ts +++ b/projects/nshmp-apps/src/shared/utils/applications.utils.ts @@ -1,4 +1,8 @@ -import {Applications, DevApplications} from '../models/applications.model'; +import { + Applications, + DevApplications, + InternalApplications, +} from '../models/applications.model'; /** Main application name */ export const TOOLBOX_NAME = 'USGS Earthquake Hazard Toolbox'; @@ -103,43 +107,78 @@ export function apps(): Applications { */ export function devApps(): DevApplications { return { - aws: { - checkHazJobs: { - display: 'Check nshmp-haz Jobs', - routerLink: '/dev/aws/check-haz-jobs', - }, - hazJobHistory: { - display: 'nshmp-haz Job History', - routerLink: '/dev/aws/haz-job-history', - }, - submitHazJobs: { - display: 'Submit nshmp-haz Jobs', - routerLink: '/dev/aws/submit-haz-jobs', - }, - terminateHazJobs: { - display: 'Terminate nshmp-haz Jobs', - routerLink: '/dev/aws/terminate-haz-jobs', - }, - }, dashboard: { display: 'Development Dashboard', routerLink: '/dev', }, - exceedanceExplorer: { - display: 'Exceedance Explorer', - routerLink: '/dev/math/exceedance-explorer', - }, gmm: { + dashboard: { + display: 'Development GMM Dashboard', + routerLink: '/dev/gmm', + showInDashboard: false, + }, hangingWallEffects: { display: 'Hanging Wall Effects', routerLink: '/dev/gmm/hanging-wall-effects', }, }, hazard: { + dashboard: { + display: 'Development Hazard Dashboard', + routerLink: '/dev/hazard', + showInDashboard: false, + }, dynamicCompare: { display: 'Dynamic Hazard Compare', routerLink: '/dev/hazard/dynamic-compare', }, }, + math: { + dashboard: { + display: 'Development Math Dashboard', + routerLink: '/dev/math', + showInDashboard: false, + }, + exceedanceExplorer: { + display: 'Exceedance Explorer', + routerLink: '/dev/math/exceedance-explorer', + }, + }, + }; +} + +/** + * Returns all the dev application info. + */ +export function internalApps(): InternalApplications { + return { + aws: { + dashboard: { + display: 'Internal AWS Dashboard', + routerLink: '/internal/aws', + showInDashboard: false, + }, + // eslint-disable-next-line sort-keys-fix/sort-keys-fix + checkHazJobs: { + display: 'Check nshmp-haz Jobs', + routerLink: '/internal/aws/check-haz-jobs', + }, + hazJobHistory: { + display: 'nshmp-haz Job History', + routerLink: '/internal/aws/haz-job-history', + }, + submitHazJobs: { + display: 'Submit nshmp-haz Jobs', + routerLink: '/internal/aws/submit-haz-jobs', + }, + terminateHazJobs: { + display: 'Terminate nshmp-haz Jobs', + routerLink: '/internal/aws/terminate-haz-jobs', + }, + }, + dashboard: { + display: 'Internal Dashboard', + routerLink: '/internal', + }, }; } diff --git a/projects/nshmp-apps/src/shared/utils/navigation.utils.ts b/projects/nshmp-apps/src/shared/utils/navigation.utils.ts index d9a6082add1f324bb52489fe355d69373d4106d2..9b66d1f3a6057e080f71963394e85e3a6e284ac2 100644 --- a/projects/nshmp-apps/src/shared/utils/navigation.utils.ts +++ b/projects/nshmp-apps/src/shared/utils/navigation.utils.ts @@ -4,6 +4,7 @@ import * as ApplicationsUtils from './applications.utils'; const APPS = ApplicationsUtils.apps(); const DEV_APPS = ApplicationsUtils.devApps(); +const INTERNAL_APPS = ApplicationsUtils.internalApps(); /** * Returns the list of design map application. @@ -12,11 +13,12 @@ export function designMapApps(): Navigation[] { return Object.values(APPS.designMaps) as Navigation[]; } -/** - * Returns the list of AWS applications. - */ -export function devAwsApps(): Navigation[] { - return Object.values(DEV_APPS.aws) as Navigation[]; +export function devGmmApps(): Navigation[] { + return Object.values(DEV_APPS.gmm) as Navigation[]; +} + +export function devHazardApps(): Navigation[] { + return Object.values(DEV_APPS.hazard) as Navigation[]; } /** @@ -24,23 +26,35 @@ export function devAwsApps(): Navigation[] { */ export function devMainApps(): Navigation[] { return [ - DEV_APPS.exceedanceExplorer, + DEV_APPS.math.exceedanceExplorer, DEV_APPS.hazard.dynamicCompare, DEV_APPS.gmm.hangingWallEffects, ]; } +export function devMathApps(): Navigation[] { + return Object.values(DEV_APPS.math) as Navigation[]; +} + /** * Returns the drop down navigation menu for development applications. */ export function devNavigation(): NavigationList[] { const devNavigation: NavigationList[] = [ { - navigation: [DEV_APPS.dashboard, ...devMainApps()], + navigation: [DEV_APPS.dashboard], }, { - navigation: devAwsApps(), - subHeader: 'AWS', + navigation: devHazardApps(), + subHeader: 'Hazard', + }, + { + navigation: devGmmApps(), + subHeader: 'Ground Motion Models', + }, + { + navigation: devMathApps(), + subHeader: 'Math', }, ]; @@ -61,6 +75,31 @@ export function hazardApps(): Navigation[] { return Object.values(APPS.hazard) as Navigation[]; } +/** + * Returns the list of AWS applications. + */ +export function internalAwsApps(): Navigation[] { + return Object.values(INTERNAL_APPS.aws) as Navigation[]; +} + +export function internalMainApps(): Navigation[] { + return internalAwsApps(); +} + +export function internalNavigation(): NavigationList[] { + const internalNavigation: NavigationList[] = [ + { + navigation: [INTERNAL_APPS.dashboard], + }, + { + navigation: internalAwsApps(), + subHeader: 'AWS', + }, + ]; + + return [...internalNavigation]; +} + /** * Returns the list of main applications. */ @@ -101,6 +140,10 @@ export function navigation(): NavigationList[] { navigation: ncmApps(), subHeader: 'National Crustal Model', }, + { + navigation: [DEV_APPS.dashboard, ...devMainApps()], + subHeader: 'Development', + }, { navigation: [APPS.services], },