Display empty state for soa control assessment
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
committed by
Bryan Frimin
parent
f33a1fe149
commit
c63a0b7ded
@@ -294,66 +294,58 @@ export default function StateOfApplicabilityControlsTab({
|
||||
</Td>
|
||||
<Td>
|
||||
<div className="flex justify-center">
|
||||
<Badge
|
||||
variant={
|
||||
control.regulatory
|
||||
? "success"
|
||||
: "danger"
|
||||
}
|
||||
size="sm"
|
||||
>
|
||||
{control.regulatory
|
||||
? __("Yes")
|
||||
: __("No")}
|
||||
</Badge>
|
||||
{control.applicability === false
|
||||
? <span className="text-txt-tertiary">-</span>
|
||||
: (
|
||||
<Badge
|
||||
variant={control.regulatory ? "success" : "danger"}
|
||||
size="sm"
|
||||
>
|
||||
{control.regulatory ? __("Yes") : __("No")}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
</Td>
|
||||
<Td>
|
||||
<div className="flex justify-center">
|
||||
<Badge
|
||||
variant={
|
||||
control.contractual
|
||||
? "success"
|
||||
: "danger"
|
||||
}
|
||||
size="sm"
|
||||
>
|
||||
{control.contractual
|
||||
? __("Yes")
|
||||
: __("No")}
|
||||
</Badge>
|
||||
{control.applicability === false
|
||||
? <span className="text-txt-tertiary">-</span>
|
||||
: (
|
||||
<Badge
|
||||
variant={control.contractual ? "success" : "danger"}
|
||||
size="sm"
|
||||
>
|
||||
{control.contractual ? __("Yes") : __("No")}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
</Td>
|
||||
<Td>
|
||||
<div className="flex justify-center">
|
||||
<Badge
|
||||
variant={
|
||||
control.bestPractice
|
||||
? "success"
|
||||
: "danger"
|
||||
}
|
||||
size="sm"
|
||||
>
|
||||
{control.bestPractice
|
||||
? __("Yes")
|
||||
: __("No")}
|
||||
</Badge>
|
||||
{control.applicability === false
|
||||
? <span className="text-txt-tertiary">-</span>
|
||||
: (
|
||||
<Badge
|
||||
variant={control.bestPractice ? "success" : "danger"}
|
||||
size="sm"
|
||||
>
|
||||
{control.bestPractice ? __("Yes") : __("No")}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
</Td>
|
||||
<Td>
|
||||
<div className="flex justify-center">
|
||||
<Badge
|
||||
variant={
|
||||
control.riskAssessment
|
||||
? "success"
|
||||
: "danger"
|
||||
}
|
||||
size="sm"
|
||||
>
|
||||
{control.riskAssessment
|
||||
? __("Yes")
|
||||
: __("No")}
|
||||
</Badge>
|
||||
{control.applicability === false
|
||||
? <span className="text-txt-tertiary">-</span>
|
||||
: (
|
||||
<Badge
|
||||
variant={control.riskAssessment ? "success" : "danger"}
|
||||
size="sm"
|
||||
>
|
||||
{control.riskAssessment ? __("Yes") : __("No")}
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
</Td>
|
||||
{(canUpdate || canDelete) && (
|
||||
|
||||
@@ -306,7 +306,7 @@ type (
|
||||
Name string
|
||||
Applicability *bool
|
||||
Justification *string
|
||||
BestPractice bool
|
||||
BestPractice *bool
|
||||
Regulatory *bool
|
||||
Contractual *bool
|
||||
RiskAssessment *bool
|
||||
|
||||
@@ -333,19 +333,7 @@
|
||||
</td>
|
||||
<td>{{boolToYesNoDash .Regulatory}}</td>
|
||||
<td>{{boolToYesNoDash .Contractual}}</td>
|
||||
<td>
|
||||
{{- if .Applicability}}
|
||||
{{- if and .Applicability .BestPractice}}
|
||||
Yes
|
||||
{{- else if .Applicability}}
|
||||
No
|
||||
{{- else}}
|
||||
-
|
||||
{{- end}}
|
||||
{{- else}}
|
||||
-
|
||||
{{- end}}
|
||||
</td>
|
||||
<td>{{boolToYesNoDash .BestPractice}}</td>
|
||||
<td>{{boolToYesNoDash .RiskAssessment}}</td>
|
||||
</tr>
|
||||
{{- end}}
|
||||
|
||||
@@ -543,6 +543,7 @@ func (s StateOfApplicabilityService) ExportPDF(
|
||||
|
||||
var regulatory *bool
|
||||
var contractual *bool
|
||||
var bestPractice *bool
|
||||
var riskAssessment *bool
|
||||
|
||||
if stmt.Applicability {
|
||||
@@ -562,6 +563,8 @@ func (s StateOfApplicabilityService) ExportPDF(
|
||||
if hasRisk {
|
||||
riskAssessment = &trueVal
|
||||
}
|
||||
|
||||
bestPractice = &control.BestPractice
|
||||
}
|
||||
|
||||
applicability := stmt.Applicability
|
||||
@@ -574,7 +577,7 @@ func (s StateOfApplicabilityService) ExportPDF(
|
||||
Name: control.Name,
|
||||
Applicability: &applicability,
|
||||
Justification: stmt.Justification,
|
||||
BestPractice: control.BestPractice,
|
||||
BestPractice: bestPractice,
|
||||
Regulatory: regulatory,
|
||||
Contractual: contractual,
|
||||
RiskAssessment: riskAssessment,
|
||||
|
||||
Reference in New Issue
Block a user