19434: fixed ripple shape, moved some inline styles to where they should be
[arvados.git] / src / views-components / process-runtime-status / process-runtime-status.tsx
index 3858e49e2372be08549f81816327138ffb09c046..4761e12f4c6a4b8f47aa95dad5afa59a618182ec 100644 (file)
@@ -7,6 +7,7 @@ import {
     ExpansionPanel,
     ExpansionPanelDetails,
     ExpansionPanelSummary,
+    Paper,
     StyleRulesCallback,
     Typography,
     withStyles,
@@ -26,7 +27,8 @@ type CssRules = 'root'
     | 'error'
     | 'errorColor'
     | 'warning'
-    | 'warningColor';
+    | 'warningColor'
+    | 'paperRoot';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     root: {
@@ -53,7 +55,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         whiteSpace: 'pre-line',
     },
     errorColor: {
-        color: theme.customs.colors.red900,
+        color: theme.customs.colors.grey700,
     },
     error: {
         backgroundColor: theme.customs.colors.red100,
@@ -63,17 +65,23 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         backgroundColor: theme.customs.colors.yellow100,
     },
     warningColor: {
-        color: theme.customs.colors.yellow900,
+        color: theme.customs.colors.grey700,
+    },
+    paperRoot: {
+        minHeight: theme.spacing.unit * 6,
+        display: 'flex',
+        alignItems: 'center',
     },
 });
 export interface ProcessRuntimeStatusDataProps {
     runtimeStatus: RuntimeStatus | undefined;
+    containerCount: number;
 }
 
 type ProcessRuntimeStatusProps = ProcessRuntimeStatusDataProps & WithStyles<CssRules>;
 
 export const ProcessRuntimeStatus = withStyles(styles)(
-    ({ runtimeStatus, classes }: ProcessRuntimeStatusProps) => {
+    ({ runtimeStatus, containerCount, classes }: ProcessRuntimeStatusProps) => {
     return <div className={classes.root}>
         { runtimeStatus?.error &&
         <div data-cy='process-runtime-status-error'><ExpansionPanel className={classes.error} elevation={0}>
@@ -103,5 +111,14 @@ export const ProcessRuntimeStatus = withStyles(styles)(
             </ExpansionPanelDetails>
         </ExpansionPanel></div>
         }
+        { containerCount > 1 &&
+        <div data-cy='process-runtime-status-retry-warning' >
+            <Paper className={classNames(classes.warning, classes.paperRoot)} elevation={0}>
+                <Typography className={classNames(classes.heading, classes.summary, classes.warningColor)}>
+                    {`Warning: Process retried ${containerCount - 1} time${containerCount > 2 ? 's' : ''} due to failure.`}
+                </Typography>
+            </Paper>
+        </div>
+        }
     </div>
-});
\ No newline at end of file
+});