MM-53481 Fix textbox broken Help link (#24889)
* Fixed broken link * Fix importa * Lint * Fix import * Linting * fix snapshots
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9698ab2119
Коммит
2f5b756d67
@@ -81,7 +81,7 @@ exports[`components/EditChannelHeaderModal edit direct message channel 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="post-create-footer"
|
className="post-create-footer"
|
||||||
>
|
>
|
||||||
<Connect(TextboxLinks)
|
<TextboxLinks
|
||||||
hasExceededCharacterLimit={false}
|
hasExceededCharacterLimit={false}
|
||||||
hasText={true}
|
hasText={true}
|
||||||
isMarkdownPreviewEnabled={false}
|
isMarkdownPreviewEnabled={false}
|
||||||
@@ -208,7 +208,7 @@ exports[`components/EditChannelHeaderModal error with intl message 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="post-create-footer"
|
className="post-create-footer"
|
||||||
>
|
>
|
||||||
<Connect(TextboxLinks)
|
<TextboxLinks
|
||||||
hasExceededCharacterLimit={false}
|
hasExceededCharacterLimit={false}
|
||||||
hasText={true}
|
hasText={true}
|
||||||
isMarkdownPreviewEnabled={false}
|
isMarkdownPreviewEnabled={false}
|
||||||
@@ -353,7 +353,7 @@ exports[`components/EditChannelHeaderModal error without intl message 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="post-create-footer"
|
className="post-create-footer"
|
||||||
>
|
>
|
||||||
<Connect(TextboxLinks)
|
<TextboxLinks
|
||||||
hasExceededCharacterLimit={false}
|
hasExceededCharacterLimit={false}
|
||||||
hasText={true}
|
hasText={true}
|
||||||
isMarkdownPreviewEnabled={false}
|
isMarkdownPreviewEnabled={false}
|
||||||
@@ -490,7 +490,7 @@ exports[`components/EditChannelHeaderModal should match snapshot, init 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="post-create-footer"
|
className="post-create-footer"
|
||||||
>
|
>
|
||||||
<Connect(TextboxLinks)
|
<TextboxLinks
|
||||||
hasExceededCharacterLimit={false}
|
hasExceededCharacterLimit={false}
|
||||||
hasText={true}
|
hasText={true}
|
||||||
isMarkdownPreviewEnabled={false}
|
isMarkdownPreviewEnabled={false}
|
||||||
@@ -617,7 +617,7 @@ exports[`components/EditChannelHeaderModal submitted 1`] = `
|
|||||||
<div
|
<div
|
||||||
className="post-create-footer"
|
className="post-create-footer"
|
||||||
>
|
>
|
||||||
<Connect(TextboxLinks)
|
<TextboxLinks
|
||||||
hasExceededCharacterLimit={false}
|
hasExceededCharacterLimit={false}
|
||||||
hasText={true}
|
hasText={true}
|
||||||
isMarkdownPreviewEnabled={false}
|
isMarkdownPreviewEnabled={false}
|
||||||
|
|||||||
@@ -10,10 +10,9 @@ import type {ServerError} from '@mattermost/types/errors';
|
|||||||
|
|
||||||
import type {ActionResult} from 'mattermost-redux/types/actions';
|
import type {ActionResult} from 'mattermost-redux/types/actions';
|
||||||
|
|
||||||
import Textbox from 'components/textbox';
|
import Textbox, {TextboxLinks} from 'components/textbox';
|
||||||
import type {TextboxElement} from 'components/textbox';
|
import type {TextboxElement} from 'components/textbox';
|
||||||
import type TextboxClass from 'components/textbox/textbox';
|
import type TextboxClass from 'components/textbox/textbox';
|
||||||
import TextboxLinks from 'components/textbox/textbox_links';
|
|
||||||
|
|
||||||
import Constants from 'utils/constants';
|
import Constants from 'utils/constants';
|
||||||
import {isKeyPressed} from 'utils/keyboard';
|
import {isKeyPressed} from 'utils/keyboard';
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import {searchAssociatedGroupsForReference} from 'actions/views/group';
|
|||||||
|
|
||||||
import Textbox from './textbox';
|
import Textbox from './textbox';
|
||||||
import type {Props as TextboxProps} from './textbox';
|
import type {Props as TextboxProps} from './textbox';
|
||||||
|
import TextboxLinks from './textbox_links';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
channelId: string;
|
channelId: string;
|
||||||
@@ -63,3 +64,4 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
|
|||||||
export {Textbox as TextboxClass};
|
export {Textbox as TextboxClass};
|
||||||
|
|
||||||
export default connect(makeMapStateToProps, mapDispatchToProps, null, {forwardRef: true})(Textbox);
|
export default connect(makeMapStateToProps, mapDispatchToProps, null, {forwardRef: true})(Textbox);
|
||||||
|
export {TextboxLinks};
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import type {MouseEvent} from 'react';
|
import type {MouseEvent} from 'react';
|
||||||
import {FormattedMessage} from 'react-intl';
|
import {FormattedMessage} from 'react-intl';
|
||||||
import {Link} from 'react-router-dom';
|
|
||||||
|
import ExternalLink from 'components/external_link';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
showPreview?: boolean;
|
showPreview?: boolean;
|
||||||
@@ -12,7 +13,6 @@ type Props = {
|
|||||||
hasText?: boolean;
|
hasText?: boolean;
|
||||||
hasExceededCharacterLimit?: boolean;
|
hasExceededCharacterLimit?: boolean;
|
||||||
isMarkdownPreviewEnabled: boolean;
|
isMarkdownPreviewEnabled: boolean;
|
||||||
currentLocale: string;
|
|
||||||
updatePreview?: (showPreview: boolean) => void;
|
updatePreview?: (showPreview: boolean) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -22,7 +22,6 @@ function TextboxLinks({
|
|||||||
hasText = false,
|
hasText = false,
|
||||||
hasExceededCharacterLimit = false,
|
hasExceededCharacterLimit = false,
|
||||||
isMarkdownPreviewEnabled,
|
isMarkdownPreviewEnabled,
|
||||||
currentLocale,
|
|
||||||
updatePreview,
|
updatePreview,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const togglePreview = (e: MouseEvent) => {
|
const togglePreview = (e: MouseEvent) => {
|
||||||
@@ -125,17 +124,16 @@ function TextboxLinks({
|
|||||||
<div className={'help__text ' + helpTextClass}>
|
<div className={'help__text ' + helpTextClass}>
|
||||||
{helpText}
|
{helpText}
|
||||||
{previewLink}
|
{previewLink}
|
||||||
<Link
|
<ExternalLink
|
||||||
target='_blank'
|
location='textbox_links'
|
||||||
rel='noopener noreferrer'
|
href={'https://docs.mattermost.com/collaborate/format-messages.html'}
|
||||||
to={`/help/messaging?locale=${currentLocale}`}
|
|
||||||
className='textbox-help-link'
|
className='textbox-help-link'
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='textbox.help'
|
id='textbox.help'
|
||||||
defaultMessage='Help'
|
defaultMessage='Help'
|
||||||
/>
|
/>
|
||||||
</Link>
|
</ExternalLink>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
||||||
// See LICENSE.txt for license information.
|
|
||||||
|
|
||||||
import {connect} from 'react-redux';
|
|
||||||
|
|
||||||
import {getCurrentLocale} from 'selectors/i18n';
|
|
||||||
|
|
||||||
import type {GlobalState} from 'types/store';
|
|
||||||
|
|
||||||
import TextboxLinks from './textbox_links';
|
|
||||||
|
|
||||||
function mapStateToProps(state: GlobalState) {
|
|
||||||
return ({
|
|
||||||
currentLocale: getCurrentLocale(state),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export default connect(mapStateToProps)(TextboxLinks);
|
|
||||||
Ссылка в новой задаче
Block a user