IO-2035 LMS Media.

This commit is contained in:
Patrick Fic
2022-08-30 12:26:22 -07:00
parent 64a31dc544
commit e25172f0bf
8 changed files with 1185 additions and 830 deletions

View File

@@ -13,6 +13,7 @@ import LoadingDisplay from "../loading-display/loading-display.component";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import JobDocumentsLocalComponent from "../job-documents/job-documents-local.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
@@ -55,16 +56,21 @@ export function ScreenJobDetail({ bodyshop, route }) {
loading: loading,
refetch: refetch,
}),
...(bodyshop.uselocalmediaserver
? {}
: {
documents: () =>
JobDocuments({
job: data.jobs_by_pk,
loading: loading,
refetch: refetch,
}),
}),
documents: () => {
return bodyshop.uselocalmediaserver
? JobDocumentsLocalComponent({
job: data.jobs_by_pk,
bodyshop: bodyshop,
})
: JobDocuments({
job: data.jobs_by_pk,
loading: loading,
refetch: refetch,
});
},
notes: () =>
JobNotes({
job: data.jobs_by_pk,
@@ -77,9 +83,7 @@ export function ScreenJobDetail({ bodyshop, route }) {
const [routes] = React.useState([
{ key: "job", title: t("jobdetail.labels.job") },
{ key: "lines", title: t("jobdetail.labels.lines") },
...(bodyshop.uselocalmediaserver
? []
: [{ key: "documents", title: t("jobdetail.labels.documents") }]),
{ key: "documents", title: t("jobdetail.labels.documents") },
{ key: "notes", title: t("jobdetail.labels.notes") },
]);