oa-componentbook 1.0.1-stage.405 → 1.0.1-stage.407
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/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +29 -2
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +6 -1
- package/build/layout/GenricLayOut/GenricLayOut.js +89 -62
- package/build/layout/GenricLayOut/components/Modal.js +4 -2
- package/build/layout/GenricLayOut/components/ProfileSection.js +135 -9
- package/build/layout/GenricLayOut/styles.js +15 -3
- package/build/widgets/oa-widget-content-panel/ContentPanel.js +1 -1
- package/build/widgets/oa-widget-profile-data/ProfileDataWidget.js +56 -3
- package/build/widgets/oa-widget-select-list-item-modal/SelectListItemModal.js +18 -6
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.default = EntityOverviewLayout;
|
|
10
10
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
11
|
require("core-js/modules/es.promise.js");
|
|
12
|
+
require("core-js/modules/es.json.stringify.js");
|
|
12
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _entityOverviewLayoutReducer = require("./reducer/entityOverviewLayoutReducer");
|
|
14
15
|
var _GlobalCss = _interopRequireDefault(require("../../global-css/GlobalCss"));
|
|
@@ -43,7 +44,8 @@ function EntityOverviewLayout(_ref) {
|
|
|
43
44
|
addUserClick,
|
|
44
45
|
deleteUserClick,
|
|
45
46
|
editUserClick,
|
|
46
|
-
handleDrawerData
|
|
47
|
+
handleDrawerData,
|
|
48
|
+
handleSwitchSelectItem
|
|
47
49
|
}
|
|
48
50
|
} = _ref;
|
|
49
51
|
const [state, dispatch] = (0, _react.useReducer)(_entityOverviewLayoutReducer.entityOverviewLayoutReducer, config !== null && config !== void 0 ? config : _entityOverviewLayoutReducer.initialState);
|
|
@@ -125,6 +127,30 @@ function EntityOverviewLayout(_ref) {
|
|
|
125
127
|
type: _entityOverviewLayoutReducer.actionTypes.CLOSE_DRAWER
|
|
126
128
|
});
|
|
127
129
|
};
|
|
130
|
+
const handleSwitchSelectItemInternal = async selectedValue => {
|
|
131
|
+
console.log(selectedValue, "selectedValue");
|
|
132
|
+
if (selectedValue) {
|
|
133
|
+
var _data$listData;
|
|
134
|
+
// Call the external handler to get new data based on selected value
|
|
135
|
+
const {
|
|
136
|
+
error,
|
|
137
|
+
data
|
|
138
|
+
} = await (handleSwitchSelectItem === null || handleSwitchSelectItem === void 0 ? void 0 : handleSwitchSelectItem(selectedValue));
|
|
139
|
+
console.log(data, "apidata");
|
|
140
|
+
let selectedItem = data === null || data === void 0 ? void 0 : data.data;
|
|
141
|
+
const selectedData = data === null || data === void 0 || (_data$listData = data.listData) === null || _data$listData === void 0 ? void 0 : _data$listData.find(enterprise => enterprise.enterpriseId === selectedValue);
|
|
142
|
+
sessionStorage.setItem("selectedEnterprise", JSON.stringify(selectedData));
|
|
143
|
+
if (error) {
|
|
144
|
+
showErrorNotification(error);
|
|
145
|
+
} else {
|
|
146
|
+
console.log(data, "data");
|
|
147
|
+
dispatch({
|
|
148
|
+
type: _entityOverviewLayoutReducer.actionTypes.UPDATE_PROFILE_DATA,
|
|
149
|
+
payload: selectedItem
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
128
154
|
const handleActionClick = (actionType, actionData) => {
|
|
129
155
|
var _config$drawer, _drawerDetailData$dat, _state$drawer;
|
|
130
156
|
switch (actionType) {
|
|
@@ -186,7 +212,8 @@ function EntityOverviewLayout(_ref) {
|
|
|
186
212
|
rows: 1
|
|
187
213
|
}
|
|
188
214
|
}, /*#__PURE__*/_react.default.createElement(_ProfileDataWidget.default, _extends({}, profileData === null || profileData === void 0 ? void 0 : profileData.data, {
|
|
189
|
-
alignProfile: profileData === null || profileData === void 0 ? void 0 : profileData.alignProfile
|
|
215
|
+
alignProfile: profileData === null || profileData === void 0 ? void 0 : profileData.alignProfile,
|
|
216
|
+
handleSwitchSelectItem: handleSwitchSelectItemInternal
|
|
190
217
|
}))), (accordionData === null || accordionData === void 0 ? void 0 : accordionData.visible) && Array.isArray(accordionData === null || accordionData === void 0 ? void 0 : accordionData.data) && /*#__PURE__*/_react.default.createElement(_antd.Skeleton, {
|
|
191
218
|
loading: state === null || state === void 0 ? void 0 : state.isLoading,
|
|
192
219
|
active: true,
|
|
@@ -18,7 +18,8 @@ const actionTypes = exports.actionTypes = {
|
|
|
18
18
|
SET_MISC: 'SET_MISC',
|
|
19
19
|
SET_DRAWER: 'SET_DRAWER',
|
|
20
20
|
TOGGLE_DRAWER: 'TOGGLE_DRAWER',
|
|
21
|
-
CLOSE_DRAWER: 'CLOSE_DRAWER'
|
|
21
|
+
CLOSE_DRAWER: 'CLOSE_DRAWER',
|
|
22
|
+
UPDATE_PROFILE_DATA: 'UPDATE_PROFILE_DATA'
|
|
22
23
|
};
|
|
23
24
|
const initialState = exports.initialState = {};
|
|
24
25
|
const entityOverviewLayoutReducer = (state, action) => {
|
|
@@ -33,6 +34,10 @@ const entityOverviewLayoutReducer = (state, action) => {
|
|
|
33
34
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
34
35
|
profileData: _objectSpread(_objectSpread({}, state.profileData), action.payload)
|
|
35
36
|
});
|
|
37
|
+
case actionTypes.UPDATE_PROFILE_DATA:
|
|
38
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
39
|
+
profileData: action.payload
|
|
40
|
+
});
|
|
36
41
|
case actionTypes.SET_MISC:
|
|
37
42
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
38
43
|
misc: _objectSpread(_objectSpread({}, state.misc), action.payload)
|
|
@@ -53,7 +53,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
53
53
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
54
54
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* eslint-disable */
|
|
55
55
|
function GenricLayOut(_ref) {
|
|
56
|
-
var _state$
|
|
56
|
+
var _state$misc29, _sidebar$mobileMenuIt, _imageViewer$content, _imageViewer$content2, _leftHeaderFirstButto, _leftHeaderFirstButto2, _infoPanel$data, _infoPanel$data2, _infoPanel$data3, _infoPanel$data4, _infoPanel$data5, _state$customDrawer3, _state$customDrawer4, _tabs$list, _tables$columns3, _tables$columns4, _tabs$active3, _state$tables4, _tables$selectionType, _tabs$active4, _tables$selectionType2, _tables$pagination17, _drawer$data, _tabs$active5, _drawer$data$drawer$a, _drawer$data2, _tabs$active6, _tabs$active7, _nestedDrawer$data, _nestedDrawer$data$ca, _nestedDrawer$data2, _customDrawer$data, _customDrawer$data2, _contentPanel$dataSou, _tables$tableFooter, _tables$selectedRowKe, _tables$tableFooter2, _tables$tableFooter3, _tables$tableFooter5;
|
|
57
57
|
let {
|
|
58
58
|
config,
|
|
59
59
|
getInitialData,
|
|
@@ -80,7 +80,8 @@ function GenricLayOut(_ref) {
|
|
|
80
80
|
handleSubHeadingSelectClick,
|
|
81
81
|
handleCollapsibleKeyData,
|
|
82
82
|
handleProfileReroute,
|
|
83
|
-
handleTableFooterApi
|
|
83
|
+
handleTableFooterApi,
|
|
84
|
+
handleSwitchSelectItem
|
|
84
85
|
} = {}
|
|
85
86
|
} = _ref;
|
|
86
87
|
const [state, dispatch] = (0, _react.useReducer)(_layoutReducer.genericLayoutReducer, config !== null && config !== void 0 ? config : _layoutReducer.initialState);
|
|
@@ -135,6 +136,23 @@ function GenricLayOut(_ref) {
|
|
|
135
136
|
};
|
|
136
137
|
}, [headerButtons]);
|
|
137
138
|
|
|
139
|
+
// Check for notification data after component mounts (after reload)
|
|
140
|
+
(0, _react.useEffect)(() => {
|
|
141
|
+
const notificationData = sessionStorage.getItem("showEnterpriseNotification");
|
|
142
|
+
if (notificationData) {
|
|
143
|
+
try {
|
|
144
|
+
const {
|
|
145
|
+
message
|
|
146
|
+
} = JSON.parse(notificationData);
|
|
147
|
+
showSuccessNotification(message);
|
|
148
|
+
sessionStorage.removeItem("showEnterpriseNotification");
|
|
149
|
+
} catch (error) {
|
|
150
|
+
console.error("Error parsing notification data:", error);
|
|
151
|
+
sessionStorage.removeItem("showEnterpriseNotification");
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}, []);
|
|
155
|
+
|
|
138
156
|
/**
|
|
139
157
|
* Initializes the layout by fetching initial data and updating the state.
|
|
140
158
|
*
|
|
@@ -148,14 +166,16 @@ function GenricLayOut(_ref) {
|
|
|
148
166
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
149
167
|
payload: true
|
|
150
168
|
});
|
|
169
|
+
console.log('here');
|
|
170
|
+
console.log(config === null || config === void 0 ? void 0 : config.misc, "config?.misc");
|
|
151
171
|
if (getInitialData) {
|
|
152
|
-
var _config$tabs,
|
|
172
|
+
var _config$tabs, _config$misc;
|
|
153
173
|
const {
|
|
154
174
|
error,
|
|
155
175
|
data
|
|
156
176
|
} = await (getInitialData === null || getInitialData === void 0 ? void 0 : getInitialData(_objectSpread(_objectSpread({}, config !== null && config !== void 0 && (_config$tabs = config.tabs) !== null && _config$tabs !== void 0 && _config$tabs.active ? {
|
|
157
177
|
selectedTab: config.tabs.active
|
|
158
|
-
} : {}), (
|
|
178
|
+
} : {}), (_config$misc = config === null || config === void 0 ? void 0 : config.misc) !== null && _config$misc !== void 0 ? _config$misc : {})));
|
|
159
179
|
if (error) {
|
|
160
180
|
showErrorNotification(error);
|
|
161
181
|
const dynamicConfig = (0, _staticConfigResolver.default)(config, {});
|
|
@@ -256,7 +276,7 @@ function GenricLayOut(_ref) {
|
|
|
256
276
|
});
|
|
257
277
|
if (value === "") {
|
|
258
278
|
if (handleInputSearchChange) {
|
|
259
|
-
var _state$inputSearch, _state$tabs, _customDrawer$applied, _config$tables, _config$tables2, _tables$sorting, _tables$sorting2, _header$subHeading, _header$subHeading2;
|
|
279
|
+
var _state$inputSearch, _state$tabs, _customDrawer$applied, _config$tables, _config$tables2, _tables$sorting, _tables$sorting2, _header$subHeading, _header$subHeading2, _state$misc;
|
|
260
280
|
dispatch({
|
|
261
281
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
262
282
|
payload: true
|
|
@@ -264,7 +284,7 @@ function GenricLayOut(_ref) {
|
|
|
264
284
|
const {
|
|
265
285
|
error,
|
|
266
286
|
data
|
|
267
|
-
} = await handleInputSearchChange(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, state === null || state === void 0 || (_state$inputSearch = state.inputSearch) === null || _state$inputSearch === void 0 ? void 0 : _state$inputSearch.request), state !== null && state !== void 0 && (_state$tabs = state.tabs) !== null && _state$tabs !== void 0 && _state$tabs.active ? {
|
|
287
|
+
} = await handleInputSearchChange(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, state === null || state === void 0 || (_state$inputSearch = state.inputSearch) === null || _state$inputSearch === void 0 ? void 0 : _state$inputSearch.request), state !== null && state !== void 0 && (_state$tabs = state.tabs) !== null && _state$tabs !== void 0 && _state$tabs.active ? {
|
|
268
288
|
selectedTab: state.tabs.active
|
|
269
289
|
} : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied !== void 0 ? _customDrawer$applied : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), {}, {
|
|
270
290
|
current: config === null || config === void 0 || (_config$tables = config.tables) === null || _config$tables === void 0 || (_config$tables = _config$tables.pagination) === null || _config$tables === void 0 ? void 0 : _config$tables.current,
|
|
@@ -273,7 +293,7 @@ function GenricLayOut(_ref) {
|
|
|
273
293
|
order: tables === null || tables === void 0 || (_tables$sorting2 = tables.sorting) === null || _tables$sorting2 === void 0 ? void 0 : _tables$sorting2.sortDirection
|
|
274
294
|
}, (header === null || header === void 0 || (_header$subHeading = header.subHeading) === null || _header$subHeading === void 0 || (_header$subHeading = _header$subHeading.jsxConfig) === null || _header$subHeading === void 0 ? void 0 : _header$subHeading.type) == "select" ? {
|
|
275
295
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading2 = header.subHeading) === null || _header$subHeading2 === void 0 || (_header$subHeading2 = _header$subHeading2.jsxConfig) === null || _header$subHeading2 === void 0 ? void 0 : _header$subHeading2.value
|
|
276
|
-
} : {}));
|
|
296
|
+
} : {}), (_state$misc = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc !== void 0 ? _state$misc : {}));
|
|
277
297
|
if (error) {
|
|
278
298
|
showErrorNotification(error);
|
|
279
299
|
dispatch({
|
|
@@ -334,11 +354,11 @@ function GenricLayOut(_ref) {
|
|
|
334
354
|
payload: trimedValue
|
|
335
355
|
});
|
|
336
356
|
if (handleInputSearchEnter) {
|
|
337
|
-
var _state$tabs2, _config$tables5, _config$tables6, _tables$sorting3, _tables$sorting4, _customDrawer$applied2, _header$subHeading3, _header$subHeading4;
|
|
357
|
+
var _state$tabs2, _config$tables5, _config$tables6, _tables$sorting3, _tables$sorting4, _customDrawer$applied2, _header$subHeading3, _header$subHeading4, _state$misc2;
|
|
338
358
|
const {
|
|
339
359
|
error,
|
|
340
360
|
data
|
|
341
|
-
} = await handleInputSearchEnter(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, state !== null && state !== void 0 && (_state$tabs2 = state.tabs) !== null && _state$tabs2 !== void 0 && _state$tabs2.active ? {
|
|
361
|
+
} = await handleInputSearchEnter(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, state !== null && state !== void 0 && (_state$tabs2 = state.tabs) !== null && _state$tabs2 !== void 0 && _state$tabs2.active ? {
|
|
342
362
|
selectedTab: state.tabs.active
|
|
343
363
|
} : {}), {}, {
|
|
344
364
|
searchedValue: trimedValue,
|
|
@@ -350,7 +370,7 @@ function GenricLayOut(_ref) {
|
|
|
350
370
|
queryField: inputSearch.queryField
|
|
351
371
|
} : {}), (header === null || header === void 0 || (_header$subHeading3 = header.subHeading) === null || _header$subHeading3 === void 0 || (_header$subHeading3 = _header$subHeading3.jsxConfig) === null || _header$subHeading3 === void 0 ? void 0 : _header$subHeading3.type) == "select" ? {
|
|
352
372
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading4 = header.subHeading) === null || _header$subHeading4 === void 0 || (_header$subHeading4 = _header$subHeading4.jsxConfig) === null || _header$subHeading4 === void 0 ? void 0 : _header$subHeading4.value
|
|
353
|
-
} : {}));
|
|
373
|
+
} : {}), (_state$misc2 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc2 !== void 0 ? _state$misc2 : {}));
|
|
354
374
|
if (error) {
|
|
355
375
|
showErrorNotification(error);
|
|
356
376
|
dispatch({
|
|
@@ -401,7 +421,7 @@ function GenricLayOut(_ref) {
|
|
|
401
421
|
});
|
|
402
422
|
if (value === "") {
|
|
403
423
|
if (handleDropdownSearchInputChange) {
|
|
404
|
-
var _state$tabs3, _config$tables9, _config$tables10, _tables$sorting5, _tables$sorting6, _tables$filter, _staticFilter$data2, _customDrawer$applied3, _header$subHeading5, _header$subHeading6, _state$
|
|
424
|
+
var _state$tabs3, _config$tables9, _config$tables10, _tables$sorting5, _tables$sorting6, _tables$filter, _staticFilter$data2, _customDrawer$applied3, _header$subHeading5, _header$subHeading6, _state$misc3, _state$staticFilter$m, _state$staticFilter;
|
|
405
425
|
dispatch({
|
|
406
426
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
407
427
|
payload: true
|
|
@@ -421,7 +441,7 @@ function GenricLayOut(_ref) {
|
|
|
421
441
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
422
442
|
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied3 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied3 !== void 0 ? _customDrawer$applied3 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading5 = header.subHeading) === null || _header$subHeading5 === void 0 || (_header$subHeading5 = _header$subHeading5.jsxConfig) === null || _header$subHeading5 === void 0 ? void 0 : _header$subHeading5.type) == "select" ? {
|
|
423
443
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading6 = header.subHeading) === null || _header$subHeading6 === void 0 || (_header$subHeading6 = _header$subHeading6.jsxConfig) === null || _header$subHeading6 === void 0 ? void 0 : _header$subHeading6.value
|
|
424
|
-
} : {}), (_state$
|
|
444
|
+
} : {}), (_state$misc3 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc3 !== void 0 ? _state$misc3 : {}), {}, {
|
|
425
445
|
multiSelectValue: (_state$staticFilter$m = state === null || state === void 0 || (_state$staticFilter = state.staticFilter) === null || _state$staticFilter === void 0 ? void 0 : _state$staticFilter.multiSelectValue) !== null && _state$staticFilter$m !== void 0 ? _state$staticFilter$m : []
|
|
426
446
|
}));
|
|
427
447
|
if (error) {
|
|
@@ -493,7 +513,7 @@ function GenricLayOut(_ref) {
|
|
|
493
513
|
payload: value
|
|
494
514
|
});
|
|
495
515
|
if (handleDropdownSearchEnter) {
|
|
496
|
-
var _state$tabs4, _config$tables13, _config$tables14, _tables$sorting7, _tables$sorting8, _tables$filter2, _staticFilter$data3, _customDrawer$applied4, _header$subHeading7, _header$subHeading8, _state$
|
|
516
|
+
var _state$tabs4, _config$tables13, _config$tables14, _tables$sorting7, _tables$sorting8, _tables$filter2, _staticFilter$data3, _customDrawer$applied4, _header$subHeading7, _header$subHeading8, _state$misc4, _state$staticFilter$m2, _state$staticFilter2;
|
|
497
517
|
const {
|
|
498
518
|
error,
|
|
499
519
|
data
|
|
@@ -511,7 +531,7 @@ function GenricLayOut(_ref) {
|
|
|
511
531
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
512
532
|
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied4 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied4 !== void 0 ? _customDrawer$applied4 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading7 = header.subHeading) === null || _header$subHeading7 === void 0 || (_header$subHeading7 = _header$subHeading7.jsxConfig) === null || _header$subHeading7 === void 0 ? void 0 : _header$subHeading7.type) == "select" ? {
|
|
513
533
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading8 = header.subHeading) === null || _header$subHeading8 === void 0 || (_header$subHeading8 = _header$subHeading8.jsxConfig) === null || _header$subHeading8 === void 0 ? void 0 : _header$subHeading8.value
|
|
514
|
-
} : {}), (_state$
|
|
534
|
+
} : {}), (_state$misc4 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc4 !== void 0 ? _state$misc4 : {}), {}, {
|
|
515
535
|
multiSelectValue: (_state$staticFilter$m2 = state === null || state === void 0 || (_state$staticFilter2 = state.staticFilter) === null || _state$staticFilter2 === void 0 ? void 0 : _state$staticFilter2.multiSelectValue) !== null && _state$staticFilter$m2 !== void 0 ? _state$staticFilter$m2 : []
|
|
516
536
|
}));
|
|
517
537
|
if (error) {
|
|
@@ -557,7 +577,7 @@ function GenricLayOut(_ref) {
|
|
|
557
577
|
payload: option === null || option === void 0 ? void 0 : option.value
|
|
558
578
|
});
|
|
559
579
|
if (handleDropdownSearchOptionChange) {
|
|
560
|
-
var _config$tables17, _config$tables18, _staticFilter$data4, _customDrawer$applied5, _header$subHeading9, _header$subHeading10, _state$
|
|
580
|
+
var _config$tables17, _config$tables18, _staticFilter$data4, _customDrawer$applied5, _header$subHeading9, _header$subHeading10, _state$misc5, _state$staticFilter$m3, _state$staticFilter3;
|
|
561
581
|
dispatch({
|
|
562
582
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
563
583
|
payload: true
|
|
@@ -573,7 +593,7 @@ function GenricLayOut(_ref) {
|
|
|
573
593
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
574
594
|
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied5 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied5 !== void 0 ? _customDrawer$applied5 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading9 = header.subHeading) === null || _header$subHeading9 === void 0 || (_header$subHeading9 = _header$subHeading9.jsxConfig) === null || _header$subHeading9 === void 0 ? void 0 : _header$subHeading9.type) == "select" ? {
|
|
575
595
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading10 = header.subHeading) === null || _header$subHeading10 === void 0 || (_header$subHeading10 = _header$subHeading10.jsxConfig) === null || _header$subHeading10 === void 0 ? void 0 : _header$subHeading10.value
|
|
576
|
-
} : {}), (_state$
|
|
596
|
+
} : {}), (_state$misc5 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc5 !== void 0 ? _state$misc5 : {}), {}, {
|
|
577
597
|
multiSelectValue: (_state$staticFilter$m3 = state === null || state === void 0 || (_state$staticFilter3 = state.staticFilter) === null || _state$staticFilter3 === void 0 ? void 0 : _state$staticFilter3.multiSelectValue) !== null && _state$staticFilter$m3 !== void 0 ? _state$staticFilter$m3 : []
|
|
578
598
|
}));
|
|
579
599
|
if (error) {
|
|
@@ -675,7 +695,7 @@ function GenricLayOut(_ref) {
|
|
|
675
695
|
payload: null
|
|
676
696
|
});
|
|
677
697
|
if (handleDropdownSearchClear) {
|
|
678
|
-
var _state$tabs5, _config$tables21, _config$tables22, _tables$sorting9, _tables$sorting10, _tables$filter3, _staticFilter$data5, _customDrawer$applied6, _header$subHeading11, _header$subHeading12, _state$
|
|
698
|
+
var _state$tabs5, _config$tables21, _config$tables22, _tables$sorting9, _tables$sorting10, _tables$filter3, _staticFilter$data5, _customDrawer$applied6, _header$subHeading11, _header$subHeading12, _state$misc6, _state$staticFilter$m4, _state$staticFilter4;
|
|
679
699
|
const {
|
|
680
700
|
error,
|
|
681
701
|
data
|
|
@@ -691,7 +711,7 @@ function GenricLayOut(_ref) {
|
|
|
691
711
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
692
712
|
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied6 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied6 !== void 0 ? _customDrawer$applied6 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading11 = header.subHeading) === null || _header$subHeading11 === void 0 || (_header$subHeading11 = _header$subHeading11.jsxConfig) === null || _header$subHeading11 === void 0 ? void 0 : _header$subHeading11.type) == "select" ? {
|
|
693
713
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading12 = header.subHeading) === null || _header$subHeading12 === void 0 || (_header$subHeading12 = _header$subHeading12.jsxConfig) === null || _header$subHeading12 === void 0 ? void 0 : _header$subHeading12.value
|
|
694
|
-
} : {}), (_state$
|
|
714
|
+
} : {}), (_state$misc6 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc6 !== void 0 ? _state$misc6 : {}), {}, {
|
|
695
715
|
multiSelectValue: (_state$staticFilter$m4 = state === null || state === void 0 || (_state$staticFilter4 = state.staticFilter) === null || _state$staticFilter4 === void 0 ? void 0 : _state$staticFilter4.multiSelectValue) !== null && _state$staticFilter$m4 !== void 0 ? _state$staticFilter$m4 : []
|
|
696
716
|
}));
|
|
697
717
|
if (error) {
|
|
@@ -739,7 +759,7 @@ function GenricLayOut(_ref) {
|
|
|
739
759
|
payload: null
|
|
740
760
|
});
|
|
741
761
|
if (handleInputSearchClear) {
|
|
742
|
-
var _state$tabs6, _config$tables25, _config$tables26, _tables$sorting11, _tables$sorting12, _customDrawer$applied7, _header$subHeading13, _header$subHeading14, _state$
|
|
762
|
+
var _state$tabs6, _config$tables25, _config$tables26, _tables$sorting11, _tables$sorting12, _customDrawer$applied7, _header$subHeading13, _header$subHeading14, _state$misc7;
|
|
743
763
|
const {
|
|
744
764
|
error,
|
|
745
765
|
data
|
|
@@ -752,7 +772,7 @@ function GenricLayOut(_ref) {
|
|
|
752
772
|
order: tables === null || tables === void 0 || (_tables$sorting12 = tables.sorting) === null || _tables$sorting12 === void 0 ? void 0 : _tables$sorting12.sortDirection
|
|
753
773
|
}, (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied7 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied7 !== void 0 ? _customDrawer$applied7 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading13 = header.subHeading) === null || _header$subHeading13 === void 0 || (_header$subHeading13 = _header$subHeading13.jsxConfig) === null || _header$subHeading13 === void 0 ? void 0 : _header$subHeading13.type) == "select" ? {
|
|
754
774
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading14 = header.subHeading) === null || _header$subHeading14 === void 0 || (_header$subHeading14 = _header$subHeading14.jsxConfig) === null || _header$subHeading14 === void 0 ? void 0 : _header$subHeading14.value
|
|
755
|
-
} : {}), (_state$
|
|
775
|
+
} : {}), (_state$misc7 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc7 !== void 0 ? _state$misc7 : {}));
|
|
756
776
|
if (error) {
|
|
757
777
|
showErrorNotification(error);
|
|
758
778
|
dispatch({
|
|
@@ -806,14 +826,14 @@ function GenricLayOut(_ref) {
|
|
|
806
826
|
if ((configArgs === null || configArgs === void 0 ? void 0 : configArgs.action) === "OPEN_DRAWER_AND_FETCH") {
|
|
807
827
|
const selectkey = optKey || (configArgs === null || configArgs === void 0 ? void 0 : configArgs.key);
|
|
808
828
|
if (handleTableColumnClick) {
|
|
809
|
-
var _state$
|
|
829
|
+
var _state$misc8;
|
|
810
830
|
const {
|
|
811
831
|
error,
|
|
812
832
|
data
|
|
813
833
|
} = await (handleTableColumnClick === null || handleTableColumnClick === void 0 ? void 0 : handleTableColumnClick(_objectSpread({
|
|
814
834
|
record: record,
|
|
815
835
|
type: configArgs === null || configArgs === void 0 ? void 0 : configArgs.call
|
|
816
|
-
}, (_state$
|
|
836
|
+
}, (_state$misc8 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc8 !== void 0 ? _state$misc8 : {})));
|
|
817
837
|
if (error) {
|
|
818
838
|
showErrorNotification(error);
|
|
819
839
|
} else {
|
|
@@ -848,12 +868,13 @@ function GenricLayOut(_ref) {
|
|
|
848
868
|
}
|
|
849
869
|
} else if ((configArgs === null || configArgs === void 0 ? void 0 : configArgs.action) === "EXPORT_DATA") {
|
|
850
870
|
if (handleSecondaryTableCTAClick) {
|
|
871
|
+
var _state$misc9;
|
|
851
872
|
const {
|
|
852
873
|
error,
|
|
853
874
|
data
|
|
854
|
-
} = await (handleSecondaryTableCTAClick === null || handleSecondaryTableCTAClick === void 0 ? void 0 : handleSecondaryTableCTAClick({
|
|
875
|
+
} = await (handleSecondaryTableCTAClick === null || handleSecondaryTableCTAClick === void 0 ? void 0 : handleSecondaryTableCTAClick(_objectSpread({
|
|
855
876
|
rentalId: record === null || record === void 0 ? void 0 : record.rentalId
|
|
856
|
-
}));
|
|
877
|
+
}, (_state$misc9 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc9 !== void 0 ? _state$misc9 : {})));
|
|
857
878
|
if (error) {
|
|
858
879
|
showErrorNotification(error);
|
|
859
880
|
} else {
|
|
@@ -862,20 +883,22 @@ function GenricLayOut(_ref) {
|
|
|
862
883
|
}
|
|
863
884
|
} else if ((configArgs === null || configArgs === void 0 ? void 0 : configArgs.action) === "OPEN_URL_IN_NEW_TAB") {
|
|
864
885
|
if (handleTableColumnClick) {
|
|
865
|
-
|
|
886
|
+
var _state$misc10;
|
|
887
|
+
handleTableColumnClick === null || handleTableColumnClick === void 0 || handleTableColumnClick(_objectSpread({
|
|
866
888
|
record: record,
|
|
867
889
|
type: configArgs === null || configArgs === void 0 ? void 0 : configArgs.call
|
|
868
|
-
});
|
|
890
|
+
}, (_state$misc10 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc10 !== void 0 ? _state$misc10 : {}));
|
|
869
891
|
}
|
|
870
892
|
} else if ((configArgs === null || configArgs === void 0 ? void 0 : configArgs.action) === "OPEN_MODAL") {
|
|
871
893
|
if (handleTableColumnClick) {
|
|
894
|
+
var _state$misc11;
|
|
872
895
|
const {
|
|
873
896
|
error,
|
|
874
897
|
data
|
|
875
|
-
} = await (handleTableColumnClick === null || handleTableColumnClick === void 0 ? void 0 : handleTableColumnClick({
|
|
898
|
+
} = await (handleTableColumnClick === null || handleTableColumnClick === void 0 ? void 0 : handleTableColumnClick(_objectSpread({
|
|
876
899
|
record: record,
|
|
877
900
|
type: configArgs === null || configArgs === void 0 ? void 0 : configArgs.call
|
|
878
|
-
}));
|
|
901
|
+
}, (_state$misc11 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc11 !== void 0 ? _state$misc11 : {})));
|
|
879
902
|
if (error) {
|
|
880
903
|
showErrorNotification(error);
|
|
881
904
|
} else {
|
|
@@ -894,13 +917,14 @@ function GenricLayOut(_ref) {
|
|
|
894
917
|
}
|
|
895
918
|
} else if ((configArgs === null || configArgs === void 0 ? void 0 : configArgs.action) === "ACTION_ON_CTA") {
|
|
896
919
|
if (handleActionOnTableCTAClick) {
|
|
920
|
+
var _state$misc12;
|
|
897
921
|
const {
|
|
898
922
|
error,
|
|
899
923
|
data
|
|
900
|
-
} = await (handleActionOnTableCTAClick === null || handleActionOnTableCTAClick === void 0 ? void 0 : handleActionOnTableCTAClick({
|
|
924
|
+
} = await (handleActionOnTableCTAClick === null || handleActionOnTableCTAClick === void 0 ? void 0 : handleActionOnTableCTAClick(_objectSpread({
|
|
901
925
|
record: record,
|
|
902
926
|
type: configArgs === null || configArgs === void 0 ? void 0 : configArgs.call
|
|
903
|
-
}));
|
|
927
|
+
}, (_state$misc12 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc12 !== void 0 ? _state$misc12 : {})));
|
|
904
928
|
if (error) {
|
|
905
929
|
showErrorNotification(error);
|
|
906
930
|
} else {
|
|
@@ -910,13 +934,14 @@ function GenricLayOut(_ref) {
|
|
|
910
934
|
}
|
|
911
935
|
} else if ((configArgs === null || configArgs === void 0 ? void 0 : configArgs.action) === "VIEW_PHOTO") {
|
|
912
936
|
if (handleTableColumnClick) {
|
|
937
|
+
var _state$misc13;
|
|
913
938
|
const {
|
|
914
939
|
error,
|
|
915
940
|
data
|
|
916
|
-
} = await (handleTableColumnClick === null || handleTableColumnClick === void 0 ? void 0 : handleTableColumnClick({
|
|
941
|
+
} = await (handleTableColumnClick === null || handleTableColumnClick === void 0 ? void 0 : handleTableColumnClick(_objectSpread({
|
|
917
942
|
record: record,
|
|
918
943
|
type: configArgs === null || configArgs === void 0 ? void 0 : configArgs.call
|
|
919
|
-
}));
|
|
944
|
+
}, (_state$misc13 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc13 !== void 0 ? _state$misc13 : {})));
|
|
920
945
|
if (error) {
|
|
921
946
|
showErrorNotification(error);
|
|
922
947
|
} else {
|
|
@@ -1096,7 +1121,7 @@ function GenricLayOut(_ref) {
|
|
|
1096
1121
|
}
|
|
1097
1122
|
});
|
|
1098
1123
|
if (handleTableChange) {
|
|
1099
|
-
var _state$dropdownSearch3, _state$inputSearch4, _state$tabs8, _header$subHeading15, _header$subHeading16, _staticFilter$data6, _customDrawer$applied8, _state$
|
|
1124
|
+
var _state$dropdownSearch3, _state$inputSearch4, _state$tabs8, _header$subHeading15, _header$subHeading16, _staticFilter$data6, _customDrawer$applied8, _state$misc14, _state$staticFilter$m5, _state$staticFilter5;
|
|
1100
1125
|
dispatch({
|
|
1101
1126
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
1102
1127
|
payload: true
|
|
@@ -1121,7 +1146,7 @@ function GenricLayOut(_ref) {
|
|
|
1121
1146
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1122
1147
|
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied8 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied8 !== void 0 ? _customDrawer$applied8 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), {}, {
|
|
1123
1148
|
order: (sorter === null || sorter === void 0 ? void 0 : sorter.order) === "ascend" && "ASC" || (sorter === null || sorter === void 0 ? void 0 : sorter.order) === "descend" && "DESC" || ""
|
|
1124
|
-
}, (_state$
|
|
1149
|
+
}, (_state$misc14 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc14 !== void 0 ? _state$misc14 : {}), {}, {
|
|
1125
1150
|
multiSelectValue: (_state$staticFilter$m5 = state === null || state === void 0 || (_state$staticFilter5 = state.staticFilter) === null || _state$staticFilter5 === void 0 ? void 0 : _state$staticFilter5.multiSelectValue) !== null && _state$staticFilter$m5 !== void 0 ? _state$staticFilter$m5 : []
|
|
1126
1151
|
}));
|
|
1127
1152
|
if (error) {
|
|
@@ -1204,7 +1229,7 @@ function GenricLayOut(_ref) {
|
|
|
1204
1229
|
});
|
|
1205
1230
|
const selectedStaticFilterValue = tables !== null && tables !== void 0 && tables.staticFilterKey && (tables === null || tables === void 0 ? void 0 : tables.staticFilterKey) == key && Array.isArray(staticFilter.data) ? (_staticFilter$data$fi2 = staticFilter.data.find(item => item.selected)) === null || _staticFilter$data$fi2 === void 0 ? void 0 : _staticFilter$data$fi2.value : undefined;
|
|
1206
1231
|
if (handleTabClick) {
|
|
1207
|
-
var _state$
|
|
1232
|
+
var _state$misc15, _tables$pagination, _tables$pagination2, _tables$sorting13, _tables$sorting14, _state$dropdownSearch4, _header$subHeading17, _header$subHeading18, _customDrawer$applied9, _state$misc16, _state$staticFilter$m6, _state$staticFilter6;
|
|
1208
1233
|
dispatch({
|
|
1209
1234
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
1210
1235
|
payload: true
|
|
@@ -1212,7 +1237,7 @@ function GenricLayOut(_ref) {
|
|
|
1212
1237
|
const {
|
|
1213
1238
|
error,
|
|
1214
1239
|
data
|
|
1215
|
-
} = await handleTabClick(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (_state$
|
|
1240
|
+
} = await handleTabClick(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (_state$misc15 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc15 !== void 0 ? _state$misc15 : {}), {}, {
|
|
1216
1241
|
selectedTab: key,
|
|
1217
1242
|
current: tables === null || tables === void 0 || (_tables$pagination = tables.pagination) === null || _tables$pagination === void 0 ? void 0 : _tables$pagination.current,
|
|
1218
1243
|
pageSize: tables === null || tables === void 0 || (_tables$pagination2 = tables.pagination) === null || _tables$pagination2 === void 0 ? void 0 : _tables$pagination2.pageSize,
|
|
@@ -1226,7 +1251,7 @@ function GenricLayOut(_ref) {
|
|
|
1226
1251
|
selectedOption: state.dropdownSearch.selectedOption
|
|
1227
1252
|
}), (header === null || header === void 0 || (_header$subHeading17 = header.subHeading) === null || _header$subHeading17 === void 0 || (_header$subHeading17 = _header$subHeading17.jsxConfig) === null || _header$subHeading17 === void 0 ? void 0 : _header$subHeading17.type) == "select" ? {
|
|
1228
1253
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading18 = header.subHeading) === null || _header$subHeading18 === void 0 || (_header$subHeading18 = _header$subHeading18.jsxConfig) === null || _header$subHeading18 === void 0 ? void 0 : _header$subHeading18.value
|
|
1229
|
-
} : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied9 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied9 !== void 0 ? _customDrawer$applied9 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$
|
|
1254
|
+
} : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied9 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied9 !== void 0 ? _customDrawer$applied9 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$misc16 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc16 !== void 0 ? _state$misc16 : {}), {}, {
|
|
1230
1255
|
multiSelectValue: (_state$staticFilter$m6 = state === null || state === void 0 || (_state$staticFilter6 = state.staticFilter) === null || _state$staticFilter6 === void 0 ? void 0 : _state$staticFilter6.multiSelectValue) !== null && _state$staticFilter$m6 !== void 0 ? _state$staticFilter$m6 : []
|
|
1231
1256
|
}));
|
|
1232
1257
|
if (error) {
|
|
@@ -1322,11 +1347,11 @@ function GenricLayOut(_ref) {
|
|
|
1322
1347
|
return;
|
|
1323
1348
|
}
|
|
1324
1349
|
if (handleDrawerFormOnFinish) {
|
|
1325
|
-
var _state$
|
|
1350
|
+
var _state$misc17;
|
|
1326
1351
|
const {
|
|
1327
1352
|
error,
|
|
1328
1353
|
data
|
|
1329
|
-
} = await (handleDrawerFormOnFinish === null || handleDrawerFormOnFinish === void 0 ? void 0 : handleDrawerFormOnFinish(_objectSpread(_objectSpread(_objectSpread({}, record), formData), (_state$
|
|
1354
|
+
} = await (handleDrawerFormOnFinish === null || handleDrawerFormOnFinish === void 0 ? void 0 : handleDrawerFormOnFinish(_objectSpread(_objectSpread(_objectSpread({}, record), formData), (_state$misc17 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc17 !== void 0 ? _state$misc17 : {})));
|
|
1330
1355
|
if (error) {
|
|
1331
1356
|
showErrorNotification(error);
|
|
1332
1357
|
} else {
|
|
@@ -1350,7 +1375,7 @@ function GenricLayOut(_ref) {
|
|
|
1350
1375
|
|
|
1351
1376
|
// If there are remaining filters, reapply them
|
|
1352
1377
|
if (Object.keys(currentFilters).length > 0) {
|
|
1353
|
-
var _state$dropdownSearch5, _state$inputSearch5, _state$tabs11, _tables$pagination3, _tables$pagination4, _tables$filter6, _tables$sorting15, _header$subHeading19, _header$subHeading20, _staticFilter$data7, _tables$sorting16, _state$
|
|
1378
|
+
var _state$dropdownSearch5, _state$inputSearch5, _state$tabs11, _tables$pagination3, _tables$pagination4, _tables$filter6, _tables$sorting15, _header$subHeading19, _header$subHeading20, _staticFilter$data7, _tables$sorting16, _state$misc18, _state$staticFilter$m7, _state$staticFilter7;
|
|
1354
1379
|
const {
|
|
1355
1380
|
error,
|
|
1356
1381
|
data
|
|
@@ -1376,7 +1401,7 @@ function GenricLayOut(_ref) {
|
|
|
1376
1401
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1377
1402
|
}), {}, {
|
|
1378
1403
|
order: tables === null || tables === void 0 || (_tables$sorting16 = tables.sorting) === null || _tables$sorting16 === void 0 ? void 0 : _tables$sorting16.sortDirection
|
|
1379
|
-
}, (_state$
|
|
1404
|
+
}, (_state$misc18 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc18 !== void 0 ? _state$misc18 : {}), {}, {
|
|
1380
1405
|
multiSelectValue: (_state$staticFilter$m7 = state === null || state === void 0 || (_state$staticFilter7 = state.staticFilter) === null || _state$staticFilter7 === void 0 ? void 0 : _state$staticFilter7.multiSelectValue) !== null && _state$staticFilter$m7 !== void 0 ? _state$staticFilter$m7 : []
|
|
1381
1406
|
}));
|
|
1382
1407
|
if (error) {
|
|
@@ -1410,7 +1435,7 @@ function GenricLayOut(_ref) {
|
|
|
1410
1435
|
const filterFormOnFinish = async formData => {
|
|
1411
1436
|
// Check if this is a cancel/clear action - check both buttonClickType and the actual button data
|
|
1412
1437
|
if (formData.type === "FILTER-CANCEL") {
|
|
1413
|
-
var _state$dropdownSearch6, _state$inputSearch6, _state$tabs12, _tables$pagination5, _tables$pagination6, _tables$filter7, _tables$sorting17, _header$subHeading21, _header$subHeading22, _staticFilter$data8, _tables$sorting18, _state$
|
|
1438
|
+
var _state$dropdownSearch6, _state$inputSearch6, _state$tabs12, _tables$pagination5, _tables$pagination6, _tables$filter7, _tables$sorting17, _header$subHeading21, _header$subHeading22, _staticFilter$data8, _tables$sorting18, _state$misc19, _state$staticFilter$m8, _state$staticFilter8;
|
|
1414
1439
|
if (isFiltersEmpty(customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)) {
|
|
1415
1440
|
dispatch({
|
|
1416
1441
|
type: _layoutReducer.actionTypes.CUSTOM_DRAWER_CLOSED
|
|
@@ -1439,7 +1464,7 @@ function GenricLayOut(_ref) {
|
|
|
1439
1464
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1440
1465
|
}), {}, {
|
|
1441
1466
|
order: tables === null || tables === void 0 || (_tables$sorting18 = tables.sorting) === null || _tables$sorting18 === void 0 ? void 0 : _tables$sorting18.sortDirection
|
|
1442
|
-
}, (_state$
|
|
1467
|
+
}, (_state$misc19 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc19 !== void 0 ? _state$misc19 : {}), {}, {
|
|
1443
1468
|
multiSelectValue: (_state$staticFilter$m8 = state === null || state === void 0 || (_state$staticFilter8 = state.staticFilter) === null || _state$staticFilter8 === void 0 ? void 0 : _state$staticFilter8.multiSelectValue) !== null && _state$staticFilter$m8 !== void 0 ? _state$staticFilter$m8 : []
|
|
1444
1469
|
}));
|
|
1445
1470
|
if (error) {
|
|
@@ -1489,7 +1514,7 @@ function GenricLayOut(_ref) {
|
|
|
1489
1514
|
|
|
1490
1515
|
// Only process filter data if this is actually a filter drawer
|
|
1491
1516
|
if (formData.type === "FILTER-SUBMIT") {
|
|
1492
|
-
var _state$dropdownSearch7, _state$inputSearch7, _ref4, _appliedFilters$filte, _state$tabs13, _config$tables29, _config$tables30, _tables$filter8, _tables$sorting19, _header$subHeading23, _header$subHeading24, _staticFilter$data9, _tables$sorting20, _state$
|
|
1517
|
+
var _state$dropdownSearch7, _state$inputSearch7, _ref4, _appliedFilters$filte, _state$tabs13, _config$tables29, _config$tables30, _tables$filter8, _tables$sorting19, _header$subHeading23, _header$subHeading24, _staticFilter$data9, _tables$sorting20, _state$misc20, _state$staticFilter$m9, _state$staticFilter9;
|
|
1493
1518
|
const appliedFilters = {};
|
|
1494
1519
|
Object.keys(formData).forEach(key => {
|
|
1495
1520
|
const value = formData[key];
|
|
@@ -1528,7 +1553,7 @@ function GenricLayOut(_ref) {
|
|
|
1528
1553
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1529
1554
|
}), {}, {
|
|
1530
1555
|
order: tables === null || tables === void 0 || (_tables$sorting20 = tables.sorting) === null || _tables$sorting20 === void 0 ? void 0 : _tables$sorting20.sortDirection
|
|
1531
|
-
}, (_state$
|
|
1556
|
+
}, (_state$misc20 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc20 !== void 0 ? _state$misc20 : {}), {}, {
|
|
1532
1557
|
multiSelectValue: (_state$staticFilter$m9 = state === null || state === void 0 || (_state$staticFilter9 = state.staticFilter) === null || _state$staticFilter9 === void 0 ? void 0 : _state$staticFilter9.multiSelectValue) !== null && _state$staticFilter$m9 !== void 0 ? _state$staticFilter$m9 : []
|
|
1533
1558
|
}));
|
|
1534
1559
|
if (error) {
|
|
@@ -1583,7 +1608,7 @@ function GenricLayOut(_ref) {
|
|
|
1583
1608
|
}
|
|
1584
1609
|
});
|
|
1585
1610
|
if (handleSecondaryTableCTAClick) {
|
|
1586
|
-
var _state$dropdownSearch8, _state$inputSearch8, _state$tabs14, _tables$pagination7, _tables$pagination8, _tables$filter9, _tables$sorting21, _tables$sorting22, _header$subHeading25, _header$subHeading26, _staticFilter$data10, _state$
|
|
1611
|
+
var _state$dropdownSearch8, _state$inputSearch8, _state$tabs14, _tables$pagination7, _tables$pagination8, _tables$filter9, _tables$sorting21, _tables$sorting22, _header$subHeading25, _header$subHeading26, _staticFilter$data10, _state$misc21, _state$staticFilter$m10, _state$staticFilter10;
|
|
1587
1612
|
const {
|
|
1588
1613
|
error,
|
|
1589
1614
|
data
|
|
@@ -1608,7 +1633,7 @@ function GenricLayOut(_ref) {
|
|
|
1608
1633
|
toDate: formData === null || formData === void 0 ? void 0 : formData.toDate
|
|
1609
1634
|
}, appliedFilters), (formData === null || formData === void 0 ? void 0 : formData.exportType) && {
|
|
1610
1635
|
exportType: formData === null || formData === void 0 ? void 0 : formData.exportType
|
|
1611
|
-
}), (_state$
|
|
1636
|
+
}), (_state$misc21 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc21 !== void 0 ? _state$misc21 : {}), {}, {
|
|
1612
1637
|
multiSelectValue: (_state$staticFilter$m10 = state === null || state === void 0 || (_state$staticFilter10 = state.staticFilter) === null || _state$staticFilter10 === void 0 ? void 0 : _state$staticFilter10.multiSelectValue) !== null && _state$staticFilter$m10 !== void 0 ? _state$staticFilter$m10 : []
|
|
1613
1638
|
})));
|
|
1614
1639
|
if (error) {
|
|
@@ -1624,7 +1649,7 @@ function GenricLayOut(_ref) {
|
|
|
1624
1649
|
}
|
|
1625
1650
|
};
|
|
1626
1651
|
const onClearAllAppliedFilters = async () => {
|
|
1627
|
-
var _state$dropdownSearch9, _state$inputSearch9, _state$tabs15, _tables$pagination9, _tables$pagination10, _tables$filter10, _tables$sorting23, _header$subHeading27, _header$subHeading28, _staticFilter$data11, _tables$sorting24, _state$
|
|
1652
|
+
var _state$dropdownSearch9, _state$inputSearch9, _state$tabs15, _tables$pagination9, _tables$pagination10, _tables$filter10, _tables$sorting23, _header$subHeading27, _header$subHeading28, _staticFilter$data11, _tables$sorting24, _state$misc22, _state$staticFilter$m11, _state$staticFilter11;
|
|
1628
1653
|
const {
|
|
1629
1654
|
error,
|
|
1630
1655
|
data
|
|
@@ -1647,7 +1672,7 @@ function GenricLayOut(_ref) {
|
|
|
1647
1672
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1648
1673
|
}), {}, {
|
|
1649
1674
|
order: tables === null || tables === void 0 || (_tables$sorting24 = tables.sorting) === null || _tables$sorting24 === void 0 ? void 0 : _tables$sorting24.sortDirection
|
|
1650
|
-
}, (_state$
|
|
1675
|
+
}, (_state$misc22 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc22 !== void 0 ? _state$misc22 : {}), {}, {
|
|
1651
1676
|
multiSelectValue: (_state$staticFilter$m11 = state === null || state === void 0 || (_state$staticFilter11 = state.staticFilter) === null || _state$staticFilter11 === void 0 ? void 0 : _state$staticFilter11.multiSelectValue) !== null && _state$staticFilter$m11 !== void 0 ? _state$staticFilter$m11 : []
|
|
1652
1677
|
}));
|
|
1653
1678
|
if (error) {
|
|
@@ -1706,14 +1731,14 @@ function GenricLayOut(_ref) {
|
|
|
1706
1731
|
return;
|
|
1707
1732
|
} else if (action === "CLOSE_MODAL_AND_FETCH") {
|
|
1708
1733
|
if (handleModalCloseSuccess) {
|
|
1709
|
-
var _stateRef$current, _state$
|
|
1734
|
+
var _stateRef$current, _state$misc23;
|
|
1710
1735
|
const {
|
|
1711
1736
|
error,
|
|
1712
1737
|
data
|
|
1713
1738
|
} = await (handleModalCloseSuccess === null || handleModalCloseSuccess === void 0 ? void 0 : handleModalCloseSuccess(_objectSpread({
|
|
1714
1739
|
modalValue: stateRef === null || stateRef === void 0 || (_stateRef$current = stateRef.current) === null || _stateRef$current === void 0 || (_stateRef$current = _stateRef$current.modal) === null || _stateRef$current === void 0 ? void 0 : _stateRef$current.value,
|
|
1715
1740
|
call: buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.call
|
|
1716
|
-
}, (_state$
|
|
1741
|
+
}, (_state$misc23 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc23 !== void 0 ? _state$misc23 : {})));
|
|
1717
1742
|
if (error) {
|
|
1718
1743
|
showErrorNotification(error);
|
|
1719
1744
|
} else {
|
|
@@ -1727,10 +1752,11 @@ function GenricLayOut(_ref) {
|
|
|
1727
1752
|
}
|
|
1728
1753
|
} else {
|
|
1729
1754
|
if (handleDrawerFormOnFinish) {
|
|
1730
|
-
var _state$tables$selecte, _state$tables3;
|
|
1755
|
+
var _state$tables$selecte, _state$tables3, _state$misc24;
|
|
1731
1756
|
let req = {};
|
|
1732
1757
|
req.type = "APPROVE";
|
|
1733
1758
|
req.orderUUID = (_state$tables$selecte = state === null || state === void 0 || (_state$tables3 = state.tables) === null || _state$tables3 === void 0 || (_state$tables3 = _state$tables3.selectedRowKeys) === null || _state$tables3 === void 0 ? void 0 : _state$tables3.map(item => item.orderUUID)) !== null && _state$tables$selecte !== void 0 ? _state$tables$selecte : [];
|
|
1759
|
+
req.misc = (_state$misc24 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc24 !== void 0 ? _state$misc24 : {};
|
|
1734
1760
|
const {
|
|
1735
1761
|
error,
|
|
1736
1762
|
data
|
|
@@ -1830,7 +1856,7 @@ function GenricLayOut(_ref) {
|
|
|
1830
1856
|
};
|
|
1831
1857
|
const rightHeaderSecondButtonClick = async () => {
|
|
1832
1858
|
if ((rightHeaderSecondButton === null || rightHeaderSecondButton === void 0 ? void 0 : rightHeaderSecondButton.action) === "RESET_CUSTOM_DRAWER") {
|
|
1833
|
-
var _state$dropdownSearch10, _state$inputSearch10, _state$tabs16, _tables$pagination11, _tables$pagination12, _tables$filter11, _tables$sorting25, _header$subHeading29, _header$subHeading30, _staticFilter$data12, _tables$sorting26, _state$
|
|
1859
|
+
var _state$dropdownSearch10, _state$inputSearch10, _state$tabs16, _tables$pagination11, _tables$pagination12, _tables$filter11, _tables$sorting25, _header$subHeading29, _header$subHeading30, _staticFilter$data12, _tables$sorting26, _state$misc25, _state$staticFilter$m12, _state$staticFilter12;
|
|
1834
1860
|
const {
|
|
1835
1861
|
error,
|
|
1836
1862
|
data
|
|
@@ -1853,7 +1879,7 @@ function GenricLayOut(_ref) {
|
|
|
1853
1879
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1854
1880
|
}), {}, {
|
|
1855
1881
|
order: tables === null || tables === void 0 || (_tables$sorting26 = tables.sorting) === null || _tables$sorting26 === void 0 ? void 0 : _tables$sorting26.sortDirection
|
|
1856
|
-
}, (_state$
|
|
1882
|
+
}, (_state$misc25 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc25 !== void 0 ? _state$misc25 : {}), {}, {
|
|
1857
1883
|
multiSelectValue: (_state$staticFilter$m12 = state === null || state === void 0 || (_state$staticFilter12 = state.staticFilter) === null || _state$staticFilter12 === void 0 ? void 0 : _state$staticFilter12.multiSelectValue) !== null && _state$staticFilter$m12 !== void 0 ? _state$staticFilter$m12 : []
|
|
1858
1884
|
}));
|
|
1859
1885
|
if (error) {
|
|
@@ -1906,7 +1932,7 @@ function GenricLayOut(_ref) {
|
|
|
1906
1932
|
};
|
|
1907
1933
|
const handleSubHeadingSelect = async val => {
|
|
1908
1934
|
if (val) {
|
|
1909
|
-
var _state$tabs17, _tables$pagination13, _tables$pagination14, _state$
|
|
1935
|
+
var _state$tabs17, _tables$pagination13, _tables$pagination14, _state$misc26;
|
|
1910
1936
|
dispatch({
|
|
1911
1937
|
type: _layoutReducer.actionTypes.SET_SUBHEADING_SELECTED_CONFIG,
|
|
1912
1938
|
payload: val
|
|
@@ -1920,7 +1946,7 @@ function GenricLayOut(_ref) {
|
|
|
1920
1946
|
current: tables === null || tables === void 0 || (_tables$pagination13 = tables.pagination) === null || _tables$pagination13 === void 0 ? void 0 : _tables$pagination13.current,
|
|
1921
1947
|
pageSize: tables === null || tables === void 0 || (_tables$pagination14 = tables.pagination) === null || _tables$pagination14 === void 0 ? void 0 : _tables$pagination14.pageSize,
|
|
1922
1948
|
subHeadingSelectVal: val
|
|
1923
|
-
}, (_state$
|
|
1949
|
+
}, (_state$misc26 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc26 !== void 0 ? _state$misc26 : {}));
|
|
1924
1950
|
if (error) {
|
|
1925
1951
|
showErrorNotification(error);
|
|
1926
1952
|
dispatch({
|
|
@@ -1956,7 +1982,7 @@ function GenricLayOut(_ref) {
|
|
|
1956
1982
|
|
|
1957
1983
|
// Call the handler if provided
|
|
1958
1984
|
if (handleTableChange) {
|
|
1959
|
-
var _state$dropdownSearch11, _state$inputSearch11, _state$tabs18, _tables$pagination15, _tables$sorting27, _tables$sorting28, _header$subHeading31, _header$subHeading32, _customDrawer$applied10, _state$
|
|
1985
|
+
var _state$dropdownSearch11, _state$inputSearch11, _state$tabs18, _tables$pagination15, _tables$sorting27, _tables$sorting28, _header$subHeading31, _header$subHeading32, _customDrawer$applied10, _state$misc27;
|
|
1960
1986
|
dispatch({
|
|
1961
1987
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
1962
1988
|
payload: true
|
|
@@ -1979,7 +2005,7 @@ function GenricLayOut(_ref) {
|
|
|
1979
2005
|
order: tables === null || tables === void 0 || (_tables$sorting28 = tables.sorting) === null || _tables$sorting28 === void 0 ? void 0 : _tables$sorting28.sortDirection
|
|
1980
2006
|
}, (header === null || header === void 0 || (_header$subHeading31 = header.subHeading) === null || _header$subHeading31 === void 0 || (_header$subHeading31 = _header$subHeading31.jsxConfig) === null || _header$subHeading31 === void 0 ? void 0 : _header$subHeading31.type) == "select" ? {
|
|
1981
2007
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading32 = header.subHeading) === null || _header$subHeading32 === void 0 || (_header$subHeading32 = _header$subHeading32.jsxConfig) === null || _header$subHeading32 === void 0 ? void 0 : _header$subHeading32.value
|
|
1982
|
-
} : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied10 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied10 !== void 0 ? _customDrawer$applied10 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$
|
|
2008
|
+
} : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied10 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied10 !== void 0 ? _customDrawer$applied10 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$misc27 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc27 !== void 0 ? _state$misc27 : {}), {}, {
|
|
1983
2009
|
staticFilter: filterValue,
|
|
1984
2010
|
// Pass static filter value
|
|
1985
2011
|
multiSelectValue: multiSelectValue
|
|
@@ -2023,7 +2049,7 @@ function GenricLayOut(_ref) {
|
|
|
2023
2049
|
}
|
|
2024
2050
|
});
|
|
2025
2051
|
if (handleTableChange) {
|
|
2026
|
-
var _state$dropdownSearch12, _state$inputSearch12, _state$tabs19, _tables$filter12, _tables$sorting29, _tables$sorting30, _header$subHeading33, _header$subHeading34, _staticFilter$data13, _customDrawer$applied11, _state$
|
|
2052
|
+
var _state$dropdownSearch12, _state$inputSearch12, _state$tabs19, _tables$filter12, _tables$sorting29, _tables$sorting30, _header$subHeading33, _header$subHeading34, _staticFilter$data13, _customDrawer$applied11, _state$misc28, _state$staticFilter$m13, _state$staticFilter13;
|
|
2027
2053
|
const {
|
|
2028
2054
|
error,
|
|
2029
2055
|
data
|
|
@@ -2043,7 +2069,7 @@ function GenricLayOut(_ref) {
|
|
|
2043
2069
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading34 = header.subHeading) === null || _header$subHeading34 === void 0 || (_header$subHeading34 = _header$subHeading34.jsxConfig) === null || _header$subHeading34 === void 0 ? void 0 : _header$subHeading34.value
|
|
2044
2070
|
} : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data13 = staticFilter.data) === null || _staticFilter$data13 === void 0 || (_staticFilter$data13 = _staticFilter$data13.find(item => item.selected)) === null || _staticFilter$data13 === void 0 ? void 0 : _staticFilter$data13.value) && {
|
|
2045
2071
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
2046
|
-
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied11 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied11 !== void 0 ? _customDrawer$applied11 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$
|
|
2072
|
+
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied11 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied11 !== void 0 ? _customDrawer$applied11 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$misc28 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc28 !== void 0 ? _state$misc28 : {}), {}, {
|
|
2047
2073
|
multiSelectValue: (_state$staticFilter$m13 = state === null || state === void 0 || (_state$staticFilter13 = state.staticFilter) === null || _state$staticFilter13 === void 0 ? void 0 : _state$staticFilter13.multiSelectValue) !== null && _state$staticFilter$m13 !== void 0 ? _state$staticFilter$m13 : []
|
|
2048
2074
|
}));
|
|
2049
2075
|
if (error) {
|
|
@@ -2074,7 +2100,7 @@ function GenricLayOut(_ref) {
|
|
|
2074
2100
|
console.log(state, "GenricLayOutstate");
|
|
2075
2101
|
return /*#__PURE__*/_react.default.createElement(_styles.OapageWithDataStyle, {
|
|
2076
2102
|
marginBottom: infoPanel !== null && infoPanel !== void 0 && infoPanel.bottomMarginRequired ? "18px" : "0",
|
|
2077
|
-
className: (state === null || state === void 0 || (_state$
|
|
2103
|
+
className: (state === null || state === void 0 || (_state$misc29 = state.misc) === null || _state$misc29 === void 0 ? void 0 : _state$misc29.flow) === "hubAutomation" ? "hubAutomationContainer" : ""
|
|
2078
2104
|
}, /*#__PURE__*/_react.default.createElement(_styles.DrawerWithOutFooter, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
2079
2105
|
className: "fullPageLayout"
|
|
2080
2106
|
}, /*#__PURE__*/_react.default.createElement(_GlobalCss.default, null, (sidebar === null || sidebar === void 0 ? void 0 : sidebar.visible) && /*#__PURE__*/_react.default.createElement(_antd.Skeleton, {
|
|
@@ -2347,7 +2373,8 @@ function GenricLayOut(_ref) {
|
|
|
2347
2373
|
type: _layoutReducer.actionTypes.TOGGLE_MODAL,
|
|
2348
2374
|
payload: false
|
|
2349
2375
|
}),
|
|
2350
|
-
onFooterAction: onClickModalFooter
|
|
2376
|
+
onFooterAction: onClickModalFooter,
|
|
2377
|
+
handleSwitchSelectItem: handleSwitchSelectItem
|
|
2351
2378
|
}))), /*#__PURE__*/_react.default.createElement(_CustomNotification.default, {
|
|
2352
2379
|
ref: notificationRef
|
|
2353
2380
|
}))));
|
|
@@ -26,7 +26,8 @@ function LayoutModal(_ref) {
|
|
|
26
26
|
let {
|
|
27
27
|
modal,
|
|
28
28
|
onCancel,
|
|
29
|
-
onFooterAction
|
|
29
|
+
onFooterAction,
|
|
30
|
+
handleSwitchSelectItem
|
|
30
31
|
} = _ref;
|
|
31
32
|
if (!(modal !== null && modal !== void 0 && modal.visible)) return null;
|
|
32
33
|
const getModalButtonConfig = buttonConfig => buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.map(button => _objectSpread(_objectSpread({}, button), {}, {
|
|
@@ -46,7 +47,8 @@ function LayoutModal(_ref) {
|
|
|
46
47
|
} else if ((modal === null || modal === void 0 ? void 0 : modal.widget) === "selectListItem") {
|
|
47
48
|
return /*#__PURE__*/_react.default.createElement(_SelectListItemModal.default, {
|
|
48
49
|
modalContent: modal === null || modal === void 0 ? void 0 : modal.modalContent,
|
|
49
|
-
onItemSelect: item => onFooterAction("select", item)
|
|
50
|
+
onItemSelect: item => onFooterAction("select", item),
|
|
51
|
+
handleSwitchSelectItem: handleSwitchSelectItem
|
|
50
52
|
});
|
|
51
53
|
} else {
|
|
52
54
|
var _modal$modalContent2, _modal$modalContent3, _modal$modalContent4, _modal$modalContent5, _modal$modalContent6, _modal$modalContent7, _modal$modalContent8, _modal$modalContent9, _modal$modalContent10, _modal$modalContent11, _modal$modalContent12, _modal$modalContent13;
|
|
@@ -7,9 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
9
|
require("core-js/modules/es.string.trim.js");
|
|
10
|
+
require("core-js/modules/es.json.stringify.js");
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
13
|
var _Typography = _interopRequireDefault(require("../../../components/oa-component-typography/Typography"));
|
|
14
|
+
var _MaterialIcon = _interopRequireDefault(require("../../../components/oa-component-icons/MaterialIcon"));
|
|
15
|
+
var _ChevronRight = _interopRequireDefault(require("@material-ui/icons/ChevronRight"));
|
|
16
|
+
var _CustomButton = _interopRequireDefault(require("../../../components/oa-component-button/CustomButton"));
|
|
13
17
|
var _styles = require("../styles");
|
|
14
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -26,16 +30,20 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
26
30
|
* @param {string} props.profileData.iconBgColor - Design token like 'primary'
|
|
27
31
|
* @param {string} props.profileData.tooltipText - Text to display in the tooltip
|
|
28
32
|
* @param {boolean} props.profileData.visible - Whether to show the profile section
|
|
33
|
+
* @param {string} props.profileData.behavior - 'reroute' or 'open-container'
|
|
34
|
+
* @param {Object} props.profileData.containerData - Data for container modal
|
|
29
35
|
* @param {Function} props.onProfileClick - Function to call when profile is clicked
|
|
30
36
|
*
|
|
31
37
|
* @returns {JSX.Element} Profile section component
|
|
32
38
|
*/
|
|
33
39
|
function ProfileSection(_ref) {
|
|
40
|
+
var _containerData$curren, _containerData$curren2, _containerData$curren3, _containerData$curren4;
|
|
34
41
|
let {
|
|
35
42
|
profileData,
|
|
36
43
|
onProfileClick
|
|
37
44
|
} = _ref;
|
|
38
45
|
const [showTooltip, setShowTooltip] = (0, _react.useState)(false);
|
|
46
|
+
const [showContainer, setShowContainer] = (0, _react.useState)(false);
|
|
39
47
|
if (!(profileData !== null && profileData !== void 0 && profileData.visible)) {
|
|
40
48
|
return null;
|
|
41
49
|
}
|
|
@@ -43,14 +51,59 @@ function ProfileSection(_ref) {
|
|
|
43
51
|
iconText,
|
|
44
52
|
iconColor,
|
|
45
53
|
iconBgColor,
|
|
46
|
-
tooltipText
|
|
54
|
+
tooltipText,
|
|
55
|
+
behavior = "reroute",
|
|
56
|
+
containerData,
|
|
57
|
+
mwebTypographyType = "type-h2-500"
|
|
47
58
|
} = profileData;
|
|
48
59
|
const resolveToken = token => "var(--color-".concat(String(token || "").trim(), ")");
|
|
60
|
+
const handleProfileClick = () => {
|
|
61
|
+
if (behavior === "open-container") {
|
|
62
|
+
setShowContainer(true);
|
|
63
|
+
} else {
|
|
64
|
+
onProfileClick();
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const handleListItemSelect = enterprise => {
|
|
68
|
+
// Store selected enterprise in session storage
|
|
69
|
+
sessionStorage.setItem("selectedEnterprise", JSON.stringify(enterprise));
|
|
70
|
+
|
|
71
|
+
// Store notification data for after reload
|
|
72
|
+
sessionStorage.setItem("showEnterpriseNotification", JSON.stringify({
|
|
73
|
+
message: "Successfully switched to another enterprise.",
|
|
74
|
+
type: "success"
|
|
75
|
+
}));
|
|
76
|
+
|
|
77
|
+
// Close container
|
|
78
|
+
setShowContainer(false);
|
|
79
|
+
|
|
80
|
+
// Reload the page immediately
|
|
81
|
+
window.location.reload();
|
|
82
|
+
};
|
|
83
|
+
const getEnterpriseAvatarStyle = index => {
|
|
84
|
+
if (containerData !== null && containerData !== void 0 && containerData.avatarColors && containerData.avatarColors.length > 0) {
|
|
85
|
+
// Use modulo to cycle through colors
|
|
86
|
+
const colorIndex = index % containerData.avatarColors.length;
|
|
87
|
+
return containerData.avatarColors[colorIndex];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Fallback to enterprise's own color if no avatarColors provided
|
|
91
|
+
return {
|
|
92
|
+
backgroundColor: enterprise.iconBgColor || "#1890ff",
|
|
93
|
+
color: "#fff"
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
const handleManageProfile = () => {
|
|
97
|
+
setShowContainer(false);
|
|
98
|
+
if (containerData !== null && containerData !== void 0 && containerData.manageProfileReroute) {
|
|
99
|
+
window.location.href = containerData.manageProfileReroute;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
49
102
|
return /*#__PURE__*/_react.default.createElement(_styles.ProfileSectionContainer, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
50
103
|
className: "profile-icon-container",
|
|
51
104
|
onMouseEnter: () => setShowTooltip(true),
|
|
52
105
|
onMouseLeave: () => setShowTooltip(false),
|
|
53
|
-
onClick:
|
|
106
|
+
onClick: handleProfileClick
|
|
54
107
|
}, /*#__PURE__*/_react.default.createElement(_styles.ProfileIcon, {
|
|
55
108
|
style: {
|
|
56
109
|
backgroundColor: resolveToken(iconBgColor),
|
|
@@ -58,11 +111,58 @@ function ProfileSection(_ref) {
|
|
|
58
111
|
}
|
|
59
112
|
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
60
113
|
color: "white",
|
|
61
|
-
typography:
|
|
62
|
-
}, iconText)), showTooltip && /*#__PURE__*/_react.default.createElement(_styles.Tooltip, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
114
|
+
typography: mwebTypographyType
|
|
115
|
+
}, iconText)), showTooltip && tooltipText && /*#__PURE__*/_react.default.createElement(_styles.Tooltip, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
63
116
|
color: "white",
|
|
64
117
|
typography: "type-b2-400"
|
|
65
|
-
}, tooltipText)))
|
|
118
|
+
}, tooltipText))), showContainer && containerData && /*#__PURE__*/_react.default.createElement(_styles.ProfileContainerOverlay, {
|
|
119
|
+
onClick: () => setShowContainer(false),
|
|
120
|
+
onMouseDown: e => e.target === e.currentTarget && setShowContainer(false)
|
|
121
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.ProfileContainerModal, {
|
|
122
|
+
onClick: e => e.stopPropagation()
|
|
123
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.CurrentProfileSection, null, /*#__PURE__*/_react.default.createElement(_styles.ProfileInfoContainer, null, /*#__PURE__*/_react.default.createElement(_styles.ProfileAvatar, {
|
|
124
|
+
style: {
|
|
125
|
+
backgroundColor: resolveToken(((_containerData$curren = containerData.currentProfile) === null || _containerData$curren === void 0 ? void 0 : _containerData$curren.iconBgColor) || "primary"),
|
|
126
|
+
color: resolveToken(((_containerData$curren2 = containerData.currentProfile) === null || _containerData$curren2 === void 0 ? void 0 : _containerData$curren2.iconColor) || "white"),
|
|
127
|
+
fontSize: "25px",
|
|
128
|
+
fontWeight: "500"
|
|
129
|
+
}
|
|
130
|
+
}, ((_containerData$curren3 = containerData.currentProfile) === null || _containerData$curren3 === void 0 ? void 0 : _containerData$curren3.iconText) || iconText), /*#__PURE__*/_react.default.createElement(_styles.ProfileNameContainer, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
131
|
+
color: "primary-content",
|
|
132
|
+
typography: "type-t2-700"
|
|
133
|
+
}, ((_containerData$curren4 = containerData.currentProfile) === null || _containerData$curren4 === void 0 ? void 0 : _containerData$curren4.name) || "Current Profile"), /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
134
|
+
label: "Manage Profile",
|
|
135
|
+
type: "secondary",
|
|
136
|
+
onClick: handleManageProfile,
|
|
137
|
+
style: {
|
|
138
|
+
width: "fit-content"
|
|
139
|
+
}
|
|
140
|
+
})))), containerData.listItems && containerData.listItems.length > 0 && /*#__PURE__*/_react.default.createElement(_styles.EnterpriseSection, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
141
|
+
color: "primary-content",
|
|
142
|
+
typography: "type-t2-700",
|
|
143
|
+
style: {
|
|
144
|
+
marginBottom: "16px"
|
|
145
|
+
}
|
|
146
|
+
}, "Switch to Another Enterprise"), /*#__PURE__*/_react.default.createElement(_styles.EnterpriseList, null, containerData.listItems.map((enterprise, index) => {
|
|
147
|
+
const avatarStyle = getEnterpriseAvatarStyle(index);
|
|
148
|
+
return /*#__PURE__*/_react.default.createElement(_styles.EnterpriseItem, {
|
|
149
|
+
key: index,
|
|
150
|
+
onClick: () => handleListItemSelect(enterprise)
|
|
151
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.EnterpriseAvatar, {
|
|
152
|
+
style: {
|
|
153
|
+
backgroundColor: avatarStyle.backgroundColor,
|
|
154
|
+
color: avatarStyle.color
|
|
155
|
+
}
|
|
156
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
157
|
+
typography: "type-h2-500"
|
|
158
|
+
}, enterprise.iconText)), /*#__PURE__*/_react.default.createElement(_styles.EnterpriseContent, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
159
|
+
typography: "type-t2-700"
|
|
160
|
+
}, enterprise.name)), /*#__PURE__*/_react.default.createElement(_styles.EnterpriseArrow, null, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
161
|
+
icon: _ChevronRight.default,
|
|
162
|
+
size: 20,
|
|
163
|
+
color: "primary"
|
|
164
|
+
})));
|
|
165
|
+
}))))));
|
|
66
166
|
}
|
|
67
167
|
ProfileSection.propTypes = {
|
|
68
168
|
profileData: _propTypes.default.shape({
|
|
@@ -70,9 +170,31 @@ ProfileSection.propTypes = {
|
|
|
70
170
|
iconText: _propTypes.default.string,
|
|
71
171
|
iconColor: _propTypes.default.string,
|
|
72
172
|
iconBgColor: _propTypes.default.string,
|
|
73
|
-
tooltipText: _propTypes.default.string
|
|
173
|
+
tooltipText: _propTypes.default.string,
|
|
174
|
+
mwebTypographyType: _propTypes.default.string,
|
|
175
|
+
behavior: _propTypes.default.oneOf(["reroute", "open-container"]),
|
|
176
|
+
containerData: _propTypes.default.shape({
|
|
177
|
+
currentProfile: _propTypes.default.shape({
|
|
178
|
+
name: _propTypes.default.string,
|
|
179
|
+
iconText: _propTypes.default.string,
|
|
180
|
+
iconColor: _propTypes.default.string,
|
|
181
|
+
iconBgColor: _propTypes.default.string
|
|
182
|
+
}),
|
|
183
|
+
avatarColors: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
184
|
+
backgroundColor: _propTypes.default.string,
|
|
185
|
+
color: _propTypes.default.string
|
|
186
|
+
})),
|
|
187
|
+
manageProfileReroute: _propTypes.default.string,
|
|
188
|
+
listItems: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
189
|
+
name: _propTypes.default.string,
|
|
190
|
+
iconText: _propTypes.default.string,
|
|
191
|
+
iconBgColor: _propTypes.default.string,
|
|
192
|
+
reroute: _propTypes.default.string
|
|
193
|
+
}))
|
|
194
|
+
})
|
|
74
195
|
}),
|
|
75
|
-
onProfileClick: _propTypes.default.func
|
|
196
|
+
onProfileClick: _propTypes.default.func,
|
|
197
|
+
onShowNotification: _propTypes.default.func
|
|
76
198
|
};
|
|
77
199
|
ProfileSection.defaultProps = {
|
|
78
200
|
profileData: {
|
|
@@ -80,8 +202,12 @@ ProfileSection.defaultProps = {
|
|
|
80
202
|
iconText: "R",
|
|
81
203
|
iconColor: "primary-content",
|
|
82
204
|
iconBgColor: "primary",
|
|
83
|
-
tooltipText: "To manage the sub-admins, go to the Profile section."
|
|
205
|
+
tooltipText: "To manage the sub-admins, go to the Profile section.",
|
|
206
|
+
mwebTypographyType: "type-h2-500",
|
|
207
|
+
behavior: "reroute",
|
|
208
|
+
containerData: null
|
|
84
209
|
},
|
|
85
|
-
onProfileClick: () => {}
|
|
210
|
+
onProfileClick: () => {},
|
|
211
|
+
onShowNotification: () => {}
|
|
86
212
|
};
|
|
87
213
|
var _default = exports.default = ProfileSection;
|
|
@@ -5,9 +5,9 @@ require("core-js/modules/web.dom-collections.iterator.js");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.Tooltip = exports.TableDataStyle = exports.ProfileSectionContainer = exports.ProfileIcon = exports.OapageWithDataStyle = exports.ListofDamageParts = exports.IncidentListParts = exports.FormWidgetStyle = exports.DrawerWithOutFooter = void 0;
|
|
8
|
+
exports.default = exports.Tooltip = exports.TableDataStyle = exports.ProfileSectionContainer = exports.ProfileNameContainer = exports.ProfileInfoContainer = exports.ProfileIcon = exports.ProfileContainerOverlay = exports.ProfileContainerModal = exports.ProfileAvatar = exports.OapageWithDataStyle = exports.ListofDamageParts = exports.IncidentListParts = exports.FormWidgetStyle = exports.EnterpriseSection = exports.EnterpriseList = exports.EnterpriseItem = exports.EnterpriseContent = exports.EnterpriseAvatar = exports.EnterpriseArrow = exports.DrawerWithOutFooter = exports.CurrentProfileSection = void 0;
|
|
9
9
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
10
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21;
|
|
11
11
|
/* eslint-disable */
|
|
12
12
|
// styles.js
|
|
13
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -16,7 +16,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
16
16
|
const DrawerWithOutFooter = exports.DrawerWithOutFooter = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.hubAutomationContainer .fullPageLayout {padding: 0 !important; background: #fff !important;}\n.hubAutomationContainer .fullPageLayout .oaRightLayouts{\n max-width: 1154px;\n margin: 24px auto;\n padding: 0 16px;\n box-shadow: none;}\n.oaDrawer div + div.ant-drawer-body{padding-bottom:100px !important;}\n\n.ant-checkbox-indeterminate .ant-checkbox-inner:after {\n background-color: #014fc5;\n}\n\n.ant-form-item .ant-form-item-label >label.ant-form-item-required::before {display:none;}\n.ant-form-item .ant-form-item-label >label.ant-form-item-required::after{ content: \"*\"; color: #DE350B; visibility: visible !important;}\n\n\n.cstUplaodWithFullWidth{margin-bottom:24px;}\n.cstUplaodWithFullWidth:last-child{margin-bottom:0;}\n.cstUplaodWithFullWidth .uploadDiv{width:100%;}\n.cstUplaodWithFullWidth .uploadDiv .ant-upload-list-item-container, .cstUplaodWithFullWidth .uploadDiv .ant-upload-wrapper .ant-upload-list-picture-card .ant-upload-select, .cstUplaodWithFullWidth .uploadDiv .ant-upload-wrapper.ant-upload-picture-card-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-container {\n width: 100%; \n height: 120px;\n}\n\n\n\n\n.oaDrawer .ant-form-item .ant-form-item-explain-error {\n color: #DE350B;\n font-size: 12px;\n margin: 4px 0 0 0;\n}\n.bottomSelectedSecion{background: #F6F6F6; padding: 16px 36px; position: fixed; bottom: 0; left: 0; right: 0;\nbox-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.14);\n display: flex; z-index: 2;\n align-items: center;\n justify-content: end;\n gap: 24px;}\n\n\n\n.listOfItems{ border-radius: 12px;\n border: 1px solid #E0E0E0;\n padding: 24px;\n margin: 24px 0 0 0;}\n modalSubheading{\n padding: 24px;\n margin: 24px 0 0 0;}\n\n.listOfItemsWithoutBorder{\n padding: 24px 0;\n margin: 24px 0 0 0;}\n\n modalSubheading{\n padding: 24px;\n margin: 24px 0 0 0;}\n\n\n\n\n.modalIconAndTextBox{display:flex; flex-direction:row; align-items: center; margin: 0 0 16px 0; gap:4px;}\n\n/* Select List Item Styles */\n.select-list-container {\n padding: 0;\n margin: 16px 0 0 0;\n}\n\n.select-list-item {\n display: flex;\n align-items: center;\n padding: 16px 0;\n cursor: pointer;\n transition: background-color 0.2s ease;\n border-bottom: 1px solid #f0f0f0;\n position: relative;\n}\n\n.select-list-item:hover {\n background-color: #f8f9fa;\n}\n\n.select-list-item:last-child {\n border-bottom: none;\n}\n\n.item-avatar {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background-color: #f0f0f0;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 12px;\n font-size: 20px;\n font-weight: 500;\n color: #333;\n flex-shrink: 0;\n}\n\n/* Different avatar colors for different items */\n.select-list-item:nth-child(1) .item-avatar {\n background-color: #717171;\n color: #fff;\n}\n\n.select-list-item:nth-child(2) .item-avatar {\n background-color: #014fc5;\n color: #fff;\n}\n\n.item-content {\n flex: 1;\n min-width: 0;\n}\n\n.item-arrow {\n flex-shrink: 0;\n margin-left: 8px;\n color: #014fc5;\n}\n"])));
|
|
17
17
|
const FormWidgetStyle = exports.FormWidgetStyle = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .formBottomAction {\n position: absolute;\n bottom: 0px;\n background-color: rgb(249, 249, 249);\n box-shadow: rgba(0, 0, 0, 0.1) 0px -2px 8px;\n padding: 16px;\n display: flex;\n justify-content: flex-end;\n gap: 12px;\n z-index: 10;\n left: 0;\n right: 0;\n }\n\n .formBottomAction .ant-form-item {\n margin-bottom: 0px;\n }\n\n .searchErrorMsg {\n font-size: 12px;\n }\n .searchErrorMsg {\n font-size: 12px;\n }\n"])));
|
|
18
18
|
const TableDataStyle = exports.TableDataStyle = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .tableContainerList th,\n button {\n white-space: nowrap;\n }\n .tableContainerList th,\n button {\n white-space: nowrap;\n }\n"])));
|
|
19
|
-
const OapageWithDataStyle = exports.OapageWithDataStyle = _styledComponents.default.aside(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .oaTopHeaderAndBtnSec {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n\n .headerContent {\n display: flex;\n align-items: flex-start; // Changed from 'center' to 'flex-start'\n justify-content: space-between;\n width: 100%;\n\n .headerLeft {\n flex: 1;\n }\n\n .headerRight {\n display: flex;\n align-items: flex-start; // Changed from 'center' to 'flex-start'\n justify-content: flex-end;\n }\n }\n }\n\n .fullPageLayout {\n display: flex;\n padding: 8px;\n background: #f6f6f6;\n }\n .ant-pagination {\n padding: 0 16px;\n justify-content: end;\n }\n .layoutHeadingPage {\n display: flex;\n gap: 8px;\n margin: 0 0 32px 0;\n flex-direction: column;\n justify-content: flex-start;\n }\n\n .topHadingWithIcon span {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n }\n\n .subHadingText {\n margin: 0 0 0 36px;\n }\n\n .subHading1Text {\n margin: 0 0 ", " 40px;\n }\n\n .marginNone {\n margin: 0 !important;\n }\n\n .subHadingText > span {\n display: flex;\n flex-direction: row;\n gap: 4px;\n align-items: center;\n }\n\n .oaRightLayouts {\n width: 100%;\n min-height: calc(100vh - 16px);\n padding: 76px 48px;\n overflow-y: auto;\n border-radius: 16px;\n background: #fff;\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.14);\n }\n\n .oaheaderSearchAndFilter {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 0 0 16px 0;\n gap: 16px;\n }\n\n .oaRightLayouts .iconAndTextSecBox {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n }\n .inLine {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n }\n\n .customeSelectDropdown {\n margin: 4px 0 0 8px;\n }\n\n .cardData {\n padding: 28px 0 48px 0;\n }\n\n .ant-carousel .slick-dots {\n position: static;\n margin: 20px auto 12px 0;\n }\n .ant-carousel .slick-dots li {\n width: 8px;\n height: 8px;\n }\n .ant-carousel .slick-dots li button {\n width: 8px;\n height: 8px;\n background: #cacaca;\n border-radius: 50%;\n opacity: 0.5;\n }\n .ant-carousel .slick-dots li.slick-active {\n width: 8px;\n height: 8px;\n }\n .ant-carousel .slick-dots li.slick-active button {\n width: 8px;\n height: 8px;\n opacity: 1;\n }\n .ant-carousel .slick-dots li::after {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n opacity: 1;\n background: #717171;\n }\n\n .oaTabs .ant-tabs-nav {\n border-top: 1px solid #e0e0e0;\n border-left: 1px solid #e0e0e0;\n border-right: 1px solid #e0e0e0;\n padding: 12px 22px 0 22px;\n margin: 0 0 8px 0;\n background: #fff;\n border-radius: 4px 4px 0 0;\n }\n .ant-card-body {\n padding: 24px 16px !important;\n border-radius: 16px;\n background: #f6f6f6;\n }\n .cardContainer {\n display: flex;\n gap: 24px;\n }\n .selectAndSearch .noClear {\n border-radius: 0 4px 4px 0;\n width: 320px;\n }\n\n .searchErrorMsg {\n font-size: 12px;\n margin: 4px 0px 0px;\n color: #de350b;\n }\n .searchOnly {\n margin: 0px 0px 16px;\n position: relative;\n }\n .searchOnly .ant-input-affix-wrapper {\n border-radius: 4px;\n max-width: 420px;\n padding-left: 44px;\n }\n .searchOnly .cstSearchIcon {\n position: absolute;\n left: 16px;\n top: 14px;\n z-index: 2;\n }\n\n .selectAndSearch .ant-input-affix-wrapper {\n border-radius: 0 4px 4px 0;\n width: 320px;\n }\n\n .selectAndSearch {\n flex-shrink: 0;\n }\n\n .customeSelectDropdown .ant-select-selector {\n border: none;\n padding: 0;\n
|
|
19
|
+
const OapageWithDataStyle = exports.OapageWithDataStyle = _styledComponents.default.aside(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .oaTopHeaderAndBtnSec {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n\n .headerContent {\n display: flex;\n align-items: flex-start; // Changed from 'center' to 'flex-start'\n justify-content: space-between;\n width: 100%;\n\n .headerLeft {\n flex: 1;\n }\n\n .headerRight {\n display: flex;\n align-items: flex-start; // Changed from 'center' to 'flex-start'\n justify-content: flex-end;\n }\n }\n }\n\n .fullPageLayout {\n display: flex;\n padding: 8px;\n background: #f6f6f6;\n }\n .ant-pagination {\n padding: 0 16px;\n justify-content: end;\n }\n .layoutHeadingPage {\n display: flex;\n gap: 8px;\n margin: 0 0 32px 0;\n flex-direction: column;\n justify-content: flex-start;\n }\n\n .topHadingWithIcon span {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n }\n\n .subHadingText {\n margin: 0 0 0 36px;\n }\n\n .subHading1Text {\n margin: 0 0 ", " 40px;\n }\n\n .marginNone {\n margin: 0 !important;\n }\n\n .subHadingText > span {\n display: flex;\n flex-direction: row;\n gap: 4px;\n align-items: center;\n }\n\n .oaRightLayouts {\n width: 100%;\n min-height: calc(100vh - 16px);\n padding: 76px 48px;\n overflow-y: auto;\n border-radius: 16px;\n background: #fff;\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.14);\n }\n\n .oaheaderSearchAndFilter {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 0 0 16px 0;\n gap: 16px;\n }\n\n .oaRightLayouts .iconAndTextSecBox {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n }\n .inLine {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n }\n\n .customeSelectDropdown {\n margin: 4px 0 0 8px;\n }\n\n .cardData {\n padding: 28px 0 48px 0;\n }\n\n .ant-carousel .slick-dots {\n position: static;\n margin: 20px auto 12px 0;\n }\n .ant-carousel .slick-dots li {\n width: 8px;\n height: 8px;\n }\n .ant-carousel .slick-dots li button {\n width: 8px;\n height: 8px;\n background: #cacaca;\n border-radius: 50%;\n opacity: 0.5;\n }\n .ant-carousel .slick-dots li.slick-active {\n width: 8px;\n height: 8px;\n }\n .ant-carousel .slick-dots li.slick-active button {\n width: 8px;\n height: 8px;\n opacity: 1;\n }\n .ant-carousel .slick-dots li::after {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n opacity: 1;\n background: #717171;\n }\n\n .oaTabs .ant-tabs-nav {\n border-top: 1px solid #e0e0e0;\n border-left: 1px solid #e0e0e0;\n border-right: 1px solid #e0e0e0;\n padding: 12px 22px 0 22px;\n margin: 0 0 8px 0;\n background: #fff;\n border-radius: 4px 4px 0 0;\n }\n .ant-card-body {\n padding: 24px 16px !important;\n border-radius: 16px;\n background: #f6f6f6;\n }\n .cardContainer {\n display: flex;\n gap: 24px;\n }\n .selectAndSearch .noClear {\n border-radius: 0 4px 4px 0;\n width: 320px;\n }\n\n .searchErrorMsg {\n font-size: 12px;\n margin: 4px 0px 0px;\n color: #de350b;\n }\n .searchOnly {\n margin: 0px 0px 16px;\n position: relative;\n }\n .searchOnly .ant-input-affix-wrapper {\n border-radius: 4px;\n max-width: 420px;\n padding-left: 44px;\n }\n .searchOnly .cstSearchIcon {\n position: absolute;\n left: 16px;\n top: 14px;\n z-index: 2;\n }\n\n .selectAndSearch .ant-input-affix-wrapper {\n border-radius: 0 4px 4px 0;\n width: 320px;\n }\n\n .selectAndSearch {\n flex-shrink: 0;\n }\n\n .customeSelectDropdown .ant-select-selector {\n border: none;\n padding: 0;\n max-width: 83vw;\n }\n .customeSelectDropdown .ant-select-selection-item > span {\n font-size: 24px;\n font-weight: 500;\n line-height: 32px;\n }\n\n .customeSelectDropdown .ant-select {\n margin: 0 0 0 32px;\n }\n\n .customeSelectDropdown .ant-select .ant-select-arrow {\n color: #014fc5;\n inset-inline-end: -6px;\n }\n\n .customeSelectDropdown .ant-select-selector {\n box-shadow: none !important;\n }\n\n .customeSelectDropdown .ant-select-selection-item {\n display: inline-block;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n vertical-align: bottom;\n }\n\n .oaheaderButtons {\n display: flex;\n gap: 24px;\n align-items: center;\n position: relative;\n flex-grow: 1;\n justify-content: space-between;\n }\n\n .oaheaderButtons.single-child {\n justify-content: flex-end;\n }\n\n .oaheaderButtonsRight {\n display: flex;\n flex-direction: row;\n gap: 16px;\n }\n\n .oaheaderButtons .notifyDot {\n width: 12px;\n height: 12px;\n background: #de350b;\n position: absolute;\n top: -4px;\n right: -4px;\n border-radius: 50%;\n }\n\n @media only screen and (max-width: 600px) {\n .selectAndSearch .ant-input-affix-wrapper {\n width: calc(100% - 84px);\n }\n .oaheaderSearchAndFilter .dropDownSearchContainer {\n width: 100%;\n }\n\n .oaheaderSearchAndFilter {\n align-items: flex-end;\n flex-direction: column;\n gap: 16px;\n }\n\n .inLine {\n flex-direction: column;\n gap: 0;\n align-items: flex-start;\n }\n\n .subHadingText > span {\n flex-direction: column;\n align-items: flex-start;\n }\n\n .customeSelectDropdown {\n margin: 4px 0 0 0;\n }\n\n .customeSelectDropdown .ant-select {\n margin: 0 0 0 0;\n }\n\n .fullPageLayout {\n flex-direction: column;\n padding: 0;\n }\n .oaRightLayouts {\n padding: 16px;\n border-radius: 0;\n background: #fff;\n box-shadow: none;\n height: auto;\n background: #f6f6f6;\n }\n .oaTabs .ant-tabs-nav {\n margin: 0 0 28px 0;\n padding: 12px 0 0 0;\n }\n .layoutHeadingPage {\n margin: 0 0 16px 0;\n background: #fff;\n padding: 16px;\n border-radius: 8px;\n width: 100%;\n }\n .layoutHeadingAndSearch {\n background: #fff;\n padding: 20px 16px;\n margin: 0;\n width: 100%;\n border-radius: 8px;\n }\n\n /* Hide profile section on mobile when sidebar has profile icon */\n .hideProfileOnMobile {\n display: none !important;\n }\n }\n"])), _ref => {
|
|
20
20
|
let {
|
|
21
21
|
marginBottom
|
|
22
22
|
} = _ref;
|
|
@@ -27,4 +27,16 @@ const IncidentListParts = exports.IncidentListParts = _styledComponents.default.
|
|
|
27
27
|
const ProfileSectionContainer = exports.ProfileSectionContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-left: auto;\n\n .profile-icon-container {\n position: relative;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n"])));
|
|
28
28
|
const ProfileIcon = exports.ProfileIcon = _styledComponents.default.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 16px;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.2s ease;\n box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--color-primary);\n\n &:hover {\n transform: scale(1.05);\n }\n"])));
|
|
29
29
|
const Tooltip = exports.Tooltip = _styledComponents.default.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n position: absolute;\n top: 100%;\n right: 0;\n margin-top: 8px;\n background: #000000;\n color: #ffffff;\n padding: 8px 12px;\n border-radius: 6px;\n font-size: 12px;\n white-space: nowrap;\n z-index: 1000;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n\n &::before {\n content: \"\";\n position: absolute;\n top: -4px;\n right: 12px;\n width: 0;\n height: 0;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-bottom: 4px solid #000000;\n }\n"])));
|
|
30
|
+
const ProfileContainerOverlay = exports.ProfileContainerOverlay = _styledComponents.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: transparent;\n z-index: 1000;\n display: flex;\n justify-content: flex-end;\n align-items: flex-start;\n padding-top: 150px;\n padding-right: 53px;\n pointer-events: auto;\n"])));
|
|
31
|
+
const ProfileContainerModal = exports.ProfileContainerModal = _styledComponents.default.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n background-color: white;\n border-radius: 8px;\n padding: 16px;\n width: 380px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n position: relative;\n border: 1px solid #e0e0e0;\n pointer-events: auto;\n"])));
|
|
32
|
+
const CurrentProfileSection = exports.CurrentProfileSection = _styledComponents.default.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n margin-bottom: 24px;\n"])));
|
|
33
|
+
const ProfileInfoContainer = exports.ProfileInfoContainer = _styledComponents.default.div(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n display: flex;\n align-items: flex-start;\n margin-bottom: 16px;\n"])));
|
|
34
|
+
const ProfileNameContainer = exports.ProfileNameContainer = _styledComponents.default.div(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 12px;\n"])));
|
|
35
|
+
const ProfileAvatar = exports.ProfileAvatar = _styledComponents.default.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 12px;\n"])));
|
|
36
|
+
const EnterpriseSection = exports.EnterpriseSection = _styledComponents.default.div(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n margin-top: 24px;\n padding-top: 24px;\n border-top: 1px solid #e0e0e0;\n"])));
|
|
37
|
+
const EnterpriseList = exports.EnterpriseList = _styledComponents.default.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n margin-top: 12px;\n"])));
|
|
38
|
+
const EnterpriseItem = exports.EnterpriseItem = _styledComponents.default.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n padding: 0 16px;\n cursor: pointer;\n border-radius: 4px;\n margin-bottom: 8px;\n height: 80px;\n transition: background-color 0.2s ease;\n background-color: #f8f9fa;\n\n &:hover {\n background-color: #e9ecef;\n }\n\n &:last-child {\n margin-bottom: 0;\n }\n"])));
|
|
39
|
+
const EnterpriseAvatar = exports.EnterpriseAvatar = _styledComponents.default.div(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 12px;\n flex-shrink: 0;\n"])));
|
|
40
|
+
const EnterpriseContent = exports.EnterpriseContent = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n flex: 1;\n min-width: 0;\n"])));
|
|
41
|
+
const EnterpriseArrow = exports.EnterpriseArrow = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n margin-left: 8px;\n color: #1890ff;\n"])));
|
|
30
42
|
var _default = exports.default = {};
|
|
@@ -35,7 +35,7 @@ function ContentPanel(_ref) {
|
|
|
35
35
|
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
36
36
|
icon: _icons.InfoCircleOutlined,
|
|
37
37
|
size: 16,
|
|
38
|
-
color: "
|
|
38
|
+
color: "secondary"
|
|
39
39
|
}))));
|
|
40
40
|
const renderContent = () => {
|
|
41
41
|
if (design === "keyvalue") {
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.weak-map.js");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = ProfileDataWidget;
|
|
8
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
7
9
|
require("core-js/modules/es.string.trim.js");
|
|
8
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
12
|
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
13
|
+
var _CustomDropdown = _interopRequireDefault(require("../../components/oa-component-dropdown/CustomDropdown"));
|
|
11
14
|
var _styles = require("./styles");
|
|
15
|
+
var _CustomSelect = _interopRequireDefault(require("../../components/oa-component-select/CustomSelect"));
|
|
12
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
19
|
/* eslint-disable */
|
|
14
20
|
|
|
15
21
|
function ProfileDataWidget(_ref) {
|
|
22
|
+
var _widget$jsxConfig, _widget$jsxConfig2, _widget$jsxConfig3;
|
|
16
23
|
let {
|
|
17
24
|
image,
|
|
18
25
|
title,
|
|
@@ -21,8 +28,12 @@ function ProfileDataWidget(_ref) {
|
|
|
21
28
|
line3,
|
|
22
29
|
line4,
|
|
23
30
|
line5,
|
|
24
|
-
|
|
31
|
+
subtext,
|
|
32
|
+
widget,
|
|
33
|
+
alignProfile,
|
|
34
|
+
handleSwitchSelectItem
|
|
25
35
|
} = _ref;
|
|
36
|
+
const [isDropdownOpen, setIsDropdownOpen] = (0, _react.useState)(false);
|
|
26
37
|
// Determine what to display in the icon
|
|
27
38
|
const getIconContent = () => {
|
|
28
39
|
if (!(image !== null && image !== void 0 && image.visible)) return null;
|
|
@@ -73,7 +84,22 @@ function ProfileDataWidget(_ref) {
|
|
|
73
84
|
}, line4.label || ""), line5 && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
74
85
|
color: line5.color || "secondary-content",
|
|
75
86
|
typography: line5.typography || "type-b1-400"
|
|
76
|
-
}, line5.label || ""))
|
|
87
|
+
}, line5.label || "")), subtext && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
88
|
+
color: subtext.color || "secondary-content",
|
|
89
|
+
typography: subtext.typography || "type-b2-400",
|
|
90
|
+
style: {
|
|
91
|
+
marginTop: "16px"
|
|
92
|
+
}
|
|
93
|
+
}, subtext.label || ""), (widget === null || widget === void 0 ? void 0 : widget.visible) && /*#__PURE__*/_react.default.createElement("div", {
|
|
94
|
+
style: {
|
|
95
|
+
marginTop: "16px"
|
|
96
|
+
}
|
|
97
|
+
}, widget.widgetType === "select" && /*#__PURE__*/_react.default.createElement(_CustomSelect.default, {
|
|
98
|
+
options: widget === null || widget === void 0 || (_widget$jsxConfig = widget.jsxConfig) === null || _widget$jsxConfig === void 0 ? void 0 : _widget$jsxConfig.value,
|
|
99
|
+
defaultValue: widget === null || widget === void 0 || (_widget$jsxConfig2 = widget.jsxConfig) === null || _widget$jsxConfig2 === void 0 ? void 0 : _widget$jsxConfig2.defaultValue,
|
|
100
|
+
placeholder: widget === null || widget === void 0 || (_widget$jsxConfig3 = widget.jsxConfig) === null || _widget$jsxConfig3 === void 0 ? void 0 : _widget$jsxConfig3.placeholder,
|
|
101
|
+
onChange: e => handleSwitchSelectItem(e)
|
|
102
|
+
}))));
|
|
77
103
|
}
|
|
78
104
|
ProfileDataWidget.propTypes = {
|
|
79
105
|
image: _propTypes.default.shape({
|
|
@@ -113,5 +139,32 @@ ProfileDataWidget.propTypes = {
|
|
|
113
139
|
typography: _propTypes.default.string,
|
|
114
140
|
color: _propTypes.default.string
|
|
115
141
|
}),
|
|
142
|
+
subtext: _propTypes.default.shape({
|
|
143
|
+
label: _propTypes.default.string,
|
|
144
|
+
typography: _propTypes.default.string,
|
|
145
|
+
color: _propTypes.default.string
|
|
146
|
+
}),
|
|
147
|
+
widget: _propTypes.default.shape({
|
|
148
|
+
visible: _propTypes.default.bool,
|
|
149
|
+
widgetType: _propTypes.default.oneOf(["select", "button", "input"]),
|
|
150
|
+
jsxConfig: _propTypes.default.shape({
|
|
151
|
+
value: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.shape({
|
|
152
|
+
id: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
153
|
+
label: _propTypes.default.string
|
|
154
|
+
})), _propTypes.default.string // For dynamic data like '{{enterpriseDropdownData}}'
|
|
155
|
+
]),
|
|
156
|
+
selectedValue: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
157
|
+
name: _propTypes.default.string,
|
|
158
|
+
placeholder: _propTypes.default.string,
|
|
159
|
+
onChange: _propTypes.default.func,
|
|
160
|
+
onClick: _propTypes.default.func,
|
|
161
|
+
style: _propTypes.default.object,
|
|
162
|
+
dropdownStyle: _propTypes.default.object,
|
|
163
|
+
dropdownProps: _propTypes.default.object,
|
|
164
|
+
backgroundColor: _propTypes.default.string,
|
|
165
|
+
color: _propTypes.default.string,
|
|
166
|
+
inputType: _propTypes.default.string
|
|
167
|
+
})
|
|
168
|
+
}),
|
|
116
169
|
alignProfile: _propTypes.default.string
|
|
117
170
|
};
|
|
@@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
require("core-js/modules/es.json.stringify.js");
|
|
8
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
9
|
+
require("core-js/modules/es.string.replace.js");
|
|
7
10
|
var _react = _interopRequireDefault(require("react"));
|
|
8
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
12
|
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
@@ -16,21 +19,30 @@ const SelectListItemModal = _ref => {
|
|
|
16
19
|
var _modalContent$header, _modalContent$header2, _modalContent$subHead, _modalContent$subHead2, _modalContent$listIte;
|
|
17
20
|
let {
|
|
18
21
|
modalContent,
|
|
19
|
-
onItemSelect
|
|
22
|
+
onItemSelect,
|
|
23
|
+
handleSwitchSelectItem
|
|
20
24
|
} = _ref;
|
|
21
25
|
const avatarColors = (modalContent === null || modalContent === void 0 ? void 0 : modalContent.avatarColors) || [];
|
|
22
26
|
const handleItemSelect = item => {
|
|
23
|
-
//
|
|
27
|
+
// Store selected item data in session storage as selectedEnterprise
|
|
28
|
+
sessionStorage.setItem("selectedEnterprise", JSON.stringify(item));
|
|
29
|
+
|
|
30
|
+
// Call the onItemSelect callback if provided
|
|
24
31
|
if (onItemSelect) {
|
|
25
32
|
onItemSelect(item);
|
|
26
33
|
}
|
|
34
|
+
|
|
35
|
+
// Reroute to modalContent.reroute if provided
|
|
36
|
+
if (modalContent !== null && modalContent !== void 0 && modalContent.reroute) {
|
|
37
|
+
window.location.replace(modalContent.reroute);
|
|
38
|
+
}
|
|
27
39
|
};
|
|
28
40
|
const getAvatarStyle = index => {
|
|
29
41
|
if (avatarColors.length === 0) {
|
|
30
42
|
// Default colors if no colors provided
|
|
31
43
|
return {
|
|
32
|
-
backgroundColor:
|
|
33
|
-
color:
|
|
44
|
+
backgroundColor: "#f0f0f0",
|
|
45
|
+
color: "#333"
|
|
34
46
|
};
|
|
35
47
|
}
|
|
36
48
|
|
|
@@ -48,7 +60,7 @@ const SelectListItemModal = _ref => {
|
|
|
48
60
|
color: "secondary-content"
|
|
49
61
|
}, modalContent === null || modalContent === void 0 || (_modalContent$subHead2 = modalContent.subHeading) === null || _modalContent$subHead2 === void 0 ? void 0 : _modalContent$subHead2.text)), /*#__PURE__*/_react.default.createElement("div", {
|
|
50
62
|
className: "select-list-container"
|
|
51
|
-
}, modalContent === null || modalContent === void 0 || (_modalContent$listIte = modalContent.listItem) === null || _modalContent$listIte === void 0 ? void 0 : _modalContent$listIte.map((item, index) => {
|
|
63
|
+
}, Array.isArray(modalContent === null || modalContent === void 0 ? void 0 : modalContent.listItem) && (modalContent === null || modalContent === void 0 || (_modalContent$listIte = modalContent.listItem) === null || _modalContent$listIte === void 0 ? void 0 : _modalContent$listIte.map((item, index) => {
|
|
52
64
|
var _item$label;
|
|
53
65
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
54
66
|
key: index,
|
|
@@ -69,7 +81,7 @@ const SelectListItemModal = _ref => {
|
|
|
69
81
|
size: 20,
|
|
70
82
|
color: "primary"
|
|
71
83
|
})));
|
|
72
|
-
})));
|
|
84
|
+
}))));
|
|
73
85
|
};
|
|
74
86
|
SelectListItemModal.propTypes = {
|
|
75
87
|
modalContent: _propTypes.default.object,
|