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