@banch0u/core-project-test-repository 1.9.8 → 1.9.10

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.
@@ -23,9 +23,7 @@ var useNotification = function useNotification() {
23
23
  skipNegotiation: true
24
24
  }).configureLogging(signalR.LogLevel.Information).build();
25
25
  connection.start().then(function () {
26
- console.log("SignalR bağlantısı quruldu.");
27
26
  connection.on("receive", function (message) {
28
- console.log("Yeni bildiriş:", message);
29
27
  store.dispatch(setNotificationsRender());
30
28
  infoMessageBottomRight(message);
31
29
  });
@@ -34,7 +32,6 @@ var useNotification = function useNotification() {
34
32
  });
35
33
  return function () {
36
34
  connection.stop();
37
- console.log("SignalR bağlantısı bağlandı.");
38
35
  };
39
36
  }, []);
40
37
  };
@@ -72,7 +72,6 @@ var Sidebar = function Sidebar(_ref) {
72
72
  setCollapsed(sidebarState);
73
73
  dispatch(getCompanyInfo());
74
74
  }, [dispatch]);
75
- console.log(companyInfo);
76
75
  useEffect(function () {
77
76
  var fetchLogo = /*#__PURE__*/function () {
78
77
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
@@ -72,7 +72,6 @@ var QuestionnairesDocumentTypeContent = function QuestionnairesDocumentTypeConte
72
72
  value: item === null || item === void 0 ? void 0 : item.id
73
73
  };
74
74
  });
75
- console.log(categoriesAll);
76
75
  var onSubmit = useCallback(/*#__PURE__*/function () {
77
76
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
78
77
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -90,7 +89,6 @@ var QuestionnairesDocumentTypeContent = function QuestionnairesDocumentTypeConte
90
89
  };
91
90
  }(), [dispatch]);
