Skip to content

Commit

Permalink
[Uptime] Use base path for screenshot url (#81930)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 authored Oct 29, 2020
1 parent 59662ee commit 995111a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ describe('ExecutedJourney component', () => {
}
}
/>
<EuiSpacer
size="s"
/>
</EuiFlexGroup>
`);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const ExecutedJourney: FC<ExecutedJourneyProps> = ({ journey }) => (
{journey.steps.filter(isStepEnd).map((step, index) => (
<ExecutedStep key={index} index={index} step={step} />
))}
<EuiSpacer size="s" />
</EuiFlexGroup>
</div>
);
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const ExecutedStep: FC<ExecutedStepProps> = ({ step, index }) => (
<div>
<StatusBadge status={step.synthetics?.payload?.status} />
</div>
<EuiSpacer />
<EuiSpacer size="s" />
<div>
<EuiFlexGroup>
<EuiFlexItem grow={false}>
Expand Down Expand Up @@ -87,6 +87,5 @@ export const ExecutedStep: FC<ExecutedStepProps> = ({ step, index }) => (
</EuiFlexGroup>
</div>
</div>
<EuiSpacer />
</>
);
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import React, { useContext, useEffect, useRef, useState, FC } from 'react';
import { useIntersection } from 'react-use';
import { UptimeThemeContext } from '../../../contexts';
import { UptimeSettingsContext, UptimeThemeContext } from '../../../contexts';

interface StepScreenshotDisplayProps {
screenshotExists?: boolean;
Expand All @@ -41,6 +41,8 @@ export const StepScreenshotDisplay: FC<StepScreenshotDisplayProps> = ({
colors: { lightestShade: pageBackground },
} = useContext(UptimeThemeContext);

const { basePath } = useContext(UptimeSettingsContext);

const [isImagePopoverOpen, setIsImagePopoverOpen] = useState<boolean>(false);
const [isOverlayOpen, setIsOverlayOpen] = useState<boolean>(false);

Expand All @@ -59,7 +61,7 @@ export const StepScreenshotDisplay: FC<StepScreenshotDisplayProps> = ({
}, [hasIntersected, isIntersecting, setHasIntersected]);

let content: JSX.Element | null = null;
const imgSrc = `/api/uptime/journey/screenshot/${checkGroup}/${stepIndex}`;
const imgSrc = basePath + `/api/uptime/journey/screenshot/${checkGroup}/${stepIndex}`;
if (hasIntersected && screenshotExists) {
content = (
<>
Expand Down

0 comments on commit 995111a

Please sign in to comment.