Skip to content

Commit

Permalink
Fix [UI] do not show "Failed to delete" status in UI (#2482)
Browse files Browse the repository at this point in the history
  • Loading branch information
illia-prokopchuk committed May 28, 2024
1 parent 1c89ff3 commit d3b2263
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/elements/ProjectTable/projectTable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
}

&_failed,
&_failedToDelete,
&_error,
&_unhealthy {
color: $amaranth;
Expand Down
1 change: 0 additions & 1 deletion src/utils/getState.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const functionStateLabels = {
deploying: 'Deploying',
error: 'Error',
failed: 'Error',
failedToDelete: 'Failed to delete',
omitted: 'Omitted',
pending: 'Deploying',
ready: 'Ready',
Expand Down
5 changes: 2 additions & 3 deletions src/utils/parseFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ such restriction.
*/
import { isEmpty } from 'lodash'
import getState from './getState'
import { FUNCTION_FAILED_TO_DELETE_STATE, FUNCTION_TYPE_APPLICATION } from '../constants'
import { FUNCTION_TYPE_APPLICATION } from '../constants'
import { getFunctionIdentifier } from './getUniqueIdentifier'
import { page } from '../components/FunctionsPage/functions.util'
import { parseKeyValues } from './object'

export const parseFunction = (func, projectName, customState, apiGateway) => {
const state = (func.status?.deletion_error ? FUNCTION_FAILED_TO_DELETE_STATE : customState) || func.status?.state
const command = func.kind === FUNCTION_TYPE_APPLICATION && !isEmpty(apiGateway)
? `${window.location.protocol}//${apiGateway.spec.host}${apiGateway.spec.path}`
: func.spec?.command
Expand Down Expand Up @@ -63,7 +62,7 @@ export const parseFunction = (func, projectName, customState, apiGateway) => {
project: func.metadata?.project || projectName,
resources: func.spec?.resources ?? {},
secret_sources: func.spec?.secret_sources ?? [],
state: getState(state, page, 'function'),
state: getState(customState || func.status?.state, page, 'function'),
tag: func.metadata?.tag ?? '',
track_models: func.spec?.track_models ?? false,
type: func.kind,
Expand Down

0 comments on commit d3b2263

Please sign in to comment.