92
91
  var onEdit = useCallback(function (id, record) {
93
- console.log(record);
94
92
  var data = {
95
93
  id: id,
96
94
  name: record === null || record === void 0 ? void 0 : record.name,
@@ -38,6 +38,24 @@ export var getStreetColumns = function getStreetColumns(onEditClick, innerW) {
38
38
  width: innerW,
39
39
  disabled: false,
40
40
  ellipsis: true
41
+ }, {
42
+ title: "Sürücülər",
43
+ dataIndex: "DriverPositions1",
44
+ width: innerW,
45
+ disabled: false,
46
+ ellipsis: true
47
+ }, {
48
+ title: "Mexaniklər",
49
+ dataIndex: "MechanicPositions1",
50
+ width: innerW,
51
+ disabled: false,
52
+ ellipsis: true
53
+ }, {
54
+ title: "Dispetçerlər",
55
+ dataIndex: "DispatcherPositions",
56
+ width: innerW,
57
+ disabled: false,
58
+ ellipsis: true
41
59
  }, {
42
60
  title: "",
43
61
  key: "actions",
@@ -83,7 +83,7 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
83
83
  var paginationLength = setPaginationLength(employeeConfigurations === null || employeeConfigurations === void 0 ? void 0 : employeeConfigurations.count, employeeConfigurations === null || employeeConfigurations === void 0 ? void 0 : employeeConfigurations.size);
84
84
  var onSubmit = useCallback(/*#__PURE__*/function () {
85
85
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(data_) {
86
- var _data_$EmployeeIds, _data_$Positions, _data_$PersonInCharge, _data_$GeneralStructu, _data_$OperatingManag;
86
+ var _data_$EmployeeIds, _data_$Positions, _data_$PersonInCharge, _data_$GeneralStructu, _data_$OperatingManag, _data_$DriverPosition, _data_$MechanicPositi, _data_$DispatcherPosi;
87
87
  var data;
88
88
  return _regeneratorRuntime.wrap(function _callee$(_context) {
89
89
  while (1) switch (_context.prev = _context.next) {
@@ -93,7 +93,10 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
93
93
  Positions: ((_data_$Positions = data_.Positions) !== null && _data_$Positions !== void 0 ? _data_$Positions : []).join(","),
94
94
  PersonInChargeForFuelIds: ((_data_$PersonInCharge = data_.PersonInChargeForFuelIds) !== null && _data_$PersonInCharge !== void 0 ? _data_$PersonInCharge : []).join(","),
95
95
  GeneralStructures: ((_data_$GeneralStructu = data_.GeneralStructures) !== null && _data_$GeneralStructu !== void 0 ? _data_$GeneralStructu : []).join(","),
96
- OperatingManagerIds: ((_data_$OperatingManag = data_.OperatingManagerIds) !== null && _data_$OperatingManag !== void 0 ? _data_$OperatingManag : []).join(",")
96
+ OperatingManagerIds: ((_data_$OperatingManag = data_.OperatingManagerIds) !== null && _data_$OperatingManag !== void 0 ? _data_$OperatingManag : []).join(","),
97
+ DriverPositions: ((_data_$DriverPosition = data_.DriverPositions) !== null && _data_$DriverPosition !== void 0 ? _data_$DriverPosition : []).join(","),
98
+ MechanicPositions: ((_data_$MechanicPositi = data_.MechanicPositions) !== null && _data_$MechanicPositi !== void 0 ? _data_$MechanicPositi : []).join(","),
99
+ DispatcherPositions: ((_data_$DispatcherPosi = data_.DispatcherPositions) !== null && _data_$DispatcherPosi !== void 0 ? _data_$DispatcherPosi : []).join(",")
97
100
  });
98
101
  console.log(data);
99
102
  dispatch(addEmployeeConfigurations(data));
@@ -108,14 +111,17 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
108
111
  };
109
112
  }(), [dispatch, typeSelect]);
110
113
  var onEdit = useCallback(function (id, record) {
111
- var _record$EmployeeIds, _record$Positions, _record$PersonInCharg, _record$GeneralStruct, _record$OperatingMana;
114
+ var _record$EmployeeIds, _record$Positions, _record$PersonInCharg, _record$GeneralStruct, _record$OperatingMana, _record$DriverPositio, _record$MechanicPosit, _record$DispatcherPos;
112
115
  var data = {
113
116
  id: id,
114
117
  EmployeeIds: ((_record$EmployeeIds = record === null || record === void 0 ? void 0 : record.EmployeeIds) !== null && _record$EmployeeIds !== void 0 ? _record$EmployeeIds : []).join(","),
115
118
  Positions: ((_record$Positions = record === null || record === void 0 ? void 0 : record.Positions) !== null && _record$Positions !== void 0 ? _record$Positions : []).join(","),
116
119
  PersonInChargeForFuelIds: ((_record$PersonInCharg = record === null || record === void 0 ? void 0 : record.PersonInChargeForFuelIds) !== null && _record$PersonInCharg !== void 0 ? _record$PersonInCharg : []).join(","),
117
120
  GeneralStructures: ((_record$GeneralStruct = record === null || record === void 0 ? void 0 : record.GeneralStructures) !== null && _record$GeneralStruct !== void 0 ? _record$GeneralStruct : []).join(","),
118
- OperatingManagerIds: ((_record$OperatingMana = record === null || record === void 0 ? void 0 : record.OperatingManagerIds) !== null && _record$OperatingMana !== void 0 ? _record$OperatingMana : []).join(",")
121
+ OperatingManagerIds: ((_record$OperatingMana = record === null || record === void 0 ? void 0 : record.OperatingManagerIds) !== null && _record$OperatingMana !== void 0 ? _record$OperatingMana : []).join(","),
122
+ DriverPositions: ((_record$DriverPositio = record === null || record === void 0 ? void 0 : record.DriverPositions) !== null && _record$DriverPositio !== void 0 ? _record$DriverPositio : []).join(","),
123
+ MechanicPositions: ((_record$MechanicPosit = record === null || record === void 0 ? void 0 : record.MechanicPositions) !== null && _record$MechanicPosit !== void 0 ? _record$MechanicPosit : []).join(","),
124
+ DispatcherPositions: ((_record$DispatcherPos = record === null || record === void 0 ? void 0 : record.DispatcherPositions) !== null && _record$DispatcherPos !== void 0 ? _record$DispatcherPos : []).join(",")
119
125
  };
120
126
  dispatch(editEmployeeConfigurations(data));
121
127
  }, [dispatch, typeSelect]);
@@ -247,11 +253,17 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
247
253
  OperatingManagerIds1: formatNames(dataObj === null || dataObj === void 0 ? void 0 : dataObj.operatingManagerIds),
248
254
  PersonInChargeForFuelIds1: formatNames(dataObj === null || dataObj === void 0 ? void 0 : dataObj.personInChargeForFuelIds),
249
255
  Positions1: formatPositionNames(dataObj === null || dataObj === void 0 ? void 0 : dataObj.positions),
256
+ DriverPositions1: formatNames(dataObj === null || dataObj === void 0 ? void 0 : dataObj.driverPositions),
257
+ MechanicPositions1: formatNames(dataObj === null || dataObj === void 0 ? void 0 : dataObj.mechanicPositions),
258
+ DispatcherPositions1: formatNames(dataObj === null || dataObj === void 0 ? void 0 : dataObj.dispatcherPositions),
250
259
  EmployeeIds: toArray(dataObj === null || dataObj === void 0 ? void 0 : dataObj.employeeIds),
251
260
  GeneralStructures: toArray(dataObj === null || dataObj === void 0 ? void 0 : dataObj.generalStructures),
252
261
  OperatingManagerIds: toArray(dataObj === null || dataObj === void 0 ? void 0 : dataObj.operatingManagerIds),
253
262
  PersonInChargeForFuelIds: toArray(dataObj === null || dataObj === void 0 ? void 0 : dataObj.personInChargeForFuelIds),
254
263
  Positions: toArray(dataObj === null || dataObj === void 0 ? void 0 : dataObj.positions),
264
+ DriverPositions: toArray(dataObj === null || dataObj === void 0 ? void 0 : dataObj.driverPositions),
265
+ MechanicPositions: toArray(dataObj === null || dataObj === void 0 ? void 0 : dataObj.mechanicPositions),
266
+ DispatcherPositions: toArray(dataObj === null || dataObj === void 0 ? void 0 : dataObj.dispatcherPositions),
255
267
  isActive: dataObj === null || dataObj === void 0 ? void 0 : dataObj.isActive,
256
268
  className: "rowClassName1"
257
269
  };
@@ -471,6 +483,51 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
471
483
  value: item.id,
472
484
  label: "".concat(item.name, " ").concat(item.surname)
473
485
  }, "".concat(item.name, " ").concat(item.surname, " ").concat(item.patronymic, ", ").concat(item.generalStructureName, ", ").concat(item.positionName));
486
+ }))), /*#__PURE__*/React.createElement(Item, {
487
+ rules: [{
488
+ required: false,
489
+ message: ""
490
+ }],
491
+ name: "DriverPositions",
492
+ label: "Sürücülər"
493
+ }, /*#__PURE__*/React.createElement(Select, {
494
+ mode: "multiple"
495
+ }, transportEmployeesAll === null || transportEmployeesAll === void 0 ? void 0 : transportEmployeesAll.map(function (item) {
496
+ return /*#__PURE__*/React.createElement(Option, {
497
+ key: item.id,
498
+ value: item.id,
499
+ label: "".concat(item.name, " ").concat(item.surname)
500
+ }, "".concat(item.name, " ").concat(item.surname, " ").concat(item.patronymic, ", ").concat(item.generalStructureName, ", ").concat(item.positionName));
501
+ }))), /*#__PURE__*/React.createElement(Item, {
502
+ rules: [{
503
+ required: false,
504
+ message: ""
505
+ }],
506
+ name: "MechanicPositions",
507
+ label: "Mexaniklər"
508
+ }, /*#__PURE__*/React.createElement(Select, {
509
+ mode: "multiple"
510
+ }, transportEmployeesAll === null || transportEmployeesAll === void 0 ? void 0 : transportEmployeesAll.map(function (item) {
511
+ return /*#__PURE__*/React.createElement(Option, {
512
+ key: item.id,
513
+ value: item.id,
514
+ label: "".concat(item.name, " ").concat(item.surname)
515
+ }, "".concat(item.name, " ").concat(item.surname, " ").concat(item.patronymic, ", ").concat(item.generalStructureName, ", ").concat(item.positionName));
516
+ }))), /*#__PURE__*/React.createElement(Item, {
517
+ rules: [{
518
+ required: false,
519
+ message: ""
520
+ }],
521
+ name: "DispatcherPositions",
522
+ label: "Dispetçerlər"
523
+ }, /*#__PURE__*/React.createElement(Select, {
524
+ mode: "multiple"
525
+ }, transportEmployeesAll === null || transportEmployeesAll === void 0 ? void 0 : transportEmployeesAll.map(function (item) {
526
+ return /*#__PURE__*/React.createElement(Option, {
527
+ key: item.id,
528
+ value: item.id,
529
+ label: "".concat(item.name, " ").concat(item.surname)
530
+ }, "".concat(item.name, " ").concat(item.surname, " ").concat(item.patronymic, ", ").concat(item.generalStructureName, ", ").concat(item.positionName));
474
531
  })))), /*#__PURE__*/React.createElement(DeleteModal, {
475
532
  onCancel: function onCancel() {
476
533
  return dispatch(setDeleteModalVisible(false));
@@ -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
  },
@@ -10468,7 +10468,7 @@ export var getEmployeeConfigurationsAll = createAsyncThunk("/getEmployeeConfigur
10468
10468
  _context320.prev = 1;
10469
10469
  dispatch(setLoading(true));
10470
10470
  _context320.next = 5;
10471
- return Services.getEmployeeConfigurationsAll(visibility);
10471
+ return Services.getEmployeeConfigurationsAll(visibility === null || visibility === void 0 ? void 0 : visibility.visibility);
10472
10472
  case 5:
10473
10473
  response = _context320.sent;
10474
10474
  dispatch(setLoading(false));
@@ -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;
@@ -5516,16 +5516,15 @@ _defineProperty(Services, "addEmployeeConfigurations", /*#__PURE__*/function ()
5516
5516
  return _regeneratorRuntime.wrap(function _callee298$(_context298) {
5517
5517
  while (1) switch (_context298.prev = _context298.next) {
5518
5518
  case 0:
5519
- console.log(data);
5520
- _context298.next = 3;
5519
+ _context298.next = 2;
5521
5520
  return api.post("/employeeconfigurations", data, {
5522
5521
  headers: {
5523
5522
  "Content-Type": "application/json"
5524
5523
  }
5525
5524
  });
5526
- case 3:
5525
+ case 2:
5527
5526
  return _context298.abrupt("return", _context298.sent);
5528
- case 4:
5527
+ case 3:
5529
5528
  case "end":
5530
5529
  return _context298.stop();
5531
5530
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@banch0u/core-project-test-repository",
3
- "version": "1.9.8",
3
+ "version": "1.9.10",
4
4
  "description": "Shared core features for all projects",
5
5
  "main": "dist/index.js",
6
6
  "files": [