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

[NCL-8709] Fix Brew Push 404 error #612

Merged
merged 1 commit into from
Dec 2, 2024
Merged
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
68 changes: 33 additions & 35 deletions src/components/BuildBrewPushPage/BuildBrewPushPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const BuildBrewPushPage = () => {
serviceContainerBrewPushRunner({
serviceData: { id: buildId },
onError: (result) => {
if (isAxiosError(result.error) && result.error?.status === 404) {
if (isAxiosError(result.error) && result.error?.response?.status === 404) {
setIsBrewPushEmpty(true);
}
},
Expand Down Expand Up @@ -92,40 +92,38 @@ export const BuildBrewPushPage = () => {
return (
<>
{!isBrewPushEmpty ? (
<>
<ServiceContainerLoading {...serviceContainerBrewPush} title="Brew Push details">
<ContentBox padding marginBottom isResponsive>
<Attributes>
<AttributesItem title={buildPushResultEntityAttributes.status.title}>
{serviceContainerBrewPush.data?.status && (
<BuildPushStatusLabelMapper status={serviceContainerBrewPush.data.status} />
)}
</AttributesItem>
<AttributesItem title={buildPushResultEntityAttributes.brewBuildId.title}>
{serviceContainerBrewPush.data?.brewBuildId}
</AttributesItem>
<AttributesItem title={buildPushResultEntityAttributes.brewBuildUrl.title}>
{serviceContainerBrewPush.data?.brewBuildUrl && (
<a target="_blank" rel="noreferrer" href={serviceContainerBrewPush.data.brewBuildUrl}>
{serviceContainerBrewPush.data.brewBuildUrl}
</a>
)}
</AttributesItem>
</Attributes>
</ContentBox>

<Toolbar borderBottom>
<ToolbarItem>
<TextContent>
<Text component={TextVariants.h2}>Logs</Text>
</TextContent>
</ToolbarItem>
</Toolbar>
<ContentBox padding>
<LogViewer isStatic={serviceContainerBrewPush?.data?.status !== 'ACCEPTED'} data={logBuffer} />
</ContentBox>
</ServiceContainerLoading>
</>
<ServiceContainerLoading {...serviceContainerBrewPush} title="Brew Push details">
<ContentBox padding marginBottom isResponsive>
<Attributes>
<AttributesItem title={buildPushResultEntityAttributes.status.title}>
{serviceContainerBrewPush.data?.status && (
<BuildPushStatusLabelMapper status={serviceContainerBrewPush.data.status} />
)}
</AttributesItem>
<AttributesItem title={buildPushResultEntityAttributes.brewBuildId.title}>
{serviceContainerBrewPush.data?.brewBuildId}
</AttributesItem>
<AttributesItem title={buildPushResultEntityAttributes.brewBuildUrl.title}>
{serviceContainerBrewPush.data?.brewBuildUrl && (
<a target="_blank" rel="noreferrer" href={serviceContainerBrewPush.data.brewBuildUrl}>
{serviceContainerBrewPush.data.brewBuildUrl}
</a>
)}
</AttributesItem>
</Attributes>
</ContentBox>

<Toolbar borderBottom>
<ToolbarItem>
<TextContent>
<Text component={TextVariants.h2}>Logs</Text>
</TextContent>
</ToolbarItem>
</Toolbar>
<ContentBox padding>
<LogViewer isStatic={serviceContainerBrewPush?.data?.status !== 'ACCEPTED'} data={logBuffer} />
</ContentBox>
</ServiceContainerLoading>
) : (
<ContentBox padding marginBottom>
<EmptyStateCard title="Brew Push of the Build" />
Expand Down