diff --git a/projects/nshmp-apps/src/app/source/dashboard/app.component.html b/projects/nshmp-apps/src/app/source/dashboard/app.component.html new file mode 100644 index 0000000000000000000000000000000000000000..a39713d9b34abad6f55e9e2bc11c1a30c7676772 --- /dev/null +++ b/projects/nshmp-apps/src/app/source/dashboard/app.component.html @@ -0,0 +1,19 @@ +<nshmp-lib-ng-template #template [navigationList]="navigationList" [title]=""> + <!-- Dashboard --> + <nshmp-lib-ng-dashboard [sections]="sections"> + <nshmp-lib-ng-dashboard-title> + USGS Earthquake Hazard Toolbox: + <br /> + Source 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/source/dashboard/app.component.scss b/projects/nshmp-apps/src/app/source/dashboard/app.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/projects/nshmp-apps/src/app/source/dashboard/app.component.spec.ts b/projects/nshmp-apps/src/app/source/dashboard/app.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..10ce8a0027da801bcb011e66163c0de975d46b49 --- /dev/null +++ b/projects/nshmp-apps/src/app/source/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/source/dashboard/app.component.ts b/projects/nshmp-apps/src/app/source/dashboard/app.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..a19b283acfda3311353dbc7c031970ef15598f1a --- /dev/null +++ b/projects/nshmp-apps/src/app/source/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 { + navigation, + sourceModelApps, +} 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 = navigation(); + + sections: ApplicationSections[] = [ + { + gridClass: 'grid-col-10', + sections: [ + { + applications: sourceModelApps().map(navigation => ({navigation})), + gridClass: 'grid-col-12 tablet-lg:grid-col-8 grid-offset-1', + }, + ], + }, + ]; +} diff --git a/projects/nshmp-apps/src/app/source/source.routes.ts b/projects/nshmp-apps/src/app/source/source.routes.ts index 36e53d53bbf319fb4fc9ff83332325089d2da692..5054debe490160c7202507414ec78e7c83a7cd27 100644 --- a/projects/nshmp-apps/src/app/source/source.routes.ts +++ b/projects/nshmp-apps/src/app/source/source.routes.ts @@ -2,6 +2,11 @@ import {Routes} from '@angular/router'; /** Routes for source model applications */ const routes: Routes = [ + { + loadComponent: () => + import('./dashboard/app.component').then(com => com.AppComponent), + path: '', + }, // model maps application { loadComponent: () =>