[MM-60156] Migrate tooltips of 'components/file_upload/file_upload.tsx' to WithTooltip (#27970)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8012275ca1
Коммит
f2d9b2e94b
@@ -5,13 +5,10 @@ exports[`components/FileUpload should match snapshot 1`] = `
|
|||||||
className="style--none"
|
className="style--none"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<OverlayTrigger
|
<WithTooltip
|
||||||
defaultOverlayShown={false}
|
|
||||||
delayShow={400}
|
|
||||||
overlay={
|
|
||||||
<Tooltip
|
|
||||||
id="upload-tooltip"
|
id="upload-tooltip"
|
||||||
>
|
placement="top"
|
||||||
|
title={
|
||||||
<Memo(KeyboardShortcutSequence)
|
<Memo(KeyboardShortcutSequence)
|
||||||
hoistDescription={true}
|
hoistDescription={true}
|
||||||
isInsideTooltip={true}
|
isInsideTooltip={true}
|
||||||
@@ -28,14 +25,6 @@ exports[`components/FileUpload should match snapshot 1`] = `
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
|
||||||
}
|
|
||||||
placement="top"
|
|
||||||
trigger={
|
|
||||||
Array [
|
|
||||||
"hover",
|
|
||||||
"focus",
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
@@ -52,7 +41,7 @@ exports[`components/FileUpload should match snapshot 1`] = `
|
|||||||
size={18}
|
size={18}
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
</OverlayTrigger>
|
</WithTooltip>
|
||||||
<input
|
<input
|
||||||
accept=""
|
accept=""
|
||||||
aria-label="Upload files"
|
aria-label="Upload files"
|
||||||
|
|||||||
@@ -15,10 +15,9 @@ import type {UploadFile} from 'actions/file_actions';
|
|||||||
|
|
||||||
import type {FilePreviewInfo} from 'components/file_preview/file_preview';
|
import type {FilePreviewInfo} from 'components/file_preview/file_preview';
|
||||||
import KeyboardShortcutSequence, {KEYBOARD_SHORTCUTS} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence';
|
import KeyboardShortcutSequence, {KEYBOARD_SHORTCUTS} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence';
|
||||||
import OverlayTrigger from 'components/overlay_trigger';
|
|
||||||
import Tooltip from 'components/tooltip';
|
|
||||||
import Menu from 'components/widgets/menu/menu';
|
import Menu from 'components/widgets/menu/menu';
|
||||||
import MenuWrapper from 'components/widgets/menu/menu_wrapper';
|
import MenuWrapper from 'components/widgets/menu/menu_wrapper';
|
||||||
|
import WithTooltip from 'components/with_tooltip';
|
||||||
|
|
||||||
import Constants from 'utils/constants';
|
import Constants from 'utils/constants';
|
||||||
import DelayedAction from 'utils/delayed_action';
|
import DelayedAction from 'utils/delayed_action';
|
||||||
@@ -569,18 +568,15 @@ export class FileUpload extends PureComponent<Props, State> {
|
|||||||
if (this.props.pluginFileUploadMethods.length === 0) {
|
if (this.props.pluginFileUploadMethods.length === 0) {
|
||||||
bodyAction = (
|
bodyAction = (
|
||||||
<div>
|
<div>
|
||||||
<OverlayTrigger
|
<WithTooltip
|
||||||
delayShow={Constants.OVERLAY_TIME_DELAY}
|
id='upload-tooltip'
|
||||||
placement='top'
|
placement='top'
|
||||||
trigger={['hover', 'focus']}
|
title={
|
||||||
overlay={
|
|
||||||
<Tooltip id='upload-tooltip'>
|
|
||||||
<KeyboardShortcutSequence
|
<KeyboardShortcutSequence
|
||||||
shortcut={KEYBOARD_SHORTCUTS.filesUpload}
|
shortcut={KEYBOARD_SHORTCUTS.filesUpload}
|
||||||
hoistDescription={true}
|
hoistDescription={true}
|
||||||
isInsideTooltip={true}
|
isInsideTooltip={true}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
@@ -599,7 +595,7 @@ export class FileUpload extends PureComponent<Props, State> {
|
|||||||
aria-label={iconAriaLabel}
|
aria-label={iconAriaLabel}
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
</OverlayTrigger>
|
</WithTooltip>
|
||||||
<input
|
<input
|
||||||
id='fileUploadInput'
|
id='fileUploadInput'
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
@@ -648,18 +644,15 @@ export class FileUpload extends PureComponent<Props, State> {
|
|||||||
accept={accept}
|
accept={accept}
|
||||||
/>
|
/>
|
||||||
<MenuWrapper>
|
<MenuWrapper>
|
||||||
<OverlayTrigger
|
<WithTooltip
|
||||||
delayShow={Constants.OVERLAY_TIME_DELAY}
|
id='upload-tooltip'
|
||||||
placement='top'
|
placement='top'
|
||||||
trigger={['hover', 'focus']}
|
title={
|
||||||
overlay={
|
|
||||||
<Tooltip id='upload-tooltip'>
|
|
||||||
<KeyboardShortcutSequence
|
<KeyboardShortcutSequence
|
||||||
shortcut={KEYBOARD_SHORTCUTS.filesUpload}
|
shortcut={KEYBOARD_SHORTCUTS.filesUpload}
|
||||||
hoistDescription={true}
|
hoistDescription={true}
|
||||||
isInsideTooltip={true}
|
isInsideTooltip={true}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
@@ -674,7 +667,7 @@ export class FileUpload extends PureComponent<Props, State> {
|
|||||||
aria-label={iconAriaLabel}
|
aria-label={iconAriaLabel}
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
</OverlayTrigger>
|
</WithTooltip>
|
||||||
<Menu
|
<Menu
|
||||||
id='fileUploadOptions'
|
id='fileUploadOptions'
|
||||||
openLeft={true}
|
openLeft={true}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user