1- import { Box , ButtonGroup , Typography } from '@mui/material'
1+ import { Box , ButtonGroup } from '@mui/material'
22import YAML from 'yaml'
33import { omit } from 'lodash'
44import React , { useEffect , useState } from 'react'
@@ -22,11 +22,11 @@ import {
2222 useGetWorkloadCatalogMutation ,
2323} from 'redux/otomiApi'
2424import DeleteButton from 'components/DeleteButton'
25- import { DocsLink } from 'components/DocsLink'
2625import ImgButtonGroup from 'components/ImgButtonGroup'
2726import { TextField } from 'components/forms/TextField'
2827import Section from 'components/Section'
2928import { LoadingButton } from '@mui/lab'
29+ import { LandingHeader } from 'components/LandingHeader'
3030import CodeEditor from './WorkloadsCodeEditor'
3131import { createAplWorkloadApiResponseSchema } from './create-edit-workloads.validator'
3232
@@ -311,36 +311,48 @@ export default function WorkloadsCreateEditPage({
311311
312312 return (
313313 < PaperLayout title = { t ( 'TITLE_WORKLOAD' , { workloadName, role : 'team' } ) } >
314+ < Box className = { classes . header } sx = { { display : 'flex' , alignItems : 'center' , width : '100%' } } >
315+ < Box className = { classes . imgHolder } sx = { { flex : '0 0 auto' } } >
316+ < img
317+ className = { classes . img }
318+ src = { icon }
319+ onError = { ( { currentTarget } ) => {
320+ currentTarget . onerror = null
321+ currentTarget . src = `${ icon } `
322+ } }
323+ alt = { `Logo for ${ icon } ` }
324+ />
325+ </ Box >
326+
327+ < Box sx = { { flex : '1 1 auto' , minWidth : 0 } } >
328+ < LandingHeader
329+ title = { headerName && headerPath ? `${ headerName } (${ headerPath } )` : headerName ?? headerPath }
330+ docsLabel = 'Docs'
331+ docsLink = {
332+ workloadData ?. spec ?. url && workloadData ?. spec ?. path
333+ ? getDocsLink ( workloadData . spec . url as string , workloadData . spec . path as string )
334+ : undefined
335+ }
336+ hideCrumbX = { workloadName ? [ 1 , 2 ] : undefined }
337+ breadcrumbOverrides = { [
338+ {
339+ position : 1 ,
340+ label : 'Workloads' ,
341+ linkTo : `/teams/${ teamId } /workloads` ,
342+ } ,
343+ {
344+ position : 2 ,
345+ label : 'Catalogs' ,
346+ linkTo : `/catalogs/${ teamId } ` ,
347+ } ,
348+ ] }
349+ />
350+ </ Box >
351+ </ Box >
314352 { isErrorWorkload ? null : (
315353 < FormProvider { ...methods } >
316354 < form onSubmit = { handleSubmit ( onSubmit ) } >
317355 < Box sx = { { width : '100%' } } >
318- < Box className = { classes . header } >
319- < Box className = { classes . imgHolder } >
320- < img
321- className = { classes . img }
322- src = { icon }
323- onError = { ( { currentTarget } ) => {
324- // eslint-disable-next-line no-param-reassign
325- currentTarget . onerror = null
326- // eslint-disable-next-line no-param-reassign
327- currentTarget . src = `${ icon } `
328- } }
329- alt = { `Logo for ${ icon } ` }
330- />
331- </ Box >
332- < Box >
333- < Typography variant = 'h6' >
334- { headerName && headerPath ? `${ headerName } (${ headerPath } )` : headerName ?? headerPath }
335- </ Typography >
336- </ Box >
337- { workloadData ?. spec ?. url && workloadData ?. spec ?. path && (
338- < Box sx = { { ml : 'auto' } } >
339- < DocsLink href = { getDocsLink ( workloadData . spec . url as string , workloadData . spec . path as string ) } />
340- </ Box >
341- ) }
342- </ Box >
343-
344356 < Section >
345357 < Box sx = { { display : 'flex' , gap : 2 , alignItems : 'flex-start' } } >
346358 < TextField
0 commit comments