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