Skip to content

Commit ca9fa32

Browse files
authored
Merge pull request #2889 from devtron-labs/feat/sync-notes-card-fix
feat: sync notes card fix
2 parents 5c5deb9 + 1a76415 commit ca9fa32

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
GitProviderIcon,
2323
Icon,
2424
LoadingCard,
25+
Tooltip,
2526
useQuery,
2627
} from '@devtron-labs/devtron-fe-common-lib'
2728

@@ -47,6 +48,7 @@ const DeployedCommitCard = ({ cardLoading, showCommitInfoDrawer, envId, ciArtifa
4748
<div className="flexbox deployed-commit-card">
4849
{materials.map((material) => {
4950
const lastCommit = material.history[0]
51+
const commitMessage = lastCommit?.message ?? ''
5052

5153
return (
5254
<div
@@ -78,10 +80,12 @@ const DeployedCommitCard = ({ cardLoading, showCommitInfoDrawer, envId, ciArtifa
7880
</div>
7981
<GitProviderIcon gitRepoUrl={lastCommit?.commitURL} size={24} />
8082
</div>
81-
<div className="app-details-info-card__bottom-container dc__content-space">
82-
<span className="app-details-info-card__bottom-container__message fs-12 fw-4">
83-
{lastCommit?.message ?? ''}
84-
</span>
83+
<div className="app-details-info-card__bottom-container dc__content-space dc__gap-8">
84+
<Tooltip content={commitMessage} placement="bottom">
85+
<span className="app-details-info-card__bottom-container__message fs-12 fw-4">
86+
{commitMessage}
87+
</span>
88+
</Tooltip>
8589
<div className="app-details-info-card__bottom-container__details fs-12 fw-6">Details</div>
8690
</div>
8791
</div>

src/components/v2/appDetails/sourceInfo/environment.type.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import React from 'react'
17+
import React, { SyntheticEvent } from 'react'
1818

1919
import {
2020
AppEnvironment as BaseAppEnvironmentType,
@@ -49,7 +49,7 @@ export interface NodeStreamMap {
4949
export interface ChartUsedCardType {
5050
appDetails: AppDetails
5151
notes: string
52-
onClickShowNotes: () => void
52+
onClickShowNotes: (e: SyntheticEvent) => void
5353
cardLoading: boolean
5454
onClickUpgrade: () => void
5555
}

src/components/v2/appDetails/sourceInfo/environmentStatus/EnvironmentStatus.component.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { useMemo, useState } from 'react'
17+
import { SyntheticEvent, useMemo, useState } from 'react'
1818
import './environmentStatus.scss'
1919
import IndexStore from '../../index.store'
2020
import { URLS } from '../../../../../config'
@@ -29,6 +29,7 @@ import {
2929
AppStatusModalTabType,
3030
DeploymentAppTypes,
3131
LoadingCard,
32+
stopPropagation,
3233
useAsync,
3334
} from '@devtron-labs/devtron-fe-common-lib'
3435
import { EnvironmentStatusComponentType } from '../environment.type'
@@ -112,7 +113,8 @@ const EnvironmentStatusComponent = ({
112113
)
113114
}
114115

115-
const onClickShowNotes = () => {
116+
const onClickShowNotes = (e: SyntheticEvent) => {
117+
stopPropagation(e)
116118
setShowNotes(true)
117119
}
118120

src/components/v2/appDetails/sourceInfo/environmentStatus/NotesDrawer.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
*/
1616

1717
import { useEffect, useRef } from 'react'
18-
import { ReactComponent as Close } from '../../../assets/icons/ic-close.svg'
1918
import './environmentStatus.scss'
2019
import { NotesDrawerType } from './notesDrawer.type'
21-
import { Drawer, MarkDown } from '@devtron-labs/devtron-fe-common-lib'
20+
import { Button, ButtonStyleType, ButtonVariantType, ComponentSizeType, Drawer, Icon, MarkDown } from '@devtron-labs/devtron-fe-common-lib'
2221

2322
const NotesDrawer = ({ notes, close }: NotesDrawerType) => {
2423
const appNotesRef = useRef<HTMLDivElement>(null)
@@ -59,9 +58,16 @@ const NotesDrawer = ({ notes, close }: NotesDrawerType) => {
5958
data-testid="notes-heading-after-click"
6059
>
6160
Notes
62-
<span className="cursor" onClick={close} data-testid="close-notes-button">
63-
<Close className="icon-dim-24" />
64-
</span>
61+
<Button
62+
dataTestId="close-notes-button"
63+
icon={<Icon name="ic-close-large" color={null} />}
64+
onClick={close}
65+
ariaLabel="Close notes drawer"
66+
showAriaLabelInTippy={false}
67+
size={ComponentSizeType.xs}
68+
variant={ButtonVariantType.borderLess}
69+
style={ButtonStyleType.negativeGrey}
70+
/>
6571
</div>
6672
</div>
6773
<div className="app-notes__body dc__white-space-pre">

0 commit comments

Comments
 (0)