Base functionality with SDK44.

This commit is contained in:
Patrick Fic
2022-05-10 18:28:14 -07:00
parent a6d98f734e
commit 717b75a1b8
13 changed files with 4382 additions and 3632 deletions

View File

@@ -10,8 +10,18 @@ import JobLines from "../job-lines/job-lines.component";
import JobNotes from "../job-notes/job-notes.component";
import JobTombstone from "../job-tombstone/job-tombstone.component";
import LoadingDisplay from "../loading-display/loading-display.component";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
});
export default connect(mapStateToProps, mapDispatchToProps)(ScreenJobDetail);
export default function ScreenJobDetail({ route }) {
export function ScreenJobDetail({ bodyshop, route }) {
const {
params: { jobId },
} = route;
@@ -45,12 +55,16 @@ export default function ScreenJobDetail({ route }) {
loading: loading,
refetch: refetch,
}),
documents: () =>
JobDocuments({
job: data.jobs_by_pk,
loading: loading,
refetch: refetch,
}),
...(bodyshop.uselocalmediaserver
? {}
: {
documents: () =>
JobDocuments({
job: data.jobs_by_pk,
loading: loading,
refetch: refetch,
}),
}),
notes: () =>
JobNotes({
job: data.jobs_by_pk,
@@ -63,7 +77,9 @@ export default function ScreenJobDetail({ route }) {
const [routes] = React.useState([
{ key: "job", title: t("jobdetail.labels.job") },
{ key: "lines", title: t("jobdetail.labels.lines") },
{ key: "documents", title: t("jobdetail.labels.documents") },
...(bodyshop.uselocalmediaserver
? []
: [{ key: "documents", title: t("jobdetail.labels.documents") }]),
{ key: "notes", title: t("jobdetail.labels.notes") },
]);