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>
|
||||||
<Td>
|
<Td>
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<Badge
|
{control.applicability === false
|
||||||
variant={
|
? <span className="text-txt-tertiary">-</span>
|
||||||
control.regulatory
|
: (
|
||||||
? "success"
|
<Badge
|
||||||
: "danger"
|
variant={control.regulatory ? "success" : "danger"}
|
||||||
}
|
size="sm"
|
||||||
size="sm"
|
>
|
||||||
>
|
{control.regulatory ? __("Yes") : __("No")}
|
||||||
{control.regulatory
|
</Badge>
|
||||||
? __("Yes")
|
)}
|
||||||
: __("No")}
|
|
||||||
</Badge>
|
|
||||||
</div>
|
</div>
|
||||||
</Td>
|
</Td>
|
||||||
<Td>
|
<Td>
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<Badge
|
{control.applicability === false
|
||||||
variant={
|
? <span className="text-txt-tertiary">-</span>
|
||||||
control.contractual
|
: (
|
||||||
? "success"
|
<Badge
|
||||||
: "danger"
|
variant={control.contractual ? "success" : "danger"}
|
||||||
}
|
size="sm"
|
||||||
size="sm"
|
>
|
||||||
>
|
{control.contractual ? __("Yes") : __("No")}
|
||||||
{control.contractual
|
</Badge>
|
||||||
? __("Yes")
|
)}
|
||||||
: __("No")}
|
|
||||||
</Badge>
|
|
||||||
</div>
|
</div>
|
||||||
</Td>
|
</Td>
|
||||||
<Td>
|
<Td>
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<Badge
|
{control.applicability === false
|
||||||
variant={
|
? <span className="text-txt-tertiary">-</span>
|
||||||
control.bestPractice
|
: (
|
||||||
? "success"
|
<Badge
|
||||||
: "danger"
|
variant={control.bestPractice ? "success" : "danger"}
|
||||||
}
|
size="sm"
|
||||||
size="sm"
|
>
|
||||||
>
|
{control.bestPractice ? __("Yes") : __("No")}
|
||||||
{control.bestPractice
|
</Badge>
|
||||||
? __("Yes")
|
)}
|
||||||
: __("No")}
|
|
||||||
</Badge>
|
|
||||||
</div>
|
</div>
|
||||||
</Td>
|
</Td>
|
||||||
<Td>
|
<Td>
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<Badge
|
{control.applicability === false
|
||||||
variant={
|
? <span className="text-txt-tertiary">-</span>
|
||||||
control.riskAssessment
|
: (
|
||||||
? "success"
|
<Badge
|
||||||
: "danger"
|
variant={control.riskAssessment ? "success" : "danger"}
|
||||||
}
|
size="sm"
|
||||||
size="sm"
|
>
|
||||||
>
|
{control.riskAssessment ? __("Yes") : __("No")}
|
||||||
{control.riskAssessment
|
</Badge>
|
||||||
? __("Yes")
|
)}
|
||||||
: __("No")}
|
|
||||||
</Badge>
|
|
||||||
</div>
|
</div>
|
||||||
</Td>
|
</Td>
|
||||||
{(canUpdate || canDelete) && (
|
{(canUpdate || canDelete) && (
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ type (
|
|||||||
Name string
|
Name string
|
||||||
Applicability *bool
|
Applicability *bool
|
||||||
Justification *string
|
Justification *string
|
||||||
BestPractice bool
|
BestPractice *bool
|
||||||
Regulatory *bool
|
Regulatory *bool
|
||||||
Contractual *bool
|
Contractual *bool
|
||||||
RiskAssessment *bool
|
RiskAssessment *bool
|
||||||
|
|||||||
@@ -333,19 +333,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>{{boolToYesNoDash .Regulatory}}</td>
|
<td>{{boolToYesNoDash .Regulatory}}</td>
|
||||||
<td>{{boolToYesNoDash .Contractual}}</td>
|
<td>{{boolToYesNoDash .Contractual}}</td>
|
||||||
<td>
|
<td>{{boolToYesNoDash .BestPractice}}</td>
|
||||||
{{- if .Applicability}}
|
|
||||||
{{- if and .Applicability .BestPractice}}
|
|
||||||
Yes
|
|
||||||
{{- else if .Applicability}}
|
|
||||||
No
|
|
||||||
{{- else}}
|
|
||||||
-
|
|
||||||
{{- end}}
|
|
||||||
{{- else}}
|
|
||||||
-
|
|
||||||
{{- end}}
|
|
||||||
</td>
|
|
||||||
<td>{{boolToYesNoDash .RiskAssessment}}</td>
|
<td>{{boolToYesNoDash .RiskAssessment}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{- end}}
|
{{- end}}
|
||||||
|
|||||||
@@ -543,6 +543,7 @@ func (s StateOfApplicabilityService) ExportPDF(
|
|||||||
|
|
||||||
var regulatory *bool
|
var regulatory *bool
|
||||||
var contractual *bool
|
var contractual *bool
|
||||||
|
var bestPractice *bool
|
||||||
var riskAssessment *bool
|
var riskAssessment *bool
|
||||||
|
|
||||||
if stmt.Applicability {
|
if stmt.Applicability {
|
||||||
@@ -562,6 +563,8 @@ func (s StateOfApplicabilityService) ExportPDF(
|
|||||||
if hasRisk {
|
if hasRisk {
|
||||||
riskAssessment = &trueVal
|
riskAssessment = &trueVal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bestPractice = &control.BestPractice
|
||||||
}
|
}
|
||||||
|
|
||||||
applicability := stmt.Applicability
|
applicability := stmt.Applicability
|
||||||
@@ -574,7 +577,7 @@ func (s StateOfApplicabilityService) ExportPDF(
|
|||||||
Name: control.Name,
|
Name: control.Name,
|
||||||
Applicability: &applicability,
|
Applicability: &applicability,
|
||||||
Justification: stmt.Justification,
|
Justification: stmt.Justification,
|
||||||
BestPractice: control.BestPractice,
|
BestPractice: bestPractice,
|
||||||
Regulatory: regulatory,
|
Regulatory: regulatory,
|
||||||
Contractual: contractual,
|
Contractual: contractual,
|
||||||
RiskAssessment: riskAssessment,
|
RiskAssessment: riskAssessment,
|
||||||
|
|||||||
Reference in New Issue
Block a user