versacall-dashboards-library-react 2.0.39 → 2.0.40
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/package.json +2 -2
- package/dist/components/DashboardsCell/DashboardsCell.js +0 -267
- package/dist/components/DashboardsCell/index.js +0 -15
- package/dist/components/DashboardsCellContent/DashboardsCellContent.js +0 -438
- package/dist/components/DashboardsCellContent/index.js +0 -15
- package/dist/components/DashboardsCellFindAndReplace/DashboardsCellFindAndReplace.js +0 -190
- package/dist/components/DashboardsCellFindAndReplace/index.js +0 -15
- package/dist/components/DashboardsCellGlobalActions/DashboardsCellGlobalActions.js +0 -218
- package/dist/components/DashboardsCellGlobalActions/index.js +0 -15
- package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditions.js +0 -1043
- package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditionsNestable.js +0 -927
- package/dist/components/DashboardsCellGlobalConditions/DashboardsCellGlobalConditionsOld.js +0 -816
- package/dist/components/DashboardsCellGlobalConditions/index.js +0 -15
- package/dist/components/DashboardsCellGlobalStyles/DashboardsCellGlobalStyles.js +0 -394
- package/dist/components/DashboardsCellGlobalStyles/index.js +0 -15
- package/dist/components/DashboardsCellMergeUnmerge/DashboardsCellMergeUnmerge.js +0 -152
- package/dist/components/DashboardsCellMergeUnmerge/index.js +0 -15
- package/dist/components/DashboardsCellPosition/DashboardsCellPosition.js +0 -85
- package/dist/components/DashboardsCellPosition/index.js +0 -15
- package/dist/components/DashboardsCellSize/DashboardsCellSize.js +0 -89
- package/dist/components/DashboardsCellSize/index.js +0 -15
- package/dist/components/DashboardsCellStyle/DashboardsCellStyle.js +0 -83
- package/dist/components/DashboardsCellStyle/index.js +0 -15
- package/dist/components/DashboardsCellStyleAlignItems/DashboardsCellStyleAlignItems.js +0 -152
- package/dist/components/DashboardsCellStyleAlignItems/index.js +0 -15
- package/dist/components/DashboardsCellStyleBackgroundColor/DashboardsCellStyleBackgroundColor.js +0 -198
- package/dist/components/DashboardsCellStyleBackgroundColor/index.js +0 -15
- package/dist/components/DashboardsCellStyleClear/DashboardsCellStyleClear.js +0 -50
- package/dist/components/DashboardsCellStyleClear/index.js +0 -15
- package/dist/components/DashboardsCellStyleColor/DashboardsCellStyleColor.js +0 -198
- package/dist/components/DashboardsCellStyleColor/index.js +0 -15
- package/dist/components/DashboardsCellStyleDisplay/DashboardsCellStyleDisplay.js +0 -65
- package/dist/components/DashboardsCellStyleDisplay/index.js +0 -15
- package/dist/components/DashboardsCellStyleFontFamily/DashboardsCellStyleFontFamily.js +0 -64
- package/dist/components/DashboardsCellStyleFontFamily/index.js +0 -15
- package/dist/components/DashboardsCellStyleFontSize/DashboardsCellStyleFontSize.js +0 -89
- package/dist/components/DashboardsCellStyleFontSize/index.js +0 -15
- package/dist/components/DashboardsCellStyleJustifyContent/DashboardsCellStyleJustifyContent.js +0 -152
- package/dist/components/DashboardsCellStyleJustifyContent/index.js +0 -15
- package/dist/components/DashboardsCellStyleObjectFit/DashboardsCellStyleObjectFit.js +0 -81
- package/dist/components/DashboardsCellStyleObjectFit/index.js +0 -15
- package/dist/components/DashboardsCellStylePadding/DashboardsCellStylePadding.js +0 -105
- package/dist/components/DashboardsCellStylePadding/index.js +0 -15
- package/dist/components/DashboardsCellStyleWeightStyleDecoration/DashboardsCellStyleWeightStyleDecoration.js +0 -154
- package/dist/components/DashboardsCellStyleWeightStyleDecoration/index.js +0 -15
- package/dist/components/DashboardsCopyAndPaste/DashboardsCopyAndPaste.js +0 -112
- package/dist/components/DashboardsCopyAndPaste/index.js +0 -15
- package/dist/components/DashboardsEditor/DashboardsEditor.js +0 -415
- package/dist/components/DashboardsEditor/index.js +0 -15
- package/dist/components/DashboardsGlobalStylesPicker/DashboardsGlobalStylesPicker.js +0 -90
- package/dist/components/DashboardsGlobalStylesPicker/index.js +0 -15
- package/dist/components/DashboardsGrid/DashboardsGrid.js +0 -139
- package/dist/components/DashboardsGrid/index.js +0 -15
- package/dist/components/DashboardsMainFreehand/DashboardsMainFreehand.js +0 -466
- package/dist/components/DashboardsMainFreehand/index.js +0 -15
- package/dist/components/DashboardsMainMessaging/DashboardsMainMessaging.js +0 -628
- package/dist/components/DashboardsMainMessaging/index.js +0 -15
- package/dist/components/DashboardsMainTable/DashboardsMainTable.js +0 -626
- package/dist/components/DashboardsMainTable/index.js +0 -15
- package/dist/components/DashboardsPreview/DashboardsPreview.js +0 -113
- package/dist/components/DashboardsPreview/index.js +0 -15
- package/dist/components/DashboardsRatio/DashboardsRatio.js +0 -288
- package/dist/components/DashboardsRatio/DashboardsRatioOld.js +0 -211
- package/dist/components/DashboardsRatio/index.js +0 -15
- package/dist/components/DashboardsStatusBar/DashboardsStatusBar.css +0 -1
- package/dist/components/DashboardsStatusBar/DashboardsStatusBar.js +0 -137
- package/dist/components/DashboardsStatusBar/index.js +0 -15
- package/dist/components/DashboardsUndoRedo/DashboardsUndoRedo.js +0 -144
- package/dist/components/DashboardsUndoRedo/index.js +0 -15
- package/dist/components/DashboardsViewer/DashboardsViewer.js +0 -74
- package/dist/components/DashboardsViewer/index.js +0 -15
- package/dist/components/DashboardsWidthHeight/DashboardsWidthHeight.js +0 -98
- package/dist/components/DashboardsWidthHeight/index.js +0 -15
- package/dist/components/WidgetParameters/WidgetParameters.js +0 -383
- package/dist/components/WidgetParameters/index.js +0 -15
- package/dist/components/index.js +0 -287
- package/dist/constants/defaultFreehandCell.js +0 -23
- package/dist/constants/defaultFreehandDashboard.js +0 -23
- package/dist/constants/defaultMessagingDashboard.js +0 -53
- package/dist/constants/defaultStyle.js +0 -11
- package/dist/constants/defaultTableCell.js +0 -27
- package/dist/constants/defaultTableDashboard.js +0 -25
- package/dist/constants/index.js +0 -55
- package/dist/functions/addTranslations.js +0 -28
- package/dist/functions/calculateDashboardVariables.js +0 -146
- package/dist/functions/convertColorObject.js +0 -10
- package/dist/functions/convertColorString.js +0 -26
- package/dist/functions/convertPercentToInt.js +0 -10
- package/dist/functions/convertSecondsToElapsedTime.js +0 -37
- package/dist/functions/generateFreehandCell.js +0 -24
- package/dist/functions/generateFreehandDashboard.js +0 -19
- package/dist/functions/generateMessagingDashboard.js +0 -14
- package/dist/functions/generateSelected.js +0 -18
- package/dist/functions/generateTableCell.js +0 -18
- package/dist/functions/generateTableDashboard.js +0 -37
- package/dist/functions/index.js +0 -119
- package/dist/functions/mergeSelected.js +0 -22
- package/dist/functions/sortCells.js +0 -26
- package/dist/images/BackgroundTransparency.png +0 -0
- package/dist/index.js +0 -44
- package/dist/translations/en.json +0 -11
- package/dist/translations/es.json +0 -3
|
@@ -1,628 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _reactIntl = require("react-intl");
|
|
11
|
-
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
var _functions = require("../../functions");
|
|
15
|
-
|
|
16
|
-
var _DashboardsStatusBar = _interopRequireDefault(require("../DashboardsStatusBar"));
|
|
17
|
-
|
|
18
|
-
var _DashboardsViewer = _interopRequireDefault(require("../DashboardsViewer"));
|
|
19
|
-
|
|
20
|
-
var _DashboardsCell = _interopRequireDefault(require("../DashboardsCell"));
|
|
21
|
-
|
|
22
|
-
var _DashboardsGrid = _interopRequireDefault(require("../DashboardsGrid"));
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
27
|
-
|
|
28
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
-
|
|
30
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
-
|
|
32
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
33
|
-
|
|
34
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
|
-
|
|
36
|
-
var style = {
|
|
37
|
-
root: {
|
|
38
|
-
position: 'absolute',
|
|
39
|
-
width: '100%',
|
|
40
|
-
height: '100%',
|
|
41
|
-
overflow: 'hidden'
|
|
42
|
-
},
|
|
43
|
-
preview: {
|
|
44
|
-
display: 'block',
|
|
45
|
-
boxSizing: 'border-box',
|
|
46
|
-
flexGrow: 1,
|
|
47
|
-
height: '100%',
|
|
48
|
-
overflow: 'hidden',
|
|
49
|
-
position: 'relative'
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
class DashboardsMainMessaging extends _react.Component {
|
|
54
|
-
constructor() {
|
|
55
|
-
super();
|
|
56
|
-
this.state = {
|
|
57
|
-
windowInnerWidth: 100,
|
|
58
|
-
windowInnerHeight: 100,
|
|
59
|
-
previewWidth: 0,
|
|
60
|
-
previewHeight: 0,
|
|
61
|
-
viewWidth: 0,
|
|
62
|
-
viewHeight: 0,
|
|
63
|
-
timestamp: new Date()
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
componentDidMount() {
|
|
68
|
-
this.updateWindowInnerDimensionsBinded = this.updateWindowInnerDimensions.bind(this);
|
|
69
|
-
window.addEventListener('resize', this.updateWindowInnerDimensionsBinded);
|
|
70
|
-
this.updateWindowInnerDimensionsBinded();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
componentDidUpdate(prevProps) {
|
|
74
|
-
if (prevProps.messagingDashboard.ratio.stretch !== this.props.messagingDashboard.ratio.stretch || prevProps.messagingDashboard.ratio.width !== this.props.messagingDashboard.ratio.width || prevProps.messagingDashboard.ratio.height !== this.props.messagingDashboard.ratio.height) {
|
|
75
|
-
this.updateViewDimensionsToState();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
componentWillUnmount() {
|
|
80
|
-
window.removeEventListener('resize', this.updateWindowInnerDimensionsBinded);
|
|
81
|
-
} // eslint-disable-next-line react/sort-comp
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
updateWindowInnerDimensions() {
|
|
85
|
-
this.setState(prevState => prevState.windowInnerWidth !== window.innerWidth || prevState.windowInnerHeight !== window.innerHeight ? {
|
|
86
|
-
windowInnerWidth: window.innerWidth,
|
|
87
|
-
windowInnerHeight: window.innerHeight
|
|
88
|
-
} : null);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
updateElementDimensions(element) {
|
|
92
|
-
if (element) {
|
|
93
|
-
this.setState(prevState => {
|
|
94
|
-
var size = element.getBoundingClientRect();
|
|
95
|
-
|
|
96
|
-
if (prevState.previewWidth !== Math.floor(size.width) || prevState.previewHeight !== Math.floor(size.height)) {
|
|
97
|
-
var previewWidth = Math.floor(size.width);
|
|
98
|
-
var previewHeight = Math.floor(size.height);
|
|
99
|
-
return _objectSpread({
|
|
100
|
-
previewWidth: previewWidth,
|
|
101
|
-
previewHeight: previewHeight
|
|
102
|
-
}, this.updateViewDimensions(previewWidth, previewHeight));
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return null;
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
updateViewDimensions(previewWidth, previewHeight) {
|
|
111
|
-
var viewWidth = previewWidth;
|
|
112
|
-
var viewHeight = 0;
|
|
113
|
-
var allowedHeight = previewHeight;
|
|
114
|
-
|
|
115
|
-
if (this.props.messagingDashboard.ratio.stretch) {
|
|
116
|
-
viewWidth = previewWidth;
|
|
117
|
-
viewHeight = previewHeight;
|
|
118
|
-
} else {
|
|
119
|
-
viewHeight = Math.floor(viewWidth / this.props.messagingDashboard.ratio.width * this.props.messagingDashboard.ratio.height);
|
|
120
|
-
|
|
121
|
-
if (viewHeight > allowedHeight) {
|
|
122
|
-
viewHeight = allowedHeight;
|
|
123
|
-
viewWidth = Math.floor(viewHeight / this.props.messagingDashboard.ratio.height * this.props.messagingDashboard.ratio.width);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return {
|
|
128
|
-
viewWidth: viewWidth,
|
|
129
|
-
viewHeight: viewHeight
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
updateViewDimensionsToState() {
|
|
134
|
-
this.setState(prevState => _objectSpread({}, this.updateViewDimensions(prevState.previewWidth, prevState.previewHeight)));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
getParentEvents(eventId) {
|
|
138
|
-
var parentEvents = this.props.parentEvents;
|
|
139
|
-
var pEvents = [];
|
|
140
|
-
var parentEvent = parentEvents.find(x => x.id === eventId);
|
|
141
|
-
|
|
142
|
-
if (parentEvent) {
|
|
143
|
-
pEvents.push(parentEvent);
|
|
144
|
-
|
|
145
|
-
if (parentEvent.parentId !== null && parentEvent.parentId.length > 0) {
|
|
146
|
-
var other = this.getParentEvents(parentEvent.parentId);
|
|
147
|
-
|
|
148
|
-
if (other.length > 0) {
|
|
149
|
-
pEvents.push(...other);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return pEvents;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
render() {
|
|
158
|
-
var _this = this;
|
|
159
|
-
|
|
160
|
-
var _this$props = this.props,
|
|
161
|
-
intl = _this$props.intl,
|
|
162
|
-
messagingDashboard = _this$props.messagingDashboard,
|
|
163
|
-
styles = _this$props.styles,
|
|
164
|
-
events = _this$props.events,
|
|
165
|
-
moduleConfigurations = _this$props.moduleConfigurations,
|
|
166
|
-
definedMessages = _this$props.definedMessages,
|
|
167
|
-
gap = _this$props.gap,
|
|
168
|
-
viewColor = _this$props.viewColor,
|
|
169
|
-
previewColor = _this$props.previewColor;
|
|
170
|
-
var _this$state = this.state,
|
|
171
|
-
viewWidth = _this$state.viewWidth,
|
|
172
|
-
viewHeight = _this$state.viewHeight,
|
|
173
|
-
previewHeight = _this$state.previewHeight,
|
|
174
|
-
timestamp = _this$state.timestamp;
|
|
175
|
-
var messagingDashboardProcessed = JSON.parse(JSON.stringify(messagingDashboard));
|
|
176
|
-
var defaultActiveStyleId = styles.find(dashboardStyle => dashboardStyle.id === messagingDashboard.defaultActiveStyleId);
|
|
177
|
-
var styleId = styles.find(dashboardStyle => dashboardStyle.id === messagingDashboard.styleId);
|
|
178
|
-
var eventsProcessed = events.filter(event => !!moduleConfigurations.find(moduleConfiguration => moduleConfiguration.id === event.moduleConfiguration.id));
|
|
179
|
-
var moduleConfigurationsProcessed = moduleConfigurations.filter(moduleConfiguration => !!eventsProcessed.find(event => event.moduleConfiguration.id === moduleConfiguration.id));
|
|
180
|
-
eventsProcessed = eventsProcessed.map(event => {
|
|
181
|
-
var processedEvent = JSON.parse(JSON.stringify(event));
|
|
182
|
-
processedEvent.moduleConfiguration.moduleConfiguration = moduleConfigurationsProcessed.find(moduleConfiguration => moduleConfiguration.id === processedEvent.moduleConfiguration.id);
|
|
183
|
-
|
|
184
|
-
var _loop = function _loop(i) {
|
|
185
|
-
var currentMonitoringPoint = processedEvent.moduleConfiguration.moduleConfiguration.monitoringPoints.find(monitoringPoint => monitoringPoint.id === processedEvent.configurationIds[i]);
|
|
186
|
-
|
|
187
|
-
if (currentMonitoringPoint.communicationPaths) {
|
|
188
|
-
var _loop5 = function _loop5(j) {
|
|
189
|
-
if (currentMonitoringPoint.communicationPaths[j].useDefinedMessage) {
|
|
190
|
-
var currentDefinedMessage = definedMessages.find(definedMessage => definedMessage.id === currentMonitoringPoint.communicationPaths[j].definedMessageId);
|
|
191
|
-
|
|
192
|
-
if (currentDefinedMessage) {
|
|
193
|
-
if (processedEvent.respondDateTime) {
|
|
194
|
-
processedEvent.messageProceessed = currentDefinedMessage.respondMessage;
|
|
195
|
-
} else {
|
|
196
|
-
processedEvent.messageProceessed = currentDefinedMessage.startMessage;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
} else if (processedEvent.respondDateTime) {
|
|
200
|
-
processedEvent.messageProceessed = currentMonitoringPoint.communicationPaths[j].respondState.message;
|
|
201
|
-
} else {
|
|
202
|
-
processedEvent.messageProceessed = currentMonitoringPoint.communicationPaths[j].startState.message;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
if (processedEvent.messageProceessed) {
|
|
206
|
-
return "break";
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
for (var j = 0; j < currentMonitoringPoint.communicationPaths.length; j++) {
|
|
211
|
-
var _ret4 = _loop5(j);
|
|
212
|
-
|
|
213
|
-
if (_ret4 === "break") break;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (processedEvent.messageProceessed) {
|
|
217
|
-
processedEvent.monitoringPoint = JSON.parse(JSON.stringify(currentMonitoringPoint));
|
|
218
|
-
return "break";
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
for (var i = processedEvent.configurationIds.length - 1; i > 1; i--) {
|
|
224
|
-
var _ret = _loop(i);
|
|
225
|
-
|
|
226
|
-
if (_ret === "break") break;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
if (processedEvent.messageProceessed) {
|
|
230
|
-
processedEvent.custom = {
|
|
231
|
-
viewWidth: viewWidth,
|
|
232
|
-
viewHeight: viewHeight,
|
|
233
|
-
style: {}
|
|
234
|
-
};
|
|
235
|
-
processedEvent.startDateTimeFormatted = (0, _functions.convertSecondsToElapsedTime)(processedEvent.calculated, messagingDashboardProcessed.timeFormat);
|
|
236
|
-
var newStyle = null;
|
|
237
|
-
|
|
238
|
-
switch (messagingDashboardProcessed.conditionType) {
|
|
239
|
-
case 'timeThreshold':
|
|
240
|
-
{
|
|
241
|
-
var timeThresholdTotal = 0;
|
|
242
|
-
|
|
243
|
-
var _loop2 = function _loop2(_i) {
|
|
244
|
-
timeThresholdTotal += messagingDashboardProcessed.conditions[_i].time;
|
|
245
|
-
|
|
246
|
-
if (processedEvent.calculated <= timeThresholdTotal) {
|
|
247
|
-
newStyle = styles.find(dashboardStyle => dashboardStyle.id === messagingDashboardProcessed.conditions[_i].styleId);
|
|
248
|
-
return "break";
|
|
249
|
-
} else if (_i === messagingDashboardProcessed.conditions.length - 1) {
|
|
250
|
-
newStyle = styles.find(dashboardStyle => dashboardStyle.id === messagingDashboardProcessed.conditions[_i].styleId);
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
for (var _i = 0; _i < messagingDashboardProcessed.conditions.length; _i++) {
|
|
255
|
-
var _ret2 = _loop2(_i);
|
|
256
|
-
|
|
257
|
-
if (_ret2 === "break") break;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
case 'stateChange':
|
|
264
|
-
newStyle = styles.find(dashboardStyle => dashboardStyle.id === messagingDashboardProcessed.conditions[processedEvent.respondDateTime ? 1 : 0].styleId);
|
|
265
|
-
break;
|
|
266
|
-
|
|
267
|
-
case 'tag':
|
|
268
|
-
{
|
|
269
|
-
var _loop3 = function _loop3(_i2) {
|
|
270
|
-
if (processedEvent.tags.includes(messagingDashboardProcessed.conditions[_i2].filter)) {
|
|
271
|
-
newStyle = styles.find(dashboardStyle => dashboardStyle.id === messagingDashboardProcessed.conditions[_i2].styleId);
|
|
272
|
-
return "break";
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
for (var _i2 = 0; _i2 < messagingDashboardProcessed.conditions.length; _i2++) {
|
|
277
|
-
var _ret3 = _loop3(_i2);
|
|
278
|
-
|
|
279
|
-
if (_ret3 === "break") break;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
default:
|
|
286
|
-
break;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
processedEvent.custom.style = _objectSpread(_objectSpread({}, defaultActiveStyleId ? _objectSpread({}, defaultActiveStyleId.options) : {}), newStyle ? _objectSpread({}, newStyle.options) : {});
|
|
290
|
-
var newMessageProceessed = String(processedEvent.messageProceessed);
|
|
291
|
-
var textVariables = {
|
|
292
|
-
active: false,
|
|
293
|
-
activeInput: false,
|
|
294
|
-
list: []
|
|
295
|
-
};
|
|
296
|
-
textVariables = newMessageProceessed.split('').reduce((acc, curr) => {
|
|
297
|
-
if (!acc.active && curr === '~') {
|
|
298
|
-
return {
|
|
299
|
-
active: true,
|
|
300
|
-
activeInput: false,
|
|
301
|
-
list: [...acc.list, '']
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
if (acc.active) {
|
|
306
|
-
if (/[A-Z0-9_(]/.test(curr)) {
|
|
307
|
-
acc.list[acc.list.length - 1] = "".concat(acc.list[acc.list.length - 1]).concat(curr === '(' ? "\\".concat(curr) : curr);
|
|
308
|
-
|
|
309
|
-
if (curr === '(') {
|
|
310
|
-
acc.activeInput = true;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
return acc;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
if (acc.activeInput && /[A-Z0-9a-z )]/.test(curr)) {
|
|
317
|
-
acc.list[acc.list.length - 1] = "".concat(acc.list[acc.list.length - 1]).concat(curr === ')' ? "\\".concat(curr) : curr);
|
|
318
|
-
|
|
319
|
-
if (curr !== ')') {
|
|
320
|
-
return acc;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
acc.active = false;
|
|
326
|
-
acc.activeInput = false;
|
|
327
|
-
return acc;
|
|
328
|
-
}, textVariables);
|
|
329
|
-
|
|
330
|
-
var _loop4 = function _loop4(_i3) {
|
|
331
|
-
var textVariable = textVariables.list[_i3];
|
|
332
|
-
var replaceValue = void 0;
|
|
333
|
-
var canReplace = true;
|
|
334
|
-
|
|
335
|
-
switch (textVariable) {
|
|
336
|
-
case 'NAME':
|
|
337
|
-
replaceValue = processedEvent.monitoringPoint.name;
|
|
338
|
-
break;
|
|
339
|
-
|
|
340
|
-
case 'LOCATION':
|
|
341
|
-
replaceValue = processedEvent.location;
|
|
342
|
-
break;
|
|
343
|
-
|
|
344
|
-
case 'MODULE_NAME':
|
|
345
|
-
replaceValue = processedEvent.module.name;
|
|
346
|
-
break;
|
|
347
|
-
|
|
348
|
-
case 'EVENT_ID':
|
|
349
|
-
replaceValue = processedEvent.id;
|
|
350
|
-
break;
|
|
351
|
-
|
|
352
|
-
case 'EVENT_NAME':
|
|
353
|
-
replaceValue = processedEvent.name;
|
|
354
|
-
break;
|
|
355
|
-
|
|
356
|
-
case 'DATE_TIME':
|
|
357
|
-
{
|
|
358
|
-
var datetime = new Date(processedEvent.respondDateTime ? processedEvent.respondDateTime : processedEvent.startDateTime);
|
|
359
|
-
replaceValue = "".concat(intl.formatDate(datetime), " ").concat(intl.formatTime(datetime));
|
|
360
|
-
break;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
case 'DATE':
|
|
364
|
-
replaceValue = intl.formatDate(new Date(processedEvent.respondDateTime ? processedEvent.respondDateTime : processedEvent.startDateTime));
|
|
365
|
-
break;
|
|
366
|
-
|
|
367
|
-
case 'TIME':
|
|
368
|
-
replaceValue = intl.formatTime(new Date(processedEvent.respondDateTime ? processedEvent.respondDateTime : processedEvent.startDateTime));
|
|
369
|
-
break;
|
|
370
|
-
|
|
371
|
-
case 'START_DATE_TIME':
|
|
372
|
-
{
|
|
373
|
-
var _datetime = new Date(processedEvent.startDateTime);
|
|
374
|
-
|
|
375
|
-
replaceValue = "".concat(intl.formatDate(_datetime), " ").concat(intl.formatTime(_datetime));
|
|
376
|
-
break;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
case 'ELAPSED_TIME':
|
|
380
|
-
replaceValue = processedEvent.startDateTimeFormatted;
|
|
381
|
-
break;
|
|
382
|
-
|
|
383
|
-
default:
|
|
384
|
-
{
|
|
385
|
-
if (textVariable.startsWith('NAME\\(') && textVariable.endsWith('\\)')) {
|
|
386
|
-
replaceValue = textVariable.split('NAME\\(').join('').split('\\)').join('');
|
|
387
|
-
replaceValue = replaceValue.toUpperCase();
|
|
388
|
-
|
|
389
|
-
if (replaceValue) {
|
|
390
|
-
var replaceIndex = 0;
|
|
391
|
-
|
|
392
|
-
if (replaceValue === 'FIRST') {
|
|
393
|
-
replaceIndex = 1;
|
|
394
|
-
} else if (replaceValue === 'LAST') {
|
|
395
|
-
replaceIndex = processedEvent.alerts ? processedEvent.alerts.length : 0;
|
|
396
|
-
} else if (Number.isInteger(parseInt(replaceValue, 10))) {
|
|
397
|
-
replaceIndex = parseInt(replaceValue, 10);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
if (replaceIndex > 0 && processedEvent.alerts && replaceIndex <= processedEvent.alerts.length) {
|
|
401
|
-
var currentMonitoringPoint = processedEvent.moduleConfiguration.moduleConfiguration.monitoringPoints.find(mp => mp.id === processedEvent.alerts[replaceIndex - 1].id);
|
|
402
|
-
|
|
403
|
-
if (currentMonitoringPoint && currentMonitoringPoint.communicationPaths) {
|
|
404
|
-
replaceValue = currentMonitoringPoint.name;
|
|
405
|
-
} else {
|
|
406
|
-
canReplace = false;
|
|
407
|
-
}
|
|
408
|
-
} else {
|
|
409
|
-
canReplace = false;
|
|
410
|
-
}
|
|
411
|
-
} else {
|
|
412
|
-
canReplace = false;
|
|
413
|
-
}
|
|
414
|
-
} else if (textVariable.startsWith('VALUE\\(') && textVariable.endsWith('\\)')) {
|
|
415
|
-
replaceValue = textVariable.split('VALUE\\(').join('').split('\\)').join('');
|
|
416
|
-
replaceValue = replaceValue.toUpperCase();
|
|
417
|
-
|
|
418
|
-
if (replaceValue) {
|
|
419
|
-
var currentData = processedEvent.data.find(d => d.dataField.name.toUpperCase() === replaceValue);
|
|
420
|
-
|
|
421
|
-
if (currentData) {
|
|
422
|
-
replaceValue = currentData.dataValue.value;
|
|
423
|
-
} else if (processedEvent.parentId !== null && processedEvent.parentId.length > 0) {
|
|
424
|
-
var pEvents = _this.getParentEvents(processedEvent.parentId);
|
|
425
|
-
|
|
426
|
-
var found = false;
|
|
427
|
-
|
|
428
|
-
for (var peIndex = 0; peIndex < pEvents.length; peIndex++) {
|
|
429
|
-
var pEvent = pEvents[peIndex]; // eslint-disable-next-line no-loop-func
|
|
430
|
-
|
|
431
|
-
var parentData = pEvent.data.find(d => d.dataField.name.toUpperCase() === replaceValue);
|
|
432
|
-
|
|
433
|
-
if (parentData) {
|
|
434
|
-
replaceValue = parentData.dataValue.value;
|
|
435
|
-
found = true;
|
|
436
|
-
break;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
if (!found) {
|
|
441
|
-
canReplace = false;
|
|
442
|
-
}
|
|
443
|
-
} else {
|
|
444
|
-
canReplace = false;
|
|
445
|
-
}
|
|
446
|
-
} else {
|
|
447
|
-
canReplace = false;
|
|
448
|
-
}
|
|
449
|
-
} else {
|
|
450
|
-
canReplace = false;
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
if (canReplace) {
|
|
456
|
-
newMessageProceessed = newMessageProceessed.replace(new RegExp("~".concat(textVariable)), "".concat(replaceValue));
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
for (var _i3 = 0; _i3 < textVariables.list.length; _i3++) {
|
|
461
|
-
_loop4(_i3);
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
processedEvent.messageProceessed = newMessageProceessed;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
return processedEvent;
|
|
468
|
-
}).filter(event => event.messageProceessed);
|
|
469
|
-
messagingDashboardProcessed.custom = {
|
|
470
|
-
rowProperties: eventsProcessed.length > 0 ? Array.from({
|
|
471
|
-
length: messagingDashboard.messagesPerDisplay
|
|
472
|
-
}, () => ({
|
|
473
|
-
height: 1
|
|
474
|
-
})) : [{
|
|
475
|
-
height: 1
|
|
476
|
-
}],
|
|
477
|
-
columnProperties: messagingDashboard.showElapsedTime && eventsProcessed.length > 0 ? [{
|
|
478
|
-
width: 4
|
|
479
|
-
}, {
|
|
480
|
-
width: 1
|
|
481
|
-
}] : [{
|
|
482
|
-
width: 1
|
|
483
|
-
}],
|
|
484
|
-
gridTemplateRows: eventsProcessed.length > 0 ? '1fr '.repeat(messagingDashboard.messagesPerDisplay) : '1fr',
|
|
485
|
-
gridTemplateColumns: messagingDashboard.showElapsedTime && eventsProcessed.length > 0 ? '4fr 1fr' : '1fr'
|
|
486
|
-
};
|
|
487
|
-
var elapsedTime = 0;
|
|
488
|
-
var viewIndex = 1;
|
|
489
|
-
var neededDisplays = 0;
|
|
490
|
-
|
|
491
|
-
if (timestamp && eventsProcessed.length > 0) {
|
|
492
|
-
elapsedTime = Math.floor((new Date() - timestamp) / 1000);
|
|
493
|
-
|
|
494
|
-
if (elapsedTime === 0) {
|
|
495
|
-
elapsedTime = 1;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
neededDisplays = Math.ceil(eventsProcessed.length / messagingDashboardProcessed.messagesPerDisplay);
|
|
499
|
-
var cycleTime = neededDisplays * messagingDashboardProcessed.timePerDisplay;
|
|
500
|
-
elapsedTime -= (Math.ceil(elapsedTime / cycleTime) - 1) * cycleTime;
|
|
501
|
-
viewIndex = Math.ceil(elapsedTime / messagingDashboardProcessed.timePerDisplay);
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
505
|
-
style: style.root
|
|
506
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
507
|
-
style: _objectSpread(_objectSpread({}, style.preview), {}, {
|
|
508
|
-
height: messagingDashboard.showFooter ? '95%' : '100%'
|
|
509
|
-
}),
|
|
510
|
-
ref: element => {
|
|
511
|
-
this.updateElementDimensions(element);
|
|
512
|
-
}
|
|
513
|
-
}, /*#__PURE__*/_react.default.createElement(_DashboardsViewer.default, {
|
|
514
|
-
viewColor: viewColor,
|
|
515
|
-
viewWidth: viewWidth,
|
|
516
|
-
viewHeight: viewHeight,
|
|
517
|
-
previewColor: previewColor,
|
|
518
|
-
alignItems: messagingDashboard.ratio.verticalAlignment,
|
|
519
|
-
justifyContent: messagingDashboard.ratio.horizontalAlignment
|
|
520
|
-
}, /*#__PURE__*/_react.default.createElement(_DashboardsGrid.default, {
|
|
521
|
-
gap: gap,
|
|
522
|
-
rowProperties: messagingDashboardProcessed.custom.rowProperties,
|
|
523
|
-
gridTemplateRows: messagingDashboardProcessed.custom.gridTemplateRows,
|
|
524
|
-
columnProperties: messagingDashboardProcessed.custom.columnProperties,
|
|
525
|
-
gridTemplateColumns: messagingDashboardProcessed.custom.gridTemplateColumns
|
|
526
|
-
}, eventsProcessed.length > 0 ? eventsProcessed.slice(messagingDashboardProcessed.messagesPerDisplay * viewIndex - messagingDashboardProcessed.messagesPerDisplay, messagingDashboardProcessed.messagesPerDisplay * viewIndex).reduce((accumulator, event) => {
|
|
527
|
-
accumulator.push(event);
|
|
528
|
-
|
|
529
|
-
if (messagingDashboardProcessed.showElapsedTime) {
|
|
530
|
-
accumulator.push(event);
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
return accumulator;
|
|
534
|
-
}, []).map((event, index) => {
|
|
535
|
-
if (messagingDashboardProcessed.showElapsedTime && index % 2 !== 0) {
|
|
536
|
-
return /*#__PURE__*/_react.default.createElement(_DashboardsCell.default, {
|
|
537
|
-
key: String("1-".concat(index)),
|
|
538
|
-
cell: {
|
|
539
|
-
columnSpan: 1,
|
|
540
|
-
rowSpan: 1,
|
|
541
|
-
content: {
|
|
542
|
-
type: 'text',
|
|
543
|
-
text: event.startDateTimeFormatted
|
|
544
|
-
},
|
|
545
|
-
custom: _objectSpread(_objectSpread({}, event.custom), {}, {
|
|
546
|
-
style: _objectSpread({
|
|
547
|
-
backgroundColor: 'white',
|
|
548
|
-
justifyContent: 'center',
|
|
549
|
-
alignItems: 'center'
|
|
550
|
-
}, event.custom.style)
|
|
551
|
-
})
|
|
552
|
-
}
|
|
553
|
-
});
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
return /*#__PURE__*/_react.default.createElement(_DashboardsCell.default, {
|
|
557
|
-
key: String("1-".concat(index)),
|
|
558
|
-
cell: {
|
|
559
|
-
columnSpan: 1,
|
|
560
|
-
rowSpan: 1,
|
|
561
|
-
content: {
|
|
562
|
-
type: 'text',
|
|
563
|
-
text: event.messageProceessed
|
|
564
|
-
},
|
|
565
|
-
custom: _objectSpread(_objectSpread({}, event.custom), {}, {
|
|
566
|
-
style: _objectSpread({
|
|
567
|
-
backgroundColor: 'white',
|
|
568
|
-
alignItems: 'center'
|
|
569
|
-
}, event.custom.style)
|
|
570
|
-
})
|
|
571
|
-
}
|
|
572
|
-
});
|
|
573
|
-
}) : Array.from({
|
|
574
|
-
length: 1
|
|
575
|
-
}, () => /*#__PURE__*/_react.default.createElement(_DashboardsCell.default, {
|
|
576
|
-
key: String('9999-9999'),
|
|
577
|
-
cell: {
|
|
578
|
-
content: {
|
|
579
|
-
type: 'text',
|
|
580
|
-
text: messagingDashboard.noActiveAlerts
|
|
581
|
-
},
|
|
582
|
-
custom: {
|
|
583
|
-
viewWidth: viewWidth,
|
|
584
|
-
viewHeight: viewHeight,
|
|
585
|
-
style: _objectSpread({
|
|
586
|
-
backgroundColor: 'white',
|
|
587
|
-
justifyContent: 'center',
|
|
588
|
-
alignItems: 'center'
|
|
589
|
-
}, styleId ? _objectSpread({}, styleId.options) : {})
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
}))))), messagingDashboard.showFooter ? /*#__PURE__*/_react.default.createElement("div", {
|
|
593
|
-
style: {
|
|
594
|
-
height: '5%'
|
|
595
|
-
}
|
|
596
|
-
}, /*#__PURE__*/_react.default.createElement(_DashboardsStatusBar.default, {
|
|
597
|
-
height: Math.floor(previewHeight * 0.05)
|
|
598
|
-
})) : null);
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
DashboardsMainMessaging.propTypes = {
|
|
604
|
-
gap: _propTypes.default.string,
|
|
605
|
-
viewColor: _propTypes.default.string,
|
|
606
|
-
previewColor: _propTypes.default.string,
|
|
607
|
-
intl: _propTypes.default.shape().isRequired,
|
|
608
|
-
events: _propTypes.default.arrayOf(_propTypes.default.shape()),
|
|
609
|
-
parentEvents: _propTypes.default.arrayOf(_propTypes.default.shape()),
|
|
610
|
-
styles: _propTypes.default.arrayOf(_propTypes.default.shape()),
|
|
611
|
-
messagingDashboard: _propTypes.default.shape().isRequired,
|
|
612
|
-
definedMessages: _propTypes.default.arrayOf(_propTypes.default.shape()),
|
|
613
|
-
moduleConfigurations: _propTypes.default.arrayOf(_propTypes.default.shape())
|
|
614
|
-
};
|
|
615
|
-
DashboardsMainMessaging.defaultProps = {
|
|
616
|
-
events: [],
|
|
617
|
-
parentEvents: [],
|
|
618
|
-
styles: [],
|
|
619
|
-
gap: 'unset',
|
|
620
|
-
viewColor: 'black',
|
|
621
|
-
definedMessages: [],
|
|
622
|
-
previewColor: 'black',
|
|
623
|
-
moduleConfigurations: []
|
|
624
|
-
};
|
|
625
|
-
|
|
626
|
-
var _default = (0, _reactIntl.injectIntl)(DashboardsMainMessaging);
|
|
627
|
-
|
|
628
|
-
exports.default = _default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _DashboardsMainMessaging.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
var _DashboardsMainMessaging = _interopRequireDefault(require("./DashboardsMainMessaging"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|