Skip to content

Commit f21c3eb

Browse files
committed
chore: update text for empty state deploy button
1 parent 6ff879e commit f21c3eb

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.11.0-pre-9",
7+
"@devtron-labs/devtron-fe-common-lib": "1.11.0-pre-9-beta-2",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/components/app/details/appDetails/AppDetailsCDButton.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import ReactGA from 'react-ga4'
1919
import { useHistory, useLocation } from 'react-router-dom'
2020

2121
import {
22-
ACTION_STATE,
2322
Button,
2423
ButtonComponentType,
2524
ButtonVariantType,
@@ -30,8 +29,6 @@ import {
3029
VisibleModal,
3130
} from '@devtron-labs/devtron-fe-common-lib'
3231

33-
import { ReactComponent as InfoOutline } from '../../../../assets/icons/ic-info-outline.svg'
34-
import { ReactComponent as DeployIcon } from '../../../../assets/icons/ic-nav-rocket.svg'
3532
import { BUTTON_TITLE } from '../../../ApplicationGroup/Constants'
3633
import { importComponentFromFELibrary } from '../../../common'
3734
import { URL_PARAM_MODE_TYPE } from '../../../common/helpers/types'
@@ -41,7 +38,7 @@ import CDMaterial from '../triggerView/cdMaterial'
4138
import { TRIGGER_VIEW_PARAMS } from '../triggerView/Constants'
4239
import { MATERIAL_TYPE } from '../triggerView/types'
4340
import { DA_APP_DETAILS_GA_EVENTS } from './constants'
44-
import { getDeployButtonStyle } from './utils'
41+
import { getDeployButtonIcon, getDeployButtonStyle } from './utils'
4542

4643
const ApprovalMaterialModal = importComponentFromFELibrary('ApprovalMaterialModal')
4744

@@ -87,8 +84,8 @@ const AppDetailsCDButton = ({
8784
dataTestId="deploy-button"
8885
size={isForEmptyState ? ComponentSizeType.large : ComponentSizeType.small}
8986
variant={ButtonVariantType.primary}
90-
text={BUTTON_TITLE[DeploymentNodeType.CD]}
91-
startIcon={deploymentUserActionState === ACTION_STATE.BLOCKED ? <InfoOutline /> : <DeployIcon />}
87+
text={isForEmptyState ? 'Select Image to Deploy' : BUTTON_TITLE[DeploymentNodeType.CD]}
88+
startIcon={getDeployButtonIcon(deploymentUserActionState, isForEmptyState)}
9289
onClick={onClickDeployButton}
9390
component={ButtonComponentType.button}
9491
style={getDeployButtonStyle(deploymentUserActionState)}

src/components/app/details/appDetails/utils.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ import {
3030
prefixZeroIfSingleDigit,
3131
AppEnvironment,
3232
SelectPickerOptionType,
33+
Icon,
3334
} from '@devtron-labs/devtron-fe-common-lib'
3435
import { GetIFrameSrcParamsType } from './types'
36+
import { ReactComponent as ICDeploy } from '@Icons/ic-nav-rocket.svg'
3537

3638
export function getAggregator(nodeType: NodeType, defaultAsOtherResources?: boolean): AggregationKeys {
3739
switch (nodeType) {
@@ -386,9 +388,16 @@ export const getDeployButtonStyle = (actionState: ACTION_STATE): ButtonStyleType
386388
default:
387389
return ButtonStyleType.default
388390
}
389-
}
391+
}
392+
393+
export const getDeployButtonIcon = (actionState: ACTION_STATE, isForEmptyState: boolean): JSX.Element => {
394+
if (actionState === ACTION_STATE.BLOCKED) {
395+
return <Icon name="ic-info-outline" color={null} />
396+
}
397+
return isForEmptyState ? <Icon name="ic-hand-pointing" color={null} /> : <ICDeploy />
398+
}
390399

391400
export const getEnvOptions = (env: AppEnvironment): SelectPickerOptionType<number> => ({
392401
label: env.environmentName,
393402
value: env.environmentId,
394-
})
403+
})

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,10 +1126,10 @@
11261126
dependencies:
11271127
"@jridgewell/trace-mapping" "0.3.9"
11281128

1129-
"@devtron-labs/[email protected]":
1130-
version "1.11.0-pre-9"
1131-
resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-1.11.0-pre-9.tgz#17377b4bc671923134bf6ade08aeb5d194d8ffb3"
1132-
integrity sha512-KvdoTo7KvEK5sIT/NWbJZlbxlTla8WUUQ2BzRQsIU5QU/0IEw6gqyPslZDzMKDZvaErrWqODRyo3ZG1PedLolg==
1129+
"@devtron-labs/[email protected]-beta-2":
1130+
version "1.11.0-pre-9-beta-2"
1131+
resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-1.11.0-pre-9-beta-2.tgz#a39bf07a73de60abe9b03680a3515bcdc5df9ccc"
1132+
integrity sha512-M7+w8VbfeiGtFUw4dCficmsIC3qVyaFa+zfNfohaIQwpMtt9pAkzL5D+PLXeQ8u/bzINPhKs3wOtCgIGJ56x5A==
11331133
dependencies:
11341134
"@codemirror/lang-json" "6.0.1"
11351135
"@codemirror/lang-yaml" "6.1.2"

0 commit comments

Comments
 (0)