Skip to content

Commit 17faf35

Browse files
committed
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-lib into feat/toast-manager
2 parents 3504829 + 11a77d5 commit 17faf35

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.2.32-beta-4",
3+
"version": "0.3.3",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/Tooltip/Tooltip.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useCallback, useState, cloneElement } from 'react'
1+
import { useState, cloneElement } from 'react'
22
import TippyJS from '@tippyjs/react'
33
import { TooltipProps } from './types'
44

@@ -12,25 +12,26 @@ const Tooltip = ({
1212
}: TooltipProps) => {
1313
const [isTextTruncated, setIsTextTruncated] = useState(false)
1414

15-
const refCallback = useCallback((node: HTMLDivElement) => {
16-
if (node) {
17-
// NOTE: for line-clamp we need to check scrollHeight against clientHeight since orientation
18-
// is set to vertical through -webkit-box-orient prop that is needed for line-clamp to work
19-
// see: https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-line-clamp
20-
setIsTextTruncated(node.scrollWidth > node.clientWidth || node.scrollHeight > node.clientHeight)
15+
const handleMouseEnterEvent: React.MouseEventHandler = (event) => {
16+
const { currentTarget: node } = event
17+
const isTextOverflowing = node.scrollWidth > node.clientWidth || node.scrollHeight > node.clientHeight
18+
if (isTextOverflowing && !isTextTruncated) {
19+
setIsTextTruncated(true)
20+
} else if (!isTextOverflowing && isTextTruncated) {
21+
setIsTextTruncated(false)
2122
}
22-
}, [])
23+
}
2324

2425
return (!isTextTruncated || !showOnTruncate) && !alwaysShowTippyOnHover ? (
25-
cloneElement(child, { ...child.props, ref: refCallback })
26+
cloneElement(child, { ...child.props, onMouseEnter: handleMouseEnterEvent })
2627
) : (
2728
<TippyJS
2829
arrow={false}
2930
placement="top"
3031
{...rest}
3132
className={`default-tt ${wordBreak ? 'dc__word-break-all' : ''} dc__mxw-200-imp ${rest.className}`}
3233
>
33-
{cloneElement(child, { ...child.props, ref: refCallback })}
34+
{cloneElement(child, { ...child.props, onMouseEnter: handleMouseEnterEvent })}
3435
</TippyJS>
3536
)
3637
}

src/Shared/Components/CICDHistory/DeploymentHistoryDiff/DeploymentHistoryConfigList.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ const DeploymentHistoryConfigList = ({
8383
deploymentHistoryList &&
8484
deploymentHistoryList.map((historicalComponent, index) => (
8585
// eslint-disable-next-line react/no-array-index-key
86-
<div className="px-20 pt-20 fs-13 cn-9" key={`history-list__${index}`}>
86+
<div className="px-20 pt-20 fs-13 cn-9 flexbox-col dc__gap-12" key={`history-list__${index}`}>
8787
{historicalComponent.childList?.length > 0 ? (
8888
<>
89-
<div className="fs-14 fw-6 mb-12">
89+
<div className="fs-14 fw-6">
9090
{DEPLOYMENT_HISTORY_CONFIGURATION_LIST_MAP[historicalComponent.name].DISPLAY_NAME}
9191
</div>
9292
{historicalComponent.childList.map((historicalComponentName, childIndex) =>

0 commit comments

Comments
 (0)