Skip to content

Commit

Permalink
Fix [Functions panel] Show "Volumes" dropdown on function edit
Browse files Browse the repository at this point in the history
  • Loading branch information
illia-prokopchuk committed Nov 17, 2023
1 parent c10a5fd commit c2094a2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const FunctionsPanelResources = ({
])

const [data, setData] = useState({
disable_auto_mount: defaultData.disable_auto_mount ?? true,
volumeMounts: getDefaultVolumeMounts(
defaultData.volume_mounts ?? [],
defaultData.volumes ?? [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ const FunctionsPanelResourcesView = ({
title="Volumes"
tip="Volumes that define data paths and the required information for accessing the data from the function"
>
{mode === PANEL_CREATE_MODE && (
{(mode === PANEL_CREATE_MODE || !data.disable_auto_mount) && (
<Select
className="volume-mount"
floatingLabel
disabled={mode !== PANEL_CREATE_MODE}
label="Volume mount"
options={volumeMountOptions}
onClick={handleSelectVolumeMount}
Expand Down
1 change: 1 addition & 0 deletions src/utils/parseFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const parseFunction = (func, projectName, customState) => {
default_class: func.spec?.default_class ?? '',
default_handler: func.spec?.default_handler ?? '',
description: func.spec?.description ?? '',
disable_auto_mount: func.spec?.disable_auto_mount ?? true,
env: func.spec?.env ?? [],
error_stream: func.spec?.error_stream ?? '',
graph: func.spec?.graph ?? {},
Expand Down

0 comments on commit c2094a2

Please sign in to comment.