Skip to content

Commit c3af130

Browse files
committed
fix: notes drawer closing on click
1 parent ff043cc commit c3af130

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
GitProviderType,
2424
LoadingCard,
2525
showError,
26+
Tooltip,
2627
} from '@devtron-labs/devtron-fe-common-lib'
2728

2829
import { ReactComponent as CommitIcon } from '../../../../assets/icons/ic-code-commit.svg'
@@ -99,8 +100,10 @@ const DeployedCommitCard = ({ cardLoading, showCommitInfoDrawer, envId, ciArtifa
99100
{/* @TODO: This should be dynamic, dependent on the source */}
100101
{/* <GitHub className="github-icon" /> */}
101102
</div>
102-
<div className="app-details-info-card__bottom-container dc__content-space">
103-
<span className="app-details-info-card__bottom-container__message fs-12 fw-4">{commitMessage}</span>
103+
<div className="app-details-info-card__bottom-container dc__gap-8 dc__content-space">
104+
<Tooltip content={commitMessage} placement="bottom">
105+
<span className="app-details-info-card__bottom-container__message fs-12 fw-4">{commitMessage}</span>
106+
</Tooltip>
104107
<div className="app-details-info-card__bottom-container__details fs-12 fw-6">Details</div>
105108
</div>
106109
</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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { useEffect, useRef } from 'react'
1818
import { ReactComponent as Close } from '../../../assets/icons/ic-close.svg'
1919
import './environmentStatus.scss'
2020
import { NotesDrawerType } from './notesDrawer.type'
21-
import { Drawer, MarkDown } from '@devtron-labs/devtron-fe-common-lib'
21+
import { Button, ButtonStyleType, ButtonVariantType, ComponentSizeType, Drawer, Icon, MarkDown } from '@devtron-labs/devtron-fe-common-lib'
2222

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

0 commit comments

Comments
 (0)