diff --git a/projects/nshmp-apps/src/app/hazard/disagg/components/content/content.component.html b/projects/nshmp-apps/src/app/hazard/disagg/components/content/content.component.html index 1573a5b2071cb3f3f5229e0fda71774914d88c0f..58c70ef6fbce0aad9d77bf718c3f346c40a6fc92 100644 --- a/projects/nshmp-apps/src/app/hazard/disagg/components/content/content.component.html +++ b/projects/nshmp-apps/src/app/hazard/disagg/components/content/content.component.html @@ -1,86 +1,103 @@ -<mat-tab-group class="height-full"> - <mat-tab label="Plots"> - <ng-template matTabContent> - <div class="height-full overflow-auto report"> - <div class="grid-container-widescreen"> - <!-- Report title, show only on print --> - <div class="print-content-only"> - <h2>Disaggregation Report</h2> - </div> +<div class="height-full overflow-auto report"> + <div class="grid-container-widescreen"> + <!-- Report title, show only on print --> + <div class="print-content-only"> + <h2>Disaggregation Report</h2> + </div> - <div class="padding-y-4"> - <mat-accordion multi> - <!-- Disagg plot panel --> - <mat-expansion-panel expanded class="disagg-panel"> - <mat-expansion-panel-header> - <mat-panel-title>Disaggregation</mat-panel-title> - </mat-expansion-panel-header> + <div class="padding-y-4"> + <mat-accordion multi> + <!-- Disagg plot panel --> + <mat-expansion-panel expanded class="disagg-panel"> + <mat-expansion-panel-header> + <mat-panel-title>Disaggregation</mat-panel-title> + </mat-expansion-panel-header> - <app-plots /> - </mat-expansion-panel> + <app-plots /> + </mat-expansion-panel> - <!-- Geographical disagg panel --> - <mat-expansion-panel - [expanded]="hasLayers()" - [disabled]="hasLayers() === false" - class="geo-disagg-panel print-page-break" - > - <mat-expansion-panel-header> - <mat-panel-title>Geographical Disaggregation</mat-panel-title> - </mat-expansion-panel-header> + <!-- Geographical disagg panel --> + <mat-expansion-panel + [expanded]="hasLayers()" + [disabled]="hasLayers() === false" + class="geo-disagg-panel print-page-break" + > + <mat-expansion-panel-header> + <mat-panel-title>Geographical Disaggregation</mat-panel-title> + </mat-expansion-panel-header> - <mat-divider /> + <mat-divider /> - <app-geo-disagg /> - </mat-expansion-panel> + <app-geo-disagg /> + </mat-expansion-panel> - <!-- Parameter summary panel --> - <mat-expansion-panel expanded> - <mat-expansion-panel-header> - <mat-panel-title>Parameter Summary</mat-panel-title> - </mat-expansion-panel-header> + <!-- Parameter summary panel --> + <mat-expansion-panel expanded> + <mat-expansion-panel-header> + <mat-panel-title>Parameter Summary</mat-panel-title> + </mat-expansion-panel-header> - <app-parameter-summary /> - </mat-expansion-panel> + <app-parameter-summary /> + </mat-expansion-panel> - <div class="print-content-only print-full-page"> - <mat-expansion-panel class="print-page-break" expanded> - <app-disagg-summary [componentData]="componentData()" /> - </mat-expansion-panel> - </div> + <!-- Summary report --> + <mat-expansion-panel + class="summary-report print-full-page" + [expanded]="disaggData()" + [disabled]="disaggData() === null" + > + <mat-expansion-panel-header> + <mat-panel-title + >Disaggregation Summary: + {{ formGroup.getRawValue().disaggComponent }}</mat-panel-title + > + </mat-expansion-panel-header> - <div class="print-content-only print-full-page"> - <mat-expansion-panel class="print-page-break" expanded> - <app-disagg-contributors [componentData]="componentData()" /> - </mat-expansion-panel> - </div> + <app-disagg-summary [componentData]="componentData()" /> + </mat-expansion-panel> - <!-- App metadata --> - <mat-expansion-panel - class="print-page-break print-full-page" - expanded - > - <mat-expansion-panel-header> - <mat-panel-title>Application Metadata</mat-panel-title> - </mat-expansion-panel-header> + <!-- Contributions --> + <mat-expansion-panel + class="contributions print-full-page" + [expanded]="componentData()?.sources.length > 0" + [disabled]="componentData()?.sources.length === 0" + > + <mat-expansion-panel-header> + <mat-panel-title + >Disaggregation Contributions: + {{ formGroup.getRawValue().disaggComponent }}</mat-panel-title + > + </mat-expansion-panel-header> - <mat-divider /> - <nshmp-lib-ng-app-metadata [repositories]="repositories()" /> - </mat-expansion-panel> - </mat-accordion> - </div> - </div> - </div> - </ng-template> - </mat-tab> + <app-disagg-contributors [componentData]="componentData()" /> + </mat-expansion-panel> - <mat-tab label="Component Summary" [disabled]="hasData() === false"> - <ng-template matTabContent> - <app-component-summary /> - </ng-template> - </mat-tab> + <!-- Data --> + <mat-expansion-panel + class="print-display-none" + [expanded]="componentData()?.data.length > 0" + [disabled]="componentData()?.data.length === 0" + > + <mat-expansion-panel-header> + <mat-panel-title + >Disaggregation Data: + {{ formGroup.getRawValue().disaggComponent }}</mat-panel-title + > + </mat-expansion-panel-header> - <mat-tab label="Full Summary" [disabled]="hasData() === false"> - <app-full-summary /> - </mat-tab> -</mat-tab-group> + <app-disagg-data [componentData]="componentData()" /> + </mat-expansion-panel> + + <!-- App metadata --> + <mat-expansion-panel class="print-page-break print-full-page" expanded> + <mat-expansion-panel-header> + <mat-panel-title>Application Metadata</mat-panel-title> + </mat-expansion-panel-header> + + <mat-divider /> + <nshmp-lib-ng-app-metadata [repositories]="repositories()" /> + </mat-expansion-panel> + </mat-accordion> + </div> + </div> +</div> diff --git a/projects/nshmp-apps/src/app/hazard/disagg/components/content/content.component.ts b/projects/nshmp-apps/src/app/hazard/disagg/components/content/content.component.ts index b27b32f63b622079bc8c01d61d28366119d070db..c7929d96387e4700b7df35b7f62765f98ba085dd 100644 --- a/projects/nshmp-apps/src/app/hazard/disagg/components/content/content.component.ts +++ b/projects/nshmp-apps/src/app/hazard/disagg/components/content/content.component.ts @@ -2,14 +2,12 @@ import {AsyncPipe} from '@angular/common'; import {Component, computed} from '@angular/core'; import {MatDivider} from '@angular/material/divider'; import {MatExpansionModule} from '@angular/material/expansion'; -import {MatTabsModule} from '@angular/material/tabs'; import {NshmpLibNgAppMetadataComponent} from '@ghsc/nshmp-lib-ng/nshmp'; import {AppService} from '../../services/app.service'; -import {ComponentSummaryComponent} from '../component-summary/component-summary.component'; import {DisaggContributorsComponent} from '../disagg-contributors/disagg-contributors.component'; +import {DisaggDataComponent} from '../disagg-data/disagg-data.component'; import {DisaggSummaryComponent} from '../disagg-summary/disagg-summary.component'; -import {FullSummaryComponent} from '../full-summary/full-summary.component'; import {GeoDisaggComponent} from '../geo-disagg/geo-disagg.component'; import {ParameterSummaryComponent} from '../parameter-summary/parameter-summary.component'; import {PlotsComponent} from '../plots/plots.component'; @@ -29,11 +27,9 @@ import {PlotsComponent} from '../plots/plots.component'; GeoDisaggComponent, ParameterSummaryComponent, NshmpLibNgAppMetadataComponent, - MatTabsModule, - ComponentSummaryComponent, - FullSummaryComponent, DisaggSummaryComponent, DisaggContributorsComponent, + DisaggDataComponent, AsyncPipe, ], selector: 'app-content', @@ -43,6 +39,9 @@ import {PlotsComponent} from '../plots/plots.component'; }) export class ContentComponent { componentData = this.service.componentData; + /** Disaggregation data */ + disaggData = this.service.disaggData; + formGroup = this.service.formGroup; hasData = computed(() => this.service.serviceResponse() !== null); diff --git a/projects/nshmp-apps/src/app/hazard/disagg/components/disagg-data/disagg-data.component.html b/projects/nshmp-apps/src/app/hazard/disagg/components/disagg-data/disagg-data.component.html index 7bc8ce4ba8e4a269a0e513ffd6f04a11967424ac..e4e80db7e5bc96ff66d803bd845ed52d921a145f 100644 --- a/projects/nshmp-apps/src/app/hazard/disagg/components/disagg-data/disagg-data.component.html +++ b/projects/nshmp-apps/src/app/hazard/disagg/components/disagg-data/disagg-data.component.html @@ -17,7 +17,7 @@ <mat-divider /> } - <div class="horizontal-scrolling"> + <div class="horizontal-scrolling disagg-data"> <div> <table class="grid-col-12"> <thead> diff --git a/projects/nshmp-apps/src/app/hazard/disagg/components/disagg-data/disagg-data.component.scss b/projects/nshmp-apps/src/app/hazard/disagg/components/disagg-data/disagg-data.component.scss index 7128fbaecc50227f877b68c23b7d16c80e33ae11..f42f51ca2b2b9ab2e7bb925d75787fb5abff4dd7 100644 --- a/projects/nshmp-apps/src/app/hazard/disagg/components/disagg-data/disagg-data.component.scss +++ b/projects/nshmp-apps/src/app/hazard/disagg/components/disagg-data/disagg-data.component.scss @@ -27,3 +27,8 @@ table { line-height: clamp(0.2em, 0.1em + 1.5vw, 1.5em); } } + +.disagg-data { + max-height: 1000px; + overflow: scroll; +} diff --git a/projects/nshmp-apps/src/app/hazard/disagg/components/plots/plots.component.html b/projects/nshmp-apps/src/app/hazard/disagg/components/plots/plots.component.html index ed0b48bca039633ac4b96f6841ab836f1e2879cd..edd15e955156f04b1603574a53b9597484189c97 100644 --- a/projects/nshmp-apps/src/app/hazard/disagg/components/plots/plots.component.html +++ b/projects/nshmp-apps/src/app/hazard/disagg/components/plots/plots.component.html @@ -7,20 +7,7 @@ [disabled]="disaggData() === null" (click)="exportReport()" > - Print Report - </button> - </div> - - <!-- Export component summary button --> - <div> - <button - class="export-button" - mat-raised-button - color="primary" - [disabled]="disaggData() === null" - (click)="service.saveComponentSummaryReport()" - > - Export Component Summary + Print Report (PDF) </button> </div> @@ -33,7 +20,7 @@ [disabled]="disaggData() === null" (click)="service.saveSummaryReport()" > - Export Full Summary + Save Report (TXT) </button> </div> </div>