Skip to content

feat: add all safe experiments to the deployment page #10276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Oct 17, 2023
Prev Previous commit
Next Next commit
PR feedback
  • Loading branch information
Kira-Pilot committed Oct 17, 2023
commit 82a513ba339beea242d829b51e71688b8efee739
46 changes: 24 additions & 22 deletions site/src/components/DeploySettingsLayout/Option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,30 @@ export const OptionValue: FC<OptionValueProps> = (props) => {
if (typeof children === "object" && !Array.isArray(children)) {
return (
<ul css={listStyles}>
{Object.entries(children).map(([option, isEnabled]) => (
<li key={option} css={optionStyles}>
<Box
sx={{
display: "inline-flex",
alignItems: "center",
}}
>
{option}
{isEnabled && (
<CheckCircleOutlined
sx={{
width: 16,
height: 16,
color: (theme) => theme.palette.success.light,
margin: (theme) => theme.spacing(0, 1),
}}
/>
)}
</Box>
</li>
))}
{Object.entries(children)
.sort((a, b) => a[0].localeCompare(b[0]))
.map(([option, isEnabled]) => (
<li key={option} css={optionStyles}>
<Box
sx={{
display: "inline-flex",
alignItems: "center",
}}
>
{option}
{isEnabled && (
<CheckCircleOutlined
sx={{
width: 16,
height: 16,
color: (theme) => theme.palette.success.light,
margin: (theme) => theme.spacing(0, 1),
}}
/>
)}
</Box>
</li>
))}
</ul>
);
}
Expand Down
9 changes: 5 additions & 4 deletions site/src/components/DeploySettingsLayout/optionValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ export function optionValue(
{} as Record<string, boolean>,
);

if (!experimentMap) {
break;
}

for (const v of option.value) {
if (
experimentMap &&
Object.prototype.hasOwnProperty.call(experimentMap, v)
) {
if (Object.hasOwn(experimentMap, v)) {
experimentMap[v] = true;
}
}
Expand Down