Minor adjustments and fixes
This commit is contained in:
@@ -1283,6 +1283,48 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>loadingshop</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>loggingin</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>na</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import i18next from "i18next";
|
||||
import React, { lazy, Suspense, useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -33,7 +34,7 @@ export default connect(
|
||||
checkUserSession();
|
||||
return () => {};
|
||||
}, [checkUserSession]);
|
||||
|
||||
const { t } = useTranslation();
|
||||
if (currentUser && currentUser.language)
|
||||
i18next.changeLanguage(currentUser.language, (err, t) => {
|
||||
if (err)
|
||||
@@ -41,8 +42,7 @@ export default connect(
|
||||
});
|
||||
|
||||
if (currentUser.authorized === null) {
|
||||
//TODO: Translate this.
|
||||
return <LoadingSpinner message="Waiting for Current Auth to persist." />;
|
||||
return <LoadingSpinner message={t("general.labels.loggingin")} />;
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -50,15 +50,15 @@ export default connect(
|
||||
<Switch>
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<LoadingSpinner />}>
|
||||
<Route exact path="/" component={LandingPage} />
|
||||
<Route exact path="/unauthorized" component={Unauthorized} />
|
||||
<Route exact path='/' component={LandingPage} />
|
||||
<Route exact path='/unauthorized' component={Unauthorized} />
|
||||
|
||||
<Route exact path="/signin" component={SignInPage} />
|
||||
<Route exact path='/signin' component={SignInPage} />
|
||||
|
||||
<PrivateRoute
|
||||
//isAuthorized={HookCurrentUser.data.currentUser ? true : false}
|
||||
isAuthorized={currentUser.authorized}
|
||||
path="/manage"
|
||||
path='/manage'
|
||||
component={ManagePage}
|
||||
/>
|
||||
</Suspense>
|
||||
|
||||
@@ -43,7 +43,7 @@ export default connect(
|
||||
|
||||
const tombstoneTitle = (
|
||||
<div>
|
||||
<Avatar size="large" alt="Vehicle Image" src={CarImage} />
|
||||
<Avatar size='large' alt='Vehicle Image' src={CarImage} />
|
||||
{`${t("jobs.fields.ro_number")} ${
|
||||
job.ro_number ? job.ro_number : t("general.labels.na")
|
||||
}`}
|
||||
@@ -54,8 +54,7 @@ export default connect(
|
||||
<Menu
|
||||
onClick={e => {
|
||||
updateJobStatus(e.key);
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
{bodyshop.md_ro_statuses.statuses.map(item => (
|
||||
<Menu.Item key={item}>{item}</Menu.Item>
|
||||
))}
|
||||
@@ -63,24 +62,23 @@ export default connect(
|
||||
);
|
||||
|
||||
const menuExtra = [
|
||||
<Dropdown overlay={statusmenu} key="changestatus">
|
||||
<Dropdown overlay={statusmenu} key='changestatus'>
|
||||
<Button>
|
||||
{t("jobs.actions.changestatus")} <Icon type="down" />
|
||||
{t("jobs.actions.changestatus")} <Icon type='down' />
|
||||
</Button>
|
||||
</Dropdown>,
|
||||
<Badge key="schedule" count={job.appointments_aggregate.aggregate.count}>
|
||||
<Badge key='schedule' count={job.appointments_aggregate.aggregate.count}>
|
||||
<Button
|
||||
//TODO: Enabled logic based on status.
|
||||
onClick={() => {
|
||||
setscheduleModalVisible(true);
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
{t("jobs.actions.schedule")}
|
||||
</Button>
|
||||
</Badge>,
|
||||
<Button
|
||||
key="convert"
|
||||
type="dashed"
|
||||
key='convert'
|
||||
type='dashed'
|
||||
disabled={job.converted}
|
||||
onClick={() => {
|
||||
mutationConvertJob({
|
||||
@@ -92,16 +90,14 @@ export default connect(
|
||||
message: t("jobs.successes.converted")
|
||||
});
|
||||
});
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
{t("jobs.actions.convert")}
|
||||
</Button>,
|
||||
<Button
|
||||
type="primary"
|
||||
key="submit"
|
||||
htmlType="button"
|
||||
onClick={handleSubmit}
|
||||
>
|
||||
type='primary'
|
||||
key='submit'
|
||||
htmlType='button'
|
||||
onClick={handleSubmit}>
|
||||
{t("general.labels.save")}
|
||||
</Button>
|
||||
];
|
||||
@@ -114,9 +110,9 @@ export default connect(
|
||||
title={tombstoneTitle}
|
||||
//subTitle={tombstoneSubtitle}
|
||||
tags={
|
||||
<span key="job-status">
|
||||
{job.status ? <Tag color="blue">{job.status}</Tag> : null}
|
||||
<Tag color="red">
|
||||
<span key='job-status'>
|
||||
{job.status ? <Tag color='blue'>{job.status}</Tag> : null}
|
||||
<Tag color='red'>
|
||||
{job.owner ? (
|
||||
<Link to={`/manage/owners/${job.owner.id}`}>
|
||||
{`${job.ownr_co_nm || ""}${job.ownr_fn || ""} ${job.ownr_ln ||
|
||||
@@ -126,7 +122,7 @@ export default connect(
|
||||
t("jobs.errors.noowner")
|
||||
)}
|
||||
</Tag>
|
||||
<Tag color="green">
|
||||
<Tag color='green'>
|
||||
{job.vehicle ? (
|
||||
<Link to={`/manage/vehicles/${job.vehicle.id}`}>
|
||||
{job.vehicle.v_model_yr || t("general.labels.na")}{" "}
|
||||
@@ -140,11 +136,10 @@ export default connect(
|
||||
<BarcodePopup value={job.id} />
|
||||
</span>
|
||||
}
|
||||
extra={menuExtra}
|
||||
>
|
||||
<Descriptions size="small" column={5}>
|
||||
extra={menuExtra}>
|
||||
<Descriptions size='small' column={5}>
|
||||
<Descriptions.Item label={t("jobs.fields.repairtotal")}>
|
||||
<CurrencyFormatter>{job.claim_total}</CurrencyFormatter>
|
||||
<CurrencyFormatter>{job.clm_total}</CurrencyFormatter>
|
||||
</Descriptions.Item>
|
||||
|
||||
<Descriptions.Item label={t("jobs.fields.customerowing")}>
|
||||
@@ -157,7 +152,7 @@ export default connect(
|
||||
|
||||
<Descriptions.Item label={t("jobs.fields.scheduled_completion")}>
|
||||
{job.scheduled_completion ? (
|
||||
<Moment format="MM/DD/YYYY">{job.scheduled_completion}</Moment>
|
||||
<Moment format='MM/DD/YYYY'>{job.scheduled_completion}</Moment>
|
||||
) : null}
|
||||
</Descriptions.Item>
|
||||
|
||||
|
||||
@@ -33,13 +33,14 @@ const errorLink = onError(
|
||||
console.log("Got the new token.", token);
|
||||
window.localStorage.setItem("token", token);
|
||||
|
||||
// const oldHeaders = operation.getContext().headers;
|
||||
// operation.setContext({
|
||||
// headers: {
|
||||
// ...oldHeaders,
|
||||
// authorization: token ? `Bearer ${token}` : ""
|
||||
// }
|
||||
// });
|
||||
const oldHeaders = operation.getContext().headers;
|
||||
operation.setContext({
|
||||
headers: {
|
||||
...oldHeaders,
|
||||
authorization: token ? `Bearer ${token}` : ""
|
||||
}
|
||||
});
|
||||
console.log(operation.getContext());
|
||||
// console.log("forward", forward);
|
||||
// console.log("operation", operation);
|
||||
return forward(operation);
|
||||
|
||||
@@ -44,7 +44,6 @@ export const QUERY_ALL_OPEN_JOBS = gql`
|
||||
scheduled_delivery
|
||||
status
|
||||
updated_at
|
||||
clm_total
|
||||
ded_amt
|
||||
vehicle {
|
||||
id
|
||||
@@ -108,6 +107,7 @@ export const GET_JOB_BY_PK = gql`
|
||||
converted
|
||||
est_number
|
||||
ro_number
|
||||
clm_total
|
||||
vehicle {
|
||||
id
|
||||
plate_no
|
||||
|
||||
@@ -36,8 +36,7 @@ function JobsDetailPageContainer({ match, form }) {
|
||||
refetch();
|
||||
})
|
||||
.catch(error => {
|
||||
//TODO Error handling.
|
||||
console.log("error", error);
|
||||
notification[error]({ message: t("jobs.errors.saving") });
|
||||
});
|
||||
};
|
||||
|
||||
@@ -70,7 +69,6 @@ function JobsDetailPageContainer({ match, form }) {
|
||||
notification["success"]({
|
||||
message: t("jobs.successes.savetitle")
|
||||
});
|
||||
//TODO: Better way to reset the field decorators?
|
||||
refetch().then(r => form.resetFields());
|
||||
});
|
||||
}
|
||||
@@ -78,7 +76,7 @@ function JobsDetailPageContainer({ match, form }) {
|
||||
};
|
||||
|
||||
if (loading) return <SpinComponent />;
|
||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||
if (error) return <AlertComponent message={error.message} type='error' />;
|
||||
|
||||
return data.jobs_by_pk ? (
|
||||
<JobDetailFormContext.Provider value={form}>
|
||||
@@ -94,7 +92,7 @@ function JobsDetailPageContainer({ match, form }) {
|
||||
/>
|
||||
</JobDetailFormContext.Provider>
|
||||
) : (
|
||||
<AlertComponent message={t("jobs.errors.noaccess")} type="error" />
|
||||
<AlertComponent message={t("jobs.errors.noaccess")} type='error' />
|
||||
);
|
||||
}
|
||||
export default Form.create({ name: "JobsDetailPageContainer" })(
|
||||
|
||||
@@ -7,7 +7,10 @@ import { createStructuredSelector } from "reselect";
|
||||
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
|
||||
import { QUERY_BODYSHOP } from "../../graphql/bodyshop.queries";
|
||||
import { setBodyshop } from "../../redux/user/user.actions";
|
||||
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||
import {
|
||||
selectBodyshop,
|
||||
selectCurrentUser
|
||||
} from "../../redux/user/user.selectors";
|
||||
import ManagePage from "./manage.page";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
@@ -33,12 +36,10 @@ export default connect(
|
||||
|
||||
useEffect(() => {
|
||||
if (data) setBodyshop(data.bodyshops[0]);
|
||||
return () => {
|
||||
//
|
||||
};
|
||||
return () => {};
|
||||
}, [data, setBodyshop]);
|
||||
|
||||
//TODO Translate later.
|
||||
if (!bodyshop) return <LoadingSpinner message="Loading bodyshop data." />;
|
||||
if (!bodyshop)
|
||||
return <LoadingSpinner message={t("general.labels.loadingshop")} />;
|
||||
return <ManagePage match={match} />;
|
||||
});
|
||||
|
||||
@@ -106,6 +106,8 @@
|
||||
"in": "In",
|
||||
"loading": "Loading...",
|
||||
"loadingapp": "Loading Bodyshop.app",
|
||||
"loadingshop": "Loading shop data...",
|
||||
"loggingin": "Logging you in...",
|
||||
"na": "N/A",
|
||||
"out": "Out",
|
||||
"save": "Save",
|
||||
|
||||
@@ -106,6 +106,8 @@
|
||||
"in": "en",
|
||||
"loading": "Cargando...",
|
||||
"loadingapp": "Cargando Bodyshop.app",
|
||||
"loadingshop": "Cargando datos de la tienda ...",
|
||||
"loggingin": "Iniciando sesión ...",
|
||||
"na": "N / A",
|
||||
"out": "Afuera",
|
||||
"save": "Salvar",
|
||||
|
||||
@@ -106,6 +106,8 @@
|
||||
"in": "dans",
|
||||
"loading": "Chargement...",
|
||||
"loadingapp": "Chargement de Bodyshop.app",
|
||||
"loadingshop": "Chargement des données de la boutique ...",
|
||||
"loggingin": "Vous connecter ...",
|
||||
"na": "N / A",
|
||||
"out": "En dehors",
|
||||
"save": "sauvegarder",
|
||||
|
||||
Reference in New Issue
Block a user