From adadff54e5e984e71f49ed322f436ffc1e904aa9 Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Sun, 3 Nov 2024 23:34:36 -0300 Subject: [PATCH 1/3] ref(quick-start): Improve logic --- static/app/components/onboardingWizard/newSidebar.tsx | 3 +-- static/app/components/sidebar/newOnboardingStatus.tsx | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/static/app/components/onboardingWizard/newSidebar.tsx b/static/app/components/onboardingWizard/newSidebar.tsx index 92fb46d327f3b3..da21f9a6d528ec 100644 --- a/static/app/components/onboardingWizard/newSidebar.tsx +++ b/static/app/components/onboardingWizard/newSidebar.tsx @@ -61,7 +61,7 @@ function groupTasksByCompletion(tasks: OnboardingTask[]) { }; } -interface TaskProps extends Pick { +interface TaskProps extends Partial> { hidePanel: () => void; task: OnboardingTask; completed?: boolean; @@ -304,7 +304,6 @@ function TaskGroup({ task={task} hidePanel={hidePanel} showWaitingIndicator={taskKeyForWaitingIndicator === task.task} - status={task.status} /> ))} {completedTasks.length > 0 && ( diff --git a/static/app/components/sidebar/newOnboardingStatus.tsx b/static/app/components/sidebar/newOnboardingStatus.tsx index 3688489d8afe3c..0b41ed53c83fb7 100644 --- a/static/app/components/sidebar/newOnboardingStatus.tsx +++ b/static/app/components/sidebar/newOnboardingStatus.tsx @@ -73,12 +73,11 @@ export function NewOnboardingStatus({ }); const label = walkthrough ? t('Guided Tours') : t('Onboarding'); - const totalRemainingTasks = allTasks.length - doneTasks.length; const pendingCompletionSeen = doneTasks.length !== completeTasks.length; + const allTasksCompleted = allTasks.length === completeTasks.length; const skipQuickStart = - !organization.features?.includes('onboarding') || - (completeTasks.length === allTasks.length && !isActive); + !organization.features?.includes('onboarding') || (allTasksCompleted && !isActive); const unseenDoneTasks = useMemo( () => @@ -111,7 +110,7 @@ export function NewOnboardingStatus({ }, [onShowPanel, isActive, walkthrough, markDoneTaskAsComplete, organization]); useEffect(() => { - if (totalRemainingTasks !== 0 || skipQuickStart || quickStartCompleted) { + if (!allTasksCompleted || skipQuickStart || quickStartCompleted) { return; } @@ -123,11 +122,11 @@ export function NewOnboardingStatus({ setQuickStartCompleted(true); }, [ - totalRemainingTasks, organization, skipQuickStart, quickStartCompleted, setQuickStartCompleted, + allTasksCompleted, ]); useEffect(() => { From 84d57b6a20ea7fef8698e70654a454151079fd6a Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Mon, 4 Nov 2024 09:06:43 -0300 Subject: [PATCH 2/3] update for pending --- static/app/components/onboardingWizard/newSidebar.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/static/app/components/onboardingWizard/newSidebar.tsx b/static/app/components/onboardingWizard/newSidebar.tsx index 06f891e81dc867..1dc193cfdef480 100644 --- a/static/app/components/onboardingWizard/newSidebar.tsx +++ b/static/app/components/onboardingWizard/newSidebar.tsx @@ -304,6 +304,7 @@ function TaskGroup({ task={task} hidePanel={hidePanel} showWaitingIndicator={taskKeyForWaitingIndicator === task.task} + status={task.status === 'pending' ? task.status : undefined} /> ))} {completedTasks.length > 0 && ( From c6dbb26e5ec65431a5ade6113b0e440b90587aac Mon Sep 17 00:00:00 2001 From: Priscila Oliveira Date: Mon, 2 Dec 2024 13:59:39 +0100 Subject: [PATCH 3/3] feedback --- static/app/components/onboardingWizard/newSidebar.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/static/app/components/onboardingWizard/newSidebar.tsx b/static/app/components/onboardingWizard/newSidebar.tsx index 1dc193cfdef480..72fa11a44e48d9 100644 --- a/static/app/components/onboardingWizard/newSidebar.tsx +++ b/static/app/components/onboardingWizard/newSidebar.tsx @@ -13,7 +13,7 @@ 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 {findCompleteTasks, taskIsDone} from 'sentry/components/onboardingWizard/utils'; +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'; @@ -52,16 +52,14 @@ const orderedBeyondBasicsTasks = [ ]; function groupTasksByCompletion(tasks: OnboardingTask[]) { - const [completedTasks, incompletedTasks] = partition(tasks, task => - findCompleteTasks(task) - ); + const [completedTasks, incompletedTasks] = partition(tasks, task => taskIsDone(task)); return { completedTasks, incompletedTasks, }; } -interface TaskProps extends Partial> { +interface TaskProps extends Pick { hidePanel: () => void; task: OnboardingTask; completed?: boolean; @@ -304,7 +302,7 @@ function TaskGroup({ task={task} hidePanel={hidePanel} showWaitingIndicator={taskKeyForWaitingIndicator === task.task} - status={task.status === 'pending' ? task.status : undefined} + status={task.status} /> ))} {completedTasks.length > 0 && (