diff --git a/assets/js/dashboard/extra/exploration.js b/assets/js/dashboard/extra/exploration.js index ee9f85b23298..cc60f0dfc83f 100644 --- a/assets/js/dashboard/extra/exploration.js +++ b/assets/js/dashboard/extra/exploration.js @@ -22,6 +22,8 @@ import { ChevronUpDownIcon, ChevronRightIcon } from '@heroicons/react/20/solid' import { FlagIcon, MagnifyingGlassIcon } from '@heroicons/react/24/outline' import { popover } from '../components/popover' +const JOURNEY_END_EVENT = '__journey_end__' + const DIRECTION = { FORWARD: 'forward', BACKWARD: 'backward' } const DIRECTION_OPTIONS = [ @@ -102,6 +104,19 @@ function stepsToJourneyParam(steps) { ) } +function maybeEmptyResults(results, activeFilter) { + if ( + results.length === 0 || + (!activeFilter && + results.length === 1 && + results[0].step.name === JOURNEY_END_EVENT) + ) { + return [] + } else { + return results + } +} + // Keep only entries with index < fromIndex, discarding everything at or after. // Used to truncate frozen candidate snapshots when the journey is shortened. function truncateFrozenAt(frozen, fromIndex) { @@ -354,7 +369,9 @@ function CandidateCard({ colIndex, onSelect }) { - const isCustomEvent = step.name !== 'pageview' + const isJourneyEnd = step.name === JOURNEY_END_EVENT + const isCustomEvent = + step.name !== 'pageview' && step.name !== JOURNEY_END_EVENT const isGoal = step.is_goal const visitorsToShow = @@ -382,12 +399,16 @@ function CandidateCard({ ? 'bg-gray-100/60 dark:bg-gray-850' : 'hover:bg-gray-100/60 dark:hover:bg-gray-850' + const pointer = isJourneyEnd ? 'pointer-events-none' : '' + + const onSelectHandler = isJourneyEnd ? () => {} : onSelect + return (