Skip to content

Commit

Permalink
Merge pull request #3997 from cisagov/feat/CSET-2813
Browse files Browse the repository at this point in the history
Report refactor: Feat/cset 2813
  • Loading branch information
jekuipers authored Jul 31, 2024
2 parents 3a6e40b + 8af08d3 commit aeb0bad
Show file tree
Hide file tree
Showing 38 changed files with 317 additions and 836 deletions.
38 changes: 3 additions & 35 deletions CSETWebNg/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,23 +667,7 @@ import { AnalyticsService } from './services/analytics.service';
import { UploadDemographicsComponent } from './dialogs/import demographics/import-demographics.component';
import { CieMfrReportComponent } from './reports/cie/cie-mfr-report/cie-mfr-report.component';
import { ReportListComponent } from './assessment/results/reports/report-list/report-list.component';
import { ReportListImrComponent } from './assessment/results/reports/report-list/report-list-imr/report-list-imr.component';
import { ReportListCisComponent } from './assessment/results/reports/report-list/report-list-cis/report-list-cis.component';
import { ReportListCmmc2Component } from './assessment/results/reports/report-list/report-list-cmmc2/report-list-cmmc2.component';
import { ReportListCrrComponent } from './assessment/results/reports/report-list/report-list-crr/report-list-crr.component';
import { ReportListEdmComponent } from './assessment/results/reports/report-list/report-list-edm/report-list-edm.component';
import { ReportListRraComponent } from './assessment/results/reports/report-list/reports-rra/report-list-rra.component';
import { ReportListCpgComponent } from './assessment/results/reports/report-list/reports-list-cpg/report-list-cpg.component';
import { ReportListMvraComponent } from './assessment/results/reports/report-list/report-list-mvra/report-list-mvra.component';
import { ReportListCmmcComponent } from './assessment/results/reports/report-list/report-list-cmmc/report-list-cmmc.component';
import { ReportListDiagramComponent } from './assessment/results/reports/report-list/report-list-diagram/report-list-diagram.component';
import { ReportListC2M2Component } from './assessment/results/reports/report-list/report-list-c2m2/report-list-c2m2.component';
import { ReportListACETComponent } from './assessment/results/reports/report-list/report-list-acet/report-list-acet.component';
import { ReportListVADRComponent } from './assessment/results/reports/report-list/report-list-vadr/report-list-vadr.component';
import { ReportListISEComponent } from './assessment/results/reports/report-list/report-list-ise/report-list-ise.component';
import { ReportListHYDROComponent } from './assessment/results/reports/report-list/report-list-hydro/report-list-hydro.component';
import { ReportListSD02SeriesComponent } from './assessment/results/reports/report-list/report-list-sd02Series/report-list-sd02Series.component';
import { ReportListSD02OwnerComponent } from './assessment/results/reports/report-list/report-list-sd02Owner/report-list-sd02Owner.component';
import { ReportListCommonComponent } from './assessment/results/reports/report-list/report-list-common.component';


@NgModule({
Expand Down Expand Up @@ -1303,24 +1287,8 @@ import { ReportListSD02OwnerComponent } from './assessment/results/reports/repor
ReferencesSectionComponent,
CisaWorkflowWarningsComponent,
AnalyticsloginComponent,
ReportListImrComponent,
ReportListCisComponent,
ReportListCmmc2Component,
ReportListComponent,
ReportListCrrComponent,
ReportListEdmComponent,
ReportListRraComponent,
ReportListCpgComponent,
ReportListMvraComponent,
ReportListCmmcComponent,
ReportListC2M2Component,
ReportListDiagramComponent,
ReportListACETComponent,
ReportListVADRComponent,
ReportListISEComponent,
ReportListHYDROComponent,
ReportListSD02SeriesComponent,
ReportListSD02OwnerComponent
ReportListComponent,
ReportListCommonComponent
],
providers: [
TranslocoService,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-------------------------->

<app-report-list sectionId="SD02 Series" [list]="reportList"></app-report-list>
<app-report-list [sectionId]="sectionId" [list]="reportList"></app-report-list>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';


@Component({
selector: 'app-report-list-common',
templateUrl: './report-list-common.component.html'
})

export class ReportListCommonComponent implements OnChanges{
@Input() sectionId: string;

jsonData: any;
reportList: any[] = [];

constructor() {
// Load JSON data
this.jsonData = require('./report-list.json');
}

ngOnChanges(changes: SimpleChanges): void {
if (changes['sectionId']) {
this.reportList = this.getReportList(this.sectionId);
}
}

getReportList(sectionId: string): any[] {
const result = this.jsonData.find(item => item.title === sectionId);
// Check if the result exists and return the reportList or an empty array if not found
return result ? result.reportList : [];
}
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit aeb0bad

Please sign in to comment.