mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Fix policy constants in policy preview (#2729)
Allows the policy preview to render properly
This commit is contained in:
parent
53eb467452
commit
4376a3553c
1 changed files with 4 additions and 2 deletions
|
|
@ -27,6 +27,8 @@ interface IHostResponse {
|
|||
|
||||
const baseClass = "welcome-host";
|
||||
const HOST_ID = 1;
|
||||
const policyPass = "pass";
|
||||
const policyFail = "fail";
|
||||
|
||||
const WelcomeHost = (): JSX.Element => {
|
||||
const dispatch = useDispatch();
|
||||
|
|
@ -53,7 +55,7 @@ const WelcomeHost = (): JSX.Element => {
|
|||
setShowRefetchLoadingSpinner(returnedHost.refetch_requested);
|
||||
|
||||
const anyPassingOrFailingPolicy = returnedHost?.policies?.find(
|
||||
(p) => p.response === "passing" || p.response === "failing"
|
||||
(p) => p.response === policyPass || p.response === policyFail
|
||||
);
|
||||
setIsPoliciesEmpty(typeof anyPassingOrFailingPolicy === "undefined");
|
||||
|
||||
|
|
@ -230,7 +232,7 @@ const WelcomeHost = (): JSX.Element => {
|
|||
<div className="info">
|
||||
<img
|
||||
alt={p.response}
|
||||
src={p.response === "passing" ? IconPassed : IconError}
|
||||
src={p.response === policyPass ? IconPassed : IconError}
|
||||
/>
|
||||
{p.query_name}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue