Skip to content

Commit a3d3d20

Browse files
committed
feat: enrich compliance evaluation details with rule, rule value, and hits
1 parent 4266061 commit a3d3d20

11 files changed

Lines changed: 51 additions & 16 deletions

File tree

frontend/src/app/compliance/compliance-evaluation-history-view/compliance-query-evaluations-view/compliance-query-evaluation-detail/compliance-query-evaluation-detail.component.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@
1515
}
1616

1717
.border-left-neutral {
18-
border-left: 5px solid #e9e9e9 !important;
18+
border-left: 5px solid #6C757D !important;
1919
}
20+
21+
.border-left {
22+
border-left: 1px solid #ccc;
23+
padding-left: 10px;
24+
}
25+

frontend/src/app/compliance/compliance-evaluation-history-view/compliance-query-evaluations-view/compliance-query-evaluation-detail/compliance-query-evaluation-detail.component.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,36 @@
1717
</span>
1818
</div>
1919

20-
<div class="w-100" style="border-left: 1px solid #ccc; padding-left: 10px;">
20+
<div class="w-100 border-left" style="padding-left: 10px;">
2121
<span class="text-blue-800 font-weight-light mr-2">Evaluation rule:</span>
2222
<span class="span-small-icon d-flex justify-content-start align-items-center">
2323
{{ ComplianceEvaluationRuleLabels[query.evaluationRule] }}
2424
</span>
2525
</div>
2626
</div>
2727
</div>
28+
<div [ngClass]="{
29+
'border-left-success': query.status === ComplianceStatusExtendedEnum.COMPLIANT,
30+
'border-left-danger': query.status === ComplianceStatusExtendedEnum.NON_COMPLIANT,
31+
'border-left-neutral': query.status !== ComplianceStatusExtendedEnum.COMPLIANT
32+
&& query.status !== ComplianceStatusExtendedEnum.NON_COMPLIANT
33+
}">
34+
<div class="d-flex justify-content-around align-content-center py-1" style="border-bottom: 1px solid #ccc;">
35+
<div style="padding-left: 10px" class="w-100" *ngIf="query.ruleValue">
36+
<span class="text-blue-800 font-weight-light mr-2">Rule value:</span>
37+
<span class="span-small-icon d-flex justify-content-start align-items-center">
38+
{{ query.ruleValue }}
39+
</span>
40+
</div>
41+
42+
<div class="w-100" style="padding-left: 10px;" [ngClass]="{'border-left': query.ruleValue}">
43+
<span class="text-blue-800 font-weight-light mr-2">Result count:</span>
44+
<span class="span-small-icon d-flex justify-content-start align-items-center">
45+
{{ query.hits }}
46+
</span>
47+
</div>
48+
</div>
49+
</div>
2850

2951
<div class="p-3">
3052
<div class="alert-details w-100 d-flex justify-content-start align-items-center mt-3">

frontend/src/app/compliance/compliance-evaluation-history-view/compliance-query-evaluations-view/compliance-query-evaluations-view.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="container-fluid p-3">
1+
<div class="container-fluid px-3">
22
<div class="w-100">
33
<div class="control-detail-summary-header p-2">
44
<h6 class="d-flex align-items-center text-blue-800 font-weight-light">

frontend/src/app/compliance/compliance-evaluation-history-view/compliance-query-evaluations-view/compliance-query-evaluations-view.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@
3434
}
3535

3636
.border-left-neutral {
37-
border-left: 5px solid #e9e9e9 !important;
37+
border-left: 5px solid #6C757D !important;
3838
}

frontend/src/app/compliance/compliance-latest-evaluations-view/compliance-latest-evaluation-view-detail/compliance-latest-evaluation-view-detail.component.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616

1717
.border-left-neutral {
18-
border-left: 5px solid #e9e9e9 !important;
18+
border-left: 5px solid #6C757D !important;
1919
}
2020

