BOD-17 Creation of new contract page
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import React from "react";
|
||||
import ContractFormComponent from "../../components/contract-form/contract-form.component";
|
||||
|
||||
export default function ContractCreatePageComponent() {
|
||||
return (
|
||||
<div>
|
||||
<ContractFormComponent />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import React, { useEffect } from "react";
|
||||
|
||||
import ContractCreatePageComponent from "./contract-create.page.component";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import { Form, notification } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop
|
||||
});
|
||||
|
||||
export function ContractCreatePageContainer({ bodyshop }) {
|
||||
const [form] = Form.useForm();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleFinish = values => {
|
||||
// insertCourtesyCar({
|
||||
// variables: { courtesycar: { ...values, bodyshopid: bodyshop.id } }
|
||||
// })
|
||||
// .then(response => {
|
||||
notification["success"]({ message: t("courtesycars.successes.saved") });
|
||||
// })
|
||||
// .catch(error => console.log("error", error));
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
document.title = t("titles.contracts-create");
|
||||
}, [t]);
|
||||
|
||||
return (
|
||||
<Form form={form} autoComplete="no" onFinish={handleFinish}>
|
||||
<ContractCreatePageComponent />
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
export default connect(mapStateToProps, null)(ContractCreatePageContainer);
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import CourtesyCarCreateFormComponent from "../../components/courtesy-car-form/courtesy-car-form.component"
|
||||
import CourtesyCarFormComponent from "../../components/courtesy-car-form/courtesy-car-form.component"
|
||||
|
||||
export default function CourtesyCarCreateComponent() {
|
||||
return <CourtesyCarCreateFormComponent />;
|
||||
return <CourtesyCarFormComponent />;
|
||||
}
|
||||
|
||||
@@ -55,6 +55,9 @@ const CourtesyCarDetailContainer = lazy(() =>
|
||||
const CourtesyCarsPage = lazy(() =>
|
||||
import("../courtesy-cars/courtesy-cars.page.container")
|
||||
);
|
||||
const ContractCreatePage = lazy(() =>
|
||||
import("../contract-create/contract-create.page.container")
|
||||
);
|
||||
|
||||
const { Header, Content, Footer } = Layout;
|
||||
|
||||
@@ -117,7 +120,7 @@ export default function Manage({ match }) {
|
||||
<Route
|
||||
exact
|
||||
path={`${match.path}/courtesycars/contracts/new`}
|
||||
component={() => <div>new cc contract</div>}
|
||||
component={ContractCreatePage}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
|
||||
Reference in New Issue
Block a user