18881: Fixes the "non-status" indication on objects that aren't processes. 18881-process-runtime-status
authorLucas Di Pentima <lucas.dipentima@curii.com>
Tue, 12 Apr 2022 18:51:29 +0000 (15:51 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Tue, 12 Apr 2022 18:51:29 +0000 (15:51 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

src/views-components/data-explorer/renderers.tsx

index fe1bd07cc52effa2f57fb74af390824dab422a74..cd9f972e249a32e6111bc17de17fab8b8c7e0b45 100644 (file)
@@ -833,19 +833,21 @@ export const ProcessStatus = compose(
         return { process: getProcess(props.uuid)(state.resources) };
     }),
     withStyles({}, { withTheme: true }))
-    ((props: { process?: Process, theme: ArvadosTheme }) => {
-        const status = props.process ? getProcessStatus(props.process) : "-";
-        return <Chip label={status}
+    ((props: { process?: Process, theme: ArvadosTheme }) =>
+        props.process
+        ? <Chip label={getProcessStatus(props.process)}
             style={{
                 height: props.theme.spacing.unit * 3,
                 width: props.theme.spacing.unit * 12,
-                backgroundColor: getProcessStatusColor(status, props.theme),
+                backgroundColor: getProcessStatusColor(
+                    getProcessStatus(props.process), props.theme),
                 color: props.theme.palette.common.white,
                 fontSize: '0.875rem',
                 borderRadius: props.theme.spacing.unit * 0.625,
             }}
-        />;
-    });
+        />
+        : <Typography>-</Typography>
+    );
 
 export const ProcessStartDate = connect(
     (state: RootState, props: { uuid: string }) => {