Skip to content

Commit

Permalink
fix(UI): fixed bug where UI would crash on deleting actions (#2057)
Browse files Browse the repository at this point in the history
Ref: SRX-FFMDKH
  • Loading branch information
miguel-crespo-fdc authored Oct 22, 2024
1 parent 3c280ed commit c17dc8f
Showing 1 changed file with 46 additions and 40 deletions.
86 changes: 46 additions & 40 deletions services/frontend-service/src/ui/components/SideBar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
useLocksSimilarTo,
useRelease,
useLocksConflictingWithActions,
useReleaseDifference,
} from '../../utils/store';
import React, { ChangeEvent, useCallback, useMemo, useState } from 'react';
import { useApi } from '../../utils/GrpcApi';
Expand Down Expand Up @@ -191,45 +190,52 @@ export const getActionDetails = (
type: ActionTypes.Deploy,
name: 'Deploy',
dialogTitle: 'Please be aware:',
summary: ((): string => {
const releaseDiff = useReleaseDifference(
action.deploy.version,
action.deploy.application,
action.deploy.environment
);
if (releaseDiff < 0) {
return (
'Rolling back by ' +
releaseDiff * -1 +
' releases down to version ' +
action.deploy.version +
' of ' +
action.deploy.application +
' to ' +
action.deploy.environment
);
} else if (releaseDiff > 0) {
return (
'Advancing by ' +
releaseDiff +
' releases up to version ' +
action.deploy.version +
' of ' +
action.deploy.application +
' to ' +
action.deploy.environment
);
} else {
return (
'Deploy version ' +
action.deploy.version +
' of "' +
action.deploy.application +
'" to ' +
action.deploy.environment
);
}
})(),
summary: ((): string =>
'Deploy version ' +
action.deploy.version +
' of "' +
action.deploy.application +
'" to ' +
action.deploy.environment)(),

//TODO: The useReleaseDifference Hook is called conditionally. To be fixed in Ref: SRX-41ZF5J.
// const releaseDiff = useReleaseDifference(
// action.deploy.version,
// action.deploy.application,
// action.deploy.environment
// );
// if (releaseDiff < 0) {
// return (
// 'Rolling back by ' +
// releaseDiff * -1 +
// ' releases down to version ' +
// action.deploy.version +
// ' of ' +
// action.deploy.application +
// ' to ' +
// action.deploy.environment
// );
// } else if (releaseDiff > 0) {
// return (
// 'Advancing by ' +
// releaseDiff +
// ' releases up to version ' +
// action.deploy.version +
// ' of ' +
// action.deploy.application +
// ' to ' +
// action.deploy.environment
// );
// } else {
// return (
// 'Deploy version ' +
// action.deploy.version +
// ' of "' +
// action.deploy.application +
// '" to ' +
// action.deploy.environment
// );
// }
tooltip: '',
environment: action.deploy.environment,
application: action.deploy.application,
Expand Down

0 comments on commit c17dc8f

Please sign in to comment.