Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Uptime] Use base path for screenshot url #81930

Merged
merged 2 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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