Skip to content

Commit 14a3dea

Browse files
Andrew Farriesroboquat
authored andcommitted
Hide PVC feature section when feat flag not set
Rather than having the section always visible but with a disable checkbox, hide the entire section if the feature flag is not set.
1 parent 6ccb9ee commit 14a3dea

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

components/dashboard/src/projects/ProjectSettings.tsx

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,25 @@ export default function () {
9494
checked={!project.settings?.keepOutdatedPrebuildsRunning}
9595
onChange={({ target }) => updateProjectSettings({ keepOutdatedPrebuildsRunning: !target.checked })}
9696
/>
97-
<br></br>
98-
<h3 className="mt-12">Workspace Persistence</h3>
99-
<CheckBox
100-
title={
101-
<span>
102-
Enable Persistent Volume Claim{" "}
103-
<PillLabel type="warn" className="font-semibold mt-2 ml-2 py-0.5 px-2 self-center">
104-
Experimental
105-
</PillLabel>
106-
</span>
107-
}
108-
desc={<span>Experimental feature that is still under development.</span>}
109-
checked={project.settings?.usePersistentVolumeClaim ?? false}
110-
disabled={!showPersistentVolumeClaimUI}
111-
onChange={({ target }) => updateProjectSettings({ usePersistentVolumeClaim: target.checked })}
112-
/>
97+
{showPersistentVolumeClaimUI && (
98+
<>
99+
<br></br>
100+
<h3 className="mt-12">Workspace Persistence</h3>
101+
<CheckBox
102+
title={
103+
<span>
104+
Enable Persistent Volume Claim{" "}
105+
<PillLabel type="warn" className="font-semibold mt-2 ml-2 py-0.5 px-2 self-center">
106+
Experimental
107+
</PillLabel>
108+
</span>
109+
}
110+
desc={<span>Experimental feature that is still under development.</span>}
111+
checked={project.settings?.usePersistentVolumeClaim ?? false}
112+
onChange={({ target }) => updateProjectSettings({ usePersistentVolumeClaim: target.checked })}
113+
/>
114+
</>
115+
)}
113116
</ProjectSettingsPage>
114117
);
115118
}

0 commit comments

Comments
 (0)