Skip to content

Commit 4dde377

Browse files
Merge pull request #210 from CodeForPhilly/check-id-fix
fix: Fixed issue with Check Testing page introduced by changes to SelectedEligibilityCheck.
2 parents 15d65f7 + 5531627 commit 4dde377

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

builder-frontend/src/components/homeScreen/eligibilityCheckList/eligibilityCheckDetail/checkTesting/EligibilityCheckTest.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,12 @@ const EligibilityCheckTest = (
8888

8989
<div class="flex-1">
9090
<SelectedEligibilityCheck
91-
check={eligibilityCheck()}
91+
checkId={() => checkConfig().checkId}
9292
checkConfig={checkConfig}
9393
updateCheckConfigParams={(newCheckData: ParameterValues) => {
9494
setCheckConfig({ ...checkConfig(), parameters: newCheckData });
9595
}}
96+
onRemove={null}
9697
/>
9798
</div>
9899
</div>

builder-frontend/src/components/project/manageBenefits/configureBenefit/SelectedEligibilityCheck.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ const SelectedEligibilityCheck = (
2222
{
2323
checkId: Accessor<string>;
2424
checkConfig: Accessor<CheckConfig>;
25-
onRemove: () => void;
2625
updateCheckConfigParams: (newCheckData: ParameterValues) => void
26+
onRemove: () => void | null;
2727
}
2828
) => {
2929
const [check] = createResource(() => checkId(), fetchCustomCheck);
@@ -50,12 +50,14 @@ const SelectedEligibilityCheck = (
5050
mb-4 p-4 cursor-pointer select-none relative
5151
border-2 border-gray-200 rounded-lg hover:bg-gray-200"
5252
>
53-
<div
54-
class="absolute px-2 top-2 right-2 hover:bg-gray-300 rounded-xl font-bold"
55-
onClick={(e) => { e.stopPropagation(); onRemove(); }}
56-
>
57-
X
58-
</div>
53+
<Show when={onRemove !== null}>
54+
<div
55+
class="absolute px-2 top-2 right-2 hover:bg-gray-300 rounded-xl font-bold"
56+
onClick={(e) => { e.stopPropagation(); onRemove(); }}
57+
>
58+
X
59+
</div>
60+
</Show>
5961
<div class="text-xl font-bold mb-2">{titleCase(check().name)} - v{check().version}</div>
6062
<div class="pl-2 [&:has(+div)]:mb-2">{check().description}</div>
6163

0 commit comments

Comments
 (0)