Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and batpad committed Jul 5, 2024
1 parent d520981 commit c58f895
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
8 changes: 2 additions & 6 deletions jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@
"profile_options": {
"image": {
"display_name": "Image",
"dynamic_image_building": {
"enabled": True
},
"dynamic_image_building": {"enabled": True},
"unlisted_choice": {
"enabled": True,
"display_name": "Custom image",
Expand Down Expand Up @@ -234,9 +232,7 @@
"image": {
"choices": {},
"display_name": "Image",
"dynamic_image_building": {
"enabled": True
},
"dynamic_image_building": {"enabled": True},
"unlisted_choice": {
"display_name": "Custom image",
"enabled": True,
Expand Down
29 changes: 16 additions & 13 deletions src/ProfileOptions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@ import { ImageBuilder } from "./ImageBuilder";

function hasDynamicImageBuilding(key, option) {
console.log("dynamic image building", key, option);
return key === 'image' && option.dynamic_image_building?.enabled && option.unlisted_choice?.enabled;
return (
key === "image" &&
option.dynamic_image_building?.enabled &&
option.unlisted_choice?.enabled
);
}

export function ProfileOptions({ config, profile }) {
return (
<div className="form-grid">
{Object.entries(config).map(([key, option]) => {
const customOptions =
hasDynamicImageBuilding(key, option)
? [
{
value: "--extra-selectable-item",
label: "Build your own image",
description:
"Use a mybinder.org compatible GitHub repo to build your own image",
component: ImageBuilder,
},
]
: [];
const customOptions = hasDynamicImageBuilding(key, option)
? [
{
value: "--extra-selectable-item",
label: "Build your own image",
description:
"Use a mybinder.org compatible GitHub repo to build your own image",
component: ImageBuilder,
},
]
: [];

return (
<ResourceSelect
Expand Down

0 comments on commit c58f895

Please sign in to comment.