[GH-25020] Add new resource links to [Help (?) drop-down menu] & icons (#25070)
* fix: add resource links Help (?) dropdown * fix: refactor styles and update link url * update: i18n and snapshot * fix: update style and refactor * fix: i18n * fix: update test snapshot * Update webapp/channels/src/components/global_header/center_controls/user_guide_dropdown/__snapshots__/user_guide_dropdown.test.tsx.snap * Update webapp/channels/src/components/global_header/center_controls/user_guide_dropdown/__snapshots__/user_guide_dropdown.test.tsx.snap * Update webapp/channels/src/components/global_header/center_controls/user_guide_dropdown/__snapshots__/user_guide_dropdown.test.tsx.snap * Update webapp/channels/src/components/global_header/center_controls/user_guide_dropdown/user_guide_dropdown.tsx --------- Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com> Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -49,6 +49,21 @@ exports[`components/channel_header/components/UserGuideDropdown should match sna
|
|||||||
>
|
>
|
||||||
<MenuGroup>
|
<MenuGroup>
|
||||||
<MenuItemExternalLink
|
<MenuItemExternalLink
|
||||||
|
iconClassName="icon-file-text-outline"
|
||||||
|
id="mattermostUserGuideLink"
|
||||||
|
show={true}
|
||||||
|
text="Mattermost user guide"
|
||||||
|
url="https://docs.mattermost.com/guides/use-mattermost.html"
|
||||||
|
/>
|
||||||
|
<MenuItemExternalLink
|
||||||
|
iconClassName="icon-lightbulb-outline"
|
||||||
|
id="trainingResourcesLink"
|
||||||
|
show={true}
|
||||||
|
text="Training resources"
|
||||||
|
url="https://academy.mattermost.com/"
|
||||||
|
/>
|
||||||
|
<MenuItemExternalLink
|
||||||
|
iconClassName="icon-help"
|
||||||
id="askTheCommunityLink"
|
id="askTheCommunityLink"
|
||||||
onClick={[Function]}
|
onClick={[Function]}
|
||||||
show={true}
|
show={true}
|
||||||
@@ -56,18 +71,14 @@ exports[`components/channel_header/components/UserGuideDropdown should match sna
|
|||||||
url="https://mattermost.com/pl/default-ask-mattermost-community/"
|
url="https://mattermost.com/pl/default-ask-mattermost-community/"
|
||||||
/>
|
/>
|
||||||
<MenuItemExternalLink
|
<MenuItemExternalLink
|
||||||
id="helpResourcesLink"
|
iconClassName="icon-alert-outline"
|
||||||
show={true}
|
|
||||||
text="Help resources"
|
|
||||||
url="helpLink"
|
|
||||||
/>
|
|
||||||
<MenuItemExternalLink
|
|
||||||
id="reportAProblemLink"
|
id="reportAProblemLink"
|
||||||
show={true}
|
show={true}
|
||||||
text="Report a problem"
|
text="Report a problem"
|
||||||
url="reportAProblemLink"
|
url="reportAProblemLink"
|
||||||
/>
|
/>
|
||||||
<MenuItemAction
|
<MenuItemAction
|
||||||
|
iconClassName="icon-keyboard-return"
|
||||||
id="keyboardShortcuts"
|
id="keyboardShortcuts"
|
||||||
onClick={[Function]}
|
onClick={[Function]}
|
||||||
show={true}
|
show={true}
|
||||||
@@ -127,18 +138,28 @@ exports[`components/channel_header/components/UserGuideDropdown should match sna
|
|||||||
>
|
>
|
||||||
<MenuGroup>
|
<MenuGroup>
|
||||||
<MenuItemExternalLink
|
<MenuItemExternalLink
|
||||||
id="helpResourcesLink"
|
iconClassName="icon-file-text-outline"
|
||||||
|
id="mattermostUserGuideLink"
|
||||||
show={true}
|
show={true}
|
||||||
text="Help resources"
|
text="Mattermost user guide"
|
||||||
url="helpLink"
|
url="https://docs.mattermost.com/guides/use-mattermost.html"
|
||||||
/>
|
/>
|
||||||
<MenuItemExternalLink
|
<MenuItemExternalLink
|
||||||
|
iconClassName="icon-lightbulb-outline"
|
||||||
|
id="trainingResourcesLink"
|
||||||
|
show={true}
|
||||||
|
text="Training resources"
|
||||||
|
url="https://academy.mattermost.com/"
|
||||||
|
/>
|
||||||
|
<MenuItemExternalLink
|
||||||
|
iconClassName="icon-alert-outline"
|
||||||
id="reportAProblemLink"
|
id="reportAProblemLink"
|
||||||
show={true}
|
show={true}
|
||||||
text="Report a problem"
|
text="Report a problem"
|
||||||
url="reportAProblemLink"
|
url="reportAProblemLink"
|
||||||
/>
|
/>
|
||||||
<MenuItemAction
|
<MenuItemAction
|
||||||
|
iconClassName="icon-keyboard-return"
|
||||||
id="keyboardShortcuts"
|
id="keyboardShortcuts"
|
||||||
onClick={[Function]}
|
onClick={[Function]}
|
||||||
show={true}
|
show={true}
|
||||||
@@ -198,6 +219,21 @@ exports[`components/channel_header/components/UserGuideDropdown should match sna
|
|||||||
>
|
>
|
||||||
<MenuGroup>
|
<MenuGroup>
|
||||||
<MenuItemExternalLink
|
<MenuItemExternalLink
|
||||||
|
iconClassName="icon-file-text-outline"
|
||||||
|
id="mattermostUserGuideLink"
|
||||||
|
show={true}
|
||||||
|
text="Mattermost user guide"
|
||||||
|
url="https://docs.mattermost.com/guides/use-mattermost.html"
|
||||||
|
/>
|
||||||
|
<MenuItemExternalLink
|
||||||
|
iconClassName="icon-lightbulb-outline"
|
||||||
|
id="trainingResourcesLink"
|
||||||
|
show={true}
|
||||||
|
text="Training resources"
|
||||||
|
url="https://academy.mattermost.com/"
|
||||||
|
/>
|
||||||
|
<MenuItemExternalLink
|
||||||
|
iconClassName="icon-help"
|
||||||
id="askTheCommunityLink"
|
id="askTheCommunityLink"
|
||||||
onClick={[Function]}
|
onClick={[Function]}
|
||||||
show={true}
|
show={true}
|
||||||
@@ -205,24 +241,21 @@ exports[`components/channel_header/components/UserGuideDropdown should match sna
|
|||||||
url="https://mattermost.com/pl/default-ask-mattermost-community/"
|
url="https://mattermost.com/pl/default-ask-mattermost-community/"
|
||||||
/>
|
/>
|
||||||
<MenuItemExternalLink
|
<MenuItemExternalLink
|
||||||
id="helpResourcesLink"
|
iconClassName="icon-alert-outline"
|
||||||
show={true}
|
|
||||||
text="Help resources"
|
|
||||||
url="helpLink"
|
|
||||||
/>
|
|
||||||
<MenuItemExternalLink
|
|
||||||
id="reportAProblemLink"
|
id="reportAProblemLink"
|
||||||
show={true}
|
show={true}
|
||||||
text="Report a problem"
|
text="Report a problem"
|
||||||
url="reportAProblemLink"
|
url="reportAProblemLink"
|
||||||
/>
|
/>
|
||||||
<MenuItemAction
|
<MenuItemAction
|
||||||
|
iconClassName="icon-keyboard-return"
|
||||||
id="keyboardShortcuts"
|
id="keyboardShortcuts"
|
||||||
onClick={[Function]}
|
onClick={[Function]}
|
||||||
show={true}
|
show={true}
|
||||||
text="Keyboard shortcuts"
|
text="Keyboard shortcuts"
|
||||||
/>
|
/>
|
||||||
<MenuItemAction
|
<MenuItemAction
|
||||||
|
iconClassName="icon-thumbs-up-down"
|
||||||
id="testId_pluginmenuitem"
|
id="testId_pluginmenuitem"
|
||||||
key="testId_pluginmenuitem"
|
key="testId_pluginmenuitem"
|
||||||
onClick={[Function]}
|
onClick={[Function]}
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import {ModalIdentifiers} from 'utils/constants';
|
|||||||
|
|
||||||
import type {PropsFromRedux} from './index';
|
import type {PropsFromRedux} from './index';
|
||||||
|
|
||||||
|
const mattermostUserGuideLink = 'https://docs.mattermost.com/guides/use-mattermost.html';
|
||||||
|
const trainingResourcesLink = 'https://academy.mattermost.com/';
|
||||||
const askTheCommunityUrl = 'https://mattermost.com/pl/default-ask-mattermost-community/';
|
const askTheCommunityUrl = 'https://mattermost.com/pl/default-ask-mattermost-community/';
|
||||||
|
|
||||||
type Props = WrappedComponentProps & PropsFromRedux & {
|
type Props = WrappedComponentProps & PropsFromRedux & {
|
||||||
@@ -67,6 +69,7 @@ class UserGuideDropdown extends React.PureComponent<Props, State> {
|
|||||||
return (
|
return (
|
||||||
<Menu.ItemAction
|
<Menu.ItemAction
|
||||||
id={item.id + '_pluginmenuitem'}
|
id={item.id + '_pluginmenuitem'}
|
||||||
|
iconClassName='icon-thumbs-up-down'
|
||||||
key={item.id + '_pluginmenuitem'}
|
key={item.id + '_pluginmenuitem'}
|
||||||
onClick={item.action}
|
onClick={item.action}
|
||||||
text={item.text}
|
text={item.text}
|
||||||
@@ -76,30 +79,40 @@ class UserGuideDropdown extends React.PureComponent<Props, State> {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Menu.Group>
|
<Menu.Group>
|
||||||
|
<Menu.ItemExternalLink
|
||||||
|
id='mattermostUserGuideLink'
|
||||||
|
iconClassName='icon-file-text-outline'
|
||||||
|
url={mattermostUserGuideLink}
|
||||||
|
text={intl.formatMessage({id: 'userGuideHelp.mattermostUserGuide', defaultMessage: 'Mattermost user guide'})}
|
||||||
|
/>
|
||||||
|
{this.props.helpLink && (
|
||||||
|
<Menu.ItemExternalLink
|
||||||
|
id='trainingResourcesLink'
|
||||||
|
iconClassName='icon-lightbulb-outline'
|
||||||
|
url={trainingResourcesLink}
|
||||||
|
text={intl.formatMessage({id: 'userGuideHelp.trainingResources', defaultMessage: 'Training resources'})}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{this.props.enableAskCommunityLink === 'true' && (
|
{this.props.enableAskCommunityLink === 'true' && (
|
||||||
<Menu.ItemExternalLink
|
<Menu.ItemExternalLink
|
||||||
id='askTheCommunityLink'
|
id='askTheCommunityLink'
|
||||||
|
iconClassName='icon-help'
|
||||||
url={askTheCommunityUrl}
|
url={askTheCommunityUrl}
|
||||||
text={intl.formatMessage({id: 'userGuideHelp.askTheCommunity', defaultMessage: 'Ask the community'})}
|
text={intl.formatMessage({id: 'userGuideHelp.askTheCommunity', defaultMessage: 'Ask the community'})}
|
||||||
onClick={this.askTheCommunityClick}
|
onClick={this.askTheCommunityClick}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{this.props.helpLink && (
|
|
||||||
<Menu.ItemExternalLink
|
|
||||||
id='helpResourcesLink'
|
|
||||||
url={this.props.helpLink}
|
|
||||||
text={intl.formatMessage({id: 'userGuideHelp.helpResources', defaultMessage: 'Help resources'})}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{this.props.reportAProblemLink && (
|
{this.props.reportAProblemLink && (
|
||||||
<Menu.ItemExternalLink
|
<Menu.ItemExternalLink
|
||||||
id='reportAProblemLink'
|
id='reportAProblemLink'
|
||||||
|
iconClassName='icon-alert-outline'
|
||||||
url={this.props.reportAProblemLink}
|
url={this.props.reportAProblemLink}
|
||||||
text={intl.formatMessage({id: 'userGuideHelp.reportAProblem', defaultMessage: 'Report a problem'})}
|
text={intl.formatMessage({id: 'userGuideHelp.reportAProblem', defaultMessage: 'Report a problem'})}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Menu.ItemAction
|
<Menu.ItemAction
|
||||||
id='keyboardShortcuts'
|
id='keyboardShortcuts'
|
||||||
|
iconClassName='icon-keyboard-return'
|
||||||
onClick={this.openKeyboardShortcutsModal}
|
onClick={this.openKeyboardShortcutsModal}
|
||||||
text={intl.formatMessage({id: 'userGuideHelp.keyboardShortcuts', defaultMessage: 'Keyboard shortcuts'})}
|
text={intl.formatMessage({id: 'userGuideHelp.keyboardShortcuts', defaultMessage: 'Keyboard shortcuts'})}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
.dropdown-menu {
|
.dropdown-menu {
|
||||||
display: block;
|
display: block;
|
||||||
min-width: 220px;
|
min-width: 225px;
|
||||||
max-width: 270px;
|
max-width: 270px;
|
||||||
max-height: 80vh;
|
max-height: 80vh;
|
||||||
padding: 8px 0;
|
padding: 8px 0;
|
||||||
|
|||||||
@@ -91,6 +91,22 @@
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
|
i.icon {
|
||||||
|
padding: 0 3px;
|
||||||
|
margin-right: 4px;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
color: rgba(var(--center-channel-color-rgb), 0.72);
|
||||||
|
vertical-align: middle;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
i.icon + span.MenuItem__primary-text {
|
||||||
|
padding: 5px 4px;
|
||||||
|
}
|
||||||
|
|
||||||
&.disabled {
|
&.disabled {
|
||||||
color: rgba(var(--center-channel-color-rgb), 0.48);
|
color: rgba(var(--center-channel-color-rgb), 0.48);
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ type Props = {
|
|||||||
isDangerous?: boolean;
|
isDangerous?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
sibling?: React.ReactNode;
|
sibling?: React.ReactNode;
|
||||||
|
iconClassName?: string;
|
||||||
}
|
}
|
||||||
export const MenuItemActionImpl = ({
|
export const MenuItemActionImpl = ({
|
||||||
onClick,
|
onClick,
|
||||||
@@ -29,6 +30,7 @@ export const MenuItemActionImpl = ({
|
|||||||
isDangerous,
|
isDangerous,
|
||||||
disabled,
|
disabled,
|
||||||
sibling,
|
sibling,
|
||||||
|
iconClassName,
|
||||||
}: Props) => (
|
}: Props) => (
|
||||||
<>
|
<>
|
||||||
<button
|
<button
|
||||||
@@ -44,6 +46,7 @@ export const MenuItemActionImpl = ({
|
|||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
|
{iconClassName && <i className={`icon ${iconClassName}`}/>}
|
||||||
{text && <span className='MenuItem__primary-text'>{text}{rightDecorator}</span>}
|
{text && <span className='MenuItem__primary-text'>{text}{rightDecorator}</span>}
|
||||||
{extraText && <span className='MenuItem__help-text'>{extraText}</span>}
|
{extraText && <span className='MenuItem__help-text'>{extraText}</span>}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -11,13 +11,15 @@ type Props = {
|
|||||||
url: string;
|
url: string;
|
||||||
text: React.ReactNode;
|
text: React.ReactNode;
|
||||||
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
||||||
|
iconClassName?: string;
|
||||||
}
|
}
|
||||||
export const MenuItemExternalLinkImpl: React.FC<Props> = ({url, text, onClick}: Props) => (
|
export const MenuItemExternalLinkImpl: React.FC<Props> = ({url, text, iconClassName, onClick}: Props) => (
|
||||||
<ExternalLink
|
<ExternalLink
|
||||||
href={url}
|
href={url}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
location='menu_item_external_link'
|
location='menu_item_external_link'
|
||||||
>
|
>
|
||||||
|
{iconClassName && <i className={`icon ${iconClassName}`}/>}
|
||||||
<span className='MenuItem__primary-text'>
|
<span className='MenuItem__primary-text'>
|
||||||
{text}
|
{text}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -5657,7 +5657,9 @@
|
|||||||
"userGuideHelp.askTheCommunity": "Ask the community",
|
"userGuideHelp.askTheCommunity": "Ask the community",
|
||||||
"userGuideHelp.helpResources": "Help resources",
|
"userGuideHelp.helpResources": "Help resources",
|
||||||
"userGuideHelp.keyboardShortcuts": "Keyboard shortcuts",
|
"userGuideHelp.keyboardShortcuts": "Keyboard shortcuts",
|
||||||
|
"userGuideHelp.mattermostUserGuide": "Mattermost user guide",
|
||||||
"userGuideHelp.reportAProblem": "Report a problem",
|
"userGuideHelp.reportAProblem": "Report a problem",
|
||||||
|
"userGuideHelp.trainingResources": "Training resources",
|
||||||
"version_bar.new": "A new version of Mattermost is available.",
|
"version_bar.new": "A new version of Mattermost is available.",
|
||||||
"version_bar.refresh": "Refresh the app now",
|
"version_bar.refresh": "Refresh the app now",
|
||||||
"view_image_popover.download": "Download",
|
"view_image_popover.download": "Download",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user