@agilemotion/oui-react-js 1.8.46 → 1.8.48

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.
@@ -1,4 +1,5 @@
1
1
  .oui button {
2
2
  margin-right: 4px !important;
3
- height: 40px;
3
+ min-height: 40px;
4
+ max-height: 60px;
4
5
  }
@@ -76,6 +76,12 @@ const DocumentTemplateDesigner = props => {
76
76
  },
77
77
  set loading(val) {
78
78
  setLoading(val);
79
+ },
80
+ getDocumentValue: async () => {
81
+ if (templateDesignerHandle.api) {
82
+ return await templateDesignerHandle.api.getValue();
83
+ }
84
+ return null;
79
85
  }
80
86
  };
81
87
  };
@@ -475,6 +475,22 @@ const DocumentTemplateDesignerComponent = props => {
475
475
  container.documentEditor.search.find(selectedPropertyRows[0].placeHolder);
476
476
  }
477
477
  };
478
+ const saveAsBase64 = async () => {
479
+ if (props.allowUnresolvedChanges === false && container.documentEditor.revisions.length > 0) {
480
+ setErrorMessage("Please accept or reject all suggested changes");
481
+ return null;
482
+ }
483
+ if (container) {
484
+ container.documentEditor.editor.stopProtection("password");
485
+ let blob = await container.documentEditor.saveAsBlob('Docx');
486
+ if (props.commentsOnly) {
487
+ container.documentEditor.editor.enforceProtection('password', 'CommentsOnly');
488
+ }
489
+ return new File([blob], props.file?.name ? props.file.name : 'document.docx', {
490
+ type: props.file?.type ? props.file.type : 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
491
+ });
492
+ }
493
+ };
478
494
  const api = () => {
479
495
  return {
480
496
  get id() {
@@ -482,6 +498,9 @@ const DocumentTemplateDesignerComponent = props => {
482
498
  },
483
499
  highlightSelection: selectedPropertyRow => {
484
500
  doHighlightSelection(selectedPropertyRow);
501
+ },
502
+ getValue: () => {
503
+ return saveAsBase64();
485
504
  }
486
505
  };
487
506
  };
@@ -38,6 +38,7 @@ const DocumentViewer = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defa
38
38
  if (props.config.attributes?.autoLoadData === false) {
39
39
  setLoading(false);
40
40
  }
41
+ refresh();
41
42
  }, []);
42
43
  function doLoadData(actionConfig) {
43
44
  let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
@@ -99,6 +100,13 @@ const DocumentViewer = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defa
99
100
  }
100
101
  }
101
102
  }
