Skip to content

Commit

Permalink
Remove analysis specific tour
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfdsilva committed Dec 5, 2023
1 parent 77e0823 commit f2f1ed9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ function CustomAoI({
<>
<Tip disabled={!disableReason} content={disableReason} placement='bottom'>
<div>
<AnalysisToolbar visuallyDisabled={!!disableReason}>
<AnalysisToolbar
visuallyDisabled={!!disableReason}
data-tour='analysis-tour'
>
<ToolbarLabel>Analysis tools</ToolbarLabel>
<TipToolbarIconButton
tipContent='Draw an area of interest'
Expand Down
20 changes: 1 addition & 19 deletions app/scripts/components/exploration/tour-manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import { timelineDatasetsAtom } from './atoms/datasets';

import { usePreviousValue } from '$utils/use-effect-previous';
import useAois from '$components/common/map/controls/hooks/use-aois';

const Popover = styled.div`
position: relative;
Expand Down Expand Up @@ -45,7 +44,7 @@ const PopoverFooter = styled.div`
const introTourSteps = [
{
title: 'Time series analysis',
selector: '.mapboxgl-ctrl-top-left',
selector: "[data-tour='analysis-tour']",
content: () => (
<>
To calculate a time series of zonal statistics for
Expand All @@ -69,9 +68,6 @@ const introTourSteps = [
}
];

const analysisTourSteps = [
];

/**
* Helper function to add an action after the last step of a tour.
* @param steps The steps to add the action to
Expand Down Expand Up @@ -101,7 +97,6 @@ export function TourManager() {

// Control states for the different tours.
const [introTourShown, setIntroTourShown] = useState(false);
const [analysisTourShown, setAnalysisTourShown] = useState(false);

// Variables that cause tour 1 to start.
const datasets = useAtomValue(timelineDatasetsAtom);
Expand All @@ -117,19 +112,6 @@ export function TourManager() {
}
}, [introTourShown, prevDatasetCount, datasetCount, startTour]);

// Variables that cause tour 2 to start.
const { features } = useAois();
const featuresCount = features.length;
useEffect(() => {
if (introTourShown && !analysisTourShown && featuresCount > 0) {
// Make the last step of the intro tour mark it as shown.
const steps = addActionAfterLastStep(analysisTourSteps, () => {
setAnalysisTourShown(true);
});
startTour(steps);
}
}, [introTourShown, analysisTourShown, featuresCount, startTour]);

return null;
}

Expand Down

0 comments on commit f2f1ed9

Please sign in to comment.