MM-53088 - remove autoshow linked board (#23783)

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Pablo Andrés Vélez Vidal
2023-06-26 14:13:14 +02:00
коммит произвёл GitHub
родитель 283abbe704
Коммит 887ba95cc1
15 изменённых файлов: 6 добавлений и 341 удалений

Просмотреть файл

@@ -1,96 +0,0 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {useCallback} from 'react';
import {FormattedMessage} from 'react-intl';
import {useDispatch, useSelector} from 'react-redux';
import {Placement} from 'tippy.js';
import {setAutoShowLinkedBoardPreference} from 'mattermost-redux/actions/boards';
import {TourTip} from '@mattermost/components';
import {shouldShowAutoLinkedBoard} from 'selectors/plugins';
import {suitePluginIds} from 'utils/constants';
import {getPluggableId} from 'selectors/rhs';
import {PluginComponent} from 'types/store/plugins';
import {GlobalState} from 'types/store';
type Props = {
pulsatingDotPlacement?: Omit<Placement, 'auto'| 'auto-end'>;
}
const AutoShowLinkedBoardTourTip = ({
pulsatingDotPlacement = 'auto',
}: Props): JSX.Element | null => {
const dispatch = useDispatch();
const rhsPlugins: PluginComponent[] = useSelector((state: GlobalState) => state.plugins.components.RightHandSidebarComponent);
const pluggableId = useSelector(getPluggableId);
const pluginComponent = rhsPlugins.find((element: PluginComponent) => element.id === pluggableId);
const isBoards = pluginComponent && (pluginComponent.pluginId === suitePluginIds.focalboard || pluginComponent.pluginId === suitePluginIds.boards);
const showAutoLinkedBoard = useSelector(shouldShowAutoLinkedBoard);
const showAutoLinkedBoardTourTip = isBoards && showAutoLinkedBoard;
const title = (
<FormattedMessage
id='autoShowLinkedBoard.tutorialTip.title'
defaultMessage='Link kanban boards to channels'
/>
);
const screen = (
<FormattedMessage
id='autoShowLinkedBoard.tutorialTip.description'
defaultMessage='Manage tasks, plan sprints, conduct standup with the help of kanban boards and tables.'
/>
);
const handleDismiss = useCallback((e: React.MouseEvent) => {
e.stopPropagation();
dispatch(setAutoShowLinkedBoardPreference());
}, []);
const handleOpen = useCallback((e: React.MouseEvent) => {
e.stopPropagation();
e.preventDefault();
dispatch(setAutoShowLinkedBoardPreference());
}, []);
const nextBtn = (
<FormattedMessage
id={'tutorial_tip.done'}
defaultMessage={'Done'}
/>
);
if (!showAutoLinkedBoardTourTip) {
return null;
}
return (
<TourTip
show={true}
screen={screen}
title={title}
overlayPunchOut={null}
placement='left-start'
pulsatingDotPlacement={pulsatingDotPlacement}
step={1}
singleTip={true}
showOptOut={false}
interactivePunchOut={true}
handleDismiss={handleDismiss}
handleOpen={handleOpen}
handlePrevious={handleDismiss}
pulsatingDotTranslate={{x: -10, y: 70}}
tippyBlueStyle={true}
hideBackdrop={true}
nextBtn={nextBtn}
handleNext={handleDismiss}
/>
);
};
export default AutoShowLinkedBoardTourTip;

Просмотреть файл

@@ -7,8 +7,6 @@ import SearchResultsHeader from 'components/search_results_header';
import Pluggable from 'plugins/pluggable';
import AutoShowLinkedBoardTourTip from './auto_show_linked_board_tourtip';
export type Props = {
showPluggable: boolean;
pluggableId: string;
@@ -17,15 +15,12 @@ export type Props = {
export default class RhsPlugin extends React.PureComponent<Props> {
render() {
const autoLinkedBoardTourTip = (<AutoShowLinkedBoardTourTip/>);
return (
<div
id='rhsContainer'
className='sidebar-right__body'
>
<SearchResultsHeader>
{autoLinkedBoardTourTip}
{this.props.title}
</SearchResultsHeader>
{