Skip to content

Commit

Permalink
show remove and rejoin for relevant state
Browse files Browse the repository at this point in the history
  • Loading branch information
ousmaneo committed Dec 20, 2023
1 parent d1f3190 commit 49506bc
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ const DataNodeActions = ({ dataNode }: Props) => {
};

const isDatanodeRunning = dataNode.data_node_status === 'AVAILABLE';
const isDatanodeRemoved = dataNode.data_node_status === 'REMOVED';
const isRemovingDatanode = dataNode.data_node_status === 'REMOVING';

return (
<>
Expand All @@ -126,8 +128,8 @@ const DataNodeActions = ({ dataNode }: Props) => {
<MenuItem onSelect={() => renewDatanodeCertificate(dataNode.node_id)}>Renew certificate</MenuItem>
{!isDatanodeRunning && <MenuItem onSelect={() => startDataNode(dataNode.node_id)}>Start</MenuItem>}
{isDatanodeRunning && <MenuItem onSelect={() => handleAction(DIALOG_TYPES.STOP)}>Stop</MenuItem>}
<MenuItem onSelect={() => handleAction(DIALOG_TYPES.REJOIN)}>Rejoin</MenuItem>
<MenuItem onSelect={() => handleAction(DIALOG_TYPES.REMOVE)}>Remove</MenuItem>
{isDatanodeRemoved && <MenuItem onSelect={() => handleAction(DIALOG_TYPES.REJOIN)}>Rejoin</MenuItem>}
{(!isDatanodeRemoved || isRemovingDatanode) && <MenuItem onSelect={() => handleAction(DIALOG_TYPES.REMOVE)}>Remove</MenuItem>}
</OverlayDropdownButton>
{showDialog && (
<ConfirmDialog title={DIALOG_TEXT[dialogType].dialogTitle}
Expand Down

0 comments on commit 49506bc

Please sign in to comment.