Skip to content

Commit fda485a

Browse files
committed
chore: update disbaled messaging
1 parent 9c540e0 commit fda485a

File tree

2 files changed

+43
-22
lines changed

2 files changed

+43
-22
lines changed

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

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import AppEnvSelector from './AppDetails.components'
5454
import { HibernationModalTypes } from './appDetails.type'
5555
import AppDetailsCDButton from './AppDetailsCDButton'
5656
import AppStatusCard from './AppStatusCard'
57-
import { AG_APP_DETAILS_GA_EVENTS, DA_APP_DETAILS_GA_EVENTS } from './constants'
57+
import { ACTION_DISABLED_TEXT, AG_APP_DETAILS_GA_EVENTS, DA_APP_DETAILS_GA_EVENTS } from './constants'
5858
import DeployedCommitCard from './DeployedCommitCard'
5959
import DeploymentStatusCard from './DeploymentStatusCard'
6060
import IssuesCard from './IssuesCard'
@@ -196,20 +196,23 @@ export const SourceInfo = ({
196196
const renderAppDetailsCDButton = () => {
197197
const { buttonStyle, iconName } = getDeployButtonConfig(deploymentUserActionState)
198198
return (
199-
<AppDetailsCDButton
200-
{...appDetailsCDButtonProps}
201-
gaEvent={
202-
isAppView ? DA_APP_DETAILS_GA_EVENTS.DeployButtonClicked : AG_APP_DETAILS_GA_EVENTS.DeployButtonClicked
203-
}
204-
buttonProps={{
205-
dataTestId: 'deploy-button',
206-
size: ComponentSizeType.medium,
207-
text: 'Deploy',
208-
startIcon: <Icon name={iconName} color={null} />,
209-
style: buttonStyle,
210-
}}
211-
/>
212-
)}
199+
<AppDetailsCDButton
200+
{...appDetailsCDButtonProps}
201+
gaEvent={
202+
isAppView
203+
? DA_APP_DETAILS_GA_EVENTS.DeployButtonClicked
204+
: AG_APP_DETAILS_GA_EVENTS.DeployButtonClicked
205+
}
206+
buttonProps={{
207+
dataTestId: 'deploy-button',
208+
size: ComponentSizeType.medium,
209+
text: 'Deploy',
210+
startIcon: <Icon name={iconName} color={null} />,
211+
style: buttonStyle,
212+
}}
213+
/>
214+
)
215+
}
213216

214217
const renderRollbackButton = (isIcon?: boolean) => (
215218
<AppDetailsCDButton
@@ -243,7 +246,7 @@ export const SourceInfo = ({
243246
: ''
244247

245248
return (
246-
<div className="flex left w-100">
249+
<div className="flex left w-100 h-40">
247250
<AppEnvSelector {...(isAppView ? { isAppView, environments } : { isAppView: false, applications })} />
248251
{appDetails?.deploymentAppType && (
249252
<Tooltip
@@ -338,8 +341,16 @@ export const SourceInfo = ({
338341
style={ButtonStyleType.neutral}
339342
showTooltip={isApprovalConfigured}
340343
tooltipProps={{
341-
content:
342-
'Application deployment requiring approval cannot be hibernated.',
344+
content: (
345+
<div className="flexbox-col">
346+
<span className="fw-6">
347+
Cannot {isHibernated ? 'unhibernate' : 'hibernate'}
348+
</span>
349+
<span className="fw-4 dc__word-break">
350+
{ACTION_DISABLED_TEXT}
351+
</span>
352+
</div>
353+
),
343354
placement: 'bottom',
344355
}}
345356
ariaLabel={isHibernated ? 'Unhibernate' : 'Hibernate'}
@@ -361,12 +372,19 @@ export const SourceInfo = ({
361372
style={ButtonStyleType.neutral}
362373
showTooltip
363374
tooltipProps={{
364-
content: isApprovalConfigured
365-
? 'Application deployment requiring approval cannot be hibernated.'
366-
: 'Restart workloads',
375+
content: isApprovalConfigured ? (
376+
<div className="flexbox-col">
377+
<span className="fw-6">Cannot restart workloads</span>
378+
<span className="fw-4 dc__word-break">
379+
{ACTION_DISABLED_TEXT}
380+
</span>
381+
</div>
382+
) : (
383+
'Restart workloads'
384+
),
367385
placement: 'top',
368386
}}
369-
ariaLabel="rotate workloads"
387+
ariaLabel="restart workloads"
370388
/>
371389
)}
372390

src/components/app/details/appDetails/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ export const AG_APP_DETAILS_GA_EVENTS: Record<string, Pick<UaEventOptions, 'cate
5151
action: 'AG_APP_DETAIL_GO_TO_ENV_CONFIG',
5252
},
5353
}
54+
55+
export const ACTION_DISABLED_TEXT =
56+
'This application requires deployment approval to perform actions that impact the active deployment.'

0 commit comments

Comments
 (0)