oa-componentbook 1.0.1-stage.410 → 1.0.1-stage.411

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.
@@ -127,8 +127,7 @@ function EntityOverviewLayout(_ref) {
127
127
  type: _entityOverviewLayoutReducer.actionTypes.CLOSE_DRAWER
128
128
  });
129
129
  };
130
- const handleSwitchSelectItemInternal = async selectedValue => {
131
- console.log(selectedValue, "selectedValue");
130
+ const handleSwitchSelectItemInternal = async (selectedValue, config) => {
132
131
  if (selectedValue) {
133
132
  var _data$listData;
134
133
  // Call the external handler to get new data based on selected value
@@ -136,15 +135,15 @@ function EntityOverviewLayout(_ref) {
136
135
  error,
137
136
  data
138
137
  } = await (handleSwitchSelectItem === null || handleSwitchSelectItem === void 0 ? void 0 : handleSwitchSelectItem(selectedValue));
139
- console.log(data, "apidata");
140
138
  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
- showSuccessNotification("Successfully switched to another enterprise.");
139
+ const selectedData = data === null || data === void 0 || (_data$listData = data.listData) === null || _data$listData === void 0 ? void 0 : _data$listData.find(item => item.value === selectedValue);
140
+ {
141
+ (config === null || config === void 0 ? void 0 : config.storageType) == "sessionStorage" && (config === null || config === void 0 ? void 0 : config.storageKey) && sessionStorage.setItem(config === null || config === void 0 ? void 0 : config.storageKey, JSON.stringify(selectedData));
142
+ }
143
+ showSuccessNotification(config === null || config === void 0 ? void 0 : config.successMessage);
144
144
  if (error) {
145
145
  showErrorNotification(error);
146
146
  } else {
147
- console.log(data, "data");
148
147
  dispatch({
149
148
  type: _entityOverviewLayoutReducer.actionTypes.UPDATE_PROFILE_DATA,
150
149
  payload: selectedItem
@@ -166,8 +166,6 @@ function GenricLayOut(_ref) {
166
166
  type: _layoutReducer.actionTypes.SET_LOADING,
167
167
  payload: true
168
168
  });
169
- console.log("here");
170
- console.log(config === null || config === void 0 ? void 0 : config.misc, "config?.misc");
171
169
  if (getInitialData) {
172
170
  var _config$tabs, _config$misc;
173
171
  const {
@@ -1998,7 +1996,6 @@ function GenricLayOut(_ref) {
1998
1996
  }), {}, {
1999
1997
  selectedTab: state === null || state === void 0 || (_state$tabs18 = state.tabs) === null || _state$tabs18 === void 0 ? void 0 : _state$tabs18.active,
2000
1998
  current: 1,
2001
- // Reset to first page when filtering
2002
1999
  pageSize: tables === null || tables === void 0 || (_tables$pagination15 = tables.pagination) === null || _tables$pagination15 === void 0 ? void 0 : _tables$pagination15.pageSize,
2003
2000
  filterStatus: filterValue,
2004
2001
  field: tables === null || tables === void 0 || (_tables$sorting27 = tables.sorting) === null || _tables$sorting27 === void 0 ? void 0 : _tables$sorting27.sortBy,
@@ -39,7 +39,6 @@ const AppliedFilters = _ref => {
39
39
  if (filterByField !== null && filterByField !== void 0 && filterByField.value) {
40
40
  var _matchedOption$label;
41
41
  const matchedOption = filterByField.value.find(opt => opt.value === value);
42
- console.log("matchedOption:", matchedOption);
43
42
  return (_matchedOption$label = matchedOption === null || matchedOption === void 0 ? void 0 : matchedOption.label) !== null && _matchedOption$label !== void 0 ? _matchedOption$label : value;
44
43
  }
45
44
  return value;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.weak-map.js");
4
+ require("core-js/modules/web.dom-collections.iterator.js");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = ProfileDataWidget;
8
- require("core-js/modules/web.dom-collections.iterator.js");
9
9
  require("core-js/modules/es.string.trim.js");
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -33,7 +33,6 @@ function ProfileDataWidget(_ref) {
33
33
  alignProfile,
34
34
  handleSwitchSelectItem
35
35
  } = _ref;
36
- const [isDropdownOpen, setIsDropdownOpen] = (0, _react.useState)(false);
37
36
  // Determine what to display in the icon
38
37
  const getIconContent = () => {
39
38
  if (!(image !== null && image !== void 0 && image.visible)) return null;
@@ -94,7 +93,7 @@ function ProfileDataWidget(_ref) {
94
93
  options: widget === null || widget === void 0 || (_widget$jsxConfig = widget.jsxConfig) === null || _widget$jsxConfig === void 0 ? void 0 : _widget$jsxConfig.value,
95
94
  defaultValue: widget === null || widget === void 0 || (_widget$jsxConfig2 = widget.jsxConfig) === null || _widget$jsxConfig2 === void 0 ? void 0 : _widget$jsxConfig2.defaultValue,
96
95
  placeholder: widget === null || widget === void 0 || (_widget$jsxConfig3 = widget.jsxConfig) === null || _widget$jsxConfig3 === void 0 ? void 0 : _widget$jsxConfig3.placeholder,
97
- onChange: e => handleSwitchSelectItem(e)
96
+ onChange: e => handleSwitchSelectItem(e, widget)
98
97
  }))));
99
98
  }
100
99
  ProfileDataWidget.propTypes = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oa-componentbook",
3
- "version": "1.0.1-stage.410",
3
+ "version": "1.0.1-stage.411",
4
4
  "private": false,
5
5
  "description": "Reusable components",
6
6
  "main": "build/index.js",