From d57bfa18bd2a216b461bb0ea1a205ec07ec7008c Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Tue, 7 Jan 2025 13:23:26 +0100 Subject: [PATCH] ref(quick-start): Remove no longer used file --- .../onboardingWizard/deprecatedNewSidebar.tsx | 525 ------------------ 1 file changed, 525 deletions(-) delete mode 100644 static/app/components/onboardingWizard/deprecatedNewSidebar.tsx diff --git a/static/app/components/onboardingWizard/deprecatedNewSidebar.tsx b/static/app/components/onboardingWizard/deprecatedNewSidebar.tsx deleted file mode 100644 index d4833f619a4aa0..00000000000000 --- a/static/app/components/onboardingWizard/deprecatedNewSidebar.tsx +++ /dev/null @@ -1,525 +0,0 @@ -import {Fragment, useCallback, useEffect, useMemo, useState} from 'react'; -import {css} from '@emotion/react'; -import styled from '@emotion/styled'; -import {motion} from 'framer-motion'; -import partition from 'lodash/partition'; - -import HighlightTopRight from 'sentry-images/pattern/highlight-top-right.svg'; - -import {navigateTo} from 'sentry/actionCreators/navigation'; -import {updateOnboardingTask} from 'sentry/actionCreators/onboardingTasks'; -import {Button} from 'sentry/components/button'; -import {Chevron} from 'sentry/components/chevron'; -import InteractionStateLayer from 'sentry/components/interactionStateLayer'; -import SkipConfirm from 'sentry/components/onboardingWizard/skipConfirm'; -import type {useOnboardingTasks} from 'sentry/components/onboardingWizard/useOnboardingTasks'; -import {taskIsDone} from 'sentry/components/onboardingWizard/utils'; -import ProgressRing from 'sentry/components/progressRing'; -import SidebarPanel from 'sentry/components/sidebar/sidebarPanel'; -import type {CommonSidebarProps} from 'sentry/components/sidebar/types'; -import {Tooltip} from 'sentry/components/tooltip'; -import {IconCheckmark, IconClose, IconNot, IconSync} from 'sentry/icons'; -import {t, tct} from 'sentry/locale'; -import DemoWalkthroughStore from 'sentry/stores/demoWalkthroughStore'; -import {space} from 'sentry/styles/space'; -import { - type OnboardingTask, - OnboardingTaskKey, - type OnboardingTaskStatus, -} from 'sentry/types/onboarding'; -import {trackAnalytics} from 'sentry/utils/analytics'; -import {isDemoModeEnabled} from 'sentry/utils/demoMode'; -import useApi from 'sentry/utils/useApi'; -import {useLocalStorageState} from 'sentry/utils/useLocalStorageState'; -import useOrganization from 'sentry/utils/useOrganization'; -import useRouter from 'sentry/utils/useRouter'; - -const orderedGettingStartedTasks = [ - OnboardingTaskKey.FIRST_PROJECT, - OnboardingTaskKey.FIRST_EVENT, - OnboardingTaskKey.INVITE_MEMBER, - OnboardingTaskKey.ALERT_RULE, - OnboardingTaskKey.SOURCEMAPS, - OnboardingTaskKey.RELEASE_TRACKING, - OnboardingTaskKey.LINK_SENTRY_TO_SOURCE_CODE, -]; - -const orderedBeyondBasicsTasks = [ - OnboardingTaskKey.REAL_TIME_NOTIFICATIONS, - OnboardingTaskKey.SESSION_REPLAY, - OnboardingTaskKey.FIRST_TRANSACTION, - OnboardingTaskKey.SECOND_PLATFORM, -]; - -function groupTasksByCompletion(tasks: OnboardingTask[]) { - const [completedTasks, incompletedTasks] = partition(tasks, task => taskIsDone(task)); - return { - completedTasks, - incompletedTasks, - }; -} - -interface TaskProps extends Pick { - hidePanel: () => void; - task: OnboardingTask; - completed?: boolean; - showWaitingIndicator?: boolean; -} - -function Task({task, status, hidePanel, showWaitingIndicator}: TaskProps) { - const api = useApi(); - const organization = useOrganization(); - const router = useRouter(); - - const handleClick = useCallback( - (e: React.MouseEvent) => { - trackAnalytics('quick_start.task_card_clicked', { - organization, - todo_id: task.task, - todo_title: task.title, - action: 'clickthrough', - new_experience: true, - }); - - e.stopPropagation(); - - if (isDemoModeEnabled()) { - DemoWalkthroughStore.activateGuideAnchor(task.task); - } - - if (task.actionType === 'external') { - window.open(task.location, '_blank'); - } - - if (task.actionType === 'action') { - task.action(router); - } - - if (task.actionType === 'app') { - // Convert all paths to a location object - let to = - typeof task.location === 'string' ? {pathname: task.location} : task.location; - // Add referrer to all links - to = {...to, query: {...to.query, referrer: 'onboarding_task'}}; - - navigateTo(to, router); - } - hidePanel(); - }, - [task, organization, router, hidePanel] - ); - - const handleMarkSkipped = useCallback( - (taskKey: OnboardingTaskKey) => { - trackAnalytics('quick_start.task_card_clicked', { - organization, - todo_id: task.task, - todo_title: task.title, - action: 'skipped', - new_experience: true, - }); - updateOnboardingTask(api, organization, { - task: taskKey, - status: 'skipped', - completionSeen: true, - }); - }, - [task, organization, api] - ); - - if (status === 'complete') { - return ( - - {task.title} - - - - - ); - } - - if (status === 'skipped') { - return ( - - {task.title} - - - - - ); - } - - return ( - - -
- {task.title} -

{task.description}

-
- {task.requisiteTasks.length === 0 && ( - - {task.skippable && ( - handleMarkSkipped(task.task)}> - {({skip}) => ( -