@banch0u/core-project-test-repository 2.3.17 → 2.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Input/index.module.scss +1 -0
- package/dist/components/Table/index.module.scss +76 -76
- package/dist/components/VendorCategoryTreeSelect/index.js +49 -0
- package/dist/components/VendorCategoryTreeSelect/index.module.scss +13 -0
- package/dist/helpers/enums.js +7 -0
- package/dist/layout/QuestionnairesSidebar/index.js +10 -2
- package/dist/pages/Questionnnaires/QuestionnairesAttestationsContent/constant.js +68 -0
- package/dist/pages/Questionnnaires/QuestionnairesAttestationsContent/index.js +284 -0
- package/dist/pages/Questionnnaires/QuestionnairesWorkModesContent/constant.js +5 -0
- package/dist/pages/Questionnnaires/QuestionnairesWorkModesContent/index.js +15 -6
- package/dist/routes/QuestionnaireRoutes.js +7 -1
- package/dist/store/slices/global/index.js +186 -180
- package/dist/store/slices/questionnaire/index.js +562 -353
- package/dist/store/slices/questionnaire/service.js +128 -0
- package/dist/tools/questionnaireGenerator.js +3 -3
- package/dist/utils/path.js +4 -0
- package/package.json +69 -69
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
.table_container {
|
|
2
|
-
table {
|
|
3
|
-
tr {
|
|
4
|
-
th:first-child {
|
|
5
|
-
font-family: Inter !important;
|
|
6
|
-
font-size: 18px !important;
|
|
7
|
-
font-weight: 400 !important;
|
|
8
|
-
line-height: 21.78px !important;
|
|
9
|
-
text-align: center !important;
|
|
10
|
-
color: #000000 !important;
|
|
11
|
-
}
|
|
12
|
-
th {
|
|
13
|
-
background: #fff !important;
|
|
14
|
-
text-align: center !important;
|
|
15
|
-
|
|
16
|
-
padding: 5px !important;
|
|
17
|
-
font-family: Inter !important;
|
|
18
|
-
font-size: 16px !important;
|
|
19
|
-
font-weight: 400 !important;
|
|
20
|
-
line-height: 19.36px !important;
|
|
21
|
-
|
|
22
|
-
border-color: #bebebe !important;
|
|
23
|
-
border-top: 1px solid #bebebe !important;
|
|
24
|
-
border-start-start-radius: 0px !important;
|
|
25
|
-
border-start-end-radius: 0px !important;
|
|
26
|
-
color: #646464 !important;
|
|
27
|
-
}
|
|
28
|
-
td {
|
|
29
|
-
padding: 0px !important;
|
|
30
|
-
font-size: 16px !important;
|
|
31
|
-
font-weight: 400 !important;
|
|
32
|
-
line-height: 24px !important;
|
|
33
|
-
text-align: center !important;
|
|
34
|
-
border-color: #fff !important;
|
|
35
|
-
color: #343434 !important;
|
|
36
|
-
}
|
|
37
|
-
// th:first-child {
|
|
38
|
-
// border-right: 1px solid #BEBEBE !important;
|
|
39
|
-
// }
|
|
40
|
-
// td:first-child {
|
|
41
|
-
// border-right: 1px solid #BEBEBE !important;
|
|
42
|
-
// }
|
|
43
|
-
|
|
44
|
-
// th:last-child {
|
|
45
|
-
// border-right: none !important;
|
|
46
|
-
// }
|
|
47
|
-
}
|
|
48
|
-
tr:first-child {
|
|
49
|
-
td {
|
|
50
|
-
padding: 0 !important;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// @media screen and (max-width: 1537px) {
|
|
55
|
-
// table {
|
|
56
|
-
// tr {
|
|
57
|
-
// th {
|
|
58
|
-
// font-size: 12px !important;
|
|
59
|
-
// font-weight: 600 !important;
|
|
60
|
-
// line-height: 18px !important;
|
|
61
|
-
// }
|
|
62
|
-
// td {
|
|
63
|
-
// font-size: 12px !important;
|
|
64
|
-
// font-weight: 500 !important;
|
|
65
|
-
// line-height: 18px !important;
|
|
66
|
-
// text-align: center;
|
|
67
|
-
// }
|
|
68
|
-
// }
|
|
69
|
-
// }
|
|
70
|
-
// }
|
|
71
|
-
}
|
|
72
|
-
.draggableHeader {
|
|
73
|
-
background: #fff;
|
|
74
|
-
z-index: 2;
|
|
75
|
-
white-space: nowrap;
|
|
76
|
-
}
|
|
1
|
+
.table_container {
|
|
2
|
+
table {
|
|
3
|
+
tr {
|
|
4
|
+
th:first-child {
|
|
5
|
+
font-family: Inter !important;
|
|
6
|
+
font-size: 18px !important;
|
|
7
|
+
font-weight: 400 !important;
|
|
8
|
+
line-height: 21.78px !important;
|
|
9
|
+
text-align: center !important;
|
|
10
|
+
color: #000000 !important;
|
|
11
|
+
}
|
|
12
|
+
th {
|
|
13
|
+
background: #fff !important;
|
|
14
|
+
text-align: center !important;
|
|
15
|
+
|
|
16
|
+
padding: 5px !important;
|
|
17
|
+
font-family: Inter !important;
|
|
18
|
+
font-size: 16px !important;
|
|
19
|
+
font-weight: 400 !important;
|
|
20
|
+
line-height: 19.36px !important;
|
|
21
|
+
|
|
22
|
+
border-color: #bebebe !important;
|
|
23
|
+
border-top: 1px solid #bebebe !important;
|
|
24
|
+
border-start-start-radius: 0px !important;
|
|
25
|
+
border-start-end-radius: 0px !important;
|
|
26
|
+
color: #646464 !important;
|
|
27
|
+
}
|
|
28
|
+
td {
|
|
29
|
+
padding: 0px !important;
|
|
30
|
+
font-size: 16px !important;
|
|
31
|
+
font-weight: 400 !important;
|
|
32
|
+
line-height: 24px !important;
|
|
33
|
+
text-align: center !important;
|
|
34
|
+
border-color: #fff !important;
|
|
35
|
+
color: #343434 !important;
|
|
36
|
+
}
|
|
37
|
+
// th:first-child {
|
|
38
|
+
// border-right: 1px solid #BEBEBE !important;
|
|
39
|
+
// }
|
|
40
|
+
// td:first-child {
|
|
41
|
+
// border-right: 1px solid #BEBEBE !important;
|
|
42
|
+
// }
|
|
43
|
+
|
|
44
|
+
// th:last-child {
|
|
45
|
+
// border-right: none !important;
|
|
46
|
+
// }
|
|
47
|
+
}
|
|
48
|
+
tr:first-child {
|
|
49
|
+
td {
|
|
50
|
+
padding: 0 !important;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// @media screen and (max-width: 1537px) {
|
|
55
|
+
// table {
|
|
56
|
+
// tr {
|
|
57
|
+
// th {
|
|
58
|
+
// font-size: 12px !important;
|
|
59
|
+
// font-weight: 600 !important;
|
|
60
|
+
// line-height: 18px !important;
|
|
61
|
+
// }
|
|
62
|
+
// td {
|
|
63
|
+
// font-size: 12px !important;
|
|
64
|
+
// font-weight: 500 !important;
|
|
65
|
+
// line-height: 18px !important;
|
|
66
|
+
// text-align: center;
|
|
67
|
+
// }
|
|
68
|
+
// }
|
|
69
|
+
// }
|
|
70
|
+
// }
|
|
71
|
+
}
|
|
72
|
+
.draggableHeader {
|
|
73
|
+
background: #fff;
|
|
74
|
+
z-index: 2;
|
|
75
|
+
white-space: nowrap;
|
|
76
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["value", "onChange"];
|
|
4
|
+
import React, { useEffect } from "react";
|
|
5
|
+
import { TreeSelect } from "antd";
|
|
6
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
7
|
+
import { getVendorCategoriesAll } from "../../store/slices/questionnaire";
|
|
8
|
+
import style from "./index.module.scss";
|
|
9
|
+
var _mapCategoriesToTree = function mapCategoriesToTree() {
|
|
10
|
+
var nodes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
11
|
+
return nodes.map(function (node) {
|
|
12
|
+
var _node$children;
|
|
13
|
+
return {
|
|
14
|
+
title: node.name,
|
|
15
|
+
value: node.id,
|
|
16
|
+
children: (_node$children = node.children) !== null && _node$children !== void 0 && _node$children.length ? _mapCategoriesToTree(node.children) : []
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
var VendorCategoryTreeSelect = function VendorCategoryTreeSelect(_ref) {
|
|
21
|
+
var value = _ref.value,
|
|
22
|
+
onChange = _ref.onChange,
|
|
23
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
var dispatch = useDispatch();
|
|
25
|
+
var vendorCategoriesAll = useSelector(function (state) {
|
|
26
|
+
return state.questionnaire.vendorCategoriesAll;
|
|
27
|
+
});
|
|
28
|
+
useEffect(function () {
|
|
29
|
+
if (!(vendorCategoriesAll !== null && vendorCategoriesAll !== void 0 && vendorCategoriesAll.length)) {
|
|
30
|
+
dispatch(getVendorCategoriesAll("onlyactive"));
|
|
31
|
+
}
|
|
32
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
33
|
+
|
|
34
|
+
return /*#__PURE__*/React.createElement(TreeSelect, _extends({
|
|
35
|
+
value: value,
|
|
36
|
+
onChange: onChange,
|
|
37
|
+
treeData: _mapCategoriesToTree(vendorCategoriesAll !== null && vendorCategoriesAll !== void 0 ? vendorCategoriesAll : []),
|
|
38
|
+
showSearch: true,
|
|
39
|
+
allowClear: true,
|
|
40
|
+
treeNodeFilterProp: "title",
|
|
41
|
+
placeholder: "",
|
|
42
|
+
style: {
|
|
43
|
+
width: "100%",
|
|
44
|
+
height: 42
|
|
45
|
+
},
|
|
46
|
+
className: style.treeSelect
|
|
47
|
+
}, rest));
|
|
48
|
+
};
|
|
49
|
+
export default VendorCategoryTreeSelect;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.treeSelect > div {
|
|
2
|
+
padding: 5px 16px !important;
|
|
3
|
+
border-radius: 6px !important;
|
|
4
|
+
}
|
|
5
|
+
.treeSelect {
|
|
6
|
+
width: 100%;
|
|
7
|
+
span {
|
|
8
|
+
font-size: 16px !important;
|
|
9
|
+
font-weight: 500 !important;
|
|
10
|
+
line-height: 24px !important;
|
|
11
|
+
text-align: left !important;
|
|
12
|
+
}
|
|
13
|
+
}
|
package/dist/helpers/enums.js
CHANGED
|
@@ -5,7 +5,7 @@ import style from "./index.module.scss";
|
|
|
5
5
|
import { Layout, Menu, Input } from "antd";
|
|
6
6
|
import { QUESTIONNAIRES_ACADEMIC_DEGREES, QUESTIONNAIRES_APPLICATION_FORMS, QUESTIONNAIRES_AREAS, QUESTIONNAIRES_BRANDS, QUESTIONNAIRES_CATEGORIES, QUESTIONNAIRES_CHASSIS_TYPES, QUESTIONNAIRES_CHEMICALS, QUESTIONNAIRES_COLORS, QUESTIONNAIRES_COMPANIES, QUESTIONNAIRES_CONTRACTCURRENCIES, QUESTIONNAIRES_CONTRACTTYPES, QUESTIONNAIRES_CONTRAGENTTYPES, QUESTIONNAIRES_COUNTRIES, QUESTIONNAIRES_CRUSH_REASONS, QUESTIONNAIRES_DETAIL_PARTS, QUESTIONNAIRES_DISABILITY_STATUSES, QUESTIONNAIRES_DOCUMENT_RECIEVE_METHODS, QUESTIONNAIRES_DOCUMENT_TYPES, QUESTIONNAIRES_DOCUMENT_WHOM, QUESTIONNAIRES_DRIVING_CATEGORIES, QUESTIONNAIRES_EDUCATION_INSTITUTIONS, QUESTIONNAIRES_EDUCATION_LEVELS, QUESTIONNAIRES_EDUCATION_PAYMENTS, QUESTIONNAIRES_EMPLOYEE_CONFIGURATIONS, QUESTIONNAIRES_ENGINE_TYPES, QUESTIONNAIRES_EXECUTION_RULES, QUESTIONNAIRES_EXTRA_SERVICES, QUESTIONNAIRES_FUEL_TYPES, QUESTIONNAIRES_GEARBOX_TYPES, QUESTIONNAIRES_GENERAL_STRUCTURE_STATUSES, QUESTIONNAIRES_GENERAL_STRUCTURE_TYPES, QUESTIONNAIRES_HALLS, QUESTIONNAIRES_HONORARY_TITLES, QUESTIONNAIRES_INSURANCE_TYPES, QUESTIONNAIRES_ISSUED_AUTHORITIES, QUESTIONNAIRES_MARGIN_NOTE_TEXTS, QUESTIONNAIRES_MEASUREMENT_TYPES, QUESTIONNAIRES_MILITARY_CATEGORIES, QUESTIONNAIRES_MILITARY_GROUPS, QUESTIONNAIRES_MILITARY_RANKS, QUESTIONNAIRES_MILITARY_STAFFS, QUESTIONNAIRES_MODELS, QUESTIONNAIRES_OIL_FIELDS, QUESTIONNAIRES_ORDERS, QUESTIONNAIRES_ORGANIZATIONS, QUESTIONNAIRES_OWNERSHIP_TYPES, QUESTIONNAIRES_PENALTY_TYPES, QUESTIONNAIRES_POSITIONS, QUESTIONNAIRES_REPAIR_TYPES, QUESTIONNAIRES_REPAIRMENT_WORK_TYPES,
|
|
7
7
|
// QUESTIONNAIRES_REGIONS,
|
|
8
|
-
QUESTIONNAIRES_REPRIMAND_TYPES, QUESTIONNAIRES_SPECIAL_DAYS, QUESTIONNAIRES_SPECIALIZATIONS, QUESTIONNAIRES_STRUCTURES, QUESTIONNAIRES_SUBTOPIC, QUESTIONNAIRES_TOPIC, QUESTIONNAIRES_TRANSMITTER_TYPES, QUESTIONNAIRES_VEHICLE_CATEGORIES, QUESTIONNAIRES_VEHICLE_GROUPS, QUESTIONNAIRES_VEHICLE_TYPES, QUESTIONNAIRES_WAR_PARTICIPANTS, QUESTIONNAIRES_WORK_MODES, QUESTIONNAIRES_WORK_SCHEDULES, QUESTIONNAIRES_OWNERS, QUESTIONNAIRES_CONTRACTTOPICS, QUESTIONNAIRES_CONTRACTTYPESSUBTYPES, QUESTIONNAIRES_DEFAULTAGREEMENTPLANS, QUESTIONNAIRES_ROUTELOCATIONS, QUESTIONNAIRES_INTERNALSTRUCTURE, QUESTIONNAIRES_FIELD, QUESTIONNAIRES_WELL, QUESTIONNAIRES_BARREL, QUESTIONNAIRES_BUDGETCOMPONENTS, QUESTIONNAIRES_DEPARTMENTS, QUESTIONNAIRES_PENTIONS, QUESTIONNAIRES_PROJECTS, QUESTIONNAIRES_CUSTOMERS, QUESTIONNAIRES_INVENTORYBRANDS, QUESTIONNAIRES_INVENTORYCATEGORIES, QUESTIONNAIRES_INVENTORYMODELS, QUESTIONNAIRES_INVENTORYPACKAGETYPES, QUESTIONNAIRES_INVENTORYTECHNICALDETAILS, QUESTIONNAIRES_VENDORCATEGORIES } from "../../utils/path";
|
|
8
|
+
QUESTIONNAIRES_REPRIMAND_TYPES, QUESTIONNAIRES_SPECIAL_DAYS, QUESTIONNAIRES_SPECIALIZATIONS, QUESTIONNAIRES_STRUCTURES, QUESTIONNAIRES_SUBTOPIC, QUESTIONNAIRES_TOPIC, QUESTIONNAIRES_TRANSMITTER_TYPES, QUESTIONNAIRES_VEHICLE_CATEGORIES, QUESTIONNAIRES_VEHICLE_GROUPS, QUESTIONNAIRES_VEHICLE_TYPES, QUESTIONNAIRES_WAR_PARTICIPANTS, QUESTIONNAIRES_WORK_MODES, QUESTIONNAIRES_WORK_SCHEDULES, QUESTIONNAIRES_OWNERS, QUESTIONNAIRES_CONTRACTTOPICS, QUESTIONNAIRES_CONTRACTTYPESSUBTYPES, QUESTIONNAIRES_DEFAULTAGREEMENTPLANS, QUESTIONNAIRES_ROUTELOCATIONS, QUESTIONNAIRES_INTERNALSTRUCTURE, QUESTIONNAIRES_FIELD, QUESTIONNAIRES_WELL, QUESTIONNAIRES_BARREL, QUESTIONNAIRES_BUDGETCOMPONENTS, QUESTIONNAIRES_DEPARTMENTS, QUESTIONNAIRES_PENTIONS, QUESTIONNAIRES_PROJECTS, QUESTIONNAIRES_CUSTOMERS, QUESTIONNAIRES_INVENTORYBRANDS, QUESTIONNAIRES_INVENTORYCATEGORIES, QUESTIONNAIRES_INVENTORYMODELS, QUESTIONNAIRES_INVENTORYPACKAGETYPES, QUESTIONNAIRES_INVENTORYTECHNICALDETAILS, QUESTIONNAIRES_VENDORCATEGORIES, QUESTIONNAIRES_ATTESTATIONS } from "../../utils/path";
|
|
9
9
|
import { SearchIcon } from "../../assets/icons";
|
|
10
10
|
var Sider = Layout.Sider;
|
|
11
11
|
var SubMenu = Menu.SubMenu;
|
|
@@ -428,8 +428,16 @@ var QuestionnairesSidebar = function QuestionnairesSidebar(_ref) {
|
|
|
428
428
|
//delete the "/" at the start of string
|
|
429
429
|
label: "Kateqoriyalar (Vendor)",
|
|
430
430
|
link: QUESTIONNAIRES_VENDORCATEGORIES
|
|
431
|
-
}
|
|
431
|
+
},
|
|
432
432
|
// ---- generated sidebar item by questionnaireGenerator: VendorCategories ----
|
|
433
|
+
|
|
434
|
+
{
|
|
435
|
+
key: "attestations",
|
|
436
|
+
//delete the "/" at the start of string
|
|
437
|
+
label: "Sertifikat növləri",
|
|
438
|
+
link: QUESTIONNAIRES_ATTESTATIONS
|
|
439
|
+
}
|
|
440
|
+
// ---- generated sidebar item by questionnaireGenerator: Attestations ----
|
|
433
441
|
];
|
|
434
442
|
var sortedItems = items.sort(function (a, b) {
|
|
435
443
|
return a.label.localeCompare(b.label);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Switch, Tooltip } from "antd";
|
|
3
|
+
import style from "../Questionnaires.module.scss";
|
|
4
|
+
import { setDeleteModalVisible } from "../../../store/slices/global";
|
|
5
|
+
import { DeleteIconQ, EditIcon } from "../../../assets/icons";
|
|
6
|
+
export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch, innerW) {
|
|
7
|
+
return [{
|
|
8
|
+
title: "№",
|
|
9
|
+
dataIndex: "num",
|
|
10
|
+
showCheckbox: false,
|
|
11
|
+
ellipsis: true,
|
|
12
|
+
width: 35
|
|
13
|
+
}, {
|
|
14
|
+
title: "Sertifikat növləri",
|
|
15
|
+
dataIndex: "name",
|
|
16
|
+
width: innerW,
|
|
17
|
+
disabled: true,
|
|
18
|
+
ellipsis: true
|
|
19
|
+
}, {
|
|
20
|
+
title: "Tam adı",
|
|
21
|
+
dataIndex: "fullName",
|
|
22
|
+
width: innerW,
|
|
23
|
+
ellipsis: true
|
|
24
|
+
}, {
|
|
25
|
+
title: "Attestasiya növü",
|
|
26
|
+
dataIndex: "attestationTypeText",
|
|
27
|
+
width: innerW,
|
|
28
|
+
ellipsis: true
|
|
29
|
+
}, {
|
|
30
|
+
title: "Status",
|
|
31
|
+
key: "status",
|
|
32
|
+
disabled: true,
|
|
33
|
+
filter: false,
|
|
34
|
+
render: function render(data) {
|
|
35
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
36
|
+
placement: "top",
|
|
37
|
+
title: "Statusu d\u0259yi\u015F"
|
|
38
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
39
|
+
size: "medium",
|
|
40
|
+
checked: data === null || data === void 0 ? void 0 : data.isActive,
|
|
41
|
+
onChange: function onChange(checked) {
|
|
42
|
+
return onStatusChange(data, checked, dispatch);
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
title: "",
|
|
48
|
+
key: "actions",
|
|
49
|
+
showCheckbox: false,
|
|
50
|
+
width: 80,
|
|
51
|
+
render: function render(data) {
|
|
52
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
className: style.number
|
|
54
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: style.actions
|
|
56
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
onClick: function onClick() {
|
|
58
|
+
return onEditClick(data);
|
|
59
|
+
}
|
|
60
|
+
}, /*#__PURE__*/React.createElement(EditIcon, null)), /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
onClick: function onClick() {
|
|
62
|
+
onDelete(data === null || data === void 0 ? void 0 : data.id);
|
|
63
|
+
dispatch(setDeleteModalVisible(true));
|
|
64
|
+
}
|
|
65
|
+
}, /*#__PURE__*/React.createElement(DeleteIconQ, null)))));
|
|
66
|
+
}
|
|
67
|
+
}];
|
|
68
|
+
};
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
7
|
+
import Cookies from "js-cookie";
|
|
8
|
+
import style from "../Questionnaires.module.scss";
|
|
9
|
+
import { Form, Input, Layout, Select as AntdSelect } from "antd";
|
|
10
|
+
import { PlusIcon } from "../../../assets/icons";
|
|
11
|
+
import FormModal from "../../../components/FormModal";
|
|
12
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
13
|
+
import Delete from "../../../components/Delete/Delete";
|
|
14
|
+
import DeleteModal from "../../../components/DeleteModal/DeleteModal";
|
|
15
|
+
import Success from "../../../components/Success/Success";
|
|
16
|
+
import { setDeleteModalVisible, setViewModalVisible } from "../../../store/slices/global";
|
|
17
|
+
import ViewModal from "../../../components/ViewModal";
|
|
18
|
+
import { getStreetColumns } from "./constant";
|
|
19
|
+
import Pagination from "../../../components/Pagination";
|
|
20
|
+
import ColSort from "../../../components/ColSort";
|
|
21
|
+
import { setPaginationLength } from "../../../helpers/paginationLength";
|
|
22
|
+
import Button from "../../../components/Button";
|
|
23
|
+
import Loading from "../../../components/Loading";
|
|
24
|
+
import Table from "../../../components/Table";
|
|
25
|
+
import Filter from "../../../components/Filter";
|
|
26
|
+
import { addAttestations, deleteAttestations, editAttestations, getAttestations, attestationsVisibility } from "../../../store/slices/questionnaire";
|
|
27
|
+
import Select from "../../../components/Select";
|
|
28
|
+
import { AttestationType } from "../../../helpers/enums";
|
|
29
|
+
var Content = Layout.Content;
|
|
30
|
+
var Item = Form.Item;
|
|
31
|
+
var Option = AntdSelect.Option;
|
|
32
|
+
var QuestionnairesAttestationsContent = function QuestionnairesAttestationsContent() {
|
|
33
|
+
var _useState = useState(null),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
innerW = _useState2[0],
|
|
36
|
+
setInnerW = _useState2[1];
|
|
37
|
+
var ref = useRef();
|
|
38
|
+
var dispatch = useDispatch();
|
|
39
|
+
var _useState3 = useState(0),
|
|
40
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
41
|
+
id = _useState4[0],
|
|
42
|
+
setId = _useState4[1];
|
|
43
|
+
var _useState5 = useState(1),
|
|
44
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
45
|
+
page = _useState6[0],
|
|
46
|
+
setPage = _useState6[1];
|
|
47
|
+
var _useState7 = useState(Cookies.get("pagination-size-questionnaire-attestations") ? JSON.parse(Cookies.get("pagination-size-questionnaire-attestations")) : 20),
|
|
48
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
49
|
+
size = _useState8[0],
|
|
50
|
+
setSize = _useState8[1];
|
|
51
|
+
var _useState9 = useState({
|
|
52
|
+
name: ""
|
|
53
|
+
}),
|
|
54
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
55
|
+
query = _useState0[0],
|
|
56
|
+
setQuery = _useState0[1];
|
|
57
|
+
var _useSelector = useSelector(function (state) {
|
|
58
|
+
return state.global;
|
|
59
|
+
}),
|
|
60
|
+
loading = _useSelector.loading,
|
|
61
|
+
AttestationsRender = _useSelector.AttestationsRender;
|
|
62
|
+
var Attestations = useSelector(function (state) {
|
|
63
|
+
return state.questionnaire.attestations;
|
|
64
|
+
});
|
|
65
|
+
var paginationLength = setPaginationLength(Attestations === null || Attestations === void 0 ? void 0 : Attestations.count, Attestations === null || Attestations === void 0 ? void 0 : Attestations.size);
|
|
66
|
+
var onSubmit = useCallback(/*#__PURE__*/function () {
|
|
67
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
|
68
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
69
|
+
while (1) switch (_context.prev = _context.next) {
|
|
70
|
+
case 0:
|
|
71
|
+
dispatch(addAttestations(data));
|
|
72
|
+
case 1:
|
|
73
|
+
case "end":
|
|
74
|
+
return _context.stop();
|
|
75
|
+
}
|
|
76
|
+
}, _callee);
|
|
77
|
+
}));
|
|
78
|
+
return function (_x) {
|
|
79
|
+
return _ref.apply(this, arguments);
|
|
80
|
+
};
|
|
81
|
+
}(), [dispatch]);
|
|
82
|
+
var onEdit = useCallback(function (id, record) {
|
|
83
|
+
var data = {
|
|
84
|
+
id: id,
|
|
85
|
+
name: record === null || record === void 0 ? void 0 : record.name,
|
|
86
|
+
fullName: record === null || record === void 0 ? void 0 : record.fullName,
|
|
87
|
+
attestationType: record === null || record === void 0 ? void 0 : record.attestationType
|
|
88
|
+
};
|
|
89
|
+
dispatch(editAttestations(data));
|
|
90
|
+
}, [dispatch]);
|
|
91
|
+
var onStatusChange = useCallback(function (data, checked) {
|
|
92
|
+
var data_ = {
|
|
93
|
+
id: data === null || data === void 0 ? void 0 : data.id,
|
|
94
|
+
checked: checked
|
|
95
|
+
};
|
|
96
|
+
dispatch(attestationsVisibility(data_));
|
|
97
|
+
}, [dispatch]);
|
|
98
|
+
var closeOnViewModal = useCallback(function () {
|
|
99
|
+
dispatch(setViewModalVisible(false));
|
|
100
|
+
}, [dispatch]);
|
|
101
|
+
var onClickModal = function onClickModal() {
|
|
102
|
+
var _ref$current;
|
|
103
|
+
ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.open();
|
|
104
|
+
};
|
|
105
|
+
var onEditClick = useCallback(function (data) {
|
|
106
|
+
var _ref$current2;
|
|
107
|
+
ref === null || ref === void 0 || (_ref$current2 = ref.current) === null || _ref$current2 === void 0 || _ref$current2.setEdit(data);
|
|
108
|
+
}, []);
|
|
109
|
+
var onDelete = useCallback(function (id) {
|
|
110
|
+
setId(id);
|
|
111
|
+
}, []);
|
|
112
|
+
var handleColumnToggle = function handleColumnToggle(checked, dataIndex) {
|
|
113
|
+
setSelectedColumns(function (prevSelected) {
|
|
114
|
+
if (checked) {
|
|
115
|
+
return [].concat(_toConsumableArray(prevSelected), [dataIndex]);
|
|
116
|
+
} else {
|
|
117
|
+
return prevSelected.filter(function (col) {
|
|
118
|
+
return col !== dataIndex;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
var idFinder = function idFinder(id) {
|
|
124
|
+
var _AttestationType$find;
|
|
125
|
+
return (_AttestationType$find = AttestationType.find(function (item) {
|
|
126
|
+
return item.id === id;
|
|
127
|
+
})) === null || _AttestationType$find === void 0 ? void 0 : _AttestationType$find.text;
|
|
128
|
+
};
|
|
129
|
+
var data = [];
|
|
130
|
+
if (Attestations !== null && Attestations !== void 0 && Attestations.items) {
|
|
131
|
+
var _Attestations$items;
|
|
132
|
+
data = Attestations === null || Attestations === void 0 || (_Attestations$items = Attestations.items) === null || _Attestations$items === void 0 ? void 0 : _Attestations$items.map(function (dataObj, i) {
|
|
133
|
+
var _dataObj$attestationT, _dataObj$attestationT2, _dataObj$attestationT3, _dataObj$attestationT4;
|
|
134
|
+
return {
|
|
135
|
+
num: (Attestations === null || Attestations === void 0 ? void 0 : Attestations.size) * (Attestations === null || Attestations === void 0 ? void 0 : Attestations.page) + i + 1 - (Attestations === null || Attestations === void 0 ? void 0 : Attestations.size),
|
|
136
|
+
id: dataObj === null || dataObj === void 0 ? void 0 : dataObj.id,
|
|
137
|
+
name: dataObj === null || dataObj === void 0 ? void 0 : dataObj.name,
|
|
138
|
+
fullName: dataObj === null || dataObj === void 0 ? void 0 : dataObj.fullName,
|
|
139
|
+
attestationType: (_dataObj$attestationT = dataObj === null || dataObj === void 0 || (_dataObj$attestationT2 = dataObj.attestationType) === null || _dataObj$attestationT2 === void 0 ? void 0 : _dataObj$attestationT2.id) !== null && _dataObj$attestationT !== void 0 ? _dataObj$attestationT : dataObj === null || dataObj === void 0 ? void 0 : dataObj.attestationType,
|
|
140
|
+
attestationTypeText: idFinder((_dataObj$attestationT3 = dataObj === null || dataObj === void 0 || (_dataObj$attestationT4 = dataObj.attestationType) === null || _dataObj$attestationT4 === void 0 ? void 0 : _dataObj$attestationT4.id) !== null && _dataObj$attestationT3 !== void 0 ? _dataObj$attestationT3 : dataObj === null || dataObj === void 0 ? void 0 : dataObj.attestationType),
|
|
141
|
+
isActive: dataObj === null || dataObj === void 0 ? void 0 : dataObj.isActive,
|
|
142
|
+
className: "rowClassName1"
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
var columns = useMemo(function () {
|
|
147
|
+
return getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch);
|
|
148
|
+
}, [onEditClick, onDelete, onStatusChange, dispatch]);
|
|
149
|
+
var _useState1 = useState(columns.map(function (col) {
|
|
150
|
+
return col.dataIndex;
|
|
151
|
+
})),
|
|
152
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
153
|
+
selectedColumns = _useState10[0],
|
|
154
|
+
setSelectedColumns = _useState10[1];
|
|
155
|
+
useEffect(function () {
|
|
156
|
+
if (window.innerWidth >= 1900) {
|
|
157
|
+
setInnerW(210);
|
|
158
|
+
} else {
|
|
159
|
+
setInnerW(155);
|
|
160
|
+
}
|
|
161
|
+
var data = {
|
|
162
|
+
page: page,
|
|
163
|
+
size: size,
|
|
164
|
+
query: query,
|
|
165
|
+
visibility: "nondeleted"
|
|
166
|
+
};
|
|
167
|
+
dispatch(getAttestations(data));
|
|
168
|
+
}, [dispatch, page, AttestationsRender, query, size]);
|
|
169
|
+
var updateSize = function updateSize(newSize) {
|
|
170
|
+
setSize(newSize);
|
|
171
|
+
Cookies.set("pagination-size-questionnaire-attestations", JSON.stringify(newSize), {
|
|
172
|
+
expires: 7
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, loading ? /*#__PURE__*/React.createElement(Loading, null) : null, /*#__PURE__*/React.createElement(Layout, {
|
|
176
|
+
className: style.layout
|
|
177
|
+
}, /*#__PURE__*/React.createElement(Content, {
|
|
178
|
+
className: style.content
|
|
179
|
+
}, /*#__PURE__*/React.createElement("header", {
|
|
180
|
+
className: style.header
|
|
181
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
182
|
+
onClick: onClickModal,
|
|
183
|
+
color: "green"
|
|
184
|
+
}, /*#__PURE__*/React.createElement(PlusIcon, null), " Soraq\xE7a \u0259lav\u0259 et"), /*#__PURE__*/React.createElement(Filter, {
|
|
185
|
+
columns: columns,
|
|
186
|
+
selectedColumns: selectedColumns,
|
|
187
|
+
setQuery: setQuery,
|
|
188
|
+
disabledElementCount: 3,
|
|
189
|
+
setPage: setPage
|
|
190
|
+
}))), /*#__PURE__*/React.createElement(Layout, {
|
|
191
|
+
className: style.layout1
|
|
192
|
+
}, /*#__PURE__*/React.createElement(Content, {
|
|
193
|
+
className: style.content
|
|
194
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
195
|
+
className: style.table_header
|
|
196
|
+
}, /*#__PURE__*/React.createElement("h2", null, "Sertifikat n\xF6vl\u0259ri"), /*#__PURE__*/React.createElement("div", {
|
|
197
|
+
className: style.buttons
|
|
198
|
+
}, /*#__PURE__*/React.createElement(ColSort, {
|
|
199
|
+
columns: columns,
|
|
200
|
+
selectedColumns: selectedColumns,
|
|
201
|
+
handleColumnToggle: handleColumnToggle
|
|
202
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
203
|
+
className: "bigTable"
|
|
204
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
205
|
+
selectedColumns: selectedColumns,
|
|
206
|
+
innerW: innerW,
|
|
207
|
+
dataSource: data,
|
|
208
|
+
columns: columns,
|
|
209
|
+
disableDrag: true
|
|
210
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
211
|
+
className: style.pagination
|
|
212
|
+
}, /*#__PURE__*/React.createElement(Pagination, {
|
|
213
|
+
size: size,
|
|
214
|
+
setSize: updateSize,
|
|
215
|
+
total: paginationLength,
|
|
216
|
+
page: page,
|
|
217
|
+
onChange: setPage
|
|
218
|
+
})), /*#__PURE__*/React.createElement(FormModal, {
|
|
219
|
+
ref: ref,
|
|
220
|
+
width: 454,
|
|
221
|
+
title: "Yeni soraqça yaratma",
|
|
222
|
+
titleEdit: "Soraqça redaktə etmə",
|
|
223
|
+
okText: "Yadda saxla",
|
|
224
|
+
cancelText: "Bağla",
|
|
225
|
+
onSubmit: onSubmit,
|
|
226
|
+
onEdit: onEdit,
|
|
227
|
+
className: "absolute",
|
|
228
|
+
centered: false
|
|
229
|
+
}, /*#__PURE__*/React.createElement(Item, {
|
|
230
|
+
rules: [{
|
|
231
|
+
required: true,
|
|
232
|
+
message: ""
|
|
233
|
+
}, {
|
|
234
|
+
min: 3,
|
|
235
|
+
message: "Ən azından 3 simvol olmalıdır"
|
|
236
|
+
}],
|
|
237
|
+
name: "name",
|
|
238
|
+
label: "Ad"
|
|
239
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
240
|
+
className: style.modal_input
|
|
241
|
+
})), /*#__PURE__*/React.createElement(Item, {
|
|
242
|
+
rules: [{
|
|
243
|
+
required: true,
|
|
244
|
+
message: ""
|
|
245
|
+
}],
|
|
246
|
+
name: "fullName",
|
|
247
|
+
label: "Tam adı"
|
|
248
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
249
|
+
className: style.modal_input
|
|
250
|
+
})), /*#__PURE__*/React.createElement(Item, {
|
|
251
|
+
className: style.label,
|
|
252
|
+
rules: [{
|
|
253
|
+
required: true,
|
|
254
|
+
message: ""
|
|
255
|
+
}],
|
|
256
|
+
name: "attestationType",
|
|
257
|
+
label: "Attestasiya növü"
|
|
258
|
+
}, /*#__PURE__*/React.createElement(Select, null, AttestationType.map(function (item) {
|
|
259
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
260
|
+
key: item.id,
|
|
261
|
+
value: item.id
|
|
262
|
+
}, item.text);
|
|
263
|
+
})))), /*#__PURE__*/React.createElement(DeleteModal, {
|
|
264
|
+
onCancel: function onCancel() {
|
|
265
|
+
return dispatch(setDeleteModalVisible(false));
|
|
266
|
+
},
|
|
267
|
+
width: 280
|
|
268
|
+
}, /*#__PURE__*/React.createElement(Delete, {
|
|
269
|
+
onDelete: function onDelete() {
|
|
270
|
+
return dispatch(deleteAttestations(id));
|
|
271
|
+
},
|
|
272
|
+
onCancel: function onCancel() {
|
|
273
|
+
return dispatch(setDeleteModalVisible(false));
|
|
274
|
+
},
|
|
275
|
+
value: "Soraqçanı"
|
|
276
|
+
})), /*#__PURE__*/React.createElement(ViewModal, {
|
|
277
|
+
onCancel: closeOnViewModal,
|
|
278
|
+
width: 695
|
|
279
|
+
}, /*#__PURE__*/React.createElement(Success, {
|
|
280
|
+
onClick: closeOnViewModal,
|
|
281
|
+
value: "Soraqça"
|
|
282
|
+
}))))));
|
|
283
|
+
};
|
|
284
|
+
export default QuestionnairesAttestationsContent;
|
|
@@ -21,6 +21,11 @@ export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, o
|
|
|
21
21
|
dataIndex: "fullname",
|
|
22
22
|
width: innerW,
|
|
23
23
|
ellipsis: true
|
|
24
|
+
}, {
|
|
25
|
+
title: "Rejim dəyəri (Saat)",
|
|
26
|
+
dataIndex: "modeValue",
|
|
27
|
+
width: innerW,
|
|
28
|
+
ellipsis: true
|
|
24
29
|
}, {
|
|
25
30
|
title: "Status",
|
|
26
31
|
key: "status",
|