Skip to content

Commit

Permalink
fix: dashboard promote buttons disabled during deploy (#1669)
Browse files Browse the repository at this point in the history
- keep promote and abort buttons enabled while deploying
- disable them at all other times
- also, only enable retry button when Rollout is degraded

Fixes #1581

Signed-off-by: Ben Poland <[email protected]>
  • Loading branch information
bpoland authored Jan 4, 2022
1 parent a3477cf commit c291d2d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ui/src/app/components/rollout-actions/rollout-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const RolloutActionButton = (props: {action: RolloutAction; rollout: Roll
const namespaceCtx = React.useContext(NamespaceContext);

const restartedAt = formatTimestamp(props.rollout.restartedAt || '');
const isDeploying = props.rollout.status === RolloutStatus.Progressing || props.rollout.status === RolloutStatus.Paused

const actionMap = new Map<RolloutAction, ActionButtonProps & {body?: any}>([
[
Expand All @@ -36,6 +37,7 @@ export const RolloutActionButton = (props: {action: RolloutAction; rollout: Roll
label: 'RETRY',
icon: 'fa-redo-alt',
action: api.rolloutServiceRetryRollout,
disabled: props.rollout.status !== RolloutStatus.Degraded,
shouldConfirm: true,
},
],
Expand All @@ -45,6 +47,7 @@ export const RolloutActionButton = (props: {action: RolloutAction; rollout: Roll
label: 'ABORT',
icon: 'fa-exclamation-circle',
action: api.rolloutServiceAbortRollout,
disabled: !isDeploying,
shouldConfirm: true,
},
],
Expand All @@ -55,7 +58,7 @@ export const RolloutActionButton = (props: {action: RolloutAction; rollout: Roll
icon: 'fa-chevron-circle-up',
action: api.rolloutServicePromoteRollout,
body: {full: false},
disabled: props.rollout.status !== RolloutStatus.Paused,
disabled: !isDeploying,
shouldConfirm: true,
},
],
Expand All @@ -64,9 +67,9 @@ export const RolloutActionButton = (props: {action: RolloutAction; rollout: Roll
{
label: 'PROMOTE-FULL',
icon: 'fa-arrow-circle-up',
body: {full: true},
action: api.rolloutServicePromoteRollout,
disabled: props.rollout.status !== RolloutStatus.Paused,
body: {full: true},
disabled: !isDeploying,
shouldConfirm: true,
},
],
Expand Down

0 comments on commit c291d2d

Please sign in to comment.