103
+ function refresh() {
104
+ if (!_Utils.default.isNull(props.config) && !_Utils.default.isNull(props.config.visible)) {
105
+ setVisible(_Utils.default.evaluateBooleanExpression(props.config.visible, props.config.id));
106
+ } else {
107
+ setVisible(true);
108
+ }
109
+ }
102
110
  const api = () => {
103
111
  return {
104
112
  get id() {
@@ -111,11 +119,7 @@ const DocumentViewer = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defa
111
119
  setLabel(label);
112
120
  },
113
121
  refresh() {
114
- if (!_Utils.default.isNull(props.config) && !_Utils.default.isNull(props.config.visible)) {
115
- setVisible(_Utils.default.evaluateBooleanExpression(props.config.visible, props.config.id));
116
- } else {
117
- setVisible(true);
118
- }
122
+ refresh(props, setVisible);
119
123
  },
120
124
  setValue(newValue) {
121
125
  setValue(newValue);
@@ -70,7 +70,7 @@ class Graph {
70
70
  signal = event => {
71
71
  let nextNodeName = this.current.getNextNode(event);
72
72
  if (this.current.config.last && nextNodeName === null) {
73
- _ApplicationManager.default.removeLoadedGraph(true);
73
+ _ApplicationManager.default.removeLoadedGraph(this.config.isWindow ? 'window' : 'main');
74
74
  } else {
75
75
  if (!_Utils.default.isNull(nextNodeName)) {
76
76
  for (const node of this.config.nodes) {
@@ -101,7 +101,8 @@ class SocketManager {
101
101
  registerOnline() {
102
102
  let userDetails = _ApplicationManager.default.getUserDetails();
103
103
  // TODO : Resolve the hardcoding
104
- let profile = typeof (typeof userDetails.profile === 'string' || JSON.parse(userDetails.profile) === 'string') ? userDetails.profile : 'COJ';
104
+ let profile = 'COJ';
105
+ //let profile = typeof userDetails.profile === 'string' || JSON.parse(userDetails.profile) === 'string' ? userDetails.profile : 'COJ';
105
106
  console.log('***** REGISTERING ONLINE ***** [' + profile + ']');
106
107
  this.emitEvent(_SocketRequest.default.REGISTER_ONLINE, {
107
108
  user: {
@@ -1,16 +1,41 @@
1
+ /* container that holds ALL steps */
2
+ .stepper-container {
3
+ display: flex;
4
+ flex-wrap: wrap; /* allow wrapping */
5
+ width: 100%; /* small space between steps */
6
+ }
7
+
8
+ /* each single step wrapper (the thing we flex) */
9
+ .step-item {
10
+ flex: 0 1 180px; /* target width */
11
+ min-width: 140px; /* don’t go too small */
12
+ max-width: 240px; /* don’t go too wide */
13
+ padding-top: 8px;
14
+ }
15
+
16
+ /* original classes kept */
1
17
  .step,
2
18
  .stepActive,
3
19
  .stepVisited {
4
20
  }
5
21
 
6
- .box, .box-pending, .dot {
22
+ /* pill + dot box */
23
+ .box,
24
+ .box-pending,
25
+ .dot {
7
26
  border-radius: 100px;
8
27
  text-align: center;
9
28
  font-size: 14px;
10
29
  color: #888888;
11
30
  border: 1px solid #888888;
12
31
  display: flex;
13
- justify-content: center;
32
+ align-items: center;
33
+ }
34
+
35
+ .box,
36
+ .box-pending {
37
+ width: calc(100% - 16px);
38
+ justify-content: flex-start;
14
39
  }
15
40
 
16
41
  .box-pending {
@@ -20,6 +45,10 @@
20
45
  border-bottom: 1px solid #888888;
21
46
  }
22
47
 
48
+ .first-box {
49
+ width: 100%;
50
+ }
51
+
23
52
  .line {
24
53
  border-top: 1px solid #888888;
25
54
  width: 100%;
@@ -32,7 +61,23 @@
32
61
  float: left;
33
62
  }
34
63
 
35
- .stepVisited .firstBox {
64
+ .dash {
65
+ width: 16px;
66
+ display: flex;
67
+ align-items: center;
68
+ }
69
+
70
+ .dash div {
71
+ border-bottom: 1px solid #888888;
72
+ width: 16px;
73
+ }
74
+
75
+ .boxWrapper,
76
+ .firstBoxWrapper {
77
+ border: 1px solid green;
78
+ }
79
+
80
+ .stepVisited .firstBoxWrapper {
36
81
  margin-left: calc(50% - 15px);
37
82
  }
38
83
 
@@ -40,23 +85,32 @@
40
85
  border: none;
41
86
  }
42
87
 
43
- .stepActive .box {
44
- }
45
-
46
88
  .dot {
47
- width: 30px;
89
+ max-width: 30px;
90
+ min-width: 30px;
48
91
  height: 30px;
49
92
  font-size: 18px;
93
+ border-radius: 50%;
94
+ justify-content: center;
50
95
  }
51
96
 
97
+ /* active step dot */
52
98
  .stepActive .dot {
53
99
  color: #000000;
54
100
  border-color: #ffffff;
55
101
  }
56
102
 
57
- .stepVisited .dot {
103
+ /* the label text inside the step */
104
+ .step-title {
105
+ margin: 0 4px;
106
+ max-width: 140px;
107
+ overflow: hidden;
108
+ text-overflow: ellipsis;
109
+ white-space: nowrap;
110
+ align-self: center;
58
111
  }
59
112
 
113
+ /* lines (your old ones) */
60
114
  .leftLine,
61
115
  .rightLine {
62
116
  border-bottom: 1px solid;
@@ -101,4 +155,4 @@
101
155
  border-bottom-right-radius: 100px;
102
156
  padding: 2px 8px;
103
157
  font-weight: 600;
104
- }
158
+ }
@@ -10,6 +10,7 @@ var _ApplicationManager = _interopRequireDefault(require("../ApplicationManager"
10
10
  var _Observable = _interopRequireDefault(require("../event/Observable"));
11
11
  var _EventType = _interopRequireDefault(require("../event/EventType"));
12
12
  var _styles = require("@mui/styles");
13
+ var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
13
14
  require("./StepperTitleBar.css");
14
15
  var _jquery = _interopRequireDefault(require("jquery"));
15
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -31,17 +32,12 @@ const StepperTitleBar = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.def
31
32
  const [visible, setVisible] = _react.default.useState(false);
32
33
  const [activeSegmentPercentage, setActiveSegmentPercentage] = _react.default.useState(null);
33
34
  const currentIndex = _react.default.useRef(null);
34
- let keyCounter = 0;
35
- let counter = 0;
36
- let graphicsCounter = 0;
37
35
  const classes = useStyles();
36
+
37
+ // re-attach API on each render
38
38
  _react.default.useEffect(() => {
39
39
  props.handle.api = api();
40
- recalcLinePosition();
41
40
  });
42
- _react.default.useLayoutEffect(() => {
43
- recalcLinePosition();
44
- }, []);
45
41
  _react.default.useEffect(() => {
46
42
  let parsedConfig = _Utils.default.parseConfig(props.config, props.viewId);
47
43
  let eventHandlingConfig = _Utils.default.isNull(parsedConfig.eventHandlingConfig) ? {} : parsedConfig.eventHandlingConfig;
@@ -67,18 +63,37 @@ const StepperTitleBar = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.def
67
63
  recalcLinePosition();
68
64
  }, []);
69
65
  const recalcLinePosition = () => {
70
- let titleDiv = (0, _jquery.default)("#titleDiv");
71
- let step = (0, _jquery.default)("#step-container-" + currentIndex.current);
72
- if (currentIndex.current !== null && !_Utils.default.isNull(step.width())) {
73
- let titleWidth = titleDiv.width() + 46;
66
+ // Your old logic depended on single-row layout and a single #titleDiv
67
+ // Now that we allow wrapping, we guard this so it doesn't break.
68
+ if (currentIndex.current == null) return;
69
+ const stepEl = (0, _jquery.default)("#step-container-" + currentIndex.current);
70
+ if (!stepEl || stepEl.length === 0) return;
71
+ const stepTop = stepEl.offset().top;
72
+ const firstTop = (0, _jquery.default)("#step-container-0").offset()?.top;
73
+
74
+ // if wrapped to multiple rows, skip line math (each item already has its own line segment)
75
+ if (firstTop != null && stepTop !== firstTop) {
74
76
  (0, _jquery.default)(".stepActive .rightLine").css({
75
- 'margin-left': currentIndex.current === 0 ? titleWidth : titleWidth / 2 + step.width() / 2 - 2 + 'px',
76
- 'width': currentIndex.current === 0 ? step.width() - titleWidth + 2 : step.width() / 2 - titleWidth / 2 + 'px'
77
+ width: 0
77
78
  });
78
79
  (0, _jquery.default)(".stepActive .leftLine").css({
79
- 'width': step.width() / 2 - titleWidth / 2 + 'px'
80
+ width: 0
80
81
  });
82
+ return;
81
83
  }
84
+
85
+ // if still on one row, we can keep the old logic roughly
86
+ const stepWidth = stepEl.width();
87
+ if (!stepWidth) return;
88
+ const activeBox = stepEl.find(".box, .box-pending").first();
89
+ const titleWidth = activeBox.width();
90
+ (0, _jquery.default)(".stepActive .rightLine").css({
91
+ 'margin-left': titleWidth / 2 + 'px',
92
+ 'width': stepWidth - titleWidth + 'px'
93
+ });
94
+ (0, _jquery.default)(".stepActive .leftLine").css({
95
+ 'width': (stepWidth - titleWidth) / 2 + 'px'
96
+ });
82
97
  };
83
98
  const api = () => {
84
99
  return {
@@ -97,7 +112,6 @@ const StepperTitleBar = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.def
97
112
  },
98
113
  show() {
99
114
  let graph;
100
- let graphs = [];
101
115
  let view = _ApplicationManager.default.getView(props.viewId);
102
116
  if (view) {
103
117
  for (const key of Object.keys(_ApplicationManager.default.viewContext)) {
@@ -114,86 +128,68 @@ const StepperTitleBar = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.def
114
128
  setSteps(steps);
115
129
  currentIndex.current = graph.getCurrentNodeIndex();
116
130
  setActiveSegmentPercentage(100 - 10 * (steps.length - 1));
131
+ // recalc after render
132
+ setTimeout(() => recalcLinePosition(), 0);
117
133
  }
118
134
  }
119
135
  };
120
136
  };
121
- function renderStep(step) {
137
+ function renderStep(step, graphicsCounter, totalSteps) {
138
+ const isActive = graphicsCounter === currentIndex.current;
139
+ const isVisited = graphicsCounter < currentIndex.current;
140
+ const isLast = graphicsCounter === totalSteps - 1;
122
141
  return /*#__PURE__*/_react.default.createElement("div", {
123
- className: graphicsCounter === currentIndex.current ? `stepActive` : graphicsCounter < currentIndex.current ? 'stepVisited' : 'step'
142
+ className: isActive ? `stepActive` : isVisited ? 'stepVisited' : 'step'
124
143
  }, graphicsCounter > 0 ? /*#__PURE__*/_react.default.createElement("div", {
125
- className: (graphicsCounter <= currentIndex.current ? `${classes.themeBorder} ` : '') + '' + (graphicsCounter === steps.length - 1 ? ' lastLine' : '')
144
+ className: (graphicsCounter <= currentIndex.current ? `${classes.themeBorder} ` : '') + (isLast ? ' lastLine' : '')
126
145
  }) : null, /*#__PURE__*/_react.default.createElement("div", {
127
- className: 'row flex-nowrap' + (graphicsCounter === 0 ? ' firstBox' : ''),
146
+ className: 'row flex-nowrap' + (graphicsCounter === 0 ? ' firstBox' : 'boxWrapper'),
128
147
  style: {
129
148
  marginLeft: 'unset',
130
149
  marginRight: 'unset',
131
150
  width: '100%'
132
151
  },
133
152
  id: 'step-' + graphicsCounter
134
- }, /*#__PURE__*/_react.default.createElement("div", {
153
+ }, step.index > 0 && /*#__PURE__*/_react.default.createElement("div", {
154
+ className: 'col-*-* dash',
155
+ style: {
156
+ color: isVisited ? '#ffffff' : null
157
+ }
158
+ }, /*#__PURE__*/_react.default.createElement("div", null)), /*#__PURE__*/_react.default.createElement("div", {
135
159
  style: {
136
160
  whiteSpace: "nowrap"
137
161
  },
138
- className: (graphicsCounter < currentIndex.current ? `${classes.secondary} box flex-nowrap` : graphicsCounter === currentIndex.current ? `${classes.primary} box` : 'box-pending') + ' row no-margin no-padding'
162
+ className: (isVisited ? `${classes.secondary} box` : isActive ? `${classes.primary} box` : 'box-pending') + ' row no-margin no-padding flex-nowrap' + (step.index === 0 ? ' first-box' : '')
139
163
  }, /*#__PURE__*/_react.default.createElement("div", {
140
164
  className: 'dot col-*-*',
141
165
  style: {
142
- color: graphicsCounter < currentIndex.current ? '#ffffff' : null
166
+ color: isVisited ? '#ffffff' : null
143
167
  }
144
- }, step.index + 1), graphicsCounter <= currentIndex.current ? /*#__PURE__*/_react.default.createElement("div", {
145
- className: `col-*-*`,
146
- id: "titleDiv",
147
- style: {
148
- alignContent: 'center',
149
- color: graphicsCounter === currentIndex.current ? '#000000' : '#ffffff',
150
- margin: '0 4px'
151
- }
152
- }, step.title) : /*#__PURE__*/_react.default.createElement("div", {
153
- className: `col-*-*`,
154
- id: "titleDiv",
168
+ }, step.index + 1), /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
169
+ title: step.title
170
+ }, /*#__PURE__*/_react.default.createElement("div", {
171
+ className: "step-title",
155
172
  style: {
156
- alignContent: 'center',
157
- color: '#888888',
158
- margin: '0 4px'
173
+ color: isActive ? '#000000' : isVisited ? '#ffffff' : '#888888'
159
174
  }
160
- }, step.title)), graphicsCounter < steps.length - 1 && /*#__PURE__*/_react.default.createElement("div", {
161
- style: {
162
- flex: 1,
163
- overflow: "hidden",
164
- alignContent: 'center'
165
- },
166
- className: 'col-*-*'
167
- }, /*#__PURE__*/_react.default.createElement("div", {
168
- className: 'line'
169
- }, "\xA0"))), graphicsCounter < steps.length - 1 ? /*#__PURE__*/_react.default.createElement("div", {
170
- className: (graphicsCounter < currentIndex.current ? `${classes.themeBorder} ` : '') + '' + (graphicsCounter === 0 ? ' firstLine' : '')
171
- }) : null, graphicsCounter++ ? null : null);
175
+ }, step.title)))), !isLast ? /*#__PURE__*/_react.default.createElement("div", {
176
+ className: (graphicsCounter < currentIndex.current ? `${classes.themeBorder} ` : '') + (graphicsCounter === 0 ? ' firstLine' : '')
177
+ }) : null);
172
178
  }
173
179
  function render() {
174
180
  return /*#__PURE__*/_react.default.createElement("div", {
175
- className: "w-100 flex-nowrap",
176
- style: {
177
- display: "flex",
178
- width: "100%"
179
- }
180
- }, steps.map(step => /*#__PURE__*/_react.default.createElement("div", {
181
- align: graphicsCounter === 0 ? "left" : graphicsCounter === steps.length - 1 ? "right" : "center",
182
- key: keyCounter++,
183
- style: {
184
- whiteSpace: "nowrap",
185
- paddingTop: "8px",
186
- maxHeight: "8px",
187
- width: 100 / steps.length + "%"
188
- },
189
- id: "step-container-" + counter++
190
- }, renderStep(step))));
181
+ className: "stepper-container"
182
+ }, steps.map((step, idx) => /*#__PURE__*/_react.default.createElement("div", {
183
+ key: idx,
184
+ id: "step-container-" + idx,
185
+ className: "step-item"
186
+ }, renderStep(step, idx, steps.length))));
191
187
  }
192
188
  return /*#__PURE__*/_react.default.createElement("div", null, visible && !_Utils.default.isNull(props.config) ? /*#__PURE__*/_react.default.createElement("div", {
193
189
  style: _Utils.default.mergeStyles({
194
190
  fontSize: '24px',
195
191
  color: '#202124',
196
- padding: "0 0 32px 0",
192
+ padding: "0",
197
193
  display: 'flex',
198
194
  justifyContent: 'center',
199
195
  margin: "0 0 16px 0"
@@ -84,7 +84,7 @@ const WordDocumentViewer = props => {
84
84
  const [json, setJson] = _react.default.useState(null);
85
85
  const [errorMessage, setErrorMessage] = _react.default.useState(null);
86
86
  const ref = useOnFullyVisible(el => {
87
- console.log('Document fully visible & rendered:', el);
87
+ //console.log('Document fully visible & rendered:', el);
88
88
  if (!reRendering) {
89
89
  setVisible(false);
90
90
  setReRendering(true);
@@ -331,7 +331,6 @@ const Form = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.default.forwar
331
331
  let autoLoadData = _Utils.default.getComponentAttribute(config, 'autoLoadData', null);
332
332
  if (autoLoadData === null || autoLoadData === true) {
333
333
  let subscription = {
334
- publisher: props.viewId,
335
334
  eventType: _EventType.default.COMPONENT_LOAD,
336
335
  actions: [{
337
336
  actionType: 'loadData'
@@ -21,7 +21,6 @@ const SelectItemComponent = props => {
21
21
  const maxWidth = !_Utils.default.isNull(props.config.attributes?.style?.maxWidth) ? props.config.attributes.style.maxWidth : null;
22
22
  const minWidth = !_Utils.default.isNull(props.config.attributes?.style?.minWidth) ? props.config.attributes.style.minWidth : "240px";
23
23
  function processValueChange(newValue, isOptionsLoaded) {
24
- console.log("\n\n\n\nPROCESSING : ", newValue, isOptionsLoaded);
25
24
  if (!_Utils.default.isNull(newValue) && !isOptionsLoaded) {
26
25
  let defaultOptions = [];
27
26
  defaultOptions.push(newValue);
@@ -71,20 +71,22 @@ const TimePicker = props => {
71
71
  const parts = value.split(":");
72
72
  const hours = Number(parts[0] ?? 0);
73
73
  const minutes = Number(parts[1] ?? 0);
74
- let seconds = 0;
75
- if (parts[2]) {
76
- seconds = Number(parts[2].split(".")[0] ?? 0);
77
- }
78
74
  const dateObject = new Date();
79
- dateObject.setHours(hours, minutes, seconds, 0);
80
- return inbound ? dateObject : dateObject.toLocaleTimeString("it-IT");
75
+ dateObject.setHours(hours, minutes);
76
+ return inbound ? dateObject : dateObject.toLocaleTimeString("it-IT", {
77
+ hour: "2-digit",
78
+ minute: "2-digit"
79
+ });
81
80
  }
82
81
  return value;
83
82
  }
84
83
  }
85
84
 
86
85
  // date-time value (contains "T") or something parsable by Date
87
- return !_Utils.default.isNull(value) ? inbound ? new Date(value) : new Date(value).toLocaleTimeString("it-IT") : null;
86
+ return !_Utils.default.isNull(value) ? inbound ? new Date(value) : new Date(value).toLocaleTimeString("it-IT", {
87
+ hour: "2-digit",
88
+ minute: "2-digit"
89
+ }) : null;
88
90
  }
89
91
  }), base => /*#__PURE__*/_react.default.createElement(CustomTimePickerComponent, _extends({
90
92
  base: base
@@ -6,6 +6,16 @@
6
6
  border-radius: 4px;
7
7
  }
8
8
 
9
+ .success-green-text,
10
+ .success-green-text td {
11
+ color: #2e7d32;
12
+ }
13
+
14
+ .bold-text,
15
+ .bold-text td {
16
+ font-weight: bold;
17
+ }
18
+
9
19
  .view .sticky-header {
10
20
  position: sticky; top: 0; z-index: 1;
11
21
  box-sizing: border-box;
@@ -98,13 +98,6 @@ const View = props => {
98
98
  }
99
99
  }
100
100
  _ApplicationManager.default.updateAppBarTitle(parsedConfig.id, parsedConfig.title);
101
- let data = {};
102
- data.viewId = props.config.id;
103
- let event = new _Event.default(props.handle, props.config.id, data);
104
- _Observable.default.fireEvent(_EventType.default.COMPONENT_LOAD, event);
105
- if (props.loadCallback) {
106
- props.loadCallback();
107
- }
108
101
  const el = viewRef.current;
109
102
  let ro;
110
103
  if (el) {
@@ -128,6 +121,13 @@ const View = props => {
128
121
  ro.observe(headerEl);
129
122
  }
130
123
  }
124
+ let data = {};
125
+ data.viewId = props.config.id;
126
+ let event = new _Event.default(props.handle, props.config.id, data);
127
+ _Observable.default.fireEvent(_EventType.default.COMPONENT_LOAD, event);
128
+ if (props.loadCallback) {
129
+ props.loadCallback();
130
+ }
131
131
  return () => {
132
132
  _Observable.default.clearEventListeners(props.config.id);
133
133
  if (el) {
@@ -15,6 +15,7 @@ const SideBarContent = props => {
15
15
  const {
16
16
  tab,
17
17
  isHost,
18
+ isChairPerson,
18
19
  meetingId,
19
20
  participants,
20
21
  meetingChat
@@ -36,7 +37,8 @@ const SideBarContent = props => {
36
37
  chatTab: true,
37
38
  selectedChat: meetingChat,
38
39
  meetingId: meetingId,
39
- isHost: isHost
40
+ isHost: isHost,
41
+ isChairPerson: isChairPerson
40
42
  })));
41
43
  };
42
44
  var _default = exports.default = SideBarContent;
@@ -414,63 +414,7 @@ const Toolbar = props => {
414
414
  id: 'CHAT_BUBBLE'
415
415
  })), /*#__PURE__*/_react.default.createElement("div", {
416
416
  className: 'text'
417
- }, "Chat"))))))), isHost && roomStatus === 'SESSION' && /*#__PURE__*/_react.default.createElement("div", {
418
- className: 'button-wrapper no-margin no-padding'
419
- }, /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
420
- root: buttonStripRef,
421
- onVisibilityChange: visible => handleVisibilityChange('minutes', visible)
422
- }, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
423
- title: "Minutes"
424
- }, /*#__PURE__*/_react.default.createElement(_Button.default, {
425
- onClick: () => {
426
- if (minutesShown) {
427
- hideMinutes();
428
- } else {
429
- showMinutes();
430
- }
431
- },
432
- style: {
433
- color: minutesShown ? '#8eb2f5' : '#404239',
434
- marginRight: '4px'
435
- }
436
- }, /*#__PURE__*/_react.default.createElement("div", {
437
- style: {
438
- height: '100%'
439
- }
440
- }, /*#__PURE__*/_react.default.createElement("div", {
441
- className: 'icon'
442
- }, minutesShown ? /*#__PURE__*/_react.default.createElement(_Icon.default, {
443
- id: 'CLOSE'
444
- }) : /*#__PURE__*/_react.default.createElement(_Icon.default, {
445
- id: 'MINUTES'
446
- })), /*#__PURE__*/_react.default.createElement("div", {
447
- className: 'text'
448
- }, minutesShown ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Hide") : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Minutes"))))))), minutesShown && roomStatus === 'SESSION' && /*#__PURE__*/_react.default.createElement("div", {
449
- className: 'button-wrapper no-margin no-padding'
450
- }, /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
451
- root: buttonStripRef,
452
- onVisibilityChange: visible => handleVisibilityChange('saveMinutes', visible)
453
- }, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
454
- title: "Save Minutes"
455
- }, /*#__PURE__*/_react.default.createElement(_Button.default, {
456
- onClick: () => {
457
- saveMinutes();
458
- },
459
- style: {
460
- color: '#404239',
461
- marginRight: '4px'
462
- }
463
- }, /*#__PURE__*/_react.default.createElement("div", {
464
- style: {
465
- height: '100%'
466
- }
467
- }, /*#__PURE__*/_react.default.createElement("div", {
468
- className: 'icon'
469
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
470
- id: 'SAVE'
471
- })), /*#__PURE__*/_react.default.createElement("div", {
472
- className: 'text'
473
- }, "Save")))))), roomStatus === 'SESSION' && /*#__PURE__*/_react.default.createElement("div", {
417
+ }, "Chat"))))))), roomStatus === 'SESSION' && /*#__PURE__*/_react.default.createElement("div", {
474
418
  className: 'button-wrapper'
475
419
  }, raisedHands.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
476
420
  className: 'marker'
@@ -730,29 +674,7 @@ const Toolbar = props => {
730
674
  }
731
675
  }, /*#__PURE__*/_react.default.createElement(_material.ListItemIcon, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
732
676
  id: 'CHAT_BUBBLE'
733
- })), /*#__PURE__*/_react.default.createElement("div", null, hasUnreadChats ? '1' : '', "\xA0Chat"))), isHost && !buttonVisibility.minutes && roomStatus === 'SESSION' && /*#__PURE__*/_react.default.createElement("div", {
734
- className: 'button-wrapper no-margin no-padding'
735
- }, /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
736
- onClick: () => {
737
- if (minutesShown) {
738
- hideMinutes();
739
- } else {
740
- showMinutes();
741
- }
742
- }
743
- }, /*#__PURE__*/_react.default.createElement(_material.ListItemIcon, null, minutesShown ? /*#__PURE__*/_react.default.createElement(_Icon.default, {
744
- id: 'CLOSE'
745
- }) : /*#__PURE__*/_react.default.createElement(_Icon.default, {
746
- id: 'DESCRIPTION'
747
- })), minutesShown ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Hide Minutes") : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Minutes"))), minutesShown && roomStatus === 'SESSION' && /*#__PURE__*/_react.default.createElement("div", {
748
- className: 'button-wrapper no-margin no-padding'
749
- }, /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
750
- onClick: () => {
751
- saveMinutes();
752
- }
753
- }, /*#__PURE__*/_react.default.createElement(_material.ListItemIcon, null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
754
- id: 'SAVE'
755
- })), "Save Minutes")), !buttonVisibility.raiseHand && roomStatus === 'SESSION' && /*#__PURE__*/_react.default.createElement("div", {
677
+ })), /*#__PURE__*/_react.default.createElement("div", null, hasUnreadChats ? '1' : '', "\xA0Chat"))), !buttonVisibility.raiseHand && roomStatus === 'SESSION' && /*#__PURE__*/_react.default.createElement("div", {
756
678
  className: 'button-wrapper no-margin no-padding'
757
679
  }, /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
758
680
  onClick: () => {
@@ -52,6 +52,7 @@ const TrainingRoom = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defaul
52
52
  const [allUserParticipantsLeft, setAllUserParticipantsLeft] = (0, _react.useState)(false);
53
53
  const [lobbyWaitingList, setLobbyWaitingList] = (0, _react.useState)([]);
54
54
  const [isHost, setIsHost] = (0, _react.useState)(false);
55
+ const [isChairPerson, setIsChairPerson] = (0, _react.useState)(false);
55
56
  const [meetingParticipantGridMode, setMeetingParticipantGridMode] = (0, _react.useState)('DEFAULT');
56
57
  const [autoPermit, setAutoPermit] = (0, _react.useState)(!props.calendarEvent.askToJoin);
57
58
  const [rtpCapabilities, setRtpCapabilities] = (0, _react.useState)(null);
@@ -309,6 +310,7 @@ const TrainingRoom = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defaul
309
310
  }
310
311
  setCurrentUserFullName(userFullName);
311
312
  setIsHost(props.calendarEvent.host.username === _ApplicationManager.default.getUserDetails().username);
313
+ setIsChairPerson(props.calendarEvent.chairPersonId === _ApplicationManager.default.getUserDetails().username);
312
314
  try {
313
315
  _Media.default.joinMeeting(props.calendarEvent, props.settings, userFullName).then(response => {
314
316
  console.log('JOIN RESPONSE : ', response);
@@ -329,18 +331,15 @@ const TrainingRoom = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defaul
329
331
  }, []);
330
332
  function addUserToParticipants(user) {
331
333
  // Typically, a user shoud not exist. We are ensuring that there are never duplicates
332
- console.log('SEARCHING PARTICIPANT : ' + user.userId);
333
334
  console.log(participants);
334
335
  let participant = participants.find(u => u.userId === user.userId);
335
336
  if (participant) {
336
- console.log('FOUND EXISTING PARTICIPANT : ', participant);
337
337
  participant.name = user.name;
338
338
  participant.avatar = user.avatar;
339
339
  participant.audioMuted = user.audioMuted;
340
340
  participant.videoMuted = user.videoMuted;
341
341
  participant.producers = user.producers;
342
342
  } else {
343
- console.log('DID NOT FIND EXISTING PARTICIPANT : ', participant);
344
343
  participant = {
345
344
  userId: user.userId,
346
345
  name: user.name,
@@ -381,7 +380,7 @@ const TrainingRoom = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defaul
381
380
  _SocketManager.default.endSession(props.calendarEvent.id);
382
381
  _ApplicationManager.default.setHasActiveMeeting(false);
383
382
  _ApplicationManager.default.setActiveMeetingKey(null);
384
- _ApplicationManager.default.removeLoadedGraph(false);
383
+ _ApplicationManager.default.removeLoadedGraph('window');
385
384
  setSideBarOpen(false);
386
385
  setSideBarTab('');
387
386
  }
@@ -555,6 +554,7 @@ const TrainingRoom = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defaul
555
554
  sideBarTab: sideBarTab,
556
555
  roomStatus: roomStatus,
557
556
  isHost: isHost,
557
+ isChairPerson: isChairPerson,
558
558
  startScreenSharing: startScreenSharing,
559
559
  sharingHandler: someoneSharing => setSomeoneSharing(someoneSharing),
560
560
  onStopSharing: () => {
@@ -601,6 +601,7 @@ const TrainingRoom = /*#__PURE__*/_react.default.memo(/*#__PURE__*/_react.defaul
601
601
  }, /*#__PURE__*/_react.default.createElement(_SideBarContent.default, {
602
602
  meetingChat: meetingChat,
603
603
  isHost: isHost,
604
+ isChairPerson: isChairPerson,
604
605
  tab: sideBarTab,
605
606
  meetingId: props.calendarEvent.id,
606
607
  participants: participants,
@@ -115,6 +115,7 @@ const VCRoomWorkspace = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
115
115
  videoMuted,
116
116
  audioMuted,
117
117
  isHost,
118
+ isChairPerson,
118
119
  rtpCapabilities,
119
120
  onloadScreenShareData,
120
121
  displayState,
@@ -741,6 +742,7 @@ const VCRoomWorkspace = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
741
742
  }, /*#__PURE__*/_react.default.createElement(_SideBarContent.default, {
742
743
  meetingChat: meetingChat,
743
744
  isHost: isHost,
745
+ isChairPerson: isChairPerson,
744
746
  tab: 'People',
745
747
  meetingId: meetingId,
746
748
  participants: props.participants,
@@ -50,7 +50,7 @@ const ChatRoom = props => {
50
50
  const [mode, setMode] = (0, _react.useState)('CHAT');
51
51
  const [clearUploadedFileSwitch, setClearUploadedFileSwitch] = (0, _react.useState)(false);
52
52
  const [socketEventHandler] = (0, _react.useState)({});
53
- const [currentUser, setCurrentUser] = (0, _react.useState)(_ApplicationManager.default.getUserDetails());
53
+ const [currentUser] = (0, _react.useState)(_ApplicationManager.default.getUserDetails());
54
54
  const socketEventHandlerApi = () => {
55
55
  return {
56
56
  get id() {
@@ -146,7 +146,7 @@ const ChatRoom = props => {
146
146
  if (selectedChat) {
147
147
  const newMessages = [].concat(selectedChat.messages);
148
148
  if (!props.showAllMessagesForNewParticipants) {
149
- let find = selectedChat.participants.find(p => p.userId === currentUser.userId);
149
+ let find = selectedChat.participants.find(p => p.username === currentUser.username);
150
150
  const dateAddedToChat = find ? find.dateAddedToChat : new Date();
151
151
  const filteredMessages = newMessages.filter(txt => dateAddedToChat === null || new Date(dateAddedToChat) < new Date(txt.createdDate));
152
152
  setMessages(filteredMessages);
@@ -172,7 +172,7 @@ const ChatRoom = props => {
172
172
  if (selectedChat && currentUser) {
173
173
  setMessage('');
174
174
  setDocuments(null);
175
- let find = selectedChat.participants.find(p => p.userId === currentUser.userId);
175
+ let find = selectedChat.participants.find(p => p.userId === currentUser.username || p.username === currentUser.username);
176
176
  if (_Utils.default.isNull(find)) {
177
177
  (0, _RestUtils.postData)(`${location + '/' + _ApplicationManager.default.getContextRoot()}/calendar/api/v1/chat/addParticipants`, () => {}, e => {}, true, {
178
178
  chatId: selectedChat.id,
@@ -497,7 +497,8 @@ const ChatRoom = props => {
497
497
  messageId: message.id,
498
498
  participantsToSignalIds,
499
499
  profile: _ApplicationManager.default.getUserDetails().profile,
500
- userId: _ApplicationManager.default.getUserDetails().username
500
+ userId: _ApplicationManager.default.getUserDetails().username,
501
+ username: _ApplicationManager.default.getUserDetails().username
501
502
  }).then(data => {
502
503
  message.active = false;
503
504
  setRefresher(!refresher);
@@ -626,7 +627,7 @@ const ChatRoom = props => {
626
627
  className: "cv-poll-choice-details"
627
628
  }, /*#__PURE__*/_react.default.createElement("span", {
628
629
  className: "cv-choice-percentage"
629
- }, /*#__PURE__*/_react.default.createElement(Info, {
630
+ }, /*#__PURE__*/_react.default.createElement(_reactFeather.Info, {
630
631
  className: "selected-choice-icon"
631
632
  })), /*#__PURE__*/_react.default.createElement("span", {
632
633
  className: "cv-choice-text"
@@ -641,10 +642,11 @@ const ChatRoom = props => {
641
642
  poll: message.poll,
642
643
  chatTab: props.chatTab,
643
644
  isHost: props.isHost,
645
+ isChairPerson: props.isChairPerson,
644
646
  pollCreator: message.participant,
645
647
  createdDate: message.createdDate,
646
648
  submitPollVoteHandler: poll => submitPollVoteHandler(poll),
647
- pollParticipantIDs: selectedChat.participants.map(p => p.userId),
649
+ pollParticipantIDs: selectedChat.participants.map(p => p.username),
648
650
  currentUser: currentUser,
649
651
  closePollHandler: (e, poll) => closePollHandler(e, poll),
650
652
  numberOfPollParticipants: selectedChat.participants.length
@@ -193,7 +193,8 @@
193
193
 
194
194
  .chatroom__body {
195
195
  height: 95%;
196
- overflow: auto;
196
+ overflow-y: auto;
197
+ overflow-x: hidden;
197
198
  padding: 0 15px;
198
199
  }
199
200
 
@@ -396,7 +397,6 @@
396
397
 
397
398
  .poll-content {
398
399
  margin-top: 16px;
399
- margin-left: 26px;
400
400
  margin-bottom: 28px;
401
401
  padding: 20px 15px 20px 15px;
402
402
  letter-spacing: .01em;
@@ -488,11 +488,9 @@
488
488
  }
489
489
 
490
490
  .cv-choice-text {
491
- margin-left: 10px;
491
+ margin: 0 10px;
492
492
  display: inline-block;
493
493
  vertical-align: bottom;
494
- text-overflow: ellipsis;
495
- white-space: nowrap;
496
494
  overflow: hidden;
497
495
  color: rgba(0, 0, 0, 0.75);
498
496
  }
@@ -189,7 +189,7 @@ const PollContainer = props => {
189
189
  }).catch(() => {});
190
190
  }
191
191
  }
192
- }, "Submit Vote"), props.currentUser.userId === props.pollCreator.userId && /*#__PURE__*/_react.default.createElement(_Button.default, {
192
+ }, "Submit Vote"), props.currentUser.username === props.pollCreator.username && /*#__PURE__*/_react.default.createElement(_Button.default, {
193
193
  className: "vote-button",
194
194
  variant: "outlined",
195
195
  onClick: e => props.closePollHandler(e, poll)
@@ -216,7 +216,7 @@ const PollContainer = props => {
216
216
  style: {
217
217
  color: '#945c33'
218
218
  }
219
- }, "You have voted ", props.poll.options.find(o => o.id === poll.selectedOption)?.text)), props.isHost && tieOptions.length > 0 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
219
+ }, "You have voted ", props.poll.options.find(o => o.id === poll.selectedOption)?.text)), props.isChairPerson && tieOptions.length > 0 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
220
220
  className: "poll-choices",
221
221
  style: {
222
222
  marginTop: '8px'
@@ -40,6 +40,16 @@ class ProcurementMeetings {
40
40
  procurementNumber: meeting.procurementNumber
41
41
  }, meeting);
42
42
  };
43
+ endMeeting = meeting => {
44
+ console.log("\n\n\n\n\nENDING SESSION : ", meeting);
45
+ let api = _ApplicationManager.default.resolveComponentApi("conclusionLayout");
46
+ api.visible = true;
47
+ api = _ApplicationManager.default.resolveComponentApi("toolbar");
48
+ api.visible = false;
49
+ api = _ApplicationManager.default.resolveComponentApi("meetingLayout");
50
+ api.visible = false;
51
+ _SocketManager.default.endSession(meeting.id);
52
+ };
43
53
  handleSystemEvent = (event, meeting, viewId) => {
44
54
  console.log("PROCESSING MEETING SYSTEM EVENT : ", event);
45
55
  let data = event.data;
@@ -67,10 +77,18 @@ class ProcurementMeetings {
67
77
  } else if (event.systemEventType === 'meetingStepChanged') {
68
78
  let api = _ApplicationManager.default.resolveComponentApi(viewId);
69
79
  api.model.currentStep = data.step;
80
+ api.model.meetingStep = data.step;
70
81
  let component = _ApplicationManager.default.resolveComponentApi("toolbar");
71
82
  if (component) {
72
83
  component.refresh();
73
84
  }
85
+ } else if (event.systemEventType === 'documentSaved') {
86
+ let documentType = data.documentType;
87
+ if (documentType === 'minutes') {
88
+ meeting.minutesDraftDocumentId = data.documentId;
89
+ } else if (documentType === 'agenda') {
90
+ meeting.agendaDocumentId = data.documentId;
91
+ }
74
92
  }
75
93
  };
76
94
  showComponent = id => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilemotion/oui-react-js",
3
- "version": "1.8.46",
3
+ "version": "1.8.48",
4
4
  "description": "AgileMotion React UI Component Library - A comprehensive collection of dashboard components, forms, media controls, and more",
5
5
  "license": "ISC",
6
6
  "author": "",