Skip to content

Commit 93c6070

Browse files
Merge pull request #68 from REACT-DEVELOPER-IBROKHIM/feat/added-in-tank-functionality
Feat/added in tank functionality
2 parents 92464e6 + 144c227 commit 93c6070

File tree

8 files changed

+37
-14
lines changed

8 files changed

+37
-14
lines changed

Diff for: client/src/components/documents/adr/back/AdrCertificateBack.jsx

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22

3-
const AdrCertificateBack = ({ type }) => {
3+
const AdrCertificateBack = ({ type, tank }) => {
44
return (
55
<div
66
className={`w-[2480px] ${type !== "search" && "h-[3508px]"} flex justify-center`}
@@ -21,13 +21,17 @@ const AdrCertificateBack = ({ type }) => {
2121
</div>
2222
<div className="border-t-8 border-black w-full h-[630px] flex font-black text-[50px] text-left">
2323
<div className="w-[50%] h-full border-r-[3px] border-black px-[100px] flex flex-col gap-[10px] pt-[50px]">
24-
<p>2</p>
25-
<p>3</p>
26-
<p>4.1, 4.2, 4.3</p>
27-
<p>5.1, 5.2</p>
28-
<p>6.1, 6.2</p>
29-
<p>8</p>
30-
<p>9</p>
24+
{tank && (
25+
<>
26+
<p>2</p>
27+
<p>3</p>
28+
<p>4.1, 4.2, 4.3</p>
29+
<p>5.1, 5.2</p>
30+
<p>6.1, 6.2</p>
31+
<p>8</p>
32+
<p>9</p>
33+
</>
34+
)}
3135
</div>
3236
<div className="w-[50%] h-full border-l-[3px] border-black px-[100px] flex flex-col gap-[10px] pt-[50px]">
3337
<p>2</p>

Diff for: client/src/components/documents/adr/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const AdrCertificate = forwardRef(({ document, type }, ref) => {
88
return (
99
<div ref={ref}>
1010
<AdrCertificateFront type={type} document={document} ref={ref} />
11-
<AdrCertificateBack type={type} />
11+
<AdrCertificateBack type={type} tank={document?.tank} />
1212
<MiniCertificate
1313
document={document}
1414
type={type}

Diff for: client/src/routes/sub-routes/create/Create.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const Create = () => {
4242
birthDate: "",
4343
from: "",
4444
to: "",
45+
tank: false,
4546
},
4647
);
4748

Diff for: client/src/routes/sub-routes/create/form/index.jsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import { Form, Input } from "antd";
33
import dayjs from "dayjs";
4-
import { DatePicker } from "antd";
4+
import { DatePicker, Checkbox } from "antd";
55
import { DATE_FORMAT } from "@/constants/document";
66
import { setDataToLocalStorage } from "@/helpers/localStorageActions";
77

@@ -20,8 +20,6 @@ const CreateForm = ({ setDocument, document }) => {
2020
setDataToLocalStorage("document", { ...document, ...values });
2121
};
2222

23-
console.log(document);
24-
2523
return (
2624
<Form
2725
className="p-10"
@@ -168,6 +166,14 @@ const CreateForm = ({ setDocument, document }) => {
168166
/>
169167
</Item>
170168
</div>
169+
<Checkbox
170+
checked={document.tank}
171+
onChange={(e) =>
172+
handleValuesChange({ ...document, tank: e.target.checked })
173+
}
174+
>
175+
Sisterna
176+
</Checkbox>
171177
</Form>
172178
);
173179
};

Diff for: client/src/routes/sub-routes/edit/form/index.jsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import { Form, Input } from "antd";
33
import dayjs from "dayjs";
4-
import { DatePicker } from "antd";
4+
import { DatePicker, Checkbox } from "antd";
55
import { DATE_FORMAT } from "@/constants/document";
66
import { setDataToLocalStorage } from "@/helpers/localStorageActions";
77

@@ -204,6 +204,14 @@ const EditForm = ({ setDocument, document, form }) => {
204204
/>
205205
</Item>
206206
</div>
207+
<Checkbox
208+
checked={document.tank}
209+
onChange={(e) =>
210+
handleValuesChange({ ...document, tank: e.target.checked })
211+
}
212+
>
213+
Sisterna
214+
</Checkbox>
207215
</Form>
208216
);
209217
};

Diff for: client/src/routes/sub-routes/edit/index.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
ArrowLeftOutlined,
55
ArrowRightOutlined,
66
EditOutlined,
7-
EyeOutlined,
87
SaveOutlined,
98
} from "@ant-design/icons";
109
import EditForm from "./form";

Diff for: server/src/models/AdrCertificates.js

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ const Adr = new mongoose.Schema({
4242
type: Boolean,
4343
default: false,
4444
},
45+
tank: {
46+
type: Boolean,
47+
default: false,
48+
},
4549
})
4650

4751
const model = mongoose.model('Adr', Adr)

Diff for: server/src/routes/adrcertificates.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ certificate.post('/', verifyAdmin, async (req, res) => {
2424
birthDate: req.body.birthDate,
2525
from: req.body.from,
2626
to: req.body.to,
27+
tank: req.body.tank,
2728
})
2829
res.status(201).json(newCertificate)
2930
} catch (err) {

0 commit comments

Comments
 (0)