Skip to content
Snippets Groups Projects
Commit 4ec0f7af authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

add internal dashboard

parent c0d58c10
No related branches found
No related tags found
1 merge request!538Internal Applications
name: Development Dashboard
<nshmp-lib-ng-template #template [navigationList]="navigationList">
<!-- Dashboard -->
<nshmp-lib-ng-dashboard [sections]="sections">
<nshmp-lib-ng-dashboard-title>
USGS Earthquake
<br />
Hazard Toolbox:
<br />
Internal 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>
@import '../../../styles/dashboards';
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('DashboardComponent', () => {
let component: AppComponent;
let fixture: ComponentFixture<AppComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AppComponent],
providers: [
provideHttpClient(),
provideNoopAnimations(),
provideRouter([]),
],
teardown: {destroyAfterEach: false},
}).compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(AppComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import {Component, OnDestroy, OnInit} 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 {Subscription} from 'rxjs';
import * as nav from '../../../shared/utils/navigation.utils';
import {AuthService} from '../shared/services/auth.service';
/**
* Development dashboard showing links to development applications.
*/
@Component({
imports: [
NshmpLibNgTemplateComponent,
NshmpLibNgAboutPageComponent,
NshmpLibNgAboutContentComponent,
NshmpLibNgDashboardComponent,
NshmpLibNgDashboardTitleComponent,
NshmpLibNgDashboardDescriptionComponent,
],
selector: 'app-app',
standalone: true,
styleUrl: './app.component.scss',
templateUrl: './app.component.html',
})
export class AppComponent implements OnInit, OnDestroy {
/** Navigation list for menu */
navigationList = nav.devNavigation();
/** AWS applications */
private awsApps = nav.devAwsApps();
sections: ApplicationSections[] = [];
private sub: Subscription;
constructor(private authService: AuthService) {}
ngOnInit(): void {
this.sub = this.authService.isAuthorized().subscribe(() => {
this.sections = [
{
sections: [
{
applications: this.awsApps.map(navigation => ({navigation})),
},
],
},
];
});
}
ngOnDestroy(): void {
this.sections = [];
this.sub.unsubscribe();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment