Skip to content

Commit

Permalink
fix: Have the connect buttons be disabled if pods not yet managed
Browse files Browse the repository at this point in the history
  • Loading branch information
phantomjinx committed Apr 15, 2024
1 parent 812ea56 commit 32d7d0d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/online-shell/src/discover/DiscoverPodConnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export const DiscoverPodConnect: React.FunctionComponent<DiscoverPodConnectProps
}

const disableContainerButton = (): boolean => {
return mgmtService.podStatus(props.pod.mPod) !== 'Running' || connectionNames.length === 0 || mgmtError !== null
return mgmtService.podStatus(props.pod.mPod) !== 'Running' ||
(! props.pod.mPod.getManagement().status.managed) ||
connectionNames.length === 0 || mgmtError !== null
}

const onConnect = (connectName: string) => {
Expand Down Expand Up @@ -83,6 +85,7 @@ export const DiscoverPodConnect: React.FunctionComponent<DiscoverPodConnectProps
<DropdownItem
key={`${props.pod.uid}-container-${index}`}
component='button'
isDisabled={disableContainerButton()}
onClick={() => onConnect(connectionName)}
>
{connectionName.replace(`${props.pod.name}-`, '')}
Expand Down

0 comments on commit 32d7d0d

Please sign in to comment.