Skip to content

Commit e897f9d

Browse files
committed
chore: update emty state button config
1 parent 015c3ce commit e897f9d

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
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-beta-2",
7+
"@devtron-labs/devtron-fe-common-lib": "1.11.0-pre-9-beta-3",
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import CDMaterial from '../triggerView/cdMaterial'
3939
import { TRIGGER_VIEW_PARAMS } from '../triggerView/Constants'
4040
import { MATERIAL_TYPE } from '../triggerView/types'
4141
import { DA_APP_DETAILS_GA_EVENTS } from './constants'
42-
import { getDeployButtonIcon, getDeployButtonStyle } from './utils'
42+
import { getDeployButtonConfig } from './utils'
4343

4444
const ApprovalMaterialModal = importComponentFromFELibrary('ApprovalMaterialModal')
4545

@@ -80,7 +80,7 @@ const AppDetailsCDButton = ({
8080
history.push({ search: '' })
8181
}
8282

83-
const iconName = getDeployButtonIcon(deploymentUserActionState, isForEmptyState)
83+
const { buttonStyle, iconName } = getDeployButtonConfig(deploymentUserActionState, isForEmptyState)
8484

8585
const renderDeployButton = () => (
8686
<Button
@@ -91,7 +91,7 @@ const AppDetailsCDButton = ({
9191
startIcon={iconName && <Icon name={iconName} color={null} />}
9292
onClick={onClickDeployButton}
9393
component={ButtonComponentType.button}
94-
style={getDeployButtonStyle(deploymentUserActionState)}
94+
style={buttonStyle}
9595
/>
9696
)
9797

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -378,22 +378,21 @@ export const validateMomentDate = (date: string, format: string): string => {
378378
return moment(date, format).fromNow()
379379
}
380380

381-
export const getDeployButtonStyle = (actionState: ACTION_STATE): ButtonStyleType => {
381+
export const getDeployButtonConfig = (
382+
actionState: ACTION_STATE,
383+
isForEmptyState: boolean,
384+
): { buttonStyle: ButtonStyleType; iconName: IconsProps['name'] } => {
385+
if (isForEmptyState) {
386+
return { buttonStyle: ButtonStyleType.default, iconName: 'ic-hand-pointing' }
387+
}
382388
switch (actionState) {
383389
case ACTION_STATE.BLOCKED:
384-
return ButtonStyleType.negative
390+
return { buttonStyle: ButtonStyleType.negative, iconName: 'ic-info-outline' }
385391
case ACTION_STATE.PARTIAL:
386-
return ButtonStyleType.warning
392+
return { buttonStyle: ButtonStyleType.warning, iconName: 'ic-rocket-launch' }
387393
default:
388-
return ButtonStyleType.default
389-
}
390-
}
391-
392-
export const getDeployButtonIcon = (actionState: ACTION_STATE, isForEmptyState: boolean): IconsProps['name'] => {
393-
if (actionState === ACTION_STATE.BLOCKED) {
394-
return 'ic-info-outline'
394+
return { buttonStyle: ButtonStyleType.default, iconName: 'ic-rocket-launch' }
395395
}
396-
return isForEmptyState ? 'ic-hand-pointing' : 'ic-rocket-launch'
397396
}
398397

399398
export const getEnvOptions = (env: AppEnvironment): SelectPickerOptionType<number> => ({

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]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==
1129+
"@devtron-labs/[email protected]3":
1130+
version "1.11.0-pre-9-beta-3"
1131+
resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-1.11.0-pre-9-beta-3.tgz#cc111a19822cbc1908f060a72a4da25f3f17fb8e"
1132+
integrity sha512-oA5PgLs61uRKLwooPT3hohz5mP/L2JOPjilf6CzQByB9ZjbAZNuF4a31LoyU/RJItprNjGEe2FZq9JVmZAT8nw==
11331133
dependencies:
11341134
"@codemirror/lang-json" "6.0.1"
11351135
"@codemirror/lang-yaml" "6.1.2"

0 commit comments

Comments
 (0)