Base functionality with SDK44.
This commit is contained in:
@@ -23,6 +23,7 @@ export function JobListComponent({ bodyshop }) {
|
||||
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open", "Open*"],
|
||||
},
|
||||
skip: !bodyshop,
|
||||
notifyOnNetworkStatusChange: true,
|
||||
});
|
||||
|
||||
const onRefresh = async () => {
|
||||
@@ -32,7 +33,6 @@ export function JobListComponent({ bodyshop }) {
|
||||
|
||||
if (loading) return <LoadingDisplay />;
|
||||
if (error) return <ErrorDisplay errorMessage={error.message} />;
|
||||
|
||||
if (data && data.jobs && data.jobs.length === 0)
|
||||
return (
|
||||
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
|
||||
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
} from "../../redux/user/user.selectors";
|
||||
import { formatBytes } from "../../util/document-upload.utility";
|
||||
import { handleLocalUpload } from "../../util/local-document-upload.utility";
|
||||
import Toast from "react-native-toast-message";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
currentUser: selectCurrentUser,
|
||||
@@ -103,8 +104,13 @@ export function UploadProgress({
|
||||
},
|
||||
}));
|
||||
}
|
||||
function handleOnError(id) {
|
||||
function handleOnError(id, error) {
|
||||
logImEXEvent("imexmobile_upload_documents_error");
|
||||
Toast.show({
|
||||
type: "error",
|
||||
text1: "Unable to upload documents.",
|
||||
text2: (error && error.message) || JSON.stringify(error),
|
||||
});
|
||||
setProgress((progress) => ({
|
||||
...progress,
|
||||
action: t("mediabrowser.labels.converting"),
|
||||
@@ -191,7 +197,7 @@ export function UploadProgress({
|
||||
ev: {
|
||||
filename,
|
||||
mediaId: p.id,
|
||||
onError: () => handleOnError(p.id),
|
||||
onError: (error) => handleOnError(p.id, error),
|
||||
onProgress: ({ percent, loaded }) =>
|
||||
handleOnProgress(p.id, percent, loaded),
|
||||
onSuccess: () => handleOnSuccess(p.id, p),
|
||||
|
||||
@@ -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") },
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user