2121
button {

frontend/src/app/compliance/compliance-latest-evaluations-view/compliance-latest-evaluations-view.component.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ table {
2929
}
3030

3131
.border-left-neutral {
32-
border-left: 5px solid #e9e9e9 !important;
32+
border-left: 5px solid #6C757D !important;
3333
}

frontend/src/app/compliance/shared/components/utm-compliance-timeline/compliance-timeline.component.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
.chart-container {
22
width: 100%;
3-
height: 200px;
3+
height: 250px;
44
overflow-x: hidden;
55
overflow-y: hidden;
66
display: block;
77
white-space: nowrap;
88
}
99

1010
.chart {
11-
height: 200px;
11+
height: 300px;
1212
width: max-content;
1313
min-width: 100%;
1414
}

frontend/src/app/compliance/shared/components/utm-compliance-timeline/compliance-timeline.component.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,24 @@ export class ComplianceTimelineComponent implements OnInit {
1414

1515
options: any;
1616
complianceValue = [
17-
'COMPLIANT',
17+
'NOT_EVALUATED',
1818
'NON_COMPLIANT',
19+
'COMPLIANT',
1920
];
2021
bgColors = {
2122
COMPLIANT: '#28A745',
2223
NON_COMPLIANT: '#DC3545',
24+
NOT_EVALUATED: '#6C757D',
2325
};
2426
textColors = {
2527
COMPLIANT: '#ffffff',
2628
NON_COMPLIANT: '#ffffff',
29+
NOT_EVALUATED: '#ffffff',
2730
};
2831
lightBgColors = {
2932
COMPLIANT: '#E8F5E9',
3033
NON_COMPLIANT: '#FAEBED',
34+
NOT_EVALUATED: '#E9E9E9',
3135
};
3236

3337
private rawData: any[];
@@ -60,9 +64,9 @@ export class ComplianceTimelineComponent implements OnInit {
6064
year: 'numeric',
6165
});
6266
this.monthDays.push(dayLabel);
63-
64-
this.rawData.push([index, 0, entry.status === ComplianceStatusExtendedEnum.COMPLIANT ? 1 : 0]);
67+
this.rawData.push([index, 0, entry.status === ComplianceStatusExtendedEnum.NOT_EVALUATED ? 1 : 0]);
6568
this.rawData.push([index, 1, entry.status === ComplianceStatusExtendedEnum.NON_COMPLIANT ? 1 : 0]);
69+
this.rawData.push([index, 2, entry.status === ComplianceStatusExtendedEnum.COMPLIANT ? 1 : 0]);
6670
});
6771
}
6872

@@ -106,10 +110,10 @@ export class ComplianceTimelineComponent implements OnInit {
106110
},
107111
grid: {
108112
height: '50%',
109-
top: '15%',
113+
top: '10%',
110114
left: '10%',
111115
right: '3%',
112-
bottom: '5%',
116+
bottom: '0',
113117
width: this.evaluations.length * 30,
114118
containLabel: false
115119
},
@@ -127,7 +131,8 @@ export class ComplianceTimelineComponent implements OnInit {
127131
),
128132
axisLine: { show: false },
129133
axisTick: { show: false },
130-
axisLabel: { fontSize: 10 }
134+
axisLabel: { fontSize: 10,
135+
formatter: (value: string) => getComplianceStatusLabel(value)}
131136
},
132137
series: [
133138
{

frontend/src/app/compliance/shared/enums/compliance-status.enum.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ export enum ComplianceStatusExtendedEnum {
77
COMPLIANT = 'COMPLIANT',
88
NON_COMPLIANT = 'NON_COMPLIANT',
99
NOT_EVALUATED = 'NOT_EVALUATED',
10-
NOT_APPLICABLE = 'NOT_APPLICABLE'
10+
NOT_APPLICABLE = 'NOT_APPLICABLE',
11+
ERROR = 'ERROR'
1112
}
1213

1314
export const ComplianceStatusLabels: Record<ComplianceStatusExtendedEnum, string> = {
1415
[ComplianceStatusExtendedEnum.COMPLIANT]: 'Compliant',
1516
[ComplianceStatusExtendedEnum.NON_COMPLIANT]: 'Non Compliant',
1617
[ComplianceStatusExtendedEnum.NOT_APPLICABLE]: 'Not Applicable',
1718
[ComplianceStatusExtendedEnum.NOT_EVALUATED]: 'Not Evaluated',
19+
[ComplianceStatusExtendedEnum.ERROR]: 'Error',
1820
};
1921

2022
export function getComplianceStatusLabel(

frontend/src/app/compliance/shared/type/compliance-query-base.type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export class ComplianceQueryBaseType {
55
queryName?: string;
66
queryDescription?: string;
77
evaluationRule?: ComplianceEvaluationRuleEnum;
8+
ruleValue?: number;
89
}

0 commit comments

Comments
 (0)