From 11c2159b7e25a71b4d57a2b7400f3d77be5b49ec Mon Sep 17 00:00:00 2001 From: Julien Tant <785518+JulienTant@users.noreply.github.com> Date: Fri, 26 Jul 2024 14:58:10 -0700 Subject: [PATCH] [MM-58379] Remove playbooks from onboarding (#27757) * remove playbooks from onboarding * i18n --- .../product_menu/product_menu.tsx | 28 +-------- .../components/onboarding_tasks/constants.ts | 4 -- .../onboarding_tasks_manager.tsx | 63 +------------------ .../channels/src/components/tours/constant.ts | 8 --- webapp/channels/src/components/tours/hooks.ts | 39 +----------- .../onboarding_explore_tools_tour/index.ts | 4 -- .../onboarding_explore_tools_tour_tip.tsx | 18 ------ .../playbooks_tour_tip.tsx | 47 -------------- webapp/channels/src/i18n/en.json | 4 -- .../src/images/playbooks_tour_tip.svg | 9 --- webapp/channels/src/utils/constants.tsx | 6 -- 11 files changed, 5 insertions(+), 225 deletions(-) delete mode 100644 webapp/channels/src/components/tours/onboarding_explore_tools_tour/index.ts delete mode 100644 webapp/channels/src/components/tours/onboarding_explore_tools_tour/onboarding_explore_tools_tour_tip.tsx delete mode 100644 webapp/channels/src/components/tours/onboarding_explore_tools_tour/playbooks_tour_tip.tsx delete mode 100644 webapp/channels/src/images/playbooks_tour_tip.svg diff --git a/webapp/channels/src/components/global_header/left_controls/product_menu/product_menu.tsx b/webapp/channels/src/components/global_header/left_controls/product_menu/product_menu.tsx index 28ff3f142b..c08be00c3f 100644 --- a/webapp/channels/src/components/global_header/left_controls/product_menu/product_menu.tsx +++ b/webapp/channels/src/components/global_header/left_controls/product_menu/product_menu.tsx @@ -8,31 +8,22 @@ import styled from 'styled-components'; import IconButton from '@mattermost/compass-components/components/icon-button'; // eslint-disable-line no-restricted-imports -import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; -import {getInt} from 'mattermost-redux/selectors/entities/preferences'; -import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import {getLicense} from 'mattermost-redux/selectors/entities/general'; import {setProductMenuSwitcherOpen} from 'actions/views/product_menu'; import {isSwitcherOpen} from 'selectors/views/product_menu'; import { - GenericTaskSteps, OnboardingTaskCategory, OnboardingTasksName, TaskNameMapToSteps, useHandleOnBoardingTaskData, } from 'components/onboarding_tasks'; -import {FINISHED, TutorialTourName} from 'components/tours'; -import {PlaybooksTourTip} from 'components/tours/onboarding_explore_tools_tour'; import Menu from 'components/widgets/menu/menu'; import MenuWrapper from 'components/widgets/menu/menu_wrapper'; -import {useGetPluginsActivationState} from 'plugins/useGetPluginsActivationState'; -import {ExploreOtherToolsTourSteps, suitePluginIds} from 'utils/constants'; import {useCurrentProductId, useProducts, isChannels} from 'utils/products'; -import type {GlobalState} from 'types/store'; - import ProductBranding from './product_branding'; import ProductBrandingTeamEdition from './product_branding_team_edition'; import ProductMenuItem from './product_menu_item'; @@ -77,16 +68,6 @@ const ProductMenu = (): JSX.Element => { const currentProductID = useCurrentProductId(); const license = useSelector(getLicense); - const enableTutorial = useSelector(getConfig).EnableTutorial === 'true'; - const currentUserId = useSelector(getCurrentUserId); - const tutorialStep = useSelector((state: GlobalState) => getInt(state, TutorialTourName.EXPLORE_OTHER_TOOLS, currentUserId, 0)); - const triggerStep = useSelector((state: GlobalState) => getInt(state, OnboardingTaskCategory, OnboardingTasksName.EXPLORE_OTHER_TOOLS, FINISHED)); - const exploreToolsTourTriggered = triggerStep === GenericTaskSteps.STARTED; - - const {playbooksPlugin} = useGetPluginsActivationState(); - - const showPlaybooksTour = enableTutorial && tutorialStep === ExploreOtherToolsTourSteps.PLAYBOOKS_TOUR && exploreToolsTourTriggered && playbooksPlugin; - const handleClick = () => dispatch(setProductMenuSwitcherOpen(!switcherOpen)); const handleOnBoardingTaskData = useHandleOnBoardingTaskData(); @@ -99,7 +80,7 @@ const ProductMenu = (): JSX.Element => { }; useClickOutsideRef(menuRef, () => { - if (exploreToolsTourTriggered || !switcherOpen) { + if (!switcherOpen) { return; } dispatch(setProductMenuSwitcherOpen(false)); @@ -108,11 +89,6 @@ const ProductMenu = (): JSX.Element => { const productItems = products?.map((product) => { let tourTip; - // playbooks - if (product.pluginId === suitePluginIds.playbooks && showPlaybooksTour) { - tourTip = (); - } - return ( { defaultMessage: 'Take a tour of Channels.', }), }, - [OnboardingTasksName.PLAYBOOKS_TOUR]: { - id: 'task_resolve_incidents_faster_with_playbooks', - svg: Clipboard, - message: formatMessage({ - id: 'onboardingTask.checklist.task_resolve_incidents_faster_with_playbooks', - defaultMessage: 'Explore workflows with your first playbook.', - }), - }, [OnboardingTasksName.INVITE_PEOPLE]: { id: 'task_invite_team_members', svg: Handshake, @@ -86,15 +76,6 @@ const useGetTaskDetails = () => { }), }, - [OnboardingTasksName.EXPLORE_OTHER_TOOLS]: { - id: 'task_explore_other_tools_in_platform', - svg: Wrench, - message: formatMessage({ - id: 'onboardingTask.checklist.task_explore_other_tools_in_platform', - defaultMessage: 'Explore other tools in the platform.', - }), - }, - [OnboardingTasksName.DOWNLOAD_APP]: { id: 'task_download_mm_apps', svg: Phone, @@ -124,7 +105,6 @@ const useGetTaskDetails = () => { }; export const useTasksList = () => { - const pluginsList = useSelector((state: GlobalState) => state.plugins.plugins); const prevTrialLicense = useSelector((state: GlobalState) => state.entities.admin.prevTrialLicense); const license = useSelector(getLicense); const isPrevLicensed = prevTrialLicense?.IsLicensed; @@ -147,9 +127,6 @@ export const useTasksList = () => { const showStartTrialTask = selfHostedTrialCondition || cloudTrialCondition; const list: Record = {...OnboardingTasksName}; - if (!pluginsList.playbooks || !isUserFirstAdmin) { - delete list.PLAYBOOKS_TOUR; - } if (!showStartTrialTask) { delete list.START_TRIAL; } @@ -159,11 +136,6 @@ export const useTasksList = () => { delete list.START_TRIAL; } - // explore other tools tour is only shown to subsequent admins and end users - if (isUserFirstAdmin || (!pluginsList.playbooks && !pluginsList.focalboard)) { - delete list.EXPLORE_OTHER_TOOLS; - } - // invite other users is hidden for guest users if (isGuestUser) { delete list.INVITE_PEOPLE; @@ -233,7 +205,6 @@ export const useHandleOnBoardingTaskData = () => { export const useHandleOnBoardingTaskTrigger = () => { const dispatch = useDispatch(); - const history = useHistory(); const {pathname} = useLocation(); const handleSaveData = useHandleOnBoardingTaskData(); @@ -269,12 +240,6 @@ export const useHandleOnBoardingTaskTrigger = () => { } break; } - case OnboardingTasksName.PLAYBOOKS_TOUR: { - history.push('/playbooks/start'); - localStorage.setItem(OnboardingTaskCategory, 'true'); - handleSaveData(taskName, TaskNameMapToSteps[taskName].FINISHED, true); - break; - } case OnboardingTasksName.COMPLETE_YOUR_PROFILE: { dispatch(setStatusDropdown(true)); dispatch(setShowOnboardingCompleteProfileTour(true)); @@ -284,30 +249,6 @@ export const useHandleOnBoardingTaskTrigger = () => { } break; } - case OnboardingTasksName.EXPLORE_OTHER_TOOLS: { - dispatch(setProductMenuSwitcherOpen(true)); - handleSaveData(taskName, TaskNameMapToSteps[taskName].STARTED, true); - const tourCategory = TutorialTourName.EXPLORE_OTHER_TOOLS; - const preferences = [ - { - user_id: currentUserId, - category: tourCategory, - name: currentUserId, - value: ExploreOtherToolsTourSteps.PLAYBOOKS_TOUR.toString(), - }, - { - user_id: currentUserId, - category: tourCategory, - name: TTNameMapToATStatusKey[tourCategory], - value: AutoTourStatus.ENABLED.toString(), - }, - ]; - dispatch(savePreferences(currentUserId, preferences)); - if (!inChannels) { - dispatch(switchToChannels()); - } - break; - } case OnboardingTasksName.VISIT_SYSTEM_CONSOLE: { dispatch(setProductMenuSwitcherOpen(true)); dispatch(setShowOnboardingVisitConsoleTour(true)); diff --git a/webapp/channels/src/components/tours/constant.ts b/webapp/channels/src/components/tours/constant.ts index 6ce7b68c24..f294db4978 100644 --- a/webapp/channels/src/components/tours/constant.ts +++ b/webapp/channels/src/components/tours/constant.ts @@ -23,7 +23,6 @@ export const TutorialTourName = { CRT_TUTORIAL_STEP: 'crt_tutorial_step', CRT_THREAD_PANE_STEP: 'crt_thread_pane_step', AUTO_TOUR_STATUS: 'auto_tour_status', - EXPLORE_OTHER_TOOLS: 'explore_tools', }; export const OnboardingTourSteps = { @@ -41,11 +40,6 @@ export const OnboardingTourStepsForGuestUsers = { FINISHED, }; -export const ExploreOtherToolsTourSteps = { - PLAYBOOKS_TOUR: 1, - FINISHED, -}; - export const CrtTutorialSteps = { WELCOME_POPOVER: 0, LIST_POPOVER: 1, @@ -63,12 +57,10 @@ export const TTNameMapToATStatusKey = { [TutorialTourName.ONBOARDING_TUTORIAL_STEP]: TutorialTourName.ONBOARDING_TUTORIAL_STEP + AutoStatusSuffix, [TutorialTourName.CRT_TUTORIAL_STEP]: 'crt_tutorial_auto_tour_status', [TutorialTourName.CRT_THREAD_PANE_STEP]: TutorialTourName.CRT_THREAD_PANE_STEP + AutoStatusSuffix, - [TutorialTourName.EXPLORE_OTHER_TOOLS]: TutorialTourName.EXPLORE_OTHER_TOOLS + AutoStatusSuffix, }; export const TTNameMapToTourSteps = { [TutorialTourName.ONBOARDING_TUTORIAL_STEP]: OnboardingTourSteps, [TutorialTourName.ONBOARDING_TUTORIAL_STEP_FOR_GUESTS]: OnboardingTourStepsForGuestUsers, [TutorialTourName.CRT_TUTORIAL_STEP]: CrtTutorialSteps, - [TutorialTourName.EXPLORE_OTHER_TOOLS]: ExploreOtherToolsTourSteps, }; diff --git a/webapp/channels/src/components/tours/hooks.ts b/webapp/channels/src/components/tours/hooks.ts index 97f6e29312..7ed45798dd 100644 --- a/webapp/channels/src/components/tours/hooks.ts +++ b/webapp/channels/src/components/tours/hooks.ts @@ -11,18 +11,15 @@ import {getCurrentUserId, isCurrentUserGuestUser} from 'mattermost-redux/selecto import {setAddChannelDropdown} from 'actions/views/add_channel_dropdown'; import {close as closeLhs, open as openLhs} from 'actions/views/lhs'; import {switchToChannels} from 'actions/views/onboarding_tasks'; -import {setProductMenuSwitcherOpen} from 'actions/views/product_menu'; import {OnboardingTaskCategory, OnboardingTaskList, OnboardingTasksName} from 'components/onboarding_tasks'; -import {useGetPluginsActivationState} from 'plugins/useGetPluginsActivationState'; import {getHistory} from 'utils/browser_history'; import type {GlobalState} from 'types/store'; import { CrtTutorialSteps, - ExploreOtherToolsTourSteps, FINISHED, OnboardingTourSteps, TTNameMapToTourSteps, @@ -34,16 +31,7 @@ export const useGetTourSteps = (tourCategory: string) => { let tourSteps: Record = TTNameMapToTourSteps[tourCategory]; - const {playbooksPlugin, playbooksProductEnabled} = useGetPluginsActivationState(); - - if (tourCategory === TutorialTourName.EXPLORE_OTHER_TOOLS) { - const steps: Record = tourSteps as typeof ExploreOtherToolsTourSteps; - if (!playbooksPlugin && !playbooksProductEnabled) { - delete steps.PLAYBOOKS_TOUR; - } - - tourSteps = steps; - } else if (tourCategory === TutorialTourName.ONBOARDING_TUTORIAL_STEP && isGuestUser) { + if (tourCategory === TutorialTourName.ONBOARDING_TUTORIAL_STEP && isGuestUser) { // restrict the 'learn more about messaging' tour when user is guest (townSquare, channel creation and user invite are restricted to guests) tourSteps = TTNameMapToTourSteps[TutorialTourName.ONBOARDING_TUTORIAL_STEP_FOR_GUESTS]; } @@ -112,31 +100,6 @@ export const useHandleNavigationAndExtraActions = (tourCategory: string) => { } default: } - } else if (tourCategory === TutorialTourName.EXPLORE_OTHER_TOOLS) { - switch (step) { - case ExploreOtherToolsTourSteps.FINISHED : { - dispatch(setProductMenuSwitcherOpen(false)); - let preferences = [ - { - user_id: currentUserId, - category: OnboardingTaskCategory, - name: OnboardingTasksName.EXPLORE_OTHER_TOOLS, - value: FINISHED.toString(), - }, - ]; - preferences = [...preferences, - { - user_id: currentUserId, - category: OnboardingTaskCategory, - name: OnboardingTaskList.ONBOARDING_TASK_LIST_OPEN, - value: 'true', - }, - ]; - dispatch(savePreferences(currentUserId, preferences)); - break; - } - default: - } } }, [currentUserId, teamUrl, tourCategory]); diff --git a/webapp/channels/src/components/tours/onboarding_explore_tools_tour/index.ts b/webapp/channels/src/components/tours/onboarding_explore_tools_tour/index.ts deleted file mode 100644 index 9ae542f147..0000000000 --- a/webapp/channels/src/components/tours/onboarding_explore_tools_tour/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. - -export * from './playbooks_tour_tip'; diff --git a/webapp/channels/src/components/tours/onboarding_explore_tools_tour/onboarding_explore_tools_tour_tip.tsx b/webapp/channels/src/components/tours/onboarding_explore_tools_tour/onboarding_explore_tools_tour_tip.tsx deleted file mode 100644 index e485c33be6..0000000000 --- a/webapp/channels/src/components/tours/onboarding_explore_tools_tour/onboarding_explore_tools_tour_tip.tsx +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. - -import React from 'react'; - -import {ChannelsTourTip, TutorialTourName} from 'components/tours'; -import type {ChannelsTourTipProps} from 'components/tours'; - -const OnboardingExploreToolsTourTip = (props: Omit) => { - return ( - - ); -}; - -export default OnboardingExploreToolsTourTip; diff --git a/webapp/channels/src/components/tours/onboarding_explore_tools_tour/playbooks_tour_tip.tsx b/webapp/channels/src/components/tours/onboarding_explore_tools_tour/playbooks_tour_tip.tsx deleted file mode 100644 index 26cb976a77..0000000000 --- a/webapp/channels/src/components/tours/onboarding_explore_tools_tour/playbooks_tour_tip.tsx +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. - -import React from 'react'; -import {FormattedMessage} from 'react-intl'; - -import {useMeasurePunchouts} from '@mattermost/components'; - -import PlaybooksImg from 'images/playbooks_tour_tip.svg'; - -import OnboardingExploreToolsTourTip from './onboarding_explore_tools_tour_tip'; - -interface PlaybooksTourTipProps { - singleTip: boolean; -} - -export const PlaybooksTourTip = ({singleTip}: PlaybooksTourTipProps) => { - const title = ( - - ); - const screen = ( -

- -

- ); - - const overlayPunchOut = useMeasurePunchouts(['product-menu-item-playbooks'], []); - - return ( - - ); -}; - diff --git a/webapp/channels/src/i18n/en.json b/webapp/channels/src/i18n/en.json index a80aa3be87..b730b5c7a8 100644 --- a/webapp/channels/src/i18n/en.json +++ b/webapp/channels/src/i18n/en.json @@ -4388,10 +4388,8 @@ "onboardingTask.checklist.start_enterprise_now": "Start your free Enterprise trial now!", "onboardingTask.checklist.task_complete_your_profile": "Complete your profile.", "onboardingTask.checklist.task_download_mm_apps": "Download the Desktop and Mobile Apps.", - "onboardingTask.checklist.task_explore_other_tools_in_platform": "Explore other tools in the platform.", "onboardingTask.checklist.task_invite_team_members": "Invite team members to the workspace.", "onboardingTask.checklist.task_learn_more_about_messaging": "Take a tour of Channels.", - "onboardingTask.checklist.task_resolve_incidents_faster_with_playbooks": "Explore workflows with your first playbook.", "onboardingTask.checklist.task_start_enterprise_trial": "Learn more about Enterprise-level high-security features.", "onboardingTask.checklist.task_visit_system_console": "Visit the System Console to configure your workspace.", "onboardingTask.checklist.video_title": "Watch overview", @@ -4410,8 +4408,6 @@ "onboardingTour.customizeYourExperience.title": "Customize your experience", "onboardingTour.invitePeople.Description": "Invite members of your organization or external guests to the team and start collaborating with them.", "onboardingTour.invitePeople.title": "Invite people to the team", - "onboardingTour.Playbooks.Description": "With checklists, automations and integrations, you can define processes that ensure best practices are followed every time.", - "onboardingTour.Playbooks.title": "Build workflows with Playbooks", "onboardingTour.sendMessage.Description": "Start collaborating with others by typing or selecting one of the messages below. You can also drag and drop attachments into the text field or upload them using the paperclip icon.", "onboardingTour.sendMessage.title": "Send messages", "ONE_HUNDRED_TO_500": "101-500", diff --git a/webapp/channels/src/images/playbooks_tour_tip.svg b/webapp/channels/src/images/playbooks_tour_tip.svg deleted file mode 100644 index d7b996e8ac..0000000000 --- a/webapp/channels/src/images/playbooks_tour_tip.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/webapp/channels/src/utils/constants.tsx b/webapp/channels/src/utils/constants.tsx index 1b16a08c0b..4896de9856 100644 --- a/webapp/channels/src/utils/constants.tsx +++ b/webapp/channels/src/utils/constants.tsx @@ -680,11 +680,6 @@ export const CrtTutorialSteps = { FINISHED: 999, }; -export const ExploreOtherToolsTourSteps = { - PLAYBOOKS_TOUR: 1, - FINISHED: 999, -}; - export const CrtTutorialTriggerSteps = { START: 0, STARTED: 1, @@ -1440,7 +1435,6 @@ export const Constants = { AdminTutorialSteps, CrtTutorialSteps, CrtTutorialTriggerSteps, - ExploreOtherToolsTourSteps, CrtThreadPaneSteps, PostTypes, ErrorPageTypes,