Skip to content

Commit

Permalink
ref(quick-start): Remove the basics step (#79393)
Browse files Browse the repository at this point in the history
  • Loading branch information
priscilawebdev authored and cmanallen committed Oct 23, 2024
1 parent 6e52c8e commit 6208fce
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 218 deletions.
166 changes: 0 additions & 166 deletions static/app/components/onboardingWizard/onboardingProjectsCard.tsx

This file was deleted.

6 changes: 2 additions & 4 deletions static/app/components/onboardingWizard/progressHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ function ProgressHeader({allTasks, completedTasks}: Props) {
description = t('Walk through this guide to get the most out of Sentry right away.');
}

const filteredTasks = allTasks.filter(task => !task.renderCard);

return (
<Container>
<StyledProgressRing
size={80}
barWidth={8}
text={filteredTasks.length - completedTasks.length}
text={allTasks.length - completedTasks.length}
animateText
value={(completedTasks.length / filteredTasks.length) * 100}
value={(completedTasks.length / allTasks.length) * 100}
progressEndcaps="round"
backgroundColor={theme.gray100}
textCss={() => css`
Expand Down
24 changes: 4 additions & 20 deletions static/app/components/onboardingWizard/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ Heading.defaultProps = {

const completeNowText = isDemoWalkthrough() ? t('Sentry Basics') : t('Next Steps');

const customizedTasksHeading = <Heading key="customized">{t('The Basics')}</Heading>;
const completeNowHeading = <Heading key="now">{completeNowText}</Heading>;
const upcomingTasksHeading = (
<Heading key="upcoming">
Expand All @@ -82,13 +81,11 @@ export const useOnboardingTasks = (
projects,
onboardingContext,
}).filter(task => task.display);
const filteredTasks = all.filter(task => !task.renderCard);
return {
allTasks: all,
customTasks: all.filter(task => task.renderCard),
active: filteredTasks.filter(findActiveTasks),
upcoming: filteredTasks.filter(findUpcomingTasks),
complete: filteredTasks.filter(findCompleteTasks),
active: all.filter(findActiveTasks),
upcoming: all.filter(findUpcomingTasks),
complete: all.filter(findCompleteTasks),
};
}, [organization, projects, onboardingContext]);
};
Expand Down Expand Up @@ -120,7 +117,7 @@ export default function OnboardingWizardSidebar({
});
}

const {allTasks, customTasks, active, upcoming, complete} = useOnboardingTasks(
const {allTasks, active, upcoming, complete} = useOnboardingTasks(
organization,
projects,
onboardingContext
Expand Down Expand Up @@ -184,20 +181,7 @@ export default function OnboardingWizardSidebar({
</CompleteList>
);

const customizedCards = customTasks
.map(task =>
task.renderCard?.({
organization,
task,
onboardingContext,
projects,
})
)
.filter(card => !!card);

const items = [
customizedCards.length > 0 && customizedTasksHeading,
...customizedCards,
active.length > 0 && completeNowHeading,
...active.map(renderItem),
upcoming.length > 0 && upcomingTasksHeading,
Expand Down
13 changes: 0 additions & 13 deletions static/app/components/onboardingWizard/taskConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import EventWaiter from 'sentry/utils/eventWaiter';
import normalizeUrl from 'sentry/utils/url/normalizeUrl';
import withApi from 'sentry/utils/withApi';

import OnboardingProjectsCard from './onboardingProjectsCard';

function hasPlatformWithSourceMaps(projects: Project[] | undefined) {
return projects !== undefined
? projects.some(({platform}) => platform && sourceMaps.includes(platform))
Expand Down Expand Up @@ -467,17 +465,6 @@ export function getOnboardingTasks({
// Use `features?.` because getsentry has a different `Organization` type/payload
display: organization.features?.includes('incidents'),
},
{
task: OnboardingTaskKey.USER_SELECTED_PROJECTS,
title: t('Projects to Setup'),
description: '',
skippable: true,
requisites: [],
actionType: 'action',
action: () => {},
display: true,
renderCard: OnboardingProjectsCard,
},
];
}

Expand Down
4 changes: 1 addition & 3 deletions static/app/components/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ function useOpenOnboardingSidebar(organization?: Organization) {
onboardingContext,
});

const allDisplayedTasks = tasks
.filter(task => task.display)
.filter(task => !task.renderCard);
const allDisplayedTasks = tasks.filter(task => task.display);
const doneTasks = allDisplayedTasks.filter(isDone);

return !(doneTasks.length >= allDisplayedTasks.length);
Expand Down
4 changes: 1 addition & 3 deletions static/app/components/sidebar/onboardingStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ export default function OnboardingStatus({
onboardingContext,
});

const allDisplayedTasks = tasks
.filter(task => task.display)
.filter(task => !task.renderCard);
const allDisplayedTasks = tasks.filter(task => task.display);

const doneTasks = allDisplayedTasks.filter(isDone);
const numberRemaining = allDisplayedTasks.length - doneTasks.length;
Expand Down
9 changes: 0 additions & 9 deletions static/app/types/onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ interface OnboardingTaskDescriptorBase {
* The group that this task belongs to, e.g. basic and level up
*/
group?: OnboardingTaskGroup;
/**
* If a render function was provided, it will be used to render the entire card,
* and the card will be rendered before any other cards regardless of completion status.
* the render function is therefore responsible for determining the completion status
* of the card by returning null when it's completed.
*
* Note that this should not be given a react component.
*/
renderCard?: (props: OnboardingCustomComponentProps) => JSX.Element | null;
/**
* Joins with this task id for server-side onboarding state.
* This allows you to create alias for exising onboarding tasks or create multiple
Expand Down

0 comments on commit 6208fce

Please sign in to comment.