Skip to content

Commit

Permalink
Hide PVC feature section when feat flag not set
Browse files Browse the repository at this point in the history
Rather than having the section always visible but with a disable
checkbox, hide the entire section if the feature flag is not set.
  • Loading branch information
Andrew Farries authored and roboquat committed Aug 1, 2022
1 parent 6ccb9ee commit 14a3dea
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions components/dashboard/src/projects/ProjectSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,25 @@ export default function () {
checked={!project.settings?.keepOutdatedPrebuildsRunning}
onChange={({ target }) => updateProjectSettings({ keepOutdatedPrebuildsRunning: !target.checked })}
/>
<br></br>
<h3 className="mt-12">Workspace Persistence</h3>
<CheckBox
title={
<span>
Enable Persistent Volume Claim{" "}
<PillLabel type="warn" className="font-semibold mt-2 ml-2 py-0.5 px-2 self-center">
Experimental
</PillLabel>
</span>
}
desc={<span>Experimental feature that is still under development.</span>}
checked={project.settings?.usePersistentVolumeClaim ?? false}
disabled={!showPersistentVolumeClaimUI}
onChange={({ target }) => updateProjectSettings({ usePersistentVolumeClaim: target.checked })}
/>
{showPersistentVolumeClaimUI && (
<>
<br></br>
<h3 className="mt-12">Workspace Persistence</h3>
<CheckBox
title={
<span>
Enable Persistent Volume Claim{" "}
<PillLabel type="warn" className="font-semibold mt-2 ml-2 py-0.5 px-2 self-center">
Experimental
</PillLabel>
</span>
}
desc={<span>Experimental feature that is still under development.</span>}
checked={project.settings?.usePersistentVolumeClaim ?? false}
onChange={({ target }) => updateProjectSettings({ usePersistentVolumeClaim: target.checked })}
/>
</>
)}
</ProjectSettingsPage>
);
}

0 comments on commit 14a3dea

Please sign in to comment.