IO-749 Resolve error on displaying job with production note.

This commit is contained in:
Patrick Fic
2021-03-11 08:43:56 -07:00
parent df23eb0947
commit 373f215ffa

View File

@@ -9,13 +9,13 @@ import {
Text,
} from "native-base";
import React from "react";
import { useTranslation } from "react-i18next";
import { RefreshControl, StyleSheet } from "react-native";
import DataLabelComponent from "../data-label/data-label.component";
import { useTranslation } from "react-i18next";
export default function JobTombstone({ job, loading, refetch }) {
const { t } = useTranslation();
if (!!!job) {
if (!job) {
<Card>
<Text>Job is not defined.</Text>
</Card>;
@@ -41,11 +41,13 @@ export default function JobTombstone({ job, loading, refetch }) {
<Text>{t("objects.jobs.labels.inproduction")}</Text>
</CardItem>
)}
{job.inproduction && job.production_vars && job.production_vars.note && (
<CardItem bordered style={localStyles.inproduction}>
<Text>{job.production_vars.note}</Text>
</CardItem>
)}
{job.inproduction &&
job.production_vars &&
!!job.production_vars.note && (
<CardItem bordered style={localStyles.inproduction}>
<Text>{job.production_vars.note}</Text>
</CardItem>
)}
</Card>
<Card>
<CardItem bordered style={localStyles.status}>