Skip to content

Commit

Permalink
Fix [Functions] Add mock for GET functions request (mlrun#2589)
Browse files Browse the repository at this point in the history
  • Loading branch information
mavdryk authored and ilan7empest committed Jul 8, 2024
1 parent 4d8f4fd commit 4f8a5dd
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 105 deletions.
15 changes: 10 additions & 5 deletions src/components/FunctionsPage/functions.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@ export const generateActionsMenu = (
disabled: functionIsDeleting,
onClick: funcMin => {
getFullFunction(funcMin).then(func => {
setFunctionsPanelIsOpen(true)
setEditableItem(func)
if (!isEmpty(func)) {
setFunctionsPanelIsOpen(true)
setEditableItem(func)
}
})
},
hidden:
Expand Down Expand Up @@ -264,7 +266,8 @@ export const generateActionsMenu = (
label: 'Build and run',
icon: <DeployIcon />,
disabled: functionIsDeleting,
onClick: funcMin => getFullFunction(funcMin).then(func => buildAndRunFunc(func)),
onClick: funcMin =>
getFullFunction(funcMin).then(func => !isEmpty(func) && buildAndRunFunc(func)),
hidden:
func?.type !== FUNCTION_TYPE_JOB ||
(func?.type === FUNCTION_TYPE_JOB && func?.state?.value !== FUNCTION_INITIALIZED_STATE)
Expand All @@ -276,8 +279,10 @@ export const generateActionsMenu = (
disabled: functionIsDeleting,
onClick: funcMin => {
getFullFunction(funcMin).then(func => {
setFunctionsPanelIsOpen(true)
setEditableItem(func)
if (!isEmpty(func)) {
setFunctionsPanelIsOpen(true)
setEditableItem(func)
}
})
},
hidden: !isDemoMode || func?.type !== FUNCTION_TYPE_SERVING
Expand Down
Loading

0 comments on commit 4f8a5dd

Please sign in to comment.