Skip to content

Commit 5a7ad35

Browse files
authored
Bugfix/10.5.18/route does not update when changing the index pattern (#991)
* fix: enhance compliance report view * feat: add compliance report module * feat: add compliance report module * fix: enhance compliance report view
1 parent de8df92 commit 5a7ad35

8 files changed

Lines changed: 1262 additions & 29 deletions

File tree

backend/src/main/resources/config/liquibase/changelog/20241120001_update_compliance_menu.xml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,32 @@
2424
name = 'Alerts And Incidents'
2525
WHERE id = 505;
2626
27+
INSERT INTO public.utm_menu (id, name, url, parent_id, type, dashboard_id, position, menu_active, menu_action, menu_icon, module_name_short)
28+
VALUES (507, 'CMMC', 'compliance/report-viewer?standardId=1000000&standardName=CMMC', 500, 1, null, 6, true, false, null, null);
29+
30+
INSERT INTO public.utm_menu (id, name, url, parent_id, type, dashboard_id, position, menu_active, menu_action, menu_icon, module_name_short)
31+
VALUES (508, 'HIPAA', 'compliance/report-viewer?standardId=1000001&standardName=HIPAA', 500, 1, null, 7, true, false, null, null);
32+
33+
INSERT INTO public.utm_menu (id, name, url, parent_id, type, dashboard_id, position, menu_active, menu_action, menu_icon, module_name_short)
34+
VALUES (509, 'BANKING AUDIT', 'compliance/report-viewer?standardId=1000002&standardName=BANKING AUDIT', 500, 1, null, 7, true, false, null, null);
35+
36+
INSERT INTO utm_menu_authority (menu_id, authority_name) VALUES (507, 'ROLE_ADMIN');
37+
INSERT INTO utm_menu_authority (menu_id, authority_name) VALUES (507, 'ROLE_USER');
38+
39+
INSERT INTO utm_menu_authority (menu_id, authority_name) VALUES (508, 'ROLE_ADMIN');
40+
INSERT INTO utm_menu_authority (menu_id, authority_name) VALUES (508, 'ROLE_USER');
41+
42+
INSERT INTO utm_menu_authority (menu_id, authority_name) VALUES (509, 'ROLE_ADMIN');
43+
INSERT INTO utm_menu_authority (menu_id, authority_name) VALUES (509, 'ROLE_USER');
44+
45+
ALTER TABLE utm_compliance_report_config
46+
ADD COLUMN IF NOT EXISTS config_report_note TEXT;
47+
2748
ALTER TABLE utm_compliance_report_config
28-
ADD COLUMN config_report_note TEXT;
49+
ADD COLUMN IF NOT EXISTS config_report_name varchar(250);
2950
3051
ALTER TABLE utm_compliance_report_config
31-
ADD COLUMN config_report_name varchar(250);
52+
ADD COLUMN IF NOT EXISTS config_report_remediation TEXT;
3253
]]>
3354
</sql>
3455
</changeSet>

backend/src/main/resources/config/liquibase/changelog/20250121001_add_remediation_column_config_report.xml

Lines changed: 0 additions & 18 deletions
This file was deleted.

backend/src/main/resources/config/liquibase/changelog/20250127001_add_compliance_data.xml

Lines changed: 1225 additions & 0 deletions
Large diffs are not rendered by default.

backend/src/main/resources/config/liquibase/master.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@
6969

7070
<include file="/config/liquibase/changelog/20241213001_updating_asa_and_firepower_filters.xml" relativeToChangelogFile="false"/>
7171

72-
<!--<include file="/config/liquibase/changelog/20241120001_update_compliance_menu.xml" relativeToChangelogFile="false"/>-->
72+
<include file="/config/liquibase/changelog/20241120001_update_compliance_menu.xml" relativeToChangelogFile="false"/>
73+
74+
<include file="/config/liquibase/changelog/20250127001_add_compliance_data.xml" relativeToChangelogFile="false"/>
75+
7376

74-
<include file="/config/liquibase/changelog/20250121001_add_remediation_column_config_report.xml" relativeToChangelogFile="false"/>
7577

7678

7779
</databaseChangeLog>

frontend/src/app/compliance/compliance-reports-view/compliance-reports-view.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ <h5 class="card-title mb-0 text-uppercase label-header d-flex align-items-center
8989
<div [hidden]="noData" class="my-4">
9090
<div class="row justify-content-center">
9191
<ngb-pagination
92+
[(page)]="page"
9293
(pageChange)="loadPage($event)"
9394
[boundaryLinks]="true"
9495
[collectionSize]="totalItems"

frontend/src/app/compliance/compliance-reports-view/compliance-reports-view.component.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export class ComplianceReportsViewComponent implements OnInit, OnChanges, OnDest
5858
this.loading = true;
5959
this.selected = reportRefresh.reportSelected;
6060
}),
61-
switchMap(() => this.reportsService.fetchData({
62-
page: this.page,
61+
switchMap((reportRefresh) => this.reportsService.fetchData({
62+
page: reportRefresh.page,
6363
size: this.itemsPerPage,
6464
standardId: this.section.standardId,
6565
sectionId: this.section.id,
@@ -100,15 +100,16 @@ export class ComplianceReportsViewComponent implements OnInit, OnChanges, OnDest
100100
});
101101
}
102102

103-
loadPage(page: number) {
104-
this.page = page - 1;
103+
loadPage(pageEvent: number) {
104+
const page = this.page !== 0 ? this.page - 1 : this.page;
105105
this.reportsService.notifyRefresh({
106106
loading: true,
107107
sectionId: this.section.id,
108-
reportSelected: 0
108+
reportSelected: 0,
109+
page
109110
});
110111
this.pageChange.emit({
111-
page: this.page,
112+
page,
112113
size: this.itemsPerPage
113114
});
114115
}

frontend/src/app/compliance/compliance-reports-view/components/compliance-report-detail/compliance-report-detail.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class ComplianceReportDetailComponent implements OnInit {
6868

6969
@Input() set report(report: ComplianceReportType) {
7070
if (report) {
71+
console.log('Report:', report);
7172
this._report = report;
7273
this.request = {
7374
...this.request,

frontend/src/app/compliance/shared/services/cp-reports.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface ReportParams {
1717
providedIn: 'root'
1818
})
1919
export class CpReportsService extends RefreshDataService<{ sectionId: number,
20-
loading: boolean, reportSelected: number }, HttpResponse<ComplianceReportType[]>> {
20+
loading: boolean, reportSelected: number, page?: number }, HttpResponse<ComplianceReportType[]>> {
2121

2222
private resourceUrl = SERVER_API_URL + 'api/compliance/report-config';
2323
private loadReportSubject = new BehaviorSubject<ReportParams>(null);

0 commit comments

Comments
 (0)