Skip to content

Commit

Permalink
use the param
Browse files Browse the repository at this point in the history
  • Loading branch information
leafty committed Jan 27, 2025
1 parent e45c22b commit 8bc0bd6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion client/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ tee > "${NGINX_PATH}/config.json" << EOF
"CORE_API_VERSION_CONFIG": ${CORE_API_VERSION_CONFIG},
"USER_PREFERENCES_MAX_PINNED_PROJECTS": ${USER_PREFERENCES_MAX_PINNED_PROJECTS},
"SESSION_CLASS_EMAIL_US": ${SESSION_CLASS_EMAIL_US},
"IMAGE_BUILDERS_ENABLED": ${IMAGE_BUILDERS_ENABLED}
"IMAGE_BUILDERS_ENABLED": "${IMAGE_BUILDERS_ENABLED}"
}
EOF
echo "config.json created in ${NGINX_PATH}"
Expand Down
2 changes: 1 addition & 1 deletion client/run-telepresence.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ tee > ./public/config.json << EOF
},
"USER_PREFERENCES_MAX_PINNED_PROJECTS": ${USER_PREFERENCES_MAX_PINNED_PROJECTS:-5},
"SESSION_CLASS_EMAIL_US": { "enabled": false },
"IMAGE_BUILDERS_ENABLED": true,
"IMAGE_BUILDERS_ENABLED": "true"
}
EOF

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@ import cx from "classnames";
import { Control, Controller } from "react-hook-form";
import { ButtonGroup } from "reactstrap";
import { SessionLauncherForm } from "../../sessionsV2.types";
import { useContext } from "react";
import AppContext from "../../../../utils/context/appContext";
import { DEFAULT_APP_PARAMS } from "../../../../utils/context/appParams.constants";

interface EnvironmentKindField {
control: Control<SessionLauncherForm>;
}
export default function EnvironmentKindField({
control,
}: EnvironmentKindField) {
const { params } = useContext(AppContext);
const imageBuildersEnabled =
params?.IMAGE_BUILDERS_ENABLED ?? DEFAULT_APP_PARAMS.IMAGE_BUILDERS_ENABLED;

return (
<Controller
control={control}
Expand Down Expand Up @@ -67,22 +74,26 @@ export default function EnvironmentKindField({
Custom Environment
</label>

<input
type="radio"
className="btn-check"
name={field.name}
autoComplete="off"
checked={field.value === "BUILDER"}
id="environment-kind-builder-radio"
onChange={() => field.onChange("BUILDER")}
onBlur={field.onBlur}
/>
<label
className={cx("btn", "btn-outline-primary")}
htmlFor="environment-kind-builder-radio"
>
Create from a repository
</label>
{imageBuildersEnabled && (
<>
<input
type="radio"
className="btn-check"
name={field.name}
autoComplete="off"
checked={field.value === "BUILDER"}
id="environment-kind-builder-radio"
onChange={() => field.onChange("BUILDER")}
onBlur={field.onBlur}
/>
<label
className={cx("btn", "btn-outline-primary")}
htmlFor="environment-kind-builder-radio"
>
Create from a repository
</label>
</>
)}
</ButtonGroup>
</div>
)}
Expand Down

0 comments on commit 8bc0bd6

Please sign in to comment.