@@ -24,7 +24,8 @@ import { DatasetUtils } from '@cosmotech/core';
2424import { DescriptionEditor , TagsEditor } from '../../inputs' ;
2525import { FadingTooltip , ScenarioValidationStatusChip } from '../../misc' ;
2626import { ConfirmDeleteDialog , EditableLink } from './components' ;
27- import useStyles from './style' ;
27+ import { SHRUNK_NODE_HEIGHT } from './constants' ;
28+ import { classes , Root } from './style' ;
2829
2930const DEFAULT_LABELS = {
3031 status : 'Run status:' ,
@@ -82,7 +83,6 @@ export const ScenarioNode = ({
8283 buildScenarioNameToDelete,
8384 onScenarioUpdate = ( ) => null ,
8485} ) => {
85- const classes = useStyles ( ) ;
8686 const labels = { ...DEFAULT_LABELS , ...tmpLabels } ;
8787 const [ isConfirmDialogOpen , setIsConfirmDialogOpen ] = useState ( false ) ;
8888 labels . deleteDialog . title = buildScenarioNameToDelete ( scenario . name ) ;
@@ -208,8 +208,15 @@ export const ScenarioNode = ({
208208
209209 const getDetailedStatus = ( ) => {
210210 return (
211- < div className = { classes . scenarioDetailsStatusContainer } >
212- < Typography className = { classes . cardLabel } > { labels . status } </ Typography >
211+ < div
212+ style = { {
213+ display : 'flex' ,
214+ flexDirection : 'row' ,
215+ justifyContent : 'flex-start' ,
216+ alignItems : 'stretch' ,
217+ } }
218+ >
219+ < Typography sx = { { fontWeight : 'bold' } } > { labels . status } </ Typography >
213220 { getStatusIcon ( true ) }
214221 </ div >
215222 ) ;
@@ -278,18 +285,27 @@ export const ScenarioNode = ({
278285
279286 const getScenarioCreationData = ( ) => {
280287 return [
281- < span data-cy = "scenario-owner-name" key = "scenario-owner-name" className = { classes . scenarioHeaderItem } >
288+ < span data-cy = "scenario-owner-name" key = "scenario-owner-name" style = { { marginRight : '24px' } } >
282289 { scenario . ownerName }
283290 </ span > ,
284- < span data-cy = "scenario-creation-date" key = "scenario-creation-date" className = { classes . scenarioHeaderItem } >
291+ < span data-cy = "scenario-creation-date" key = "scenario-creation-date" style = { { marginRight : '24px' } } >
285292 { new Date ( scenario . creationDate ) . toLocaleString ( ) }
286293 </ span > ,
287294 ] ;
288295 } ;
289296
290297 const getScenarioHeader = ( ) => {
291298 return (
292- < Box className = { classes . scenarioHeader } sx = { { flexGrow : 1 } } >
299+ < Box
300+ sx = { {
301+ flexGrow : 1 ,
302+ height : '100%' ,
303+ display : 'flex' ,
304+ flexDirection : 'row' ,
305+ justifyContent : 'flex-start' ,
306+ alignItems : 'center' ,
307+ } }
308+ >
293309 { isExpanded ? getScenarioCreationData ( ) : getScenarioDetailNameLine ( false ) }
294310 </ Box >
295311 ) ;
@@ -298,7 +314,13 @@ export const ScenarioNode = ({
298314 const getAccordionSummary = ( ) => {
299315 return (
300316 < AccordionSummary
301- className = { classes . accordionSummary }
317+ sx = { {
318+ height : `${ SHRUNK_NODE_HEIGHT } px !important` ,
319+ minHeight : `${ SHRUNK_NODE_HEIGHT } px !important` ,
320+ alignItems : 'center' ,
321+ '& .MuiAccordionSummary-expandIcon' : { color : ( theme ) => theme . palette . primary . main } ,
322+ '& .MuiAccordionSummary-content' : { alignItems : 'center' } ,
323+ } }
302324 expandIcon = { < ExpandMoreIcon data-cy = "expand-accordion-button" /> }
303325 component = "div"
304326 role = "button"
@@ -307,7 +329,7 @@ export const ScenarioNode = ({
307329 { showDeleteIcon && (
308330 < FadingTooltip title = { labels . delete || 'Delete file' } >
309331 < IconButton
310- className = { classes . scenarioDeleteButton }
332+ sx = { { color : ( theme ) => theme . palette . error . main } }
311333 data-cy = "scenario-delete-button"
312334 aria-label = "delete scenario"
313335 size = "small"
@@ -322,8 +344,25 @@ export const ScenarioNode = ({
322344 } ;
323345 const getAccordionDetails = ( ) => {
324346 return (
325- < AccordionDetails className = { classes . scenarioDetailsContainer } sx = { { gap : 1 } } >
326- < div className = { classes . scenarioDetailsNameLine } > { getScenarioDetailNameLine ( true ) } </ div >
347+ < AccordionDetails
348+ sx = { {
349+ gap : 1 ,
350+ height : '100%' ,
351+ display : 'flex' ,
352+ flexDirection : 'column' ,
353+ justifyContent : 'space-between' ,
354+ alignItems : 'stretch' ,
355+ } }
356+ >
357+ < div
358+ style = { {
359+ display : 'flex' ,
360+ flexDirection : 'row' ,
361+ alignItems : 'center' ,
362+ } }
363+ >
364+ { getScenarioDetailNameLine ( true ) }
365+ </ div >
327366 < DescriptionEditor
328367 labels = { labels . description }
329368 value = { scenario . description }
@@ -340,13 +379,13 @@ export const ScenarioNode = ({
340379 headerStyle = { { color : 'unset' , fontWeight : '700' } }
341380 />
342381 { getDetailedStatus ( ) }
343- < Typography className = { classes . cardLabel } > { labels . runTemplateLabel ?? 'Run type:' } </ Typography >
344- < Typography data-cy = "scenario-run-template" className = { classes . runTemplateName } >
382+ < Typography sx = { { fontWeight : 'bold' } } > { labels . runTemplateLabel ?? 'Run type:' } </ Typography >
383+ < Typography data-cy = "scenario-run-template" sx = { { marginLeft : '15px' } } >
345384 { scenario . runTemplateName }
346385 </ Typography >
347- < Typography className = { classes . cardLabel } > { labels . dataset } </ Typography >
386+ < Typography sx = { { fontWeight : 'bold' } } > { labels . dataset } </ Typography >
348387 < Typography >
349- < span data-cy = "scenario-datasets" className = { classes . datasets } >
388+ < span data-cy = "scenario-datasets" style = { { marginLeft : '15px' } } >
350389 { datasetNames }
351390 </ span >
352391 </ Typography >
@@ -357,16 +396,18 @@ export const ScenarioNode = ({
357396 const rootClass = isExpanded ? classes . rootExpandedScenarioContainer : classes . rootShrunkScenarioContainer ;
358397 return (
359398 < Paper key = { scenario . id } className = { rootClass } >
360- < ConfirmDeleteDialog
361- open = { isConfirmDialogOpen }
362- closeDialog = { closeConfirmDialog }
363- confirmDelete = { confirmScenarioDelete }
364- labels = { labels . deleteDialog }
365- > </ ConfirmDeleteDialog >
366- < Accordion data-cy = { 'scenario-accordion-' + scenario . id } expanded = { isExpanded } onChange = { handleAccordionExpand } >
367- { getAccordionSummary ( ) }
368- { isExpanded ? getAccordionDetails ( ) : null }
369- </ Accordion >
399+ < Root >
400+ < ConfirmDeleteDialog
401+ open = { isConfirmDialogOpen }
402+ closeDialog = { closeConfirmDialog }
403+ confirmDelete = { confirmScenarioDelete }
404+ labels = { labels . deleteDialog }
405+ > </ ConfirmDeleteDialog >
406+ < Accordion data-cy = { 'scenario-accordion-' + scenario . id } expanded = { isExpanded } onChange = { handleAccordionExpand } >
407+ { getAccordionSummary ( ) }
408+ { isExpanded ? getAccordionDetails ( ) : null }
409+ </ Accordion >
410+ </ Root >
370411 </ Paper >
371412 ) ;
372413} ;
0 commit comments