@agilemotion/oui-react-js 1.8.26 → 1.8.28

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.
@@ -24,6 +24,7 @@ class ApplicationManager {
24
24
  constructor() {
25
25
  if (!ApplicationManager.instance) {
26
26
  this.views = [];
27
+ this.dashboardViews = [];
27
28
  this.props = {};
28
29
  this.listeners = [];
29
30
  this.libs = {};
@@ -355,6 +356,26 @@ class ApplicationManager {
355
356
  applicationContext[key] = values[key];
356
357
  });
357
358
  };
359
+
360
+ /**
361
+ * add view configuration
362
+ *
363
+ * @param view the listener to be added
364
+ * @param path
365
+ * @param forward
366
+ */
367
+ addDashboardView = (view, path) => {
368
+ this.dashboardViews.push(view);
369
+ };
370
+
371
+ /**
372
+ * clear dashboard view configuration
373
+ *
374
+ */
375
+ clearDashboardViews = () => {
376
+ this.dashboardViews.splice(0, this.dashboardViews.length);
377
+ };
378
+
358
379
  /**
359
380
  * add view configuration
360
381
  *
@@ -493,7 +514,7 @@ class ApplicationManager {
493
514
  return view;
494
515
  }
495
516
  }
496
- return null;
517
+ return this.dashboardViews.find(v => v.config.id === id);
497
518
  };
498
519
  getViewComponent = (view, id) => {
499
520
  if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle) && !_Utils.default.isNull(view.handle.api)) {
@@ -523,6 +544,12 @@ class ApplicationManager {
523
544
  return graph;
524
545
  }
525
546
  }
547
+ for (const view of this.dashboardViews) {
548
+ let component = this.getViewComponent(view, id);
549
+ if (component) {
550
+ return component;
551
+ }
552
+ }
526
553
  if (this.views.length === 0) {
527
554
  return this.getViewComponent(this.props.dashboardView, id);
528
555
  }
@@ -26,6 +26,7 @@ var _Notifications = _interopRequireDefault(require("@mui/icons-material/Notific
26
26
  var _Person = _interopRequireDefault(require("@mui/icons-material/Person"));
27
27
  var _Refresh = _interopRequireDefault(require("@mui/icons-material/Refresh"));
28
28
  var _Folder = _interopRequireDefault(require("@mui/icons-material/Folder"));
29
+ var _FolderOpen = _interopRequireDefault(require("@mui/icons-material/FolderOpen"));
29
30
  var _AttachFile = _interopRequireDefault(require("@mui/icons-material/AttachFile"));
30
31
  var _CalendarToday = _interopRequireDefault(require("@mui/icons-material/CalendarToday"));
31
32
  var _react = _interopRequireWildcard(require("react"));
@@ -166,6 +167,8 @@ class Icon extends _react.Component {
166
167
  });
167
168
  } else if (this.props.id === 'FOLDER') {
168
169
  return /*#__PURE__*/_react.default.createElement(_Folder.default, null);
170
+ } else if (this.props.id === 'FOLDER_OPEN') {
171
+ return /*#__PURE__*/_react.default.createElement(_FolderOpen.default, null);
169
172
  } else if (this.props.id === 'CALENDAR') {
170
173
  return /*#__PURE__*/_react.default.createElement(_CalendarToday.default, null);
171
174
  } else if (this.props.id === 'SIGN') {
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
7
+ var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactPdf = require("react-pdf");
9
9
  var _Utils = _interopRequireDefault(require("../Utils"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
+ 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 && {}.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; }
11
13
  _reactPdf.pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${_reactPdf.pdfjs.version}/pdf.worker.js`;
12
14
  const PDFViewer = props => {
13
15
  const [pageNumber, setPageNumber] = _react.default.useState(1);
@@ -21,6 +23,9 @@ const PDFViewer = props => {
21
23
  props.onDocumentLoadSuccess(numPages);
22
24
  }
23
25
  };
26
+ (0, _react.useEffect)(() => {
27
+ setPageNumber(1);
28
+ }, [props.file]);
24
29
  const changePage = offset => {
25
30
  setPageNumber(pageNumber + offset);
26
31
  };
@@ -105,11 +105,11 @@ const LookupFieldComponent = exports.LookupFieldComponent = /*#__PURE__*/_react.
105
105
  }, "...")), /*#__PURE__*/_react.default.createElement("div", {
106
106
  className: 'col-*-* no-margin no-padding',
107
107
  style: {
108
- width: 'calc(100% - 72px)',
108
+ width: !base.disabled ? 'calc(100% - 72px)' : '100%',
109
109
  marginBottom: value ? '0' : '8px',
110
110
  position: 'relative'
111
111
  }
112
- }, !base.required && /*#__PURE__*/_react.default.createElement("div", {
112
+ }, !base.required && !base.disabled && /*#__PURE__*/_react.default.createElement("div", {
113
113
  style: {
114
114
  width: '32px',
115
115
  height: '32px',
@@ -119,8 +119,7 @@ const LookupFieldComponent = exports.LookupFieldComponent = /*#__PURE__*/_react.
119
119
  }
120
120
  }, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
121
121
  variant: 'outlined',
122
- onClick: clearValue,
123
- disabled: base.disabled
122
+ onClick: clearValue
124
123
  }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
125
124
  id: "CLEAR"
126
125
  }))), /*#__PURE__*/_react.default.createElement(_TextField.default, {
@@ -130,6 +130,7 @@ const View = props => {
130
130
  return props.parameters;
131
131
  },
132
132
  get model() {
133
+ _ApplicationManager.default.enableFormMarkers(false);
133
134
  let children = layoutHandle.api.getChildren();
134
135
  for (const child of children) {
135
136
  if (!_Utils.default.isNull(child.api)) {
@@ -139,6 +140,7 @@ const View = props => {
139
140
  }
140
141
  }
141
142
  }
143
+ _ApplicationManager.default.enableFormMarkers(true);
142
144
  return model;
143
145
  },
144
146
  getChild: id => {
@@ -104,7 +104,7 @@ const DocumentContainer = props => {
104
104
  placeholder: 'Enter text here...',
105
105
  style: {
106
106
  position: 'absolute',
107
- top: -4,
107
+ top: -2,
108
108
  left: 0,
109
109
  width: 'calc(100% - 4px)',
110
110
  height: 'calc(100% - 4px)',
@@ -59,12 +59,13 @@ class ServiceCallActionHandler {
59
59
  }
60
60
  }
61
61
  handleError(e, invalidParameterCallback, currentViewId, component, errorCallback) {
62
- console.error(e);
63
62
  if (e && e.errorType === 'INVALID_PARAMETER') {
63
+ console.warn("The service was not be called because of a null required parameter : ", e.parameter);
64
64
  if (invalidParameterCallback) {
65
65
  invalidParameterCallback();
66
66
  }
67
67
  } else {
68
+ console.error(e);
68
69
  _Utils.default.publishErrorMessage(e, currentViewId, component);
69
70
  if (!_Utils.default.isNull(errorCallback)) {
70
71
  errorCallback(e);
@@ -23,7 +23,8 @@ class Validators {
23
23
  messageType: 'ERROR',
24
24
  message: ''
25
25
  };
26
- }
26
+ } //0179a4f4-99b9-4d6b-b2ba-d9eb381748b7 0179a4f4-99b9-4d6b-b2ba-d9eb381748b5
27
+
27
28
  if (item.procurementMethod.type === 'CONTRACT' || item.procurementMethod.type === 'TRANSVERSAL_CONTRACT') {
28
29
  if (item.procurementMethod.type === 'TRANSVERSAL_CONTRACT' && !item.contract.owner) {
29
30
  return {
@@ -27,6 +27,7 @@ const location = window.location.protocol + '//' + window.location.hostname;
27
27
  const text = response => {
28
28
  return response.text();
29
29
  };
30
+ let keyCounter = 0;
30
31
  const alertBarHandle = {};
31
32
  const DashboardCard = props => {
32
33
  const [path, setPath] = _react.default.useState(null);
@@ -39,7 +40,6 @@ const DashboardCard = props => {
39
40
  const [id, setId] = _react.default.useState(props.settings.id);
40
41
  const [content, setContent] = _react.default.useState(null);
41
42
  const [ref] = _react.default.useState(/*#__PURE__*/_react.default.createRef());
42
- const keyCounter = (0, _react.useRef)(0);
43
43
  _react.default.useEffect(() => {
44
44
  const accessToken = sessionStorage.getItem('accessToken');
45
45
  const idToken = sessionStorage.getItem('idToken');
@@ -56,6 +56,7 @@ const DashboardCard = props => {
56
56
  if (path && displayType) {
57
57
  if (displayType === 'VIEW') {
58
58
  (0, _RestUtils.sendRequest)(path, data => {
59
+ data.id = data.id + "-" + keyCounter++;
59
60
  let dashboardView = {};
60
61
  let defaultModel = {};
61
62
  dashboardView.config = data;
@@ -73,9 +74,9 @@ const DashboardCard = props => {
73
74
  }
74
75
  }
75
76
  };
76
- _ApplicationManager.default.addView(dashboardView, path, true);
77
+ _ApplicationManager.default.addDashboardView(dashboardView, path);
77
78
  let element = /*#__PURE__*/_react.default.createElement(_View.View, {
78
- key: data.id + "-" + keyCounter.current++,
79
+ key: data.id,
79
80
  config: data,
80
81
  parameters: [],
81
82
  handle: dashboardView.handle
@@ -464,6 +465,9 @@ const Dashboard = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.default.f
464
465
  _ApplicationManager.default.setDashboardView({
465
466
  handle: handle
466
467
  });
468
+ return () => {
469
+ _ApplicationManager.default.clearDashboardViews();
470
+ };
467
471
  }, []);
468
472
  const addDashboardCard = item => {
469
473
  let path = item.eventHandlingConfig.subscriptions[0].actions[0].path;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilemotion/oui-react-js",
3
- "version": "1.8.26",
3
+ "version": "1.8.28",
4
4
  "files": [
5
5
  "dist"
6
6
  ],