@banch0u/core-project-test-repository 2.1.16 → 2.2.1
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/NotificationDropdown/index.js +16 -11
- package/dist/components/NotificationSettingsContent/index.js +21 -35
- package/dist/components/ProfileOptions/index.js +52 -22
- package/dist/hooks/useLang.js +36 -0
- package/dist/layout/Header/AppSelect/index.js +29 -13
- package/dist/layout/QuestionnairesSidebar/index.js +10 -2
- package/dist/pages/Login/index.js +8 -5
- package/dist/pages/Platform/constant.js +61 -50
- package/dist/pages/Platform/index.js +11 -8
- package/dist/pages/Questionnnaires/QuestionnairesDefaultAgreementPlansContent/constant.js +7 -1
- package/dist/pages/Questionnnaires/QuestionnairesDefaultAgreementPlansContent/index.js +79 -36
- package/dist/pages/Questionnnaires/QuestionnairesInternalStructureContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesInternalStructureContent/index.js +247 -0
- package/dist/routes/QuestionnaireRoutes.js +7 -1
- package/dist/store/slices/auth/index.js +6 -6
- package/dist/store/slices/employees/index.js +38 -4
- package/dist/store/slices/employees/service.js +16 -0
- package/dist/store/slices/global/index.js +156 -150
- package/dist/store/slices/questionnaire/index.js +502 -293
- package/dist/store/slices/questionnaire/service.js +128 -0
- package/dist/tools/questionnaireGenerator.js +3 -3
- package/dist/translations/index.json +364 -0
- package/dist/utils/path.js +4 -0
- package/package.json +1 -1
|
@@ -9,10 +9,12 @@ import style from "./index.module.scss";
|
|
|
9
9
|
import NotificationSettingsContent from "../NotificationSettingsContent";
|
|
10
10
|
import FormModal from "../FormModal";
|
|
11
11
|
var NotificationDropdown = function NotificationDropdown(_ref) {
|
|
12
|
-
var _notifications$notifi;
|
|
12
|
+
var _notifications$notifi, _text$lang, _text$lang2, _text$lang3, _text$lang4, _text$lang5, _text$lang6, _text$lang7, _text$lang11;
|
|
13
13
|
var size = _ref.size,
|
|
14
14
|
setSize = _ref.setSize,
|
|
15
|
-
setPage = _ref.setPage
|
|
15
|
+
setPage = _ref.setPage,
|
|
16
|
+
lang = _ref.lang,
|
|
17
|
+
text = _ref.text;
|
|
16
18
|
var dispatch = useDispatch();
|
|
17
19
|
var modalRef = useRef(); // ⬅️ Modal ref
|
|
18
20
|
var contentRef = useRef(); // ⬅️ NotificationSettingsContent ref
|
|
@@ -24,7 +26,7 @@ var NotificationDropdown = function NotificationDropdown(_ref) {
|
|
|
24
26
|
var totalCount = notifications === null || notifications === void 0 ? void 0 : notifications.totalCount;
|
|
25
27
|
var items = (notifications === null || notifications === void 0 || (_notifications$notifi = notifications.notifications) === null || _notifications$notifi === void 0 ? void 0 : _notifications$notifi.items) || [];
|
|
26
28
|
var hasMore = items.length < totalCount;
|
|
27
|
-
var projects = ["",
|
|
29
|
+
var projects = ["", text === null || text === void 0 || (_text$lang = text[lang]) === null || _text$lang === void 0 || (_text$lang = _text$lang.pages) === null || _text$lang === void 0 || (_text$lang = _text$lang.platform) === null || _text$lang === void 0 || (_text$lang = _text$lang.projects) === null || _text$lang === void 0 ? void 0 : _text$lang.docflow, text === null || text === void 0 || (_text$lang2 = text[lang]) === null || _text$lang2 === void 0 || (_text$lang2 = _text$lang2.pages) === null || _text$lang2 === void 0 || (_text$lang2 = _text$lang2.platform) === null || _text$lang2 === void 0 || (_text$lang2 = _text$lang2.projects) === null || _text$lang2 === void 0 ? void 0 : _text$lang2.hr, text === null || text === void 0 || (_text$lang3 = text[lang]) === null || _text$lang3 === void 0 || (_text$lang3 = _text$lang3.pages) === null || _text$lang3 === void 0 || (_text$lang3 = _text$lang3.platform) === null || _text$lang3 === void 0 || (_text$lang3 = _text$lang3.projects) === null || _text$lang3 === void 0 ? void 0 : _text$lang3.contracts, text === null || text === void 0 || (_text$lang4 = text[lang]) === null || _text$lang4 === void 0 || (_text$lang4 = _text$lang4.pages) === null || _text$lang4 === void 0 || (_text$lang4 = _text$lang4.platform) === null || _text$lang4 === void 0 || (_text$lang4 = _text$lang4.projects) === null || _text$lang4 === void 0 ? void 0 : _text$lang4.privateAccount];
|
|
28
30
|
var parseNotification = function parseNotification(value) {
|
|
29
31
|
try {
|
|
30
32
|
return JSON.parse(value);
|
|
@@ -93,14 +95,14 @@ var NotificationDropdown = function NotificationDropdown(_ref) {
|
|
|
93
95
|
className: style.header
|
|
94
96
|
}, /*#__PURE__*/React.createElement(Typography.Text, {
|
|
95
97
|
strong: true
|
|
96
|
-
}, "
|
|
98
|
+
}, text === null || text === void 0 || (_text$lang5 = text[lang]) === null || _text$lang5 === void 0 || (_text$lang5 = _text$lang5.pages) === null || _text$lang5 === void 0 || (_text$lang5 = _text$lang5.header) === null || _text$lang5 === void 0 || (_text$lang5 = _text$lang5.notifications) === null || _text$lang5 === void 0 ? void 0 : _text$lang5.title, " (", totalCount, ")"), /*#__PURE__*/React.createElement("div", {
|
|
97
99
|
className: style.headerActions
|
|
98
100
|
}, notReadenCount > 0 && /*#__PURE__*/React.createElement(Button, {
|
|
99
101
|
size: "small",
|
|
100
102
|
icon: /*#__PURE__*/React.createElement(CheckOutlined, null),
|
|
101
103
|
onClick: handleReadAll,
|
|
102
104
|
type: "text"
|
|
103
|
-
},
|
|
105
|
+
}, text === null || text === void 0 || (_text$lang6 = text[lang]) === null || _text$lang6 === void 0 || (_text$lang6 = _text$lang6.pages) === null || _text$lang6 === void 0 || (_text$lang6 = _text$lang6.header) === null || _text$lang6 === void 0 || (_text$lang6 = _text$lang6.notifications) === null || _text$lang6 === void 0 ? void 0 : _text$lang6.readAll), /*#__PURE__*/React.createElement(Button, {
|
|
104
106
|
size: "small",
|
|
105
107
|
icon: /*#__PURE__*/React.createElement(SettingOutlined, null),
|
|
106
108
|
type: "text",
|
|
@@ -108,14 +110,15 @@ var NotificationDropdown = function NotificationDropdown(_ref) {
|
|
|
108
110
|
}))), /*#__PURE__*/React.createElement(List, {
|
|
109
111
|
dataSource: items,
|
|
110
112
|
locale: {
|
|
111
|
-
emptyText:
|
|
113
|
+
emptyText: text === null || text === void 0 || (_text$lang7 = text[lang]) === null || _text$lang7 === void 0 || (_text$lang7 = _text$lang7.pages) === null || _text$lang7 === void 0 || (_text$lang7 = _text$lang7.header) === null || _text$lang7 === void 0 || (_text$lang7 = _text$lang7.notifications) === null || _text$lang7 === void 0 ? void 0 : _text$lang7.nonotification
|
|
112
114
|
},
|
|
113
115
|
renderItem: function renderItem(item) {
|
|
116
|
+
var _text$lang8, _text$lang9, _text$lang10;
|
|
114
117
|
var parsed = parseNotification(item.text);
|
|
115
118
|
return /*#__PURE__*/React.createElement(List.Item, {
|
|
116
119
|
className: "".concat(style.notificationItem, " ").concat(item.isReaden ? style.read : style.unread),
|
|
117
120
|
actions: [!item.isReaden && /*#__PURE__*/React.createElement(Tooltip, {
|
|
118
|
-
title:
|
|
121
|
+
title: text === null || text === void 0 || (_text$lang8 = text[lang]) === null || _text$lang8 === void 0 || (_text$lang8 = _text$lang8.pages) === null || _text$lang8 === void 0 || (_text$lang8 = _text$lang8.header) === null || _text$lang8 === void 0 || (_text$lang8 = _text$lang8.notifications) === null || _text$lang8 === void 0 ? void 0 : _text$lang8.read
|
|
119
122
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
120
123
|
size: "small",
|
|
121
124
|
type: "link",
|
|
@@ -132,7 +135,7 @@ var NotificationDropdown = function NotificationDropdown(_ref) {
|
|
|
132
135
|
style: {
|
|
133
136
|
cursor: "pointer"
|
|
134
137
|
}
|
|
135
|
-
}, projects[parsed.Project] ||
|
|
138
|
+
}, projects[parsed.Project] || (text === null || text === void 0 || (_text$lang9 = text[lang]) === null || _text$lang9 === void 0 || (_text$lang9 = _text$lang9.pages) === null || _text$lang9 === void 0 || (_text$lang9 = _text$lang9.header) === null || _text$lang9 === void 0 || (_text$lang9 = _text$lang9.notifications) === null || _text$lang9 === void 0 ? void 0 : _text$lang9.title)),
|
|
136
139
|
description: /*#__PURE__*/React.createElement("div", {
|
|
137
140
|
className: style.ellipsisText,
|
|
138
141
|
onClick: function onClick() {
|
|
@@ -141,7 +144,7 @@ var NotificationDropdown = function NotificationDropdown(_ref) {
|
|
|
141
144
|
style: {
|
|
142
145
|
cursor: "pointer"
|
|
143
146
|
}
|
|
144
|
-
}, parsed.Text ||
|
|
147
|
+
}, parsed.Text || (text === null || text === void 0 || (_text$lang10 = text[lang]) === null || _text$lang10 === void 0 || (_text$lang10 = _text$lang10.pages) === null || _text$lang10 === void 0 || (_text$lang10 = _text$lang10.header) === null || _text$lang10 === void 0 || (_text$lang10 = _text$lang10.notifications) === null || _text$lang10 === void 0 ? void 0 : _text$lang10.title))
|
|
145
148
|
}));
|
|
146
149
|
}
|
|
147
150
|
}), hasMore && /*#__PURE__*/React.createElement("div", {
|
|
@@ -150,13 +153,15 @@ var NotificationDropdown = function NotificationDropdown(_ref) {
|
|
|
150
153
|
size: "small",
|
|
151
154
|
type: "text",
|
|
152
155
|
onClick: handleLoadMore
|
|
153
|
-
},
|
|
156
|
+
}, text === null || text === void 0 || (_text$lang11 = text[lang]) === null || _text$lang11 === void 0 || (_text$lang11 = _text$lang11.pages) === null || _text$lang11 === void 0 || (_text$lang11 = _text$lang11.header) === null || _text$lang11 === void 0 || (_text$lang11 = _text$lang11.notifications) === null || _text$lang11 === void 0 ? void 0 : _text$lang11.showMore))), /*#__PURE__*/React.createElement(FormModal, {
|
|
154
157
|
ref: modalRef,
|
|
155
158
|
width: 695,
|
|
156
159
|
showButtons: false
|
|
157
160
|
}, /*#__PURE__*/React.createElement(NotificationSettingsContent, {
|
|
158
161
|
ref: contentRef,
|
|
159
|
-
onClose: onCloseModal
|
|
162
|
+
onClose: onCloseModal,
|
|
163
|
+
lang: lang,
|
|
164
|
+
text: text
|
|
160
165
|
})));
|
|
161
166
|
};
|
|
162
167
|
export default NotificationDropdown;
|
|
@@ -12,36 +12,8 @@ import Button from "../Button";
|
|
|
12
12
|
var Title = Typography.Title,
|
|
13
13
|
Text = Typography.Text;
|
|
14
14
|
var Option = Select.Option;
|
|
15
|
-
var labels = {
|
|
16
|
-
internalIsActive: "Daxili bildirişlər",
|
|
17
|
-
emailIsActive: "Email bildirişləri",
|
|
18
|
-
visa: "Viza üçün",
|
|
19
|
-
sign: "İmza üçün",
|
|
20
|
-
reject: "İmtina üçün",
|
|
21
|
-
print: "Çap üçün",
|
|
22
|
-
accouncement: "Elanlar",
|
|
23
|
-
news: "Xəbərlər",
|
|
24
|
-
reservations: "Tədbir/İclas",
|
|
25
|
-
surveys: "Sorğular",
|
|
26
|
-
timeOffRequest: "İcazələr",
|
|
27
|
-
tutorials: "Təlimatlar və video"
|
|
28
|
-
};
|
|
29
|
-
var projectOptions = {
|
|
30
|
-
docFlowSettings: {
|
|
31
|
-
label: "Sənəd Dövriyyəsi",
|
|
32
|
-
keys: ["visa", "sign", "reject", "print"]
|
|
33
|
-
},
|
|
34
|
-
contractSettings: {
|
|
35
|
-
label: "Müqavilələr",
|
|
36
|
-
keys: ["visa", "sign", "reject"]
|
|
37
|
-
},
|
|
38
|
-
accountSettings: {
|
|
39
|
-
label: "Şəxsi kabinet",
|
|
40
|
-
keys: ["accouncement", "news", "reservations", "surveys", "timeOffRequest", "tutorials"]
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
15
|
var NotificationSettingsContent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
44
|
-
var _allValues$generalSet, _allValues$generalSet2, _allValues$generalSet3, _allValues$generalSet4;
|
|
16
|
+
var _props$text, _props$text2, _props$text3, _props$text4, _props$text5, _allValues$generalSet, _allValues$generalSet2, _allValues$generalSet3, _allValues$generalSet4, _props$text6, _props$text7, _props$text8, _props$text9;
|
|
45
17
|
var _Form$useForm = Form.useForm(),
|
|
46
18
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
47
19
|
form = _Form$useForm2[0];
|
|
@@ -50,7 +22,21 @@ var NotificationSettingsContent = /*#__PURE__*/React.forwardRef(function (props,
|
|
|
50
22
|
var initialValues = useSelector(function (state) {
|
|
51
23
|
return state.notification.notificationSettings;
|
|
52
24
|
});
|
|
53
|
-
|
|
25
|
+
var labels = props === null || props === void 0 || (_props$text = props.text) === null || _props$text === void 0 || (_props$text = _props$text[props === null || props === void 0 ? void 0 : props.lang]) === null || _props$text === void 0 || (_props$text = _props$text.pages) === null || _props$text === void 0 || (_props$text = _props$text.header) === null || _props$text === void 0 || (_props$text = _props$text.notifications) === null || _props$text === void 0 || (_props$text = _props$text.notificationsettings) === null || _props$text === void 0 ? void 0 : _props$text.labels;
|
|
26
|
+
var projectOptions = {
|
|
27
|
+
docFlowSettings: {
|
|
28
|
+
label: props === null || props === void 0 || (_props$text2 = props.text) === null || _props$text2 === void 0 || (_props$text2 = _props$text2[props === null || props === void 0 ? void 0 : props.lang]) === null || _props$text2 === void 0 || (_props$text2 = _props$text2.pages) === null || _props$text2 === void 0 || (_props$text2 = _props$text2.platform) === null || _props$text2 === void 0 || (_props$text2 = _props$text2.projects) === null || _props$text2 === void 0 ? void 0 : _props$text2.docflow,
|
|
29
|
+
keys: ["visa", "sign", "reject", "print"]
|
|
30
|
+
},
|
|
31
|
+
contractSettings: {
|
|
32
|
+
label: props === null || props === void 0 || (_props$text3 = props.text) === null || _props$text3 === void 0 || (_props$text3 = _props$text3[props === null || props === void 0 ? void 0 : props.lang]) === null || _props$text3 === void 0 || (_props$text3 = _props$text3.pages) === null || _props$text3 === void 0 || (_props$text3 = _props$text3.platform) === null || _props$text3 === void 0 || (_props$text3 = _props$text3.projects) === null || _props$text3 === void 0 ? void 0 : _props$text3.contracts,
|
|
33
|
+
keys: ["visa", "sign", "reject"]
|
|
34
|
+
},
|
|
35
|
+
accountSettings: {
|
|
36
|
+
label: props === null || props === void 0 || (_props$text4 = props.text) === null || _props$text4 === void 0 || (_props$text4 = _props$text4[props === null || props === void 0 ? void 0 : props.lang]) === null || _props$text4 === void 0 || (_props$text4 = _props$text4.pages) === null || _props$text4 === void 0 || (_props$text4 = _props$text4.platform) === null || _props$text4 === void 0 || (_props$text4 = _props$text4.projects) === null || _props$text4 === void 0 ? void 0 : _props$text4.accounts,
|
|
37
|
+
keys: ["accouncement", "news", "reservations", "surveys", "timeOffRequest", "tutorials"]
|
|
38
|
+
}
|
|
39
|
+
};
|
|
54
40
|
var getDefaultProjectFromPath = function getDefaultProjectFromPath(path) {
|
|
55
41
|
if (path.includes("/contract")) return "contractSettings";
|
|
56
42
|
return "docFlowSettings";
|
|
@@ -174,7 +160,7 @@ var NotificationSettingsContent = /*#__PURE__*/React.forwardRef(function (props,
|
|
|
174
160
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
175
161
|
level: 5,
|
|
176
162
|
className: style.sectionTitle
|
|
177
|
-
},
|
|
163
|
+
}, props === null || props === void 0 || (_props$text5 = props.text) === null || _props$text5 === void 0 || (_props$text5 = _props$text5[props === null || props === void 0 ? void 0 : props.lang]) === null || _props$text5 === void 0 || (_props$text5 = _props$text5.pages) === null || _props$text5 === void 0 || (_props$text5 = _props$text5.header) === null || _props$text5 === void 0 || (_props$text5 = _props$text5.notifications) === null || _props$text5 === void 0 || (_props$text5 = _props$text5.notificationsettings) === null || _props$text5 === void 0 ? void 0 : _props$text5.title), /*#__PURE__*/React.createElement(Row, {
|
|
178
164
|
gutter: [40, 0]
|
|
179
165
|
}, /*#__PURE__*/React.createElement(Col, {
|
|
180
166
|
span: 12
|
|
@@ -218,11 +204,11 @@ var NotificationSettingsContent = /*#__PURE__*/React.forwardRef(function (props,
|
|
|
218
204
|
}, label);
|
|
219
205
|
}))), /*#__PURE__*/React.createElement(Text, {
|
|
220
206
|
className: style.settingGroupTitle
|
|
221
|
-
},
|
|
207
|
+
}, props === null || props === void 0 || (_props$text6 = props.text) === null || _props$text6 === void 0 || (_props$text6 = _props$text6[props === null || props === void 0 ? void 0 : props.lang]) === null || _props$text6 === void 0 || (_props$text6 = _props$text6.pages) === null || _props$text6 === void 0 || (_props$text6 = _props$text6.header) === null || _props$text6 === void 0 || (_props$text6 = _props$text6.notifications) === null || _props$text6 === void 0 || (_props$text6 = _props$text6.notificationsettings) === null || _props$text6 === void 0 ? void 0 : _props$text6.internal), /*#__PURE__*/React.createElement(Row, {
|
|
222
208
|
gutter: [24, 24]
|
|
223
209
|
}, renderSwitches("internalSettings")), /*#__PURE__*/React.createElement(Text, {
|
|
224
210
|
className: style.settingGroupTitle
|
|
225
|
-
},
|
|
211
|
+
}, props === null || props === void 0 || (_props$text7 = props.text) === null || _props$text7 === void 0 || (_props$text7 = _props$text7[props === null || props === void 0 ? void 0 : props.lang]) === null || _props$text7 === void 0 || (_props$text7 = _props$text7.pages) === null || _props$text7 === void 0 || (_props$text7 = _props$text7.header) === null || _props$text7 === void 0 || (_props$text7 = _props$text7.notifications) === null || _props$text7 === void 0 || (_props$text7 = _props$text7.notificationsettings) === null || _props$text7 === void 0 ? void 0 : _props$text7.email), /*#__PURE__*/React.createElement(Row, {
|
|
226
212
|
gutter: [24, 24]
|
|
227
213
|
}, renderSwitches("emailSettings")), /*#__PURE__*/React.createElement("div", {
|
|
228
214
|
className: style.next_buttons_
|
|
@@ -233,11 +219,11 @@ var NotificationSettingsContent = /*#__PURE__*/React.forwardRef(function (props,
|
|
|
233
219
|
e.preventDefault();
|
|
234
220
|
},
|
|
235
221
|
color: "white"
|
|
236
|
-
},
|
|
222
|
+
}, props === null || props === void 0 || (_props$text8 = props.text) === null || _props$text8 === void 0 || (_props$text8 = _props$text8[props === null || props === void 0 ? void 0 : props.lang]) === null || _props$text8 === void 0 || (_props$text8 = _props$text8.pages) === null || _props$text8 === void 0 || (_props$text8 = _props$text8.common) === null || _props$text8 === void 0 ? void 0 : _props$text8.cancel), /*#__PURE__*/React.createElement(Button, {
|
|
237
223
|
color: "green",
|
|
238
224
|
onClick: function onClick() {
|
|
239
225
|
return onSubmit(allValues);
|
|
240
226
|
}
|
|
241
|
-
},
|
|
227
|
+
}, props === null || props === void 0 || (_props$text9 = props.text) === null || _props$text9 === void 0 || (_props$text9 = _props$text9[props === null || props === void 0 ? void 0 : props.lang]) === null || _props$text9 === void 0 || (_props$text9 = _props$text9.pages) === null || _props$text9 === void 0 || (_props$text9 = _props$text9.common) === null || _props$text9 === void 0 ? void 0 : _props$text9.save)));
|
|
242
228
|
});
|
|
243
229
|
export default NotificationSettingsContent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { useEffect, useState, useRef } from "react";
|
|
3
|
-
import { Badge, Dropdown, Tooltip, Modal, Form, Input } from "antd";
|
|
3
|
+
import { Badge, Dropdown, Tooltip, Modal, Form, Input, Select as AntdSelect } from "antd";
|
|
4
4
|
import { SunOutlined } from "@ant-design/icons";
|
|
5
5
|
import style from "./index.module.scss";
|
|
6
6
|
import { useDispatch, useSelector } from "react-redux";
|
|
@@ -11,10 +11,15 @@ import NotificationDropdown from "../NotificationDropdown";
|
|
|
11
11
|
import { Link, useNavigate } from "react-router-dom";
|
|
12
12
|
import { LOGIN_PATH } from "../../utils/path";
|
|
13
13
|
import Button from "../Button";
|
|
14
|
+
import Select from "../Select";
|
|
15
|
+
var Option = AntdSelect.Option;
|
|
16
|
+
import { useLang } from "../../hooks/useLang";
|
|
17
|
+
import text from "../../translations/index.json";
|
|
14
18
|
var ProfileOptions = function ProfileOptions() {
|
|
15
|
-
var _profileInfo$name;
|
|
19
|
+
var _text$lang, _text$lang2, _text$lang3, _profileInfo$name, _text$lang4, _text$lang5, _text$lang6, _text$lang7, _text$lang8, _text$lang9, _text$lang16, _text$lang18, _text$lang19;
|
|
16
20
|
var dispatch = useDispatch();
|
|
17
21
|
var navigate = useNavigate();
|
|
22
|
+
var lang = useLang();
|
|
18
23
|
var profileInfo = useSelector(function (state) {
|
|
19
24
|
return state.auth.profileInfo;
|
|
20
25
|
});
|
|
@@ -145,23 +150,41 @@ var ProfileOptions = function ProfileOptions() {
|
|
|
145
150
|
|
|
146
151
|
return /*#__PURE__*/React.createElement("div", {
|
|
147
152
|
className: style.profile
|
|
148
|
-
}, /*#__PURE__*/React.createElement(
|
|
153
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
154
|
+
className: style.lang_select,
|
|
155
|
+
popupClassName: style.lang_select_dropdown,
|
|
156
|
+
suffixIcon: null,
|
|
157
|
+
allowClear: false,
|
|
158
|
+
showSearch: false,
|
|
159
|
+
onChange: function onChange(val) {
|
|
160
|
+
localStorage.setItem("lang", val);
|
|
161
|
+
},
|
|
162
|
+
value: lang
|
|
163
|
+
}, /*#__PURE__*/React.createElement(Option, {
|
|
164
|
+
value: "az"
|
|
165
|
+
}, "AZ"), /*#__PURE__*/React.createElement(Option, {
|
|
166
|
+
value: "en"
|
|
167
|
+
}, "EN"), /*#__PURE__*/React.createElement(Option, {
|
|
168
|
+
value: "ru"
|
|
169
|
+
}, "RU")), /*#__PURE__*/React.createElement(Dropdown, {
|
|
149
170
|
overlay: /*#__PURE__*/React.createElement(NotificationDropdown, {
|
|
150
171
|
size: size,
|
|
151
172
|
page: page,
|
|
152
173
|
setSize: setSize,
|
|
153
|
-
setPage: setPage
|
|
174
|
+
setPage: setPage,
|
|
175
|
+
lang: lang,
|
|
176
|
+
text: text
|
|
154
177
|
}),
|
|
155
178
|
trigger: ["click"],
|
|
156
179
|
placement: "bottomRight",
|
|
157
180
|
overlayClassName: style.notificationDropdown
|
|
158
181
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
159
|
-
title:
|
|
182
|
+
title: text === null || text === void 0 || (_text$lang = text[lang]) === null || _text$lang === void 0 || (_text$lang = _text$lang.pages) === null || _text$lang === void 0 || (_text$lang = _text$lang.header) === null || _text$lang === void 0 || (_text$lang = _text$lang.notifications) === null || _text$lang === void 0 ? void 0 : _text$lang.title
|
|
160
183
|
}, /*#__PURE__*/React.createElement("button", {
|
|
161
184
|
"data-no-invert": true,
|
|
162
185
|
className: style.button
|
|
163
186
|
}, /*#__PURE__*/React.createElement(NotificationIcon, null)))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
164
|
-
title: theme === "dark" ?
|
|
187
|
+
title: theme === "dark" ? text === null || text === void 0 || (_text$lang2 = text[lang]) === null || _text$lang2 === void 0 || (_text$lang2 = _text$lang2.pages) === null || _text$lang2 === void 0 || (_text$lang2 = _text$lang2.header) === null || _text$lang2 === void 0 ? void 0 : _text$lang2.lightMode : text === null || text === void 0 || (_text$lang3 = text[lang]) === null || _text$lang3 === void 0 || (_text$lang3 = _text$lang3.pages) === null || _text$lang3 === void 0 || (_text$lang3 = _text$lang3.header) === null || _text$lang3 === void 0 ? void 0 : _text$lang3.darkMode
|
|
165
188
|
}, /*#__PURE__*/React.createElement("button", {
|
|
166
189
|
onClick: toggleTheme,
|
|
167
190
|
"data-no-invert": true,
|
|
@@ -201,25 +224,25 @@ var ProfileOptions = function ProfileOptions() {
|
|
|
201
224
|
}, scopesData === "*" && /*#__PURE__*/React.createElement(Link, {
|
|
202
225
|
className: style.menuItem,
|
|
203
226
|
to: "".concat(rootUrl, "/settings")
|
|
204
|
-
}, /*#__PURE__*/React.createElement(SettingsCogIcon, null), /*#__PURE__*/React.createElement("span", null,
|
|
227
|
+
}, /*#__PURE__*/React.createElement(SettingsCogIcon, null), /*#__PURE__*/React.createElement("span", null, text === null || text === void 0 || (_text$lang4 = text[lang]) === null || _text$lang4 === void 0 || (_text$lang4 = _text$lang4.pages) === null || _text$lang4 === void 0 || (_text$lang4 = _text$lang4.header) === null || _text$lang4 === void 0 ? void 0 : _text$lang4.settings)), loginType === 0 ? /*#__PURE__*/React.createElement("div", {
|
|
205
228
|
className: style.menuItem,
|
|
206
229
|
onClick: openPasswordModal
|
|
207
|
-
}, /*#__PURE__*/React.createElement(ChangePasswordIcon, null), /*#__PURE__*/React.createElement("span", null,
|
|
230
|
+
}, /*#__PURE__*/React.createElement(ChangePasswordIcon, null), /*#__PURE__*/React.createElement("span", null, text === null || text === void 0 || (_text$lang5 = text[lang]) === null || _text$lang5 === void 0 || (_text$lang5 = _text$lang5.pages) === null || _text$lang5 === void 0 || (_text$lang5 = _text$lang5.header) === null || _text$lang5 === void 0 || (_text$lang5 = _text$lang5.changePassword) === null || _text$lang5 === void 0 ? void 0 : _text$lang5.title)) : null, /*#__PURE__*/React.createElement("div", {
|
|
208
231
|
className: style.menuItem,
|
|
209
232
|
onClick: handleLogout
|
|
210
233
|
}, /*#__PURE__*/React.createElement(LogOutIcon, null), /*#__PURE__*/React.createElement("span", {
|
|
211
234
|
className: style.logoutText
|
|
212
|
-
},
|
|
235
|
+
}, text === null || text === void 0 || (_text$lang6 = text[lang]) === null || _text$lang6 === void 0 || (_text$lang6 = _text$lang6.pages) === null || _text$lang6 === void 0 || (_text$lang6 = _text$lang6.header) === null || _text$lang6 === void 0 ? void 0 : _text$lang6.logOut)))), /*#__PURE__*/React.createElement(Modal, {
|
|
213
236
|
open: isPasswordModalOpen,
|
|
214
237
|
onCancel: closePasswordModal,
|
|
215
238
|
footer: null,
|
|
216
239
|
centered: true,
|
|
217
|
-
title:
|
|
240
|
+
title: text === null || text === void 0 || (_text$lang7 = text[lang]) === null || _text$lang7 === void 0 || (_text$lang7 = _text$lang7.pages) === null || _text$lang7 === void 0 || (_text$lang7 = _text$lang7.header) === null || _text$lang7 === void 0 || (_text$lang7 = _text$lang7.changePassword) === null || _text$lang7 === void 0 ? void 0 : _text$lang7.title
|
|
218
241
|
}, /*#__PURE__*/React.createElement(Form, {
|
|
219
242
|
form: form,
|
|
220
243
|
layout: "vertical"
|
|
221
244
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
222
|
-
label:
|
|
245
|
+
label: text === null || text === void 0 || (_text$lang8 = text[lang]) === null || _text$lang8 === void 0 || (_text$lang8 = _text$lang8.pages) === null || _text$lang8 === void 0 || (_text$lang8 = _text$lang8.header) === null || _text$lang8 === void 0 || (_text$lang8 = _text$lang8.changePassword) === null || _text$lang8 === void 0 ? void 0 : _text$lang8.oldPassword,
|
|
223
246
|
name: "currentPassword",
|
|
224
247
|
rules: [{
|
|
225
248
|
required: true,
|
|
@@ -230,7 +253,7 @@ var ProfileOptions = function ProfileOptions() {
|
|
|
230
253
|
height: "48px"
|
|
231
254
|
}
|
|
232
255
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
233
|
-
label:
|
|
256
|
+
label: text === null || text === void 0 || (_text$lang9 = text[lang]) === null || _text$lang9 === void 0 || (_text$lang9 = _text$lang9.pages) === null || _text$lang9 === void 0 || (_text$lang9 = _text$lang9.header) === null || _text$lang9 === void 0 || (_text$lang9 = _text$lang9.changePassword) === null || _text$lang9 === void 0 ? void 0 : _text$lang9.newPassword,
|
|
234
257
|
name: "newPassword",
|
|
235
258
|
rules: [{
|
|
236
259
|
required: true,
|
|
@@ -242,22 +265,28 @@ var ProfileOptions = function ProfileOptions() {
|
|
|
242
265
|
if (!value) return Promise.resolve();
|
|
243
266
|
var errors = [];
|
|
244
267
|
if (value.length < 8) {
|
|
245
|
-
|
|
268
|
+
var _text$lang10;
|
|
269
|
+
errors.push(text === null || text === void 0 || (_text$lang10 = text[lang]) === null || _text$lang10 === void 0 || (_text$lang10 = _text$lang10.pages) === null || _text$lang10 === void 0 || (_text$lang10 = _text$lang10.header) === null || _text$lang10 === void 0 || (_text$lang10 = _text$lang10.changePassword) === null || _text$lang10 === void 0 || (_text$lang10 = _text$lang10.hints) === null || _text$lang10 === void 0 ? void 0 : _text$lang10.passwordLength);
|
|
246
270
|
}
|
|
247
271
|
if (!/[A-Z]/.test(value)) {
|
|
248
|
-
|
|
272
|
+
var _text$lang11;
|
|
273
|
+
errors.push(text === null || text === void 0 || (_text$lang11 = text[lang]) === null || _text$lang11 === void 0 || (_text$lang11 = _text$lang11.pages) === null || _text$lang11 === void 0 || (_text$lang11 = _text$lang11.header) === null || _text$lang11 === void 0 || (_text$lang11 = _text$lang11.changePassword) === null || _text$lang11 === void 0 || (_text$lang11 = _text$lang11.hints) === null || _text$lang11 === void 0 ? void 0 : _text$lang11.passwordUppercase);
|
|
249
274
|
}
|
|
250
275
|
if (!/[a-z]/.test(value)) {
|
|
251
|
-
|
|
276
|
+
var _text$lang12;
|
|
277
|
+
errors.push(text === null || text === void 0 || (_text$lang12 = text[lang]) === null || _text$lang12 === void 0 || (_text$lang12 = _text$lang12.pages) === null || _text$lang12 === void 0 || (_text$lang12 = _text$lang12.header) === null || _text$lang12 === void 0 || (_text$lang12 = _text$lang12.changePassword) === null || _text$lang12 === void 0 || (_text$lang12 = _text$lang12.hints) === null || _text$lang12 === void 0 ? void 0 : _text$lang12.passwordLowercase);
|
|
252
278
|
}
|
|
253
279
|
if (!/[0-9]/.test(value)) {
|
|
254
|
-
|
|
280
|
+
var _text$lang13;
|
|
281
|
+
errors.push(text === null || text === void 0 || (_text$lang13 = text[lang]) === null || _text$lang13 === void 0 || (_text$lang13 = _text$lang13.pages) === null || _text$lang13 === void 0 || (_text$lang13 = _text$lang13.header) === null || _text$lang13 === void 0 || (_text$lang13 = _text$lang13.changePassword) === null || _text$lang13 === void 0 || (_text$lang13 = _text$lang13.hints) === null || _text$lang13 === void 0 ? void 0 : _text$lang13.passwordDigit);
|
|
255
282
|
}
|
|
256
283
|
if (!/[!@#$%^&*]/.test(value)) {
|
|
257
|
-
|
|
284
|
+
var _text$lang14;
|
|
285
|
+
errors.push(text === null || text === void 0 || (_text$lang14 = text[lang]) === null || _text$lang14 === void 0 || (_text$lang14 = _text$lang14.pages) === null || _text$lang14 === void 0 || (_text$lang14 = _text$lang14.header) === null || _text$lang14 === void 0 || (_text$lang14 = _text$lang14.changePassword) === null || _text$lang14 === void 0 || (_text$lang14 = _text$lang14.hints) === null || _text$lang14 === void 0 ? void 0 : _text$lang14.passwordSpecialChar);
|
|
258
286
|
}
|
|
259
287
|
if (value && getFieldValue("currentPassword") === value) {
|
|
260
|
-
|
|
288
|
+
var _text$lang15;
|
|
289
|
+
errors.push(text === null || text === void 0 || (_text$lang15 = text[lang]) === null || _text$lang15 === void 0 || (_text$lang15 = _text$lang15.pages) === null || _text$lang15 === void 0 || (_text$lang15 = _text$lang15.header) === null || _text$lang15 === void 0 || (_text$lang15 = _text$lang15.changePassword) === null || _text$lang15 === void 0 || (_text$lang15 = _text$lang15.hints) === null || _text$lang15 === void 0 ? void 0 : _text$lang15.passwordDifferent);
|
|
261
290
|
}
|
|
262
291
|
|
|
263
292
|
// 🔥 Return each message as its own Error → AntD shows them line by line
|
|
@@ -272,7 +301,7 @@ var ProfileOptions = function ProfileOptions() {
|
|
|
272
301
|
height: "48px"
|
|
273
302
|
}
|
|
274
303
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
275
|
-
label:
|
|
304
|
+
label: text === null || text === void 0 || (_text$lang16 = text[lang]) === null || _text$lang16 === void 0 || (_text$lang16 = _text$lang16.pages) === null || _text$lang16 === void 0 || (_text$lang16 = _text$lang16.header) === null || _text$lang16 === void 0 || (_text$lang16 = _text$lang16.changePassword) === null || _text$lang16 === void 0 ? void 0 : _text$lang16.newPasswordConfirmation,
|
|
276
305
|
name: "confirmPassword",
|
|
277
306
|
dependencies: ["newPassword"],
|
|
278
307
|
rules: [{
|
|
@@ -282,10 +311,11 @@ var ProfileOptions = function ProfileOptions() {
|
|
|
282
311
|
var getFieldValue = _ref2.getFieldValue;
|
|
283
312
|
return {
|
|
284
313
|
validator: function validator(_, value) {
|
|
314
|
+
var _text$lang17;
|
|
285
315
|
if (!value || getFieldValue("newPassword") === value) {
|
|
286
316
|
return Promise.resolve();
|
|
287
317
|
}
|
|
288
|
-
return Promise.reject(
|
|
318
|
+
return Promise.reject(text === null || text === void 0 || (_text$lang17 = text[lang]) === null || _text$lang17 === void 0 || (_text$lang17 = _text$lang17.pages) === null || _text$lang17 === void 0 || (_text$lang17 = _text$lang17.header) === null || _text$lang17 === void 0 || (_text$lang17 = _text$lang17.changePassword) === null || _text$lang17 === void 0 || (_text$lang17 = _text$lang17.hints) === null || _text$lang17 === void 0 ? void 0 : _text$lang17.passwordMismatch);
|
|
289
319
|
}
|
|
290
320
|
};
|
|
291
321
|
}]
|
|
@@ -304,10 +334,10 @@ var ProfileOptions = function ProfileOptions() {
|
|
|
304
334
|
className: style.cancelBtn,
|
|
305
335
|
onClick: closePasswordModal,
|
|
306
336
|
color: "white"
|
|
307
|
-
},
|
|
337
|
+
}, text === null || text === void 0 || (_text$lang18 = text[lang]) === null || _text$lang18 === void 0 || (_text$lang18 = _text$lang18.pages) === null || _text$lang18 === void 0 || (_text$lang18 = _text$lang18.common) === null || _text$lang18 === void 0 ? void 0 : _text$lang18.cancel), /*#__PURE__*/React.createElement(Button, {
|
|
308
338
|
className: style.confirmBtn,
|
|
309
339
|
onClick: handlePasswordSubmit,
|
|
310
340
|
color: "green"
|
|
311
|
-
},
|
|
341
|
+
}, text === null || text === void 0 || (_text$lang19 = text[lang]) === null || _text$lang19 === void 0 || (_text$lang19 = _text$lang19.pages) === null || _text$lang19 === void 0 || (_text$lang19 = _text$lang19.common) === null || _text$lang19 === void 0 ? void 0 : _text$lang19.confirm)))));
|
|
312
342
|
};
|
|
313
343
|
export default ProfileOptions;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
var LANG_KEY = "lang";
|
|
4
|
+
var DEFAULT_LANG = "az";
|
|
5
|
+
var getLang = function getLang() {
|
|
6
|
+
return localStorage.getItem(LANG_KEY) || DEFAULT_LANG;
|
|
7
|
+
};
|
|
8
|
+
export function useLang() {
|
|
9
|
+
var _useState = useState(getLang),
|
|
10
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11
|
+
lang = _useState2[0],
|
|
12
|
+
setLang = _useState2[1];
|
|
13
|
+
useEffect(function () {
|
|
14
|
+
setLang(getLang());
|
|
15
|
+
var onStorage = function onStorage(e) {
|
|
16
|
+
if (e.key === LANG_KEY) setLang(e.newValue || DEFAULT_LANG);
|
|
17
|
+
};
|
|
18
|
+
window.addEventListener("storage", onStorage);
|
|
19
|
+
var origSetItem = localStorage.setItem.bind(localStorage);
|
|
20
|
+
var origRemoveItem = localStorage.removeItem.bind(localStorage);
|
|
21
|
+
localStorage.setItem = function (key, value) {
|
|
22
|
+
origSetItem(key, value);
|
|
23
|
+
if (key === LANG_KEY) setLang(value || DEFAULT_LANG);
|
|
24
|
+
};
|
|
25
|
+
localStorage.removeItem = function (key) {
|
|
26
|
+
origRemoveItem(key);
|
|
27
|
+
if (key === LANG_KEY) setLang(DEFAULT_LANG);
|
|
28
|
+
};
|
|
29
|
+
return function () {
|
|
30
|
+
window.removeEventListener("storage", onStorage);
|
|
31
|
+
localStorage.setItem = origSetItem;
|
|
32
|
+
localStorage.removeItem = origRemoveItem;
|
|
33
|
+
};
|
|
34
|
+
}, []);
|
|
35
|
+
return lang;
|
|
36
|
+
}
|
|
@@ -5,9 +5,23 @@ import { useLocation } from "react-router-dom";
|
|
|
5
5
|
import { Collapse } from "antd";
|
|
6
6
|
import { RightOutlined, SettingOutlined } from "@ant-design/icons";
|
|
7
7
|
import style from "./index.module.scss";
|
|
8
|
-
import {
|
|
8
|
+
import { useEntryData } from "../../../pages/Platform/constant";
|
|
9
9
|
import Portal from "../../Portal";
|
|
10
10
|
var Panel = Collapse.Panel;
|
|
11
|
+
|
|
12
|
+
// ✅ handles both absolute ("http://localhost:3004/contracts/...") and relative ("/contracts/...")
|
|
13
|
+
var getPathnameFromAny = function getPathnameFromAny(value) {
|
|
14
|
+
if (!value) return "";
|
|
15
|
+
try {
|
|
16
|
+
return new URL(value, window.location.origin).pathname || "";
|
|
17
|
+
} catch (_unused) {
|
|
18
|
+
return String(value);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var getFirstSegment = function getFirstSegment(value) {
|
|
22
|
+
var pathname = getPathnameFromAny(value);
|
|
23
|
+
return (pathname.split("/")[1] || "").trim();
|
|
24
|
+
};
|
|
11
25
|
var AppSelect = function AppSelect(_ref) {
|
|
12
26
|
var mainPage = _ref.mainPage;
|
|
13
27
|
var location = useLocation();
|
|
@@ -15,6 +29,7 @@ var AppSelect = function AppSelect(_ref) {
|
|
|
15
29
|
return state.auth;
|
|
16
30
|
}),
|
|
17
31
|
scopesData = _useSelector.scopesData;
|
|
32
|
+
var entryData = useEntryData();
|
|
18
33
|
var accordionRef = useRef(null);
|
|
19
34
|
var dropdownRef = useRef(null);
|
|
20
35
|
var _useState = useState([]),
|
|
@@ -25,21 +40,24 @@ var AppSelect = function AppSelect(_ref) {
|
|
|
25
40
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
26
41
|
dropdownStyle = _useState4[0],
|
|
27
42
|
setDropdownStyle = _useState4[1];
|
|
28
|
-
|
|
29
|
-
// ✅ if mainPage is provided => disable dropdown behavior
|
|
30
43
|
var isDisabled = !!mainPage;
|
|
31
44
|
var filteredOptions = useMemo(function () {
|
|
32
|
-
return entryData.filter(function (item) {
|
|
45
|
+
return (entryData || []).filter(function (item) {
|
|
33
46
|
return item.scopes === "account" || scopesData === "*" || (scopesData === null || scopesData === void 0 ? void 0 : scopesData.includes(item.scopes));
|
|
34
47
|
});
|
|
35
|
-
}, [scopesData]);
|
|
48
|
+
}, [entryData, scopesData]);
|
|
49
|
+
|
|
50
|
+
// ✅ IMPORTANT: use real browser path so basename won't hide "/contracts"
|
|
36
51
|
var baseSegment = useMemo(function () {
|
|
37
|
-
|
|
52
|
+
// dependency uses location.pathname to re-run on route changes
|
|
53
|
+
return getFirstSegment(window.location.pathname || location.pathname || "");
|
|
38
54
|
}, [location.pathname]);
|
|
39
55
|
var active = useMemo(function () {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
56
|
+
// match by first segment (contracts, hr, docflow, settings...)
|
|
57
|
+
var found = filteredOptions.find(function (opt) {
|
|
58
|
+
return getFirstSegment(opt.pathname) === baseSegment;
|
|
59
|
+
});
|
|
60
|
+
return found || null;
|
|
43
61
|
}, [filteredOptions, baseSegment]);
|
|
44
62
|
useEffect(function () {
|
|
45
63
|
var handleClickOutside = function handleClickOutside(e) {
|
|
@@ -67,8 +85,6 @@ var AppSelect = function AppSelect(_ref) {
|
|
|
67
85
|
});
|
|
68
86
|
}
|
|
69
87
|
}, [activeKey, isDisabled]);
|
|
70
|
-
|
|
71
|
-
// ✅ make sure dropdown is closed if it becomes disabled
|
|
72
88
|
useEffect(function () {
|
|
73
89
|
if (isDisabled) setActiveKey([]);
|
|
74
90
|
}, [isDisabled]);
|
|
@@ -113,12 +129,12 @@ var AppSelect = function AppSelect(_ref) {
|
|
|
113
129
|
className: style.accordionBody,
|
|
114
130
|
style: dropdownStyle
|
|
115
131
|
}, filteredOptions.filter(function (opt) {
|
|
116
|
-
return opt.pathname !==
|
|
132
|
+
return getFirstSegment(opt.pathname) !== baseSegment;
|
|
117
133
|
}).map(function (option) {
|
|
118
134
|
return /*#__PURE__*/React.createElement("a", {
|
|
119
135
|
key: option.id,
|
|
120
136
|
href: option.pathname,
|
|
121
|
-
className: "".concat(style.accordionOption, " ").concat(
|
|
137
|
+
className: "".concat(style.accordionOption, " ").concat(getFirstSegment(option.pathname) === baseSegment ? style.selected : "")
|
|
122
138
|
}, option.icon, /*#__PURE__*/React.createElement("span", null, option.value));
|
|
123
139
|
}))));
|
|
124
140
|
};
|
|
@@ -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 } 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 } from "../../utils/path";
|
|
9
9
|
import { SearchIcon } from "../../assets/icons";
|
|
10
10
|
var Sider = Layout.Sider;
|
|
11
11
|
var SubMenu = Menu.SubMenu;
|
|
@@ -308,8 +308,16 @@ var QuestionnairesSidebar = function QuestionnairesSidebar(_ref) {
|
|
|
308
308
|
//delete the "/" at the start of string
|
|
309
309
|
label: "Göndərilən yerlər",
|
|
310
310
|
link: QUESTIONNAIRES_ROUTELOCATIONS
|
|
311
|
-
}
|
|
311
|
+
},
|
|
312
312
|
// ---- generated sidebar item by questionnaireGenerator: RouteLocations ----
|
|
313
|
+
|
|
314
|
+
{
|
|
315
|
+
key: "internalstructures",
|
|
316
|
+
//delete the "/" at the start of string
|
|
317
|
+
label: "Daxili Strukturlar",
|
|
318
|
+
link: QUESTIONNAIRES_INTERNALSTRUCTURE
|
|
319
|
+
}
|
|
320
|
+
// ---- generated sidebar item by questionnaireGenerator: InternalStructure ----
|
|
313
321
|
];
|
|
314
322
|
var sortedItems = items.sort(function (a, b) {
|
|
315
323
|
return a.label.localeCompare(b.label);
|
|
@@ -14,16 +14,19 @@ import { useDispatch, useSelector } from "react-redux";
|
|
|
14
14
|
// import Ldap from "../../assets/icons/Ldap.png";
|
|
15
15
|
import { getCompanyInfo } from "../../store/slices/companyInfo";
|
|
16
16
|
import api from "../../utils/axios"; // 💡 Make sure this points to your axios instance
|
|
17
|
-
|
|
17
|
+
import { useLang } from "../../hooks/useLang";
|
|
18
|
+
import text from "../../translations/index.json";
|
|
18
19
|
var Label = Form.Item,
|
|
19
20
|
useForm = Form.useForm;
|
|
20
21
|
var Password = Input.Password;
|
|
21
22
|
var Login = function Login() {
|
|
23
|
+
var _text$lang, _text$lang2, _text$lang3, _text$lang4;
|
|
22
24
|
var _useForm = useForm(),
|
|
23
25
|
_useForm2 = _slicedToArray(_useForm, 1),
|
|
24
26
|
form = _useForm2[0];
|
|
25
27
|
var navigate = useNavigate();
|
|
26
28
|
var dispatch = useDispatch();
|
|
29
|
+
var lang = useLang();
|
|
27
30
|
var loading = useSelector(function (state) {
|
|
28
31
|
return state.global.loading;
|
|
29
32
|
});
|
|
@@ -120,7 +123,7 @@ var Login = function Login() {
|
|
|
120
123
|
requiredMark: false
|
|
121
124
|
}, /*#__PURE__*/React.createElement("h2", {
|
|
122
125
|
className: style.title
|
|
123
|
-
},
|
|
126
|
+
}, text === null || text === void 0 || (_text$lang = text[lang]) === null || _text$lang === void 0 || (_text$lang = _text$lang.pages) === null || _text$lang === void 0 || (_text$lang = _text$lang.login) === null || _text$lang === void 0 ? void 0 : _text$lang.title), /*#__PURE__*/React.createElement("div", {
|
|
124
127
|
className: style.control
|
|
125
128
|
}, /*#__PURE__*/React.createElement(Label, {
|
|
126
129
|
name: "username",
|
|
@@ -133,7 +136,7 @@ var Login = function Login() {
|
|
|
133
136
|
}
|
|
134
137
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
135
138
|
type: "text",
|
|
136
|
-
placeholder:
|
|
139
|
+
placeholder: text === null || text === void 0 || (_text$lang2 = text[lang]) === null || _text$lang2 === void 0 || (_text$lang2 = _text$lang2.pages) === null || _text$lang2 === void 0 || (_text$lang2 = _text$lang2.login) === null || _text$lang2 === void 0 || (_text$lang2 = _text$lang2.fields) === null || _text$lang2 === void 0 || (_text$lang2 = _text$lang2.username) === null || _text$lang2 === void 0 ? void 0 : _text$lang2.placeholder,
|
|
137
140
|
className: style.control_input
|
|
138
141
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
139
142
|
className: style.control
|
|
@@ -150,7 +153,7 @@ var Login = function Login() {
|
|
|
150
153
|
style: {
|
|
151
154
|
padding: 0
|
|
152
155
|
},
|
|
153
|
-
placeholder:
|
|
156
|
+
placeholder: text === null || text === void 0 || (_text$lang3 = text[lang]) === null || _text$lang3 === void 0 || (_text$lang3 = _text$lang3.pages) === null || _text$lang3 === void 0 || (_text$lang3 = _text$lang3.login) === null || _text$lang3 === void 0 || (_text$lang3 = _text$lang3.fields) === null || _text$lang3 === void 0 || (_text$lang3 = _text$lang3.password) === null || _text$lang3 === void 0 ? void 0 : _text$lang3.placeholder,
|
|
154
157
|
className: style.control_input
|
|
155
158
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
156
159
|
className: style.button
|
|
@@ -159,6 +162,6 @@ var Login = function Login() {
|
|
|
159
162
|
"data-no-invert": true
|
|
160
163
|
}, /*#__PURE__*/React.createElement("button", {
|
|
161
164
|
type: "submit"
|
|
162
|
-
},
|
|
165
|
+
}, text === null || text === void 0 || (_text$lang4 = text[lang]) === null || _text$lang4 === void 0 || (_text$lang4 = _text$lang4.pages) === null || _text$lang4 === void 0 || (_text$lang4 = _text$lang4.login) === null || _text$lang4 === void 0 || (_text$lang4 = _text$lang4.buttons) === null || _text$lang4 === void 0 ? void 0 : _text$lang4.login)))));
|
|
163
166
|
};
|
|
164
167
|
export default Login;
|