@banch0u/core-project-test-repository 1.9.9 → 1.9.11

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.
@@ -116,7 +116,7 @@ var Sidebar = function Sidebar(_ref) {
116
116
  return location.pathname.includes(item.key);
117
117
  })) === null || _items$flatMap$find === void 0 ? void 0 : _items$flatMap$find.key;
118
118
  return /*#__PURE__*/React.createElement(Sider, {
119
- width: 270,
119
+ width: 287,
120
120
  collapsible: true,
121
121
  collapsed: collapsed,
122
122
  collapsedWidth: 64,
@@ -132,7 +132,9 @@ var Sidebar = function Sidebar(_ref) {
132
132
  })), /*#__PURE__*/React.createElement(Link, {
133
133
  to: PLATFORM_PATH,
134
134
  className: style.buttons
135
- }, collapsed ? /*#__PURE__*/React.createElement(DsgLogoEmblem, null) : imageSrc ? /*#__PURE__*/React.createElement("img", {
135
+ }, collapsed ? /*#__PURE__*/React.createElement("div", {
136
+ className: style.emblem
137
+ }, /*#__PURE__*/React.createElement(DsgLogoEmblem, null)) : imageSrc ? /*#__PURE__*/React.createElement("img", {
136
138
  src: imageSrc,
137
139
  alt: "Company Logo"
138
140
  }) : isDark ? /*#__PURE__*/React.createElement(DsgLogo, {
@@ -25,15 +25,20 @@
25
25
  position: absolute;
26
26
  left: 15px;
27
27
  bottom: 16px;
28
- svg {
29
- width: 100%;
30
- height: auto;
31
- padding-right: 15px;
32
- }
28
+ display: flex;
29
+ justify-content: center;
30
+ align-items: center;
31
+
33
32
  img {
34
- width: 100%;
35
- height: auto;
36
- padding-right: 15px;
33
+ height: 100px;
34
+ width: auto;
35
+ }
36
+ .emblem {
37
+ svg {
38
+ height: auto;
39
+ width: 100%;
40
+ padding-right: 15px;
41
+ }
37
42
  }
38
43
  }
39
44
  .collapseButton {
@@ -3,7 +3,7 @@ import { Switch, Tooltip } from "antd";
3
3
  import style from "../Questionnaires.module.scss";
4
4
  import { setDeleteModalVisible } from "../../../store/slices/global";
5
5
  import { DeleteIconQ, EditIcon } from "../../../assets/icons";
6
- export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch, innerW) {
6
+ export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, onStatusChange, drivingcategoriesAll, dispatch, innerW) {
7
7
  return [{
8
8
  title: "№",
9
9
  dataIndex: "num",
@@ -16,6 +16,15 @@ export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, o
16
16
  width: innerW,
17
17
  disabled: true,
18
18
  ellipsis: true
19
+ }, {
20
+ title: "Kateqoriya",
21
+ dataIndex: "category",
22
+ width: innerW,
23
+ disabled: false,
24
+ ellipsis: true,
25
+ type: "select",
26
+ selectData: drivingcategoriesAll,
27
+ queryName: "categoryIds"
19
28
  }, {
20
29
  title: "Status",
21
30
  key: "status",
@@ -26,7 +26,7 @@ import Button from "../../../components/Button";
26
26
  import Loading from "../../../components/Loading";
27
27
  import Table from "../../../components/Table";
28
28
  import Filter from "../../../components/Filter";
29
- import { addModel, deleteModel, editModel, getBrandsAll, getModel, modelsVisibility } from "../../../store/slices/questionnaire";
29
+ import { addModel, deleteModel, editModel, getBrandsAll, getDrivingcategoriesAll, getModel, modelsVisibility } from "../../../store/slices/questionnaire";
30
30
  import Select from "../../../components/Select";
31
31
  var Content = Layout.Content;
32
32
  var Item = Form.Item;
@@ -71,16 +71,26 @@ var QuestionnairesModelsContent = function QuestionnairesModelsContent() {
71
71
  var brandsAll = useSelector(function (state) {
72
72
  return state.questionnaire.brandsAll;
73
73
  });
74
+ var drivingcategoriesAll = useSelector(function (state) {
75
+ return state.questionnaire.drivingcategoriesAll;
76
+ });
77
+ console.log(drivingcategoriesAll);
74
78
  var paginationLength = setPaginationLength(model === null || model === void 0 ? void 0 : model.count, model === null || model === void 0 ? void 0 : model.size);
75
79
  var onSubmit = useCallback(/*#__PURE__*/function () {
76
80
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
81
+ var category, categoryName;
77
82
  return _regeneratorRuntime.wrap(function _callee$(_context) {
78
83
  while (1) switch (_context.prev = _context.next) {
79
84
  case 0:
85
+ category = drivingcategoriesAll === null || drivingcategoriesAll === void 0 ? void 0 : drivingcategoriesAll.find(function (item) {
86
+ return item.id === data.categoryId;
87
+ });
88
+ categoryName = (category === null || category === void 0 ? void 0 : category.name) || "";
80
89
  dispatch(addModel(_objectSpread(_objectSpread({}, data), {}, {
81
- brandId: brandSelect
90
+ brandId: brandSelect,
91
+ categoryName: categoryName
82
92
  })));
83
- case 1:
93
+ case 3:
84
94
  case "end":
85
95
  return _context.stop();
86
96
  }
@@ -89,14 +99,21 @@ var QuestionnairesModelsContent = function QuestionnairesModelsContent() {
89
99
  return function (_x) {
90
100
  return _ref.apply(this, arguments);
91
101
  };
92
- }(), [dispatch, brandSelect]);
102
+ }(), [dispatch, brandSelect, drivingcategoriesAll]);
93
103
  var onEdit = useCallback(function (id, record) {
94
104
  var data = {
95
105
  id: id,
96
106
  name: record === null || record === void 0 ? void 0 : record.name,
97
- brandId: brandSelect
107
+ brandId: brandSelect,
108
+ categoryId: record === null || record === void 0 ? void 0 : record.categoryId
98
109
  };
99
- dispatch(editModel(data));
110
+ var category = drivingcategoriesAll === null || drivingcategoriesAll === void 0 ? void 0 : drivingcategoriesAll.find(function (item) {
111
+ return item.id === data.categoryId;
112
+ });
113
+ var categoryName = (category === null || category === void 0 ? void 0 : category.name) || "";
114
+ dispatch(editModel(_objectSpread(_objectSpread({}, data), {}, {
115
+ categoryName: categoryName
116
+ })));
100
117
  }, [dispatch, brandSelect]);
101
118
  var onStatusChange = useCallback(function (data, checked) {
102
119
  var data_ = {
@@ -134,18 +151,21 @@ var QuestionnairesModelsContent = function QuestionnairesModelsContent() {
134
151
  if (model !== null && model !== void 0 && model.items) {
135
152
  var _model$items;
136
153
  data = model === null || model === void 0 || (_model$items = model.items) === null || _model$items === void 0 ? void 0 : _model$items.map(function (dataObj, i) {
154
+ var _dataObj$category, _dataObj$category2;
137
155
  return {
138
156
  num: (model === null || model === void 0 ? void 0 : model.size) * (model === null || model === void 0 ? void 0 : model.page) + i + 1 - (model === null || model === void 0 ? void 0 : model.size),
139
157
  id: dataObj === null || dataObj === void 0 ? void 0 : dataObj.id,
140
158
  name: dataObj === null || dataObj === void 0 ? void 0 : dataObj.name,
159
+ category: dataObj === null || dataObj === void 0 || (_dataObj$category = dataObj.category) === null || _dataObj$category === void 0 ? void 0 : _dataObj$category.text,
160
+ categoryId: dataObj === null || dataObj === void 0 || (_dataObj$category2 = dataObj.category) === null || _dataObj$category2 === void 0 ? void 0 : _dataObj$category2.id,
141
161
  isActive: dataObj === null || dataObj === void 0 ? void 0 : dataObj.isActive,
142
162
  className: "rowClassName1"
143
163
  };
144
164
  });
145
165
  }
146
166
  var columns = useMemo(function () {
147
- return getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch);
148
- }, [onEditClick, onDelete, onStatusChange, dispatch]);
167
+ return getStreetColumns(onEditClick, onDelete, onStatusChange, drivingcategoriesAll, dispatch);
168
+ }, [onEditClick, onDelete, onStatusChange, drivingcategoriesAll, dispatch]);
149
169
  var _useState13 = useState(columns.map(function (col) {
150
170
  return col.dataIndex;
151
171
  })),
@@ -162,6 +182,7 @@ var QuestionnairesModelsContent = function QuestionnairesModelsContent() {
162
182
  dispatch(getBrandsAll({
163
183
  visibility: "nondeleted"
164
184
  }));
185
+ dispatch(getDrivingcategoriesAll("nondeleted"));
165
186
  }, [dispatch]);
166
187
  useEffect(function () {
167
188
  if (window.innerWidth >= 1900) {
@@ -266,7 +287,19 @@ var QuestionnairesModelsContent = function QuestionnairesModelsContent() {
266
287
  label: "Ad"
267
288
  }, /*#__PURE__*/React.createElement(Input, {
268
289
  className: style.modal_input
269
- }))), /*#__PURE__*/React.createElement(DeleteModal, {
290
+ })), /*#__PURE__*/React.createElement(Item, {
291
+ rules: [{
292
+ required: true,
293
+ message: ""
294
+ }],
295
+ name: "categoryId",
296
+ label: "Kateqoriya"
297
+ }, /*#__PURE__*/React.createElement(Select, null, drivingcategoriesAll === null || drivingcategoriesAll === void 0 ? void 0 : drivingcategoriesAll.map(function (item) {
298
+ return /*#__PURE__*/React.createElement(Option, {
299
+ key: item.id,
300
+ value: item.id
301
+ }, item.name);
302
+ })))), /*#__PURE__*/React.createElement(DeleteModal, {
270
303
  onCancel: function onCancel() {
271
304
  return dispatch(setDeleteModalVisible(false));
272
305
  },
@@ -11051,6 +11051,10 @@ export var questionnaire = createSlice({
11051
11051
  var payload = _ref754.payload;
11052
11052
  state.ordersAll = payload;
11053
11053
  });
11054
+ builder.addCase(getDrivingcategoriesAll.fulfilled, function (state, _ref755) {
11055
+ var payload = _ref755.payload;
11056
+ state.drivingcategoriesAll = payload;
11057
+ });
11054
11058
  }
11055
11059
  });
11056
11060
  var setPage = questionnaire.actions.setPage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@banch0u/core-project-test-repository",
3
- "version": "1.9.9",
3
+ "version": "1.9.11",
4
4
  "description": "Shared core features for all projects",
5
5
  "main": "dist/index.js",
6
6
  "files": [