Skip to content

Commit e3f0b73

Browse files
authored
[RI-7074] revert anchorClassName prop usage for RiTooltip (#4710)
* RI-7074: expose anchorClassName for RiTooltip * revert anchorClassName prop usage for RiTooltip * revert missing styles * fix missing import
1 parent f93a9a7 commit e3f0b73

File tree

98 files changed

+302
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+302
-84
lines changed

redisinsight/ui/src/components/base/shared/WindowControlGroup.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ export const WindowControlGroup = ({
2222
}: Props) => (
2323
<Row gap="m" justify="end">
2424
<FlexItem>
25-
<RiTooltip content={hideContent} position="top">
25+
<RiTooltip
26+
content={hideContent}
27+
position="top"
28+
anchorClassName="flex-row"
29+
>
2630
<IconButton
2731
size="S"
2832
icon={MinusIcon}
@@ -34,7 +38,11 @@ export const WindowControlGroup = ({
3438
</RiTooltip>
3539
</FlexItem>
3640
<FlexItem>
37-
<RiTooltip content={closeContent} position="top">
41+
<RiTooltip
42+
content={closeContent}
43+
position="top"
44+
anchorClassName="flex-row"
45+
>
3846
<IconButton
3947
size="S"
4048
icon={CancelSlimIcon}

redisinsight/ui/src/components/base/tooltip/RITooltip.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface RiTooltipProps
88
title?: React.ReactNode
99
position?: TooltipProps['placement']
1010
delay?: TooltipProps['openDelayDuration']
11+
anchorClassName?: string
1112
}
1213

1314
export const RiTooltip = ({
@@ -16,6 +17,7 @@ export const RiTooltip = ({
1617
content,
1718
position,
1819
delay,
20+
anchorClassName,
1921
...props
2022
}: RiTooltipProps) => (
2123
<TooltipProvider>
@@ -25,7 +27,7 @@ export const RiTooltip = ({
2527
placement={position}
2628
openDelayDuration={delay}
2729
>
28-
<span>{children}</span>
30+
<span className={anchorClassName}>{children}</span>
2931
</Tooltip>
3032
</TooltipProvider>
3133
)

redisinsight/ui/src/components/consents-settings/ConsentsSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { Spacer } from 'uiSrc/components/base/layout/spacer'
1717
import { PrimaryButton } from 'uiSrc/components/base/forms/buttons'
1818
import { InfoIcon } from 'uiSrc/components/base/icons'
1919
import { Title } from 'uiSrc/components/base/text/Title'
20-
import { CallOut } from 'uiSrc/components/base/display/call-out/CallOut'
2120
import { Text } from 'uiSrc/components/base/text'
2221
import { SwitchInput } from 'uiSrc/components/base/inputs'
2322
import { Link } from 'uiSrc/components/base/link/Link'
@@ -330,6 +329,7 @@ const ConsentsSettings = ({ onSubmitted }: Props) => {
330329
<FlexItem>
331330
<RiTooltip
332331
position="top"
332+
anchorClassName="euiToolTip__btn-disabled"
333333
content={
334334
submitIsDisabled() ? (
335335
<span>

redisinsight/ui/src/components/database-list-modules/DatabaseListModules.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ const DatabaseListModules = React.memo((props: Props) => {
142142
!inCircle ? (
143143
Module(moduleName, abbreviation, icon, content)
144144
) : (
145-
<RiTooltip position="bottom" content={Content[i]} key={moduleName}>
145+
<RiTooltip
146+
position="bottom"
147+
content={Content[i]}
148+
anchorClassName={styles.anchorModuleTooltip}
149+
key={moduleName}
150+
>
146151
<>{Module(moduleName, abbreviation, icon, content)}</>
147152
</RiTooltip>
148153
),

redisinsight/ui/src/components/database-list-modules/styles.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,7 @@
5454
.abbr {
5555
vertical-align: text-top;
5656
}
57+
58+
.anchorModuleTooltip {
59+
margin-right: 18px;
60+
}

redisinsight/ui/src/components/database-list-options/DatabaseListOptions.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ const DatabaseListOptions = ({ options }: Props) => {
9696
: contentProp
9797
}
9898
position="top"
99+
anchorClassName={styles.tooltip}
99100
>
100101
{icon ? (
101102
<IconButton

redisinsight/ui/src/components/formated-date/FormatedDate.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { DATETIME_FORMATTER_DEFAULT, TimezoneOption } from 'uiSrc/constants'
44
import { userSettingsConfigSelector } from 'uiSrc/slices/user/user-settings'
55
import { formatTimestamp } from 'uiSrc/utils'
66
import { RiTooltip } from 'uiSrc/components'
7+
import styles from './styles.module.scss'
78

89
export interface Props {
910
date: Date | string | number
@@ -19,7 +20,7 @@ const FormatedDate = ({ date }: Props) => {
1920
const formatedDate = formatTimestamp(date, dateFormat, timezone)
2021

2122
return (
22-
<RiTooltip content={formatedDate}>
23+
<RiTooltip anchorClassName={styles.text} content={formatedDate}>
2324
<span>{formatedDate}</span>
2425
</RiTooltip>
2526
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.text {
2+
display: inline-block;
3+
text-overflow: ellipsis;
4+
white-space: nowrap;
5+
overflow: hidden;
6+
position: relative;
7+
max-width: 100%;
8+
vertical-align: middle;
9+
}

redisinsight/ui/src/components/full-screen/FullScreen.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const FullScreen = ({
1919
<RiTooltip
2020
content={isFullScreen ? 'Exit Full Screen' : 'Full Screen'}
2121
position="left"
22+
anchorClassName={anchorClassName}
2223
>
2324
<IconButton
2425
icon={isFullScreen ? ShrinkIcon : ExtendIcon}

redisinsight/ui/src/components/inline-item-editor/InlineItemEditor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ const InlineItemEditor = (props: Props) => {
165165

166166
const ApplyBtn = (
167167
<RiTooltip
168+
anchorClassName={styles.tooltip}
168169
position="bottom"
169170
title={
170171
(isDisabled && disabledTooltipText?.title) ||

0 commit comments

Comments
 (0)