Skip to content

Commit e1963b0

Browse files
Show error msg on Job Details page in toast if Job was Failed (#9)
* Show error msg on Job Details page in toast * resolved checks failed * Copilot PR suggestions * Add Alert instead of Toast --------- Co-authored-by: babourine <babourine@users.noreply.github.com>
1 parent dd9fcf9 commit e1963b0

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

web/src/app/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import LeftNavContainer from '@/components/NavigationBar/LeftNavContainer'
2+
23
import dynamic from 'next/dynamic'
34
import { NuqsAdapter } from 'nuqs/adapters/next/app'
45

web/src/modules/Jobs/Helper.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export type JobType = {
3636
command_name: string
3737
cluster_id: string
3838
cluster_name: string
39+
error?: string
3940
context?: {
4041
properties: {
4142
'spark.driver.cores': string

web/src/modules/Jobs/JobDetails/JobDetailsHeader.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { PageHeader, SectionHeader } from '@patterninc/react-ui'
3+
import { Alert, PageHeader, SectionHeader } from '@patterninc/react-ui'
44
import styles from './_job-Details.module.scss'
55
import { JobDataTypesProps } from '../Helper'
66
import SyntaxHighlighter from 'react-syntax-highlighter'
@@ -48,6 +48,9 @@ const JobDetailsHeader = ({ jobData }: JobDataTypesProps): React.JSX.Element =>
4848
className={`${styles.bottomSectionContainer} bgc-white pat-border-t bdrc-medium-purple`}
4949
>
5050
<div className='flex flex-direction-column pat-gap-4 pat-p-4'>
51+
{jobData?.status === 'FAILED' ? (
52+
<Alert type='error' text={jobData?.error} />
53+
) : null}
5154
{yamlContext ? (
5255
<div>
5356
<SectionHeader title='Context' />

0 commit comments

Comments
 (0)