@camunda/task-testing 0.2.4 → 0.2.6
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/LICENSE +20 -20
- package/README.md +34 -34
- package/dist/index.js +641 -407
- package/dist/index.js.map +1 -1
- package/package.json +94 -91
package/dist/index.js
CHANGED
|
@@ -11,8 +11,8 @@ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
|
11
11
|
|
|
12
12
|
__webpack_require__.r(__webpack_exports__);
|
|
13
13
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14
|
-
/* harmony export */
|
|
15
|
-
/* harmony export */
|
|
14
|
+
/* harmony export */ DEFAULT_CONFIG: () => (/* binding */ DEFAULT_CONFIG),
|
|
15
|
+
/* harmony export */ ElementConfig: () => (/* binding */ ElementConfig)
|
|
16
16
|
/* harmony export */ });
|
|
17
17
|
/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! events */ "./node_modules/events/events.js");
|
|
18
18
|
/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_0__);
|
|
@@ -33,8 +33,8 @@ class ElementConfig extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
33
33
|
this._injector = injector;
|
|
34
34
|
this._elementVariables = elementVariables;
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
* @type {import('./types').Config}
|
|
36
|
+
/**
|
|
37
|
+
* @type {import('./types').Config}
|
|
38
38
|
*/
|
|
39
39
|
this._config = {
|
|
40
40
|
...DEFAULT_CONFIG,
|
|
@@ -98,19 +98,19 @@ class ElementConfig extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
98
98
|
};
|
|
99
99
|
this.emit('config.changed');
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
getInputConfigForElement(element) {
|
|
102
102
|
if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.isAny)(element, SUPPORTED_ELEMENT_TYPES)) {
|
|
103
103
|
throw new Error(`Unsupported element type: ${element.type}`);
|
|
104
104
|
}
|
|
105
105
|
if (!(0,min_dash__WEBPACK_IMPORTED_MODULE_2__.isString)(this._config.input[element.id])) {
|
|
106
|
-
return this._getDefaultInputConfig(
|
|
106
|
+
return this._getDefaultInputConfig();
|
|
107
107
|
}
|
|
108
108
|
return this._config.input[element.id];
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
/**
|
|
112
|
-
* @param {import('./types').Element} element
|
|
113
|
-
* @returns {import('./types').ElementOutput}
|
|
111
|
+
/**
|
|
112
|
+
* @param {import('./types').Element} element
|
|
113
|
+
* @returns {import('./types').ElementOutput}
|
|
114
114
|
*/
|
|
115
115
|
getOutputConfigForElement(element) {
|
|
116
116
|
if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.isAny)(element, SUPPORTED_ELEMENT_TYPES)) {
|
|
@@ -121,175 +121,9 @@ class ElementConfig extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
121
121
|
}
|
|
122
122
|
return this._config.output[element.id];
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return createDefaultInputConfig(element, variables);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Get input parameters from a BPMN element.
|
|
132
|
-
*
|
|
133
|
-
* @param {import('./types').Element} element
|
|
134
|
-
*
|
|
135
|
-
* @returns {import('./types').ModdleElement[]}
|
|
136
|
-
*/
|
|
137
|
-
function getInputParameters(element) {
|
|
138
|
-
const businessObject = (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.getBusinessObject)(element);
|
|
139
|
-
const extensionElements = businessObject.get('extensionElements');
|
|
140
|
-
if (!extensionElements) {
|
|
141
|
-
return [];
|
|
142
|
-
}
|
|
143
|
-
const values = extensionElements.get('values');
|
|
144
|
-
if (!values) {
|
|
145
|
-
return [];
|
|
146
|
-
}
|
|
147
|
-
const ioMapping = values.find(value => (0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(value, 'zeebe:IoMapping'));
|
|
148
|
-
if (!ioMapping) {
|
|
149
|
-
return [];
|
|
150
|
-
}
|
|
151
|
-
return ioMapping.get('inputParameters');
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Unflatten an object with dot notation keys into a nested object.
|
|
156
|
-
*
|
|
157
|
-
* Example:
|
|
158
|
-
*
|
|
159
|
-
* ```
|
|
160
|
-
* unflatten({
|
|
161
|
-
* 'foo.bar': 'baz'
|
|
162
|
-
* }) // returns { foo: { bar: 'baz' } }
|
|
163
|
-
* ```
|
|
164
|
-
*
|
|
165
|
-
* @param {Object} obj
|
|
166
|
-
*
|
|
167
|
-
* @returns {Object}
|
|
168
|
-
*/
|
|
169
|
-
function unflatten(obj) {
|
|
170
|
-
const result = {};
|
|
171
|
-
for (const [path, value] of Object.entries(obj)) {
|
|
172
|
-
const parts = path.split('.');
|
|
173
|
-
const lastKey = parts.pop();
|
|
174
|
-
let current = result;
|
|
175
|
-
for (const part of parts) {
|
|
176
|
-
if (!(part in current)) {
|
|
177
|
-
current[part] = {};
|
|
178
|
-
}
|
|
179
|
-
current = current[part];
|
|
180
|
-
}
|
|
181
|
-
current[lastKey] = value;
|
|
182
|
-
}
|
|
183
|
-
return result;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Create default input config for a BPMN element.
|
|
188
|
-
*
|
|
189
|
-
* @todo Only simple input parameter sources can be handled until
|
|
190
|
-
* https://github.com/bpmn-io/internal-docs/issues/1218 is implemented.
|
|
191
|
-
*
|
|
192
|
-
* @param {import('./types').Element} element
|
|
193
|
-
* @param {import('./types').Variable[]} variablesForElement
|
|
194
|
-
*
|
|
195
|
-
* @returns {string}
|
|
196
|
-
*/
|
|
197
|
-
function createDefaultInputConfig(element, variablesForElement) {
|
|
198
|
-
const inputParameters = getInputParameters(element);
|
|
199
|
-
const foundVariables = inputParameters.reduce((foundVariables, inputParameter) => {
|
|
200
|
-
const source = inputParameter.get('source'),
|
|
201
|
-
target = inputParameter.get('target');
|
|
202
|
-
const variable = variablesForElement.find(({
|
|
203
|
-
name
|
|
204
|
-
}) => name === target);
|
|
205
|
-
if (!variable) {
|
|
206
|
-
return foundVariables;
|
|
207
|
-
}
|
|
208
|
-
const {
|
|
209
|
-
name,
|
|
210
|
-
type
|
|
211
|
-
} = variable;
|
|
212
|
-
|
|
213
|
-
// for context inputs, we cannot determine the structure, so we
|
|
214
|
-
// just create an empty object
|
|
215
|
-
if (type === 'Context') {
|
|
216
|
-
return {
|
|
217
|
-
...foundVariables,
|
|
218
|
-
[name]: {}
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// only handle simple sources for now
|
|
223
|
-
if (isFeel(source) && !isBoolean(source)) {
|
|
224
|
-
const nameFromSource = getNameFromSource(source);
|
|
225
|
-
if (nameFromSource) {
|
|
226
|
-
return {
|
|
227
|
-
...foundVariables,
|
|
228
|
-
[nameFromSource]: ''
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
return foundVariables;
|
|
233
|
-
}, {});
|
|
234
|
-
return JSON.stringify(unflatten(foundVariables), null, 2);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Get the name from a source string.
|
|
239
|
-
*
|
|
240
|
-
* @example
|
|
241
|
-
*
|
|
242
|
-
* getNameFromSource('=foo') // 'foo'
|
|
243
|
-
* getNameFromSource('=foo + bar') // null
|
|
244
|
-
* getNameFromSource('= 1 + 2') // null
|
|
245
|
-
*
|
|
246
|
-
* @param {string} source
|
|
247
|
-
*
|
|
248
|
-
* @returns {string|null}
|
|
249
|
-
*/
|
|
250
|
-
function getNameFromSource(source) {
|
|
251
|
-
if (source && isFeel(source)) {
|
|
252
|
-
const name = source.slice(1).trim();
|
|
253
|
-
if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(name)) {
|
|
254
|
-
return name;
|
|
255
|
-
}
|
|
124
|
+
_getDefaultInputConfig() {
|
|
125
|
+
return '{}';
|
|
256
126
|
}
|
|
257
|
-
return null;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* Check if a source string is a FEEL expression.
|
|
262
|
-
*
|
|
263
|
-
* @example
|
|
264
|
-
*
|
|
265
|
-
* isFeel('=foo') // true
|
|
266
|
-
* isFeel('= 1 + 2') // true
|
|
267
|
-
* isFeel('foo') // false
|
|
268
|
-
*
|
|
269
|
-
* @param {string} source
|
|
270
|
-
*
|
|
271
|
-
* @returns {boolean}
|
|
272
|
-
*/
|
|
273
|
-
function isFeel(source) {
|
|
274
|
-
return !!source && source.startsWith('=');
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Check if a source string is a boolean FEEL expression.
|
|
279
|
-
*
|
|
280
|
-
* @example
|
|
281
|
-
*
|
|
282
|
-
* isBoolean('=true') // true
|
|
283
|
-
* isBoolean('= false') // true
|
|
284
|
-
* isBoolean('=foo') // false
|
|
285
|
-
* isBoolean('=1 + 2') // false
|
|
286
|
-
*
|
|
287
|
-
* @param {string} source
|
|
288
|
-
*
|
|
289
|
-
* @return {boolean}
|
|
290
|
-
*/
|
|
291
|
-
function isBoolean(source) {
|
|
292
|
-
return !!source && /^=\s*(true|false)\s*$/i.test(source);
|
|
293
127
|
}
|
|
294
128
|
|
|
295
129
|
/***/ }),
|
|
@@ -352,33 +186,33 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
352
186
|
/* harmony export */ });
|
|
353
187
|
/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! events */ "./node_modules/events/events.js");
|
|
354
188
|
/* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_0__);
|
|
355
|
-
/**
|
|
356
|
-
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
357
|
-
* under one or more contributor license agreements. See the NOTICE file
|
|
358
|
-
* distributed with this work for additional information regarding copyright
|
|
359
|
-
* ownership.
|
|
360
|
-
*
|
|
361
|
-
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
362
|
-
* except in compliance with the MIT License.
|
|
189
|
+
/**
|
|
190
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
191
|
+
* under one or more contributor license agreements. See the NOTICE file
|
|
192
|
+
* distributed with this work for additional information regarding copyright
|
|
193
|
+
* ownership.
|
|
194
|
+
*
|
|
195
|
+
* Camunda licenses this file to you under the MIT; you may not use this file
|
|
196
|
+
* except in compliance with the MIT License.
|
|
363
197
|
*/
|
|
364
198
|
|
|
365
199
|
|
|
366
200
|
const INTERVAL_MS = 1000;
|
|
367
201
|
|
|
368
|
-
/**
|
|
369
|
-
* @import { TaskExecutionApi, TaskExecutionResult, TaskExecutionError, TaskExecutionStatus } from './types';
|
|
202
|
+
/**
|
|
203
|
+
* @import { TaskExecutionApi, TaskExecutionResult, TaskExecutionError, TaskExecutionStatus } from './types';
|
|
370
204
|
*/
|
|
371
205
|
|
|
372
|
-
/**
|
|
373
|
-
* Emits:
|
|
374
|
-
* - `taskExecution.status.changed` with one of {@link TaskExecutionStatus}
|
|
375
|
-
* - `taskExecution.finished` with {@link TaskExecutionResult}
|
|
376
|
-
* - `taskExecution.error` with {@link TaskExecutionError}
|
|
206
|
+
/**
|
|
207
|
+
* Emits:
|
|
208
|
+
* - `taskExecution.status.changed` with one of {@link TaskExecutionStatus}
|
|
209
|
+
* - `taskExecution.finished` with {@link TaskExecutionResult}
|
|
210
|
+
* - `taskExecution.error` with {@link TaskExecutionError}
|
|
377
211
|
*/
|
|
378
212
|
class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
379
|
-
/**
|
|
380
|
-
* @param {Object} injector
|
|
381
|
-
* @param {TaskExecutionApi} api
|
|
213
|
+
/**
|
|
214
|
+
* @param {Object} injector
|
|
215
|
+
* @param {TaskExecutionApi} api
|
|
382
216
|
*/
|
|
383
217
|
constructor(injector, api) {
|
|
384
218
|
super();
|
|
@@ -391,18 +225,20 @@ class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
391
225
|
this._status = 'idle';
|
|
392
226
|
const eventBus = injector.get('eventBus');
|
|
393
227
|
eventBus.on(['selection.changed', 'commandStack.changed'], () => {
|
|
228
|
+
if (this._status !== 'idle') {
|
|
229
|
+
this.emit('taskExecution.interrupted');
|
|
230
|
+
}
|
|
394
231
|
this.cancelTaskExecution();
|
|
395
|
-
this.emit('taskExecution.interrupted');
|
|
396
232
|
});
|
|
397
233
|
}
|
|
398
234
|
|
|
399
|
-
/**
|
|
400
|
-
* Start task execution.
|
|
401
|
-
*
|
|
402
|
-
* @param {string} elementId
|
|
403
|
-
* @param {Object} variables
|
|
404
|
-
*
|
|
405
|
-
* @returns {Promise<void>}
|
|
235
|
+
/**
|
|
236
|
+
* Start task execution.
|
|
237
|
+
*
|
|
238
|
+
* @param {string} elementId
|
|
239
|
+
* @param {Object} variables
|
|
240
|
+
*
|
|
241
|
+
* @returns {Promise<void>}
|
|
406
242
|
*/
|
|
407
243
|
async executeTask(elementId, variables) {
|
|
408
244
|
this._changeStatus('deploying');
|
|
@@ -496,8 +332,8 @@ class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
496
332
|
this._interval = setInterval(intervalCallback, INTERVAL_MS);
|
|
497
333
|
}
|
|
498
334
|
|
|
499
|
-
/**
|
|
500
|
-
* Cancel current task execution, clean up and change status to `idle`.
|
|
335
|
+
/**
|
|
336
|
+
* Cancel current task execution, clean up and change status to `idle`.
|
|
501
337
|
*/
|
|
502
338
|
async cancelTaskExecution() {
|
|
503
339
|
// TODO: Proper clean up:
|
|
@@ -511,11 +347,11 @@ class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
511
347
|
this._changeStatus('idle');
|
|
512
348
|
}
|
|
513
349
|
|
|
514
|
-
/**
|
|
515
|
-
* Emit `taskExecution.error` event.
|
|
516
|
-
*
|
|
517
|
-
* @param {string} message
|
|
518
|
-
* @param {any} [response]
|
|
350
|
+
/**
|
|
351
|
+
* Emit `taskExecution.error` event.
|
|
352
|
+
*
|
|
353
|
+
* @param {string} message
|
|
354
|
+
* @param {any} [response]
|
|
519
355
|
*/
|
|
520
356
|
_emitError(message, response) {
|
|
521
357
|
/** @type {import('./types').TaskExecutionError} */
|
|
@@ -536,12 +372,12 @@ class TaskExecution extends (events__WEBPACK_IMPORTED_MODULE_0___default()) {
|
|
|
536
372
|
}
|
|
537
373
|
}
|
|
538
374
|
|
|
539
|
-
/**
|
|
540
|
-
* Get the process ID from the deployment response.
|
|
541
|
-
*
|
|
542
|
-
* @param {import('./types').DeploymentResponse} [response]
|
|
543
|
-
*
|
|
544
|
-
* @returns {string|null} The process ID or null if not found.
|
|
375
|
+
/**
|
|
376
|
+
* Get the process ID from the deployment response.
|
|
377
|
+
*
|
|
378
|
+
* @param {import('./types').DeploymentResponse} [response]
|
|
379
|
+
*
|
|
380
|
+
* @returns {string|null} The process ID or null if not found.
|
|
545
381
|
*/
|
|
546
382
|
function getProcessId(response) {
|
|
547
383
|
if (!response) {
|
|
@@ -558,12 +394,12 @@ function getProcessId(response) {
|
|
|
558
394
|
return null;
|
|
559
395
|
}
|
|
560
396
|
|
|
561
|
-
/**
|
|
562
|
-
* Get the process instance key from the response.
|
|
563
|
-
*
|
|
564
|
-
* @param {import('./types').StartInstanceResponse} [response]
|
|
565
|
-
*
|
|
566
|
-
* @returns {string|null} The process instance key or null if not found.
|
|
397
|
+
/**
|
|
398
|
+
* Get the process instance key from the response.
|
|
399
|
+
*
|
|
400
|
+
* @param {import('./types').StartInstanceResponse} [response]
|
|
401
|
+
*
|
|
402
|
+
* @returns {string|null} The process instance key or null if not found.
|
|
567
403
|
*/
|
|
568
404
|
function getProcessInstanceKey(response) {
|
|
569
405
|
if (!response) {
|
|
@@ -649,7 +485,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
649
485
|
|
|
650
486
|
function Input({
|
|
651
487
|
allOutputs,
|
|
652
|
-
input,
|
|
488
|
+
input = '',
|
|
653
489
|
onErrorChange,
|
|
654
490
|
onResetInput,
|
|
655
491
|
onSetInput,
|
|
@@ -678,7 +514,7 @@ function Input({
|
|
|
678
514
|
children: "Reset"
|
|
679
515
|
})
|
|
680
516
|
})]
|
|
681
|
-
}),
|
|
517
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_InputEditor__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
|
682
518
|
allOutputs: allOutputs,
|
|
683
519
|
value: input,
|
|
684
520
|
onChange: onSetInput,
|
|
@@ -767,21 +603,21 @@ function InputEditor({
|
|
|
767
603
|
value
|
|
768
604
|
}));
|
|
769
605
|
|
|
770
|
-
/**
|
|
771
|
-
* @type {import('@codemirror/autocomplete').Completion[]}
|
|
606
|
+
/**
|
|
607
|
+
* @type {import('@codemirror/autocomplete').Completion[]}
|
|
772
608
|
*/
|
|
773
609
|
const result = [...variablesForElementAutocompletions, ...outputVariablesAutocompletions];
|
|
774
610
|
return result;
|
|
775
611
|
}, [allOutputs, variablesForElement]);
|
|
776
612
|
const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
777
613
|
|
|
778
|
-
/**
|
|
779
|
-
* @type {ReturnType<typeof useState<EditorView>>}
|
|
614
|
+
/**
|
|
615
|
+
* @type {ReturnType<typeof useState<EditorView>>}
|
|
780
616
|
*/
|
|
781
617
|
const [editorView, setEditorView] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
|
782
618
|
|
|
783
|
-
/**
|
|
784
|
-
* @type {ReturnType<typeof useState<string?>>}
|
|
619
|
+
/**
|
|
620
|
+
* @type {ReturnType<typeof useState<string?>>}
|
|
785
621
|
*/
|
|
786
622
|
const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
|
787
623
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
@@ -889,19 +725,19 @@ function getAllOutputVariables(allOutputs) {
|
|
|
889
725
|
return allOutputVariables;
|
|
890
726
|
}
|
|
891
727
|
|
|
892
|
-
/**
|
|
893
|
-
* Get a string representation of the type of a value.
|
|
894
|
-
*
|
|
895
|
-
* @example
|
|
896
|
-
*
|
|
897
|
-
* getDetail('foo') // String
|
|
898
|
-
* getDetail(1337) // Number
|
|
899
|
-
* getDetail(true) // Boolean
|
|
900
|
-
* getDetail({}) // Object
|
|
901
|
-
*
|
|
902
|
-
* @param {any} value
|
|
903
|
-
*
|
|
904
|
-
* @return {string}
|
|
728
|
+
/**
|
|
729
|
+
* Get a string representation of the type of a value.
|
|
730
|
+
*
|
|
731
|
+
* @example
|
|
732
|
+
*
|
|
733
|
+
* getDetail('foo') // String
|
|
734
|
+
* getDetail(1337) // Number
|
|
735
|
+
* getDetail(true) // Boolean
|
|
736
|
+
* getDetail({}) // Object
|
|
737
|
+
*
|
|
738
|
+
* @param {any} value
|
|
739
|
+
*
|
|
740
|
+
* @return {string}
|
|
905
741
|
*/
|
|
906
742
|
function getDetail(value) {
|
|
907
743
|
const type = typeof value;
|
|
@@ -946,17 +782,17 @@ const TASK_EXECUTION_STATUS_LABEL = {
|
|
|
946
782
|
executing: 'Waiting for task to be completed...'
|
|
947
783
|
};
|
|
948
784
|
|
|
949
|
-
/**
|
|
950
|
-
* @param {Object} props
|
|
951
|
-
* @param {boolean} props.isConnectionConfigured
|
|
952
|
-
* @param {string} [props.configureConnectionBannerTitle]
|
|
953
|
-
* @param {string} [props.configureConnectionBannerDescription]
|
|
954
|
-
* @param {string} [props.configureConnectionLabel]
|
|
955
|
-
* @param {Function} [props.onConfigureConnection]
|
|
956
|
-
* @param {boolean} props.isTaskExecuting
|
|
957
|
-
* @param {import('../../types').ElementOutput} props.output
|
|
958
|
-
* @param {Function} props.onResetOutput
|
|
959
|
-
* @param {import('../../types').TaskExecutionStatus} props.taskExecutionStatus
|
|
785
|
+
/**
|
|
786
|
+
* @param {Object} props
|
|
787
|
+
* @param {boolean} props.isConnectionConfigured
|
|
788
|
+
* @param {string} [props.configureConnectionBannerTitle]
|
|
789
|
+
* @param {string} [props.configureConnectionBannerDescription]
|
|
790
|
+
* @param {string} [props.configureConnectionLabel]
|
|
791
|
+
* @param {Function} [props.onConfigureConnection]
|
|
792
|
+
* @param {boolean} props.isTaskExecuting
|
|
793
|
+
* @param {import('../../types').ElementOutput} props.output
|
|
794
|
+
* @param {Function} props.onResetOutput
|
|
795
|
+
* @param {import('../../types').TaskExecutionStatus} props.taskExecutionStatus
|
|
960
796
|
*/
|
|
961
797
|
function Output({
|
|
962
798
|
isConnectionConfigured,
|
|
@@ -988,6 +824,7 @@ function Output({
|
|
|
988
824
|
});
|
|
989
825
|
}, [output, isTaskExecuting, isConnectionConfigured]);
|
|
990
826
|
const showResetButton = isConnectionConfigured && ((output === null || output === void 0 ? void 0 : output.success) || (output === null || output === void 0 ? void 0 : output.error) || (output === null || output === void 0 ? void 0 : output.incident));
|
|
827
|
+
const showOperateUrl = isConnectionConfigured && (output === null || output === void 0 ? void 0 : output.operateUrl);
|
|
991
828
|
const headerText = isTaskExecuting ? TASK_EXECUTION_STATUS_LABEL[taskExecutionStatus] : 'Results';
|
|
992
829
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
|
993
830
|
className: "output",
|
|
@@ -1007,7 +844,7 @@ function Output({
|
|
|
1007
844
|
tooltipPosition: "right",
|
|
1008
845
|
iconDescription: "Reset output",
|
|
1009
846
|
children: "Reset"
|
|
1010
|
-
}),
|
|
847
|
+
}), showOperateUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Link, {
|
|
1011
848
|
href: output.operateUrl,
|
|
1012
849
|
target: "_blank",
|
|
1013
850
|
className: "output__header--button-operate",
|
|
@@ -1058,7 +895,7 @@ function OutputBanner({
|
|
|
1058
895
|
} : {};
|
|
1059
896
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(ErrorBanner, {
|
|
1060
897
|
title: "Task execution failed",
|
|
1061
|
-
description: `Incident: ${output.incident.
|
|
898
|
+
description: `Incident: ${output.incident.errorType}`,
|
|
1062
899
|
...action
|
|
1063
900
|
});
|
|
1064
901
|
}
|
|
@@ -1134,14 +971,14 @@ function OutputVariables({
|
|
|
1134
971
|
});
|
|
1135
972
|
}
|
|
1136
973
|
|
|
1137
|
-
/**
|
|
1138
|
-
*
|
|
1139
|
-
* @param {Object} props
|
|
1140
|
-
* @param {string} props.title
|
|
1141
|
-
* @param {string} props.description
|
|
1142
|
-
* @param {string} [props.actionLabel]
|
|
1143
|
-
* @param {string} [props.actionUrl]
|
|
1144
|
-
* @param {Function} [props.onActionClick]
|
|
974
|
+
/**
|
|
975
|
+
*
|
|
976
|
+
* @param {Object} props
|
|
977
|
+
* @param {string} props.title
|
|
978
|
+
* @param {string} props.description
|
|
979
|
+
* @param {string} [props.actionLabel]
|
|
980
|
+
* @param {string} [props.actionUrl]
|
|
981
|
+
* @param {Function} [props.onActionClick]
|
|
1145
982
|
*/
|
|
1146
983
|
function ErrorBanner({
|
|
1147
984
|
title,
|
|
@@ -1152,35 +989,33 @@ function ErrorBanner({
|
|
|
1152
989
|
}) {
|
|
1153
990
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
|
1154
991
|
className: "output__error",
|
|
1155
|
-
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.
|
|
1156
|
-
className: "output__error--
|
|
1157
|
-
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
|
|
1163
|
-
children: title
|
|
1164
|
-
}), actionLabel && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Link, {
|
|
992
|
+
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
|
993
|
+
className: "output__error--title",
|
|
994
|
+
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
|
|
995
|
+
children: title
|
|
996
|
+
}), actionLabel && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
|
997
|
+
className: "output__error--action",
|
|
998
|
+
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Link, {
|
|
1165
999
|
href: actionUrl,
|
|
1166
1000
|
onClick: () => onActionClick(),
|
|
1167
1001
|
children: actionLabel
|
|
1168
|
-
})]
|
|
1169
|
-
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
|
1170
|
-
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
|
|
1171
|
-
children: description
|
|
1172
1002
|
})
|
|
1173
1003
|
})]
|
|
1004
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
|
1005
|
+
className: "output__error--content",
|
|
1006
|
+
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
|
|
1007
|
+
children: description
|
|
1008
|
+
})
|
|
1174
1009
|
})]
|
|
1175
1010
|
});
|
|
1176
1011
|
}
|
|
1177
1012
|
|
|
1178
|
-
/**
|
|
1179
|
-
* Print the details of an incident.
|
|
1180
|
-
*
|
|
1181
|
-
* @param {Object} incident
|
|
1182
|
-
*
|
|
1183
|
-
* @returns {string}
|
|
1013
|
+
/**
|
|
1014
|
+
* Print the details of an incident.
|
|
1015
|
+
*
|
|
1016
|
+
* @param {Object} incident
|
|
1017
|
+
*
|
|
1018
|
+
* @returns {string}
|
|
1184
1019
|
*/
|
|
1185
1020
|
function printIncident(incident) {
|
|
1186
1021
|
let text = '';
|
|
@@ -1190,16 +1025,16 @@ function printIncident(incident) {
|
|
|
1190
1025
|
return text;
|
|
1191
1026
|
}
|
|
1192
1027
|
|
|
1193
|
-
/**
|
|
1194
|
-
* Capitalize a string, adding spaces before capital letters.
|
|
1195
|
-
*
|
|
1196
|
-
* @example
|
|
1197
|
-
*
|
|
1198
|
-
* capitalize('fooBar'); // Foo Bar
|
|
1199
|
-
*
|
|
1200
|
-
* @param {string} string
|
|
1201
|
-
*
|
|
1202
|
-
* @returns {string}
|
|
1028
|
+
/**
|
|
1029
|
+
* Capitalize a string, adding spaces before capital letters.
|
|
1030
|
+
*
|
|
1031
|
+
* @example
|
|
1032
|
+
*
|
|
1033
|
+
* capitalize('fooBar'); // Foo Bar
|
|
1034
|
+
*
|
|
1035
|
+
* @param {string} string
|
|
1036
|
+
*
|
|
1037
|
+
* @returns {string}
|
|
1203
1038
|
*/
|
|
1204
1039
|
function capitalize(string) {
|
|
1205
1040
|
return string.replace(/([A-Z])/g, ' $1').replace(/^./, match => match.toUpperCase());
|
|
@@ -1238,8 +1073,8 @@ function OutputEditor({
|
|
|
1238
1073
|
}) {
|
|
1239
1074
|
const ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
1240
1075
|
|
|
1241
|
-
/**
|
|
1242
|
-
* @type {ReturnType<typeof useState<EditorView>>}
|
|
1076
|
+
/**
|
|
1077
|
+
* @type {ReturnType<typeof useState<EditorView>>}
|
|
1243
1078
|
*/
|
|
1244
1079
|
const [editorView, setEditorView] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
|
1245
1080
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
@@ -1304,7 +1139,6 @@ function OutputEditor({
|
|
|
1304
1139
|
|
|
1305
1140
|
__webpack_require__.r(__webpack_exports__);
|
|
1306
1141
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1307
|
-
/* harmony export */ NO_ELEMENT_TEXT: () => (/* binding */ NO_ELEMENT_TEXT),
|
|
1308
1142
|
/* harmony export */ "default": () => (/* binding */ TaskTesting)
|
|
1309
1143
|
/* harmony export */ });
|
|
1310
1144
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
@@ -1334,23 +1168,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1334
1168
|
|
|
1335
1169
|
|
|
1336
1170
|
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
* @param {
|
|
1341
|
-
* @param {
|
|
1342
|
-
* @param {
|
|
1343
|
-
* @param {
|
|
1344
|
-
* @param {string} [props.
|
|
1345
|
-
* @param {
|
|
1346
|
-
* @param {
|
|
1347
|
-
* @param {Function} [props.
|
|
1348
|
-
* @param {
|
|
1349
|
-
* @param {
|
|
1350
|
-
* @param {
|
|
1351
|
-
* @param {Function} [props.
|
|
1352
|
-
* @param {Function} [props.onTaskExecutionInterrupted=() => {}]
|
|
1171
|
+
/**
|
|
1172
|
+
* @param {Object} props
|
|
1173
|
+
* @param {Object} props.injector
|
|
1174
|
+
* @param {import('../../types').TaskExecutionApi} props.api
|
|
1175
|
+
* @param {boolean} props.isConnectionConfigured
|
|
1176
|
+
* @param {string} [props.configureConnectionBannerTitle]
|
|
1177
|
+
* @param {string} [props.configureConnectionBannerDescription]
|
|
1178
|
+
* @param {string} [props.configureConnectionLabel]
|
|
1179
|
+
* @param {Function} [props.onConfigureConnection]
|
|
1180
|
+
* @param {import('../../types').Config|undefined} [props.config]
|
|
1181
|
+
* @param {Function} [props.onConfigChanged=() => {}]
|
|
1182
|
+
* @param {string} [props.operateBaseUrl]
|
|
1183
|
+
* @param {string} [props.documentationUrl]
|
|
1184
|
+
* @param {Function} [props.onTaskExecutionStarted=() => {}]
|
|
1185
|
+
* @param {Function} [props.onTaskExecutionFinished=() => {}]
|
|
1186
|
+
* @param {Function} [props.onTaskExecutionInterrupted=() => {}]
|
|
1353
1187
|
*/
|
|
1188
|
+
|
|
1354
1189
|
function TaskTesting({
|
|
1355
1190
|
injector,
|
|
1356
1191
|
api,
|
|
@@ -1362,40 +1197,42 @@ function TaskTesting({
|
|
|
1362
1197
|
config,
|
|
1363
1198
|
onConfigChanged = () => {},
|
|
1364
1199
|
operateBaseUrl,
|
|
1365
|
-
|
|
1200
|
+
documentationUrl,
|
|
1201
|
+
onTaskExecutionStarted = () => {},
|
|
1202
|
+
onTaskExecutionFinished = () => {},
|
|
1366
1203
|
onTaskExecutionInterrupted = () => {}
|
|
1367
1204
|
}) {
|
|
1368
|
-
/**
|
|
1369
|
-
* @type {React.RefObject<ElementVariables?>}
|
|
1205
|
+
/**
|
|
1206
|
+
* @type {React.RefObject<ElementVariables?>}
|
|
1370
1207
|
*/
|
|
1371
1208
|
const elementVariablesRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
1372
1209
|
|
|
1373
|
-
/**
|
|
1374
|
-
* @type {React.RefObject<ElementConfig?>}
|
|
1210
|
+
/**
|
|
1211
|
+
* @type {React.RefObject<ElementConfig?>}
|
|
1375
1212
|
*/
|
|
1376
1213
|
const elementConfigRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
1377
1214
|
const [variablesForElement, setVariablesForElement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
|
1378
1215
|
|
|
1379
|
-
/**
|
|
1380
|
-
* @type {ReturnType<typeof useState<import('../../types').TaskExecutionStatus>>}
|
|
1216
|
+
/**
|
|
1217
|
+
* @type {ReturnType<typeof useState<import('../../types').TaskExecutionStatus>>}
|
|
1381
1218
|
*/
|
|
1382
1219
|
const [taskExecutionStatus, setTaskExecutionStatus] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
|
1383
1220
|
|
|
1384
|
-
/**
|
|
1385
|
-
* @type {ReturnType<typeof useState<string>>}
|
|
1221
|
+
/**
|
|
1222
|
+
* @type {ReturnType<typeof useState<string>>}
|
|
1386
1223
|
*/
|
|
1387
1224
|
const [input, setInput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
|
1388
1225
|
|
|
1389
|
-
/**
|
|
1390
|
-
* @type {ReturnType<typeof useState<import('../../types').ElementOutput>>}
|
|
1226
|
+
/**
|
|
1227
|
+
* @type {ReturnType<typeof useState<import('../../types').ElementOutput>>}
|
|
1391
1228
|
*/
|
|
1392
1229
|
const [output, setOutput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
|
|
1393
1230
|
const [allOutputs, setAllOutputs] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({});
|
|
1394
1231
|
const [inputError, setInputError] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
1395
|
-
const element = (0,_hooks_useSelectedElement__WEBPACK_IMPORTED_MODULE_4__.useSelectedElement)(injector);
|
|
1232
|
+
const [element, selectedElementMessage] = (0,_hooks_useSelectedElement__WEBPACK_IMPORTED_MODULE_4__.useSelectedElement)(injector);
|
|
1396
1233
|
|
|
1397
|
-
/**
|
|
1398
|
-
* @type {React.RefObject<TaskExecution?>}
|
|
1234
|
+
/**
|
|
1235
|
+
* @type {React.RefObject<TaskExecution?>}
|
|
1399
1236
|
*/
|
|
1400
1237
|
const taskExecutionRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
1401
1238
|
|
|
@@ -1450,7 +1287,7 @@ function TaskTesting({
|
|
|
1450
1287
|
if (!element) {
|
|
1451
1288
|
return;
|
|
1452
1289
|
}
|
|
1453
|
-
elementConfigRef.current.getInputConfigForElement(element)
|
|
1290
|
+
setInput(elementConfigRef.current.getInputConfigForElement(element));
|
|
1454
1291
|
setOutput(elementConfigRef.current.getOutputConfigForElement(element));
|
|
1455
1292
|
setAllOutputs(elementConfigRef.current.getConfig().output);
|
|
1456
1293
|
};
|
|
@@ -1474,9 +1311,9 @@ function TaskTesting({
|
|
|
1474
1311
|
});
|
|
1475
1312
|
};
|
|
1476
1313
|
|
|
1477
|
-
/**
|
|
1478
|
-
* @param {import('../../types').TaskExecutionStatus} status
|
|
1479
|
-
* @param {string} [processInstanceKey]
|
|
1314
|
+
/**
|
|
1315
|
+
* @param {import('../../types').TaskExecutionStatus} status
|
|
1316
|
+
* @param {string} [processInstanceKey]
|
|
1480
1317
|
*/
|
|
1481
1318
|
const handleStatusChange = (status, processInstanceKey) => {
|
|
1482
1319
|
setTaskExecutionStatus(status);
|
|
@@ -1499,17 +1336,21 @@ function TaskTesting({
|
|
|
1499
1336
|
...output,
|
|
1500
1337
|
operateUrl
|
|
1501
1338
|
});
|
|
1339
|
+
onTaskExecutionFinished(element, output);
|
|
1340
|
+
};
|
|
1341
|
+
const handleInterrupted = () => {
|
|
1342
|
+
onTaskExecutionInterrupted();
|
|
1502
1343
|
};
|
|
1503
1344
|
taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur = taskExecutionRef.current) === null || _taskExecutionRef$cur === void 0 || _taskExecutionRef$cur.on('taskExecution.finished', handleFinished);
|
|
1504
1345
|
taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur2 = taskExecutionRef.current) === null || _taskExecutionRef$cur2 === void 0 || _taskExecutionRef$cur2.on('taskExecution.status.changed', handleStatusChange);
|
|
1505
1346
|
taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur3 = taskExecutionRef.current) === null || _taskExecutionRef$cur3 === void 0 || _taskExecutionRef$cur3.on('taskExecution.error', handleError);
|
|
1506
|
-
taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur4 = taskExecutionRef.current) === null || _taskExecutionRef$cur4 === void 0 || _taskExecutionRef$cur4.on('taskExecution.interrupted',
|
|
1347
|
+
taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur4 = taskExecutionRef.current) === null || _taskExecutionRef$cur4 === void 0 || _taskExecutionRef$cur4.on('taskExecution.interrupted', handleInterrupted);
|
|
1507
1348
|
return () => {
|
|
1508
1349
|
if (taskExecutionRef.current) {
|
|
1509
1350
|
taskExecutionRef.current.off('taskExecution.finished', handleFinished);
|
|
1510
1351
|
taskExecutionRef.current.off('taskExecution.status.changed', handleStatusChange);
|
|
1511
1352
|
taskExecutionRef.current.off('taskExecution.error', handleError);
|
|
1512
|
-
taskExecutionRef.current.off('taskExecution.interrupted',
|
|
1353
|
+
taskExecutionRef.current.off('taskExecution.interrupted', handleInterrupted);
|
|
1513
1354
|
}
|
|
1514
1355
|
};
|
|
1515
1356
|
}, [element]);
|
|
@@ -1526,7 +1367,7 @@ function TaskTesting({
|
|
|
1526
1367
|
setInput(undefined);
|
|
1527
1368
|
return;
|
|
1528
1369
|
}
|
|
1529
|
-
elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur5 = elementConfigRef.current) === null || _elementConfigRef$cur5 === void 0
|
|
1370
|
+
setInput(elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur5 = elementConfigRef.current) === null || _elementConfigRef$cur5 === void 0 ? void 0 : _elementConfigRef$cur5.getInputConfigForElement(element));
|
|
1530
1371
|
setOutput(elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur6 = elementConfigRef.current) === null || _elementConfigRef$cur6 === void 0 ? void 0 : _elementConfigRef$cur6.getOutputConfigForElement(element));
|
|
1531
1372
|
}, [element]);
|
|
1532
1373
|
const handleSetInput = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(newInput => {
|
|
@@ -1543,14 +1384,17 @@ function TaskTesting({
|
|
|
1543
1384
|
if (!isConnectionConfigured || inputError || !element || !taskExecutionRef.current || !elementConfigRef.current) {
|
|
1544
1385
|
return;
|
|
1545
1386
|
}
|
|
1546
|
-
|
|
1387
|
+
onTaskExecutionStarted(element);
|
|
1388
|
+
const inputConfig = elementConfigRef.current.getInputConfigForElement(element);
|
|
1547
1389
|
elementConfigRef.current.setOutputConfigForElement(element, null);
|
|
1548
1390
|
taskExecutionRef.current.executeTask(element.id, JSON.parse(inputConfig));
|
|
1549
|
-
onTaskExecution();
|
|
1550
1391
|
};
|
|
1551
1392
|
const handleCancelTaskExecution = () => {
|
|
1552
|
-
|
|
1553
|
-
|
|
1393
|
+
var _taskExecutionRef$cur5;
|
|
1394
|
+
taskExecutionRef === null || taskExecutionRef === void 0 || (_taskExecutionRef$cur5 = taskExecutionRef.current) === null || _taskExecutionRef$cur5 === void 0 || _taskExecutionRef$cur5.cancelTaskExecution();
|
|
1395
|
+
if (output !== null && output !== void 0 && output.operateUrl && Object.keys(output).length === 1) {
|
|
1396
|
+
var _elementConfigRef$cur7;
|
|
1397
|
+
elementConfigRef === null || elementConfigRef === void 0 || (_elementConfigRef$cur7 = elementConfigRef.current) === null || _elementConfigRef$cur7 === void 0 || _elementConfigRef$cur7.setOutputConfigForElement(element, null);
|
|
1554
1398
|
}
|
|
1555
1399
|
};
|
|
1556
1400
|
const handleResetOutput = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
|
|
@@ -1574,15 +1418,32 @@ function TaskTesting({
|
|
|
1574
1418
|
className: "task-testing__container task-testing__container--empty",
|
|
1575
1419
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
|
|
1576
1420
|
className: "task-testing__container-no-element",
|
|
1577
|
-
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.Cursor_1, {}),
|
|
1578
|
-
children:
|
|
1421
|
+
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.Cursor_1, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
|
|
1422
|
+
children: selectedElementMessage
|
|
1423
|
+
}), documentationUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Link, {
|
|
1424
|
+
href: documentationUrl,
|
|
1425
|
+
target: "_blank",
|
|
1426
|
+
children: "Learn more."
|
|
1579
1427
|
})]
|
|
1580
1428
|
})
|
|
1581
1429
|
});
|
|
1582
1430
|
}
|
|
1583
1431
|
const showTooltip = !isConnectionConfigured || !!inputError;
|
|
1584
|
-
const tooltipLabel = !isConnectionConfigured ?
|
|
1432
|
+
const tooltipLabel = !isConnectionConfigured ? configureConnectionBannerTitle : inputError;
|
|
1585
1433
|
const isTaskExecuting = !!taskExecutionStatus && taskExecutionStatus !== 'idle';
|
|
1434
|
+
const handleClick = () => {
|
|
1435
|
+
if (!isConnectionConfigured) {
|
|
1436
|
+
if (onConfigureConnection) {
|
|
1437
|
+
onConfigureConnection();
|
|
1438
|
+
}
|
|
1439
|
+
return;
|
|
1440
|
+
}
|
|
1441
|
+
if (isTaskExecuting) {
|
|
1442
|
+
handleCancelTaskExecution();
|
|
1443
|
+
return;
|
|
1444
|
+
}
|
|
1445
|
+
handleExecuteTask();
|
|
1446
|
+
};
|
|
1586
1447
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
|
|
1587
1448
|
className: "task-testing__container",
|
|
1588
1449
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
|
|
@@ -1590,8 +1451,12 @@ function TaskTesting({
|
|
|
1590
1451
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
|
|
1591
1452
|
className: "task-testing__container--header",
|
|
1592
1453
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
|
|
1593
|
-
className: "task-
|
|
1594
|
-
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(
|
|
1454
|
+
className: "task-header",
|
|
1455
|
+
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
|
|
1456
|
+
className: "task-type",
|
|
1457
|
+
children: (0,_utils_element__WEBPACK_IMPORTED_MODULE_10__.getType)(element, injector)
|
|
1458
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
|
|
1459
|
+
className: "task-name",
|
|
1595
1460
|
children: (0,_utils_element__WEBPACK_IMPORTED_MODULE_10__.getName)(element)
|
|
1596
1461
|
})]
|
|
1597
1462
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Tooltip, {
|
|
@@ -1601,11 +1466,12 @@ function TaskTesting({
|
|
|
1601
1466
|
label: tooltipLabel,
|
|
1602
1467
|
align: "left-start",
|
|
1603
1468
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_carbon_react__WEBPACK_IMPORTED_MODULE_1__.Button, {
|
|
1469
|
+
"data-testid": "test-task-btn",
|
|
1604
1470
|
className: "btn-execute",
|
|
1605
1471
|
kind: "primary",
|
|
1606
1472
|
size: "sm",
|
|
1607
1473
|
renderIcon: isTaskExecuting ? _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.StopFilledAlt : _carbon_icons_react__WEBPACK_IMPORTED_MODULE_2__.PlayFilledAlt,
|
|
1608
|
-
onClick:
|
|
1474
|
+
onClick: handleClick,
|
|
1609
1475
|
children: isTaskExecuting ? 'Cancel' : 'Test task'
|
|
1610
1476
|
})
|
|
1611
1477
|
})]
|
|
@@ -1760,6 +1626,8 @@ const syntaxClasses = (0,_codemirror_language__WEBPACK_IMPORTED_MODULE_2__.synta
|
|
|
1760
1626
|
|
|
1761
1627
|
__webpack_require__.r(__webpack_exports__);
|
|
1762
1628
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1629
|
+
/* harmony export */ SINGLE_TASK_SELECTION_REQUIRED_MESSAGE: () => (/* binding */ SINGLE_TASK_SELECTION_REQUIRED_MESSAGE),
|
|
1630
|
+
/* harmony export */ TASK_SELECTION_REQUIRED_MESSAGE: () => (/* binding */ TASK_SELECTION_REQUIRED_MESSAGE),
|
|
1763
1631
|
/* harmony export */ useSelectedElement: () => (/* binding */ useSelectedElement)
|
|
1764
1632
|
/* harmony export */ });
|
|
1765
1633
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
@@ -1767,15 +1635,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1767
1635
|
|
|
1768
1636
|
|
|
1769
1637
|
const SUPPORTED_ELEMENT_TYPES = ['bpmn:Task'];
|
|
1638
|
+
const SINGLE_TASK_SELECTION_REQUIRED_MESSAGE = 'Select a task to start testing.';
|
|
1639
|
+
const TASK_SELECTION_REQUIRED_MESSAGE = 'Task testing is only supported for tasks. Select a task to start testing.';
|
|
1770
1640
|
|
|
1771
|
-
/**
|
|
1772
|
-
* Get currently selected BPMN element, if it is a single `bpmn:Task`.
|
|
1773
|
-
*
|
|
1774
|
-
*
|
|
1775
|
-
* @
|
|
1641
|
+
/**
|
|
1642
|
+
* Get currently selected BPMN element, if it is a single `bpmn:Task`. If not,
|
|
1643
|
+
* return null and a message indicating what to do.
|
|
1644
|
+
*
|
|
1645
|
+
* @param {Object} injector
|
|
1646
|
+
* @return {[ Object|null, string|null ]}
|
|
1776
1647
|
*/
|
|
1777
1648
|
function useSelectedElement(injector) {
|
|
1778
1649
|
const [selectedElement, setSelectedElement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
1650
|
+
|
|
1651
|
+
/** @type {[ string|null, Function ]} */
|
|
1652
|
+
const [message, setMessage] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(SINGLE_TASK_SELECTION_REQUIRED_MESSAGE);
|
|
1779
1653
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
1780
1654
|
const selection = injector.get('selection');
|
|
1781
1655
|
handleSelection({
|
|
@@ -1790,13 +1664,18 @@ function useSelectedElement(injector) {
|
|
|
1790
1664
|
const handleSelection = ({
|
|
1791
1665
|
newSelection
|
|
1792
1666
|
}) => {
|
|
1793
|
-
if (newSelection.length
|
|
1794
|
-
setSelectedElement(
|
|
1795
|
-
|
|
1667
|
+
if (newSelection.length !== 1) {
|
|
1668
|
+
setSelectedElement(null);
|
|
1669
|
+
setMessage(SINGLE_TASK_SELECTION_REQUIRED_MESSAGE);
|
|
1670
|
+
} else if (!(0,bpmn_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.isAny)(newSelection[0], SUPPORTED_ELEMENT_TYPES)) {
|
|
1796
1671
|
setSelectedElement(null);
|
|
1672
|
+
setMessage(TASK_SELECTION_REQUIRED_MESSAGE);
|
|
1673
|
+
} else {
|
|
1674
|
+
setSelectedElement(newSelection[0]);
|
|
1675
|
+
setMessage(null);
|
|
1797
1676
|
}
|
|
1798
1677
|
};
|
|
1799
|
-
return selectedElement;
|
|
1678
|
+
return [selectedElement, message];
|
|
1800
1679
|
}
|
|
1801
1680
|
|
|
1802
1681
|
/***/ }),
|
|
@@ -1870,21 +1749,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1870
1749
|
|
|
1871
1750
|
|
|
1872
1751
|
|
|
1873
|
-
/**
|
|
1874
|
-
* @typedef {import('@codemirror/autocomplete').Completion} Completion
|
|
1875
|
-
* @typedef {import('@codemirror/autocomplete').CompletionContext} CompletionContext
|
|
1876
|
-
* @typedef {import('@codemirror/autocomplete').CompletionResult} CompletionResult
|
|
1752
|
+
/**
|
|
1753
|
+
* @typedef {import('@codemirror/autocomplete').Completion} Completion
|
|
1754
|
+
* @typedef {import('@codemirror/autocomplete').CompletionContext} CompletionContext
|
|
1755
|
+
* @typedef {import('@codemirror/autocomplete').CompletionResult} CompletionResult
|
|
1877
1756
|
*/
|
|
1878
1757
|
|
|
1879
|
-
/**
|
|
1880
|
-
* @param {Completion[]} variables
|
|
1758
|
+
/**
|
|
1759
|
+
* @param {Completion[]} variables
|
|
1881
1760
|
*/
|
|
1882
1761
|
function getAutocompletionExtensions(variables) {
|
|
1883
1762
|
return [autoCompletionExtension(variables), startCompletionExtension()];
|
|
1884
1763
|
}
|
|
1885
1764
|
|
|
1886
|
-
/**
|
|
1887
|
-
* @param {Completion[]} variables
|
|
1765
|
+
/**
|
|
1766
|
+
* @param {Completion[]} variables
|
|
1888
1767
|
*/
|
|
1889
1768
|
function autoCompletionExtension(variables) {
|
|
1890
1769
|
return (0,_codemirror_autocomplete__WEBPACK_IMPORTED_MODULE_0__.autocompletion)({
|
|
@@ -1892,8 +1771,8 @@ function autoCompletionExtension(variables) {
|
|
|
1892
1771
|
});
|
|
1893
1772
|
}
|
|
1894
1773
|
|
|
1895
|
-
/**
|
|
1896
|
-
* Trigger autocompletion when the user goes into a new line.
|
|
1774
|
+
/**
|
|
1775
|
+
* Trigger autocompletion when the user goes into a new line.
|
|
1897
1776
|
*/
|
|
1898
1777
|
function startCompletionExtension() {
|
|
1899
1778
|
return _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.EditorView.updateListener.of(update => {
|
|
@@ -1917,11 +1796,11 @@ function startCompletionExtension() {
|
|
|
1917
1796
|
});
|
|
1918
1797
|
}
|
|
1919
1798
|
|
|
1920
|
-
/**
|
|
1921
|
-
* @param {CompletionContext} context
|
|
1922
|
-
* @param {Array} variables
|
|
1923
|
-
*
|
|
1924
|
-
* @returns {CompletionResult | null}
|
|
1799
|
+
/**
|
|
1800
|
+
* @param {CompletionContext} context
|
|
1801
|
+
* @param {Array} variables
|
|
1802
|
+
*
|
|
1803
|
+
* @returns {CompletionResult | null}
|
|
1925
1804
|
*/
|
|
1926
1805
|
function autocomplete(context, variables) {
|
|
1927
1806
|
const {
|
|
@@ -2012,13 +1891,13 @@ function autocomplete(context, variables) {
|
|
|
2012
1891
|
};
|
|
2013
1892
|
}
|
|
2014
1893
|
|
|
2015
|
-
/**
|
|
2016
|
-
* Check if there is a property after the current position by looking for a `"` character.
|
|
2017
|
-
*
|
|
2018
|
-
* @param {*} state
|
|
2019
|
-
* @param {number} pos
|
|
2020
|
-
*
|
|
2021
|
-
* @returns {boolean}
|
|
1894
|
+
/**
|
|
1895
|
+
* Check if there is a property after the current position by looking for a `"` character.
|
|
1896
|
+
*
|
|
1897
|
+
* @param {*} state
|
|
1898
|
+
* @param {number} pos
|
|
1899
|
+
*
|
|
1900
|
+
* @returns {boolean}
|
|
2022
1901
|
*/
|
|
2023
1902
|
function hasPropertyAfter(state, pos) {
|
|
2024
1903
|
const textAfter = state.sliceDoc(pos).trimStart();
|
|
@@ -2035,25 +1914,33 @@ function hasPropertyAfter(state, pos) {
|
|
|
2035
1914
|
|
|
2036
1915
|
__webpack_require__.r(__webpack_exports__);
|
|
2037
1916
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2038
|
-
/* harmony export */
|
|
1917
|
+
/* harmony export */ getConcreteType: () => (/* binding */ getConcreteType),
|
|
1918
|
+
/* harmony export */ getName: () => (/* binding */ getName),
|
|
1919
|
+
/* harmony export */ getType: () => (/* binding */ getType)
|
|
2039
1920
|
/* harmony export */ });
|
|
2040
|
-
/* harmony import */ var
|
|
1921
|
+
/* harmony import */ var bpmn_js_lib_features_label_editing_LabelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bpmn-js/lib/features/label-editing/LabelUtil */ "./node_modules/bpmn-js/lib/util/LabelUtil.js");
|
|
2041
1922
|
|
|
2042
|
-
|
|
2043
|
-
/**
|
|
2044
|
-
* Get the name of a BPMN element.
|
|
2045
|
-
*
|
|
2046
|
-
* @param {import('../types').Element} element
|
|
2047
|
-
*
|
|
2048
|
-
* @returns {string}
|
|
2049
|
-
*/
|
|
2050
1923
|
function getName(element) {
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
1924
|
+
return (0,bpmn_js_lib_features_label_editing_LabelUtil__WEBPACK_IMPORTED_MODULE_0__.getLabel)(element);
|
|
1925
|
+
}
|
|
1926
|
+
function getType(element, injector) {
|
|
1927
|
+
const translate = injector.get('translate') || (text => text);
|
|
1928
|
+
const elementTemplates = injector.get('elementTemplates', false);
|
|
1929
|
+
if (elementTemplates) {
|
|
1930
|
+
const template = getTemplate(element, elementTemplates);
|
|
1931
|
+
if (template && template.name) {
|
|
1932
|
+
return translate(template.name);
|
|
1933
|
+
}
|
|
2055
1934
|
}
|
|
2056
|
-
|
|
1935
|
+
const concreteType = getConcreteType(element);
|
|
1936
|
+
return translate(concreteType.replace(/(\B[A-Z])/g, ' $1'));
|
|
1937
|
+
}
|
|
1938
|
+
;
|
|
1939
|
+
function getTemplate(element, elementTemplates) {
|
|
1940
|
+
return elementTemplates.get(element);
|
|
1941
|
+
}
|
|
1942
|
+
function getConcreteType(element) {
|
|
1943
|
+
return element.type.split(':')[1];
|
|
2057
1944
|
}
|
|
2058
1945
|
|
|
2059
1946
|
/***/ }),
|
|
@@ -32308,6 +32195,297 @@ function surrogateHigh(ch) { return ch >= 0xD800 && ch < 0xDC00 }
|
|
|
32308
32195
|
function codePointSize(code) { return code < 0x10000 ? 1 : 2 }
|
|
32309
32196
|
|
|
32310
32197
|
|
|
32198
|
+
/***/ }),
|
|
32199
|
+
|
|
32200
|
+
/***/ "./node_modules/bpmn-js/lib/util/LabelUtil.js":
|
|
32201
|
+
/*!****************************************************!*\
|
|
32202
|
+
!*** ./node_modules/bpmn-js/lib/util/LabelUtil.js ***!
|
|
32203
|
+
\****************************************************/
|
|
32204
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
32205
|
+
|
|
32206
|
+
__webpack_require__.r(__webpack_exports__);
|
|
32207
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
32208
|
+
/* harmony export */ DEFAULT_LABEL_SIZE: () => (/* binding */ DEFAULT_LABEL_SIZE),
|
|
32209
|
+
/* harmony export */ FLOW_LABEL_INDENT: () => (/* binding */ FLOW_LABEL_INDENT),
|
|
32210
|
+
/* harmony export */ getExternalLabelBounds: () => (/* binding */ getExternalLabelBounds),
|
|
32211
|
+
/* harmony export */ getExternalLabelMid: () => (/* binding */ getExternalLabelMid),
|
|
32212
|
+
/* harmony export */ getFlowLabelPosition: () => (/* binding */ getFlowLabelPosition),
|
|
32213
|
+
/* harmony export */ getLabel: () => (/* binding */ getLabel),
|
|
32214
|
+
/* harmony export */ getWaypointsMid: () => (/* binding */ getWaypointsMid),
|
|
32215
|
+
/* harmony export */ hasExternalLabel: () => (/* binding */ hasExternalLabel),
|
|
32216
|
+
/* harmony export */ isLabel: () => (/* reexport safe */ diagram_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.isLabel),
|
|
32217
|
+
/* harmony export */ isLabelExternal: () => (/* binding */ isLabelExternal),
|
|
32218
|
+
/* harmony export */ setLabel: () => (/* binding */ setLabel)
|
|
32219
|
+
/* harmony export */ });
|
|
32220
|
+
/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! min-dash */ "./node_modules/min-dash/dist/index.esm.js");
|
|
32221
|
+
/* harmony import */ var _ModelUtil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ModelUtil */ "./node_modules/bpmn-js/lib/util/ModelUtil.js");
|
|
32222
|
+
/* harmony import */ var diagram_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! diagram-js/lib/util/ModelUtil */ "./node_modules/diagram-js/lib/util/ModelUtil.js");
|
|
32223
|
+
|
|
32224
|
+
|
|
32225
|
+
|
|
32226
|
+
|
|
32227
|
+
|
|
32228
|
+
|
|
32229
|
+
|
|
32230
|
+
|
|
32231
|
+
/**
|
|
32232
|
+
* @typedef {import('diagram-js/lib/util/Types').Point} Point
|
|
32233
|
+
* @typedef {import('diagram-js/lib/util/Types').Rect} Rect
|
|
32234
|
+
*
|
|
32235
|
+
* @typedef {import('../model/Types').Element} Element
|
|
32236
|
+
* @typedef {import('../model/Types').ModdleElement} ModdleElement
|
|
32237
|
+
*/
|
|
32238
|
+
|
|
32239
|
+
var DEFAULT_LABEL_SIZE = {
|
|
32240
|
+
width: 90,
|
|
32241
|
+
height: 20
|
|
32242
|
+
};
|
|
32243
|
+
|
|
32244
|
+
var FLOW_LABEL_INDENT = 15;
|
|
32245
|
+
|
|
32246
|
+
|
|
32247
|
+
/**
|
|
32248
|
+
* Return true if the given semantic has an external label.
|
|
32249
|
+
*
|
|
32250
|
+
* @param {Element} semantic
|
|
32251
|
+
*
|
|
32252
|
+
* @return {boolean}
|
|
32253
|
+
*/
|
|
32254
|
+
function isLabelExternal(semantic) {
|
|
32255
|
+
return (0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:Event') ||
|
|
32256
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:Gateway') ||
|
|
32257
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:DataStoreReference') ||
|
|
32258
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:DataObjectReference') ||
|
|
32259
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:DataInput') ||
|
|
32260
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:DataOutput') ||
|
|
32261
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:SequenceFlow') ||
|
|
32262
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:MessageFlow') ||
|
|
32263
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:Group');
|
|
32264
|
+
}
|
|
32265
|
+
|
|
32266
|
+
/**
|
|
32267
|
+
* Return true if the given element has an external label.
|
|
32268
|
+
*
|
|
32269
|
+
* @param {Element} element
|
|
32270
|
+
*
|
|
32271
|
+
* @return {boolean}
|
|
32272
|
+
*/
|
|
32273
|
+
function hasExternalLabel(element) {
|
|
32274
|
+
return (0,diagram_js_lib_util_ModelUtil__WEBPACK_IMPORTED_MODULE_0__.isLabel)(element.label);
|
|
32275
|
+
}
|
|
32276
|
+
|
|
32277
|
+
/**
|
|
32278
|
+
* Get the position of a sequence flow label.
|
|
32279
|
+
*
|
|
32280
|
+
* @param {Point[]} waypoints
|
|
32281
|
+
*
|
|
32282
|
+
* @return {Point}
|
|
32283
|
+
*/
|
|
32284
|
+
function getFlowLabelPosition(waypoints) {
|
|
32285
|
+
|
|
32286
|
+
// get the waypoints mid
|
|
32287
|
+
var mid = waypoints.length / 2 - 1;
|
|
32288
|
+
|
|
32289
|
+
var first = waypoints[Math.floor(mid)];
|
|
32290
|
+
var second = waypoints[Math.ceil(mid + 0.01)];
|
|
32291
|
+
|
|
32292
|
+
// get position
|
|
32293
|
+
var position = getWaypointsMid(waypoints);
|
|
32294
|
+
|
|
32295
|
+
// calculate angle
|
|
32296
|
+
var angle = Math.atan((second.y - first.y) / (second.x - first.x));
|
|
32297
|
+
|
|
32298
|
+
var x = position.x,
|
|
32299
|
+
y = position.y;
|
|
32300
|
+
|
|
32301
|
+
if (Math.abs(angle) < Math.PI / 2) {
|
|
32302
|
+
y -= FLOW_LABEL_INDENT;
|
|
32303
|
+
} else {
|
|
32304
|
+
x += FLOW_LABEL_INDENT;
|
|
32305
|
+
}
|
|
32306
|
+
|
|
32307
|
+
return { x: x, y: y };
|
|
32308
|
+
}
|
|
32309
|
+
|
|
32310
|
+
|
|
32311
|
+
/**
|
|
32312
|
+
* Get the middle of a number of waypoints.
|
|
32313
|
+
*
|
|
32314
|
+
* @param {Point[]} waypoints
|
|
32315
|
+
*
|
|
32316
|
+
* @return {Point}
|
|
32317
|
+
*/
|
|
32318
|
+
function getWaypointsMid(waypoints) {
|
|
32319
|
+
|
|
32320
|
+
var mid = waypoints.length / 2 - 1;
|
|
32321
|
+
|
|
32322
|
+
var first = waypoints[Math.floor(mid)];
|
|
32323
|
+
var second = waypoints[Math.ceil(mid + 0.01)];
|
|
32324
|
+
|
|
32325
|
+
return {
|
|
32326
|
+
x: first.x + (second.x - first.x) / 2,
|
|
32327
|
+
y: first.y + (second.y - first.y) / 2
|
|
32328
|
+
};
|
|
32329
|
+
}
|
|
32330
|
+
|
|
32331
|
+
/**
|
|
32332
|
+
* Get the middle of the external label of an element.
|
|
32333
|
+
*
|
|
32334
|
+
* @param {Element} element
|
|
32335
|
+
*
|
|
32336
|
+
* @return {Point}
|
|
32337
|
+
*/
|
|
32338
|
+
function getExternalLabelMid(element) {
|
|
32339
|
+
|
|
32340
|
+
if (element.waypoints) {
|
|
32341
|
+
return getFlowLabelPosition(element.waypoints);
|
|
32342
|
+
} else if ((0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(element, 'bpmn:Group')) {
|
|
32343
|
+
return {
|
|
32344
|
+
x: element.x + element.width / 2,
|
|
32345
|
+
y: element.y + DEFAULT_LABEL_SIZE.height / 2
|
|
32346
|
+
};
|
|
32347
|
+
} else {
|
|
32348
|
+
return {
|
|
32349
|
+
x: element.x + element.width / 2,
|
|
32350
|
+
y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2
|
|
32351
|
+
};
|
|
32352
|
+
}
|
|
32353
|
+
}
|
|
32354
|
+
|
|
32355
|
+
|
|
32356
|
+
/**
|
|
32357
|
+
* Return the bounds of an elements label, parsed from the elements DI or
|
|
32358
|
+
* generated from its bounds.
|
|
32359
|
+
*
|
|
32360
|
+
* @param {ModdleElement} di
|
|
32361
|
+
* @param {Element} element
|
|
32362
|
+
*
|
|
32363
|
+
* @return {Rect}
|
|
32364
|
+
*/
|
|
32365
|
+
function getExternalLabelBounds(di, element) {
|
|
32366
|
+
|
|
32367
|
+
var mid,
|
|
32368
|
+
size,
|
|
32369
|
+
bounds,
|
|
32370
|
+
label = di.label;
|
|
32371
|
+
|
|
32372
|
+
if (label && label.bounds) {
|
|
32373
|
+
bounds = label.bounds;
|
|
32374
|
+
|
|
32375
|
+
size = {
|
|
32376
|
+
width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),
|
|
32377
|
+
height: bounds.height
|
|
32378
|
+
};
|
|
32379
|
+
|
|
32380
|
+
mid = {
|
|
32381
|
+
x: bounds.x + bounds.width / 2,
|
|
32382
|
+
y: bounds.y + bounds.height / 2
|
|
32383
|
+
};
|
|
32384
|
+
} else {
|
|
32385
|
+
|
|
32386
|
+
mid = getExternalLabelMid(element);
|
|
32387
|
+
|
|
32388
|
+
size = DEFAULT_LABEL_SIZE;
|
|
32389
|
+
}
|
|
32390
|
+
|
|
32391
|
+
return (0,min_dash__WEBPACK_IMPORTED_MODULE_2__.assign)({
|
|
32392
|
+
x: mid.x - size.width / 2,
|
|
32393
|
+
y: mid.y - size.height / 2
|
|
32394
|
+
}, size);
|
|
32395
|
+
}
|
|
32396
|
+
|
|
32397
|
+
/**
|
|
32398
|
+
* @param {ModdleElement} semantic
|
|
32399
|
+
*
|
|
32400
|
+
* @returns {string}
|
|
32401
|
+
*/
|
|
32402
|
+
function getLabelAttr(semantic) {
|
|
32403
|
+
if (
|
|
32404
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:FlowElement') ||
|
|
32405
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:Participant') ||
|
|
32406
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:Lane') ||
|
|
32407
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:SequenceFlow') ||
|
|
32408
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:MessageFlow') ||
|
|
32409
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:DataInput') ||
|
|
32410
|
+
(0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:DataOutput')
|
|
32411
|
+
) {
|
|
32412
|
+
return 'name';
|
|
32413
|
+
}
|
|
32414
|
+
|
|
32415
|
+
if ((0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:TextAnnotation')) {
|
|
32416
|
+
return 'text';
|
|
32417
|
+
}
|
|
32418
|
+
|
|
32419
|
+
if ((0,_ModelUtil__WEBPACK_IMPORTED_MODULE_1__.is)(semantic, 'bpmn:Group')) {
|
|
32420
|
+
return 'categoryValueRef';
|
|
32421
|
+
}
|
|
32422
|
+
}
|
|
32423
|
+
|
|
32424
|
+
/**
|
|
32425
|
+
* @param {ModdleElement} semantic
|
|
32426
|
+
*
|
|
32427
|
+
* @returns {string}
|
|
32428
|
+
*/
|
|
32429
|
+
function getCategoryValue(semantic) {
|
|
32430
|
+
var categoryValueRef = semantic['categoryValueRef'];
|
|
32431
|
+
|
|
32432
|
+
if (!categoryValueRef) {
|
|
32433
|
+
return '';
|
|
32434
|
+
}
|
|
32435
|
+
|
|
32436
|
+
|
|
32437
|
+
return categoryValueRef.value || '';
|
|
32438
|
+
}
|
|
32439
|
+
|
|
32440
|
+
/**
|
|
32441
|
+
* @param {Element} element
|
|
32442
|
+
*
|
|
32443
|
+
* @return {string}
|
|
32444
|
+
*/
|
|
32445
|
+
function getLabel(element) {
|
|
32446
|
+
var semantic = element.businessObject,
|
|
32447
|
+
attr = getLabelAttr(semantic);
|
|
32448
|
+
|
|
32449
|
+
if (attr) {
|
|
32450
|
+
|
|
32451
|
+
if (attr === 'categoryValueRef') {
|
|
32452
|
+
|
|
32453
|
+
return getCategoryValue(semantic);
|
|
32454
|
+
}
|
|
32455
|
+
|
|
32456
|
+
return semantic[attr] || '';
|
|
32457
|
+
}
|
|
32458
|
+
}
|
|
32459
|
+
|
|
32460
|
+
|
|
32461
|
+
/**
|
|
32462
|
+
* @param {Element} element
|
|
32463
|
+
* @param {string} text
|
|
32464
|
+
*
|
|
32465
|
+
* @return {Element}
|
|
32466
|
+
*/
|
|
32467
|
+
function setLabel(element, text) {
|
|
32468
|
+
var semantic = element.businessObject,
|
|
32469
|
+
attr = getLabelAttr(semantic);
|
|
32470
|
+
|
|
32471
|
+
if (attr) {
|
|
32472
|
+
|
|
32473
|
+
if (attr === 'categoryValueRef') {
|
|
32474
|
+
if (!semantic[attr]) {
|
|
32475
|
+
return element;
|
|
32476
|
+
}
|
|
32477
|
+
|
|
32478
|
+
semantic[attr].value = text;
|
|
32479
|
+
} else {
|
|
32480
|
+
semantic[attr] = text;
|
|
32481
|
+
}
|
|
32482
|
+
|
|
32483
|
+
}
|
|
32484
|
+
|
|
32485
|
+
return element;
|
|
32486
|
+
}
|
|
32487
|
+
|
|
32488
|
+
|
|
32311
32489
|
/***/ }),
|
|
32312
32490
|
|
|
32313
32491
|
/***/ "./node_modules/bpmn-js/lib/util/ModelUtil.js":
|
|
@@ -32573,10 +32751,22 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
|
|
|
32573
32751
|
gap: 12px;
|
|
32574
32752
|
width: 100%;
|
|
32575
32753
|
}
|
|
32576
|
-
.task-testing__container .task-testing__container--header .task-
|
|
32754
|
+
.task-testing__container .task-testing__container--header .task-header {
|
|
32577
32755
|
display: flex;
|
|
32578
|
-
font-weight: bold;
|
|
32579
32756
|
gap: 6px;
|
|
32757
|
+
min-width: 0;
|
|
32758
|
+
}
|
|
32759
|
+
.task-testing__container .task-testing__container--header .task-header .task-type {
|
|
32760
|
+
font-weight: bold;
|
|
32761
|
+
}
|
|
32762
|
+
.task-testing__container .task-testing__container--header .task-header .task-type,
|
|
32763
|
+
.task-testing__container .task-testing__container--header .task-header .task-name {
|
|
32764
|
+
min-width: 0;
|
|
32765
|
+
overflow: hidden;
|
|
32766
|
+
white-space: nowrap;
|
|
32767
|
+
text-overflow: ellipsis;
|
|
32768
|
+
flex-shrink: 1;
|
|
32769
|
+
flex-grow: 1;
|
|
32580
32770
|
}
|
|
32581
32771
|
.task-testing__container .task-testing__container--header .btn-execute {
|
|
32582
32772
|
width: 138px;
|
|
@@ -32660,7 +32850,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
|
|
|
32660
32850
|
}
|
|
32661
32851
|
.task-testing__container .output .output__error {
|
|
32662
32852
|
display: flex;
|
|
32663
|
-
flex-direction:
|
|
32853
|
+
flex-direction: column;
|
|
32664
32854
|
gap: 12px;
|
|
32665
32855
|
padding: 12px;
|
|
32666
32856
|
margin-bottom: 12px;
|
|
@@ -32668,24 +32858,18 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
|
|
|
32668
32858
|
border-left-width: 3px;
|
|
32669
32859
|
background-color: #fff1f1;
|
|
32670
32860
|
}
|
|
32671
|
-
.task-testing__container .output .output__error .output__error--
|
|
32861
|
+
.task-testing__container .output .output__error .output__error--title {
|
|
32672
32862
|
display: flex;
|
|
32673
|
-
flex-direction:
|
|
32674
|
-
|
|
32675
|
-
flex-grow: 1;
|
|
32676
|
-
margin-top: 1px;
|
|
32677
|
-
}
|
|
32678
|
-
.task-testing__container .output .output__error .output__error--content .output__error--title {
|
|
32679
|
-
display: flex;
|
|
32680
|
-
justify-content: space-between;
|
|
32863
|
+
flex-direction: row;
|
|
32864
|
+
align-items: center;
|
|
32681
32865
|
font-weight: bold;
|
|
32682
32866
|
}
|
|
32683
|
-
.task-testing__container .output .output__error .output__error--
|
|
32684
|
-
cursor: pointer;
|
|
32685
|
-
}
|
|
32686
|
-
.task-testing__container .output .output__error .output__error--icon svg {
|
|
32867
|
+
.task-testing__container .output .output__error .output__error--title svg {
|
|
32687
32868
|
fill: #da1e28;
|
|
32688
32869
|
}
|
|
32870
|
+
.task-testing__container .output .output__error .output__error--title .output__error--action {
|
|
32871
|
+
margin-left: auto;
|
|
32872
|
+
}
|
|
32689
32873
|
.task-testing__container .output .output__variables--empty {
|
|
32690
32874
|
height: 32px;
|
|
32691
32875
|
display: flex;
|
|
@@ -32769,7 +32953,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.task-testing__container {
|
|
|
32769
32953
|
}
|
|
32770
32954
|
.code__editor .code__editor-copy-button svg {
|
|
32771
32955
|
fill: #525252;
|
|
32772
|
-
}`, "",{"version":3,"sources":["webpack://./lib/style/style.scss"],"names":[],"mappings":"AAAA;EACE,aAAA;EACA,mBAAA;EACA,YAAA;EACA,WAAA;EACA,aAAA;EACA,eAAA;AACF;AAEI;;EAEE,aAAA;EACA,mBAAA;EACA,QAAA;EACA,YAAA;AAAN;AAEM;;EACE,oBAAA;EACA,uBAAA;AACR;AAIE;EACE,UAAA;EACA,aAAA;EACA,sBAAA;EACA,+BAAA;EACA,kBAAA;AAFJ;AAKE;EACE,UAAA;EACA,aAAA;EACA,sBAAA;EACA,iBAAA;AAHJ;AAME;EACE,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,SAAA;EACA,WAAA;AAJJ;AAMI;EACE,aAAA;EACA,
|
|
32956
|
+
}`, "",{"version":3,"sources":["webpack://./lib/style/style.scss"],"names":[],"mappings":"AAAA;EACE,aAAA;EACA,mBAAA;EACA,YAAA;EACA,WAAA;EACA,aAAA;EACA,eAAA;AACF;AAEI;;EAEE,aAAA;EACA,mBAAA;EACA,QAAA;EACA,YAAA;AAAN;AAEM;;EACE,oBAAA;EACA,uBAAA;AACR;AAIE;EACE,UAAA;EACA,aAAA;EACA,sBAAA;EACA,+BAAA;EACA,kBAAA;AAFJ;AAKE;EACE,UAAA;EACA,aAAA;EACA,sBAAA;EACA,iBAAA;AAHJ;AAME;EACE,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,8BAAA;EACA,SAAA;EACA,WAAA;AAJJ;AAMI;EACE,aAAA;EACA,QAAA;EACA,YAAA;AAJN;AAMM;EACE,iBAAA;AAJR;AAOM;;EAEE,YAAA;EACA,gBAAA;EACA,mBAAA;EACA,uBAAA;EACA,cAAA;EACA,YAAA;AALR;AASI;EACE,YAAA;AAPN;AAUI;EACE,aAAA;AARN;AAWI;EACE,aAAA;AATN;AAYI;EACE,oBAAA;EACA,uBAAA;AAVN;AAcE;EACE,YAAA;EACA,aAAA;EACA,sBAAA;EACA,QAAA;AAZJ;AAcI;EACE,aAAA;EACA,mBAAA;EACA,QAAA;AAZN;AAeI;EACE,cAAA;AAbN;AAiBE;EACE,YAAA;EACA,aAAA;EACA,sBAAA;EACA,QAAA;AAfJ;AAiBI;EACE,aAAA;EACA,mBAAA;EACA,YAAA;EACA,WAAA;AAfN;AAkBI;EACE,cAAA;EACA,aAAA;EACA,mBAAA;EACA,QAAA;AAhBN;AAkBM;EACE,aAAA;AAhBR;AAmBM;EACE,aAAA;AAjBR;AAoBM;EACE,aAAA;AAlBR;AAqBM;EACE,iBAAA;EACA,uBAAA;AAnBR;AAuBI;EACE,iBAAA;AArBN;AAwBI;EACE,aAAA;EACA,sBAAA;EACA,YAAA;EACA,kBAAA;AAtBN;AAwBM;EACE,oCAAA;AAtBR;AAyBM;EACE,UAAA;EACA,yBAAA;AAvBR;AA0BM;EACE,aAAA;AAxBR;AA4BM;EACE,aAAA;AA1BR;AA8BI;EACE,aAAA;EACA,sBAAA;EACA,SAAA;EACA,aAAA;EACA,mBAAA;EACA,yBAAA;EACA,sBAAA;EACA,yBAAA;AA5BN;AA8BM;EACE,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,iBAAA;AA5BR;AA8BQ;EACE,aAAA;AA5BV;AA+BQ;EACE,iBAAA;AA7BV;AAkCI;EACE,YAAA;EACA,aAAA;EACA,mBAAA;EACA,cAAA;AAhCN;AAmCI;EACE,iBAAA;AAjCN;AAoCI;EACE,WAAA;AAlCN;AAqCI;EACE,qBAAA;EACA,YAAA;AAnCN;AAsCI;EACE,eAAA;AApCN;;AAyCA;EACE,kBAAA;EACA,YAAA;EACA,aAAA;EACA,sBAAA;AAtCF;AAwCE;EACE,0BAAA;EACA,oBAAA;AAtCJ;AAyCE;EACE,kBAAA;EACA,YAAA;AAvCJ;AAyCI;EACE,kBAAA;EACA,MAAA;EACA,OAAA;EACA,QAAA;EACA,SAAA;AAvCN;AAyCM;EACE,YAAA;EACA,2CAAA;AAvCR;AA0CM;EACE,2BAAA;AAxCR;AA2CM;EACE,aAAA;AAzCR;AA4CM;EACE,aAAA;AA1CR;AA6CM;EACE,eAAA;AA3CR;AA8CM;EACE,YAAA;EACA,sBAAA;EACA,eAAA;EACA,gBAAA;EACA,qBAAA;AA5CR;AA8CQ;EACE,kBAAA;AA5CV;AA+CQ;EACE,eAAA;AA7CV;AAmDE;EACE,cAAA;EACA,eAAA;EACA,eAAA;AAjDJ;AAoDE;EACE,kBAAA;EACA,SAAA;EACA,WAAA;EACA,WAAA;AAlDJ;AAoDI;EACE,aAAA;AAlDN","sourcesContent":[".task-testing__container {\n display: flex;\n flex-direction: row;\n height: 100%;\n width: 100%;\n padding: 10px;\n font-size: 14px;\n\n &.task-testing__container--empty {\n .task-testing__container-no-config,\n .task-testing__container-no-element {\n display: flex;\n align-items: center;\n gap: 5px;\n height: 32px;\n\n .cds--inline-loading {\n inline-size: initial;\n min-block-size: initial;\n }\n }\n }\n\n .task-testing__container--left {\n width: 50%;\n display: flex;\n flex-direction: column;\n border-right: 1px solid #E0E0E0;\n padding-right: 6px;\n }\n\n .task-testing__container--right {\n width: 50%;\n display: flex;\n flex-direction: column;\n padding-left: 6px;\n }\n\n .task-testing__container--header {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n width: 100%;\n\n .task-header {\n display: flex;\n gap: 6px;\n min-width: 0;\n \n .task-type {\n font-weight: bold;\n }\n\n .task-type,\n .task-name {\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n flex-shrink: 1;\n flex-grow: 1;\n }\n }\n\n .btn-execute {\n width: 138px;\n }\n\n .cds--popover-container:not(.has-error) .cds--popover {\n display: none;\n }\n\n .cds--tooltip-content {\n padding: 12px;\n }\n\n .cds--btn .cds--inline-loading {\n inline-size: initial;\n min-block-size: initial;\n }\n }\n\n .input {\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n gap: 5px;\n\n .input__header {\n display: flex;\n align-items: center;\n gap: 5px;\n }\n\n .input__header--title {\n color: #525252;\n }\n }\n\n .output {\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n gap: 5px;\n\n .output__header {\n display: flex;\n align-items: center;\n height: 32px;\n width: 100%;\n }\n\n .output__header--title {\n color: #525252;\n display: flex;\n align-items: center;\n gap: 6px;\n\n svg.output__status-icon--ready {\n fill: #0043ce;\n }\n\n svg.output__status-icon--success {\n fill: #24a148;\n }\n\n svg.output__status-icon--error {\n fill: #da1e28;\n }\n\n .cds--inline-loading {\n inline-size: 16px;\n min-block-size: initial;\n }\n }\n\n .output__header--button-operate {\n margin-left: auto;\n }\n\n .output__body {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n position: relative;\n\n .cds--tabs {\n --cds-layout-size-height-local: 32px;\n }\n \n .cds--tab-content {\n padding: 0;\n height: calc(100% - 20px);\n }\n\n .cds--tab-content:not([hidden]) {\n display: flex;\n }\n\n // Tooltip on Carbon Button with absolute position is broken.\n .cds--popover {\n display: none;\n }\n }\n\n .output__error {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 12px;\n margin-bottom: 12px;\n border: 1px solid #da1e28;\n border-left-width: 3px;\n background-color: #fff1f1;\n\n .output__error--title {\n display: flex;\n flex-direction: row;\n align-items: center;\n font-weight: bold;\n\n svg {\n fill: #da1e28;\n }\n\n .output__error--action {\n margin-left: auto;\n }\n }\n }\n\n .output__variables--empty {\n height: 32px;\n display: flex;\n align-items: center;\n color: #525252;\n }\n\n .output__variables--empty-action {\n font-weight: bold;\n }\n\n .cds--snippet-container {\n width: 100%;\n }\n\n .cds--snippet {\n max-inline-size: 100%;\n height: 100%;\n }\n\n code {\n font-size: 14px;\n }\n }\n}\n\n.code__editor {\n position: relative;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n\n &.code__editor--error .code__editor-codemirror .code__editor-codemirror-inner .cm-editor {\n outline: 1px solid #da1e28;\n outline-offset: -1px;\n }\n\n .code__editor-codemirror {\n position: relative;\n flex-grow: 1;\n\n .code__editor-codemirror-inner {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n\n .cm-editor {\n height: 100%;\n background-color: var(--cds-layer, #f4f4f4);\n }\n\n .cm-scroller {\n overflow-y: auto !important;\n }\n\n .cm-content {\n padding: 15px;\n }\n\n .cm-focused {\n outline: none;\n }\n\n .cm-tooltip {\n font-size: 14px;\n }\n\n .info {\n padding: 5px;\n font-family: monospace;\n font-size: 12px;\n max-width: 300px;\n word-wrap: break-word;\n\n span {\n font-style: italic;\n }\n\n pre {\n margin-top: 5px;\n }\n }\n }\n }\n\n .code__editor-error {\n color: #da1e28;\n font-size: 13px;\n margin-top: 5px;\n }\n\n .code__editor-copy-button {\n position: absolute;\n top: 10px;\n right: 10px;\n z-index: 10;\n\n svg {\n fill: #525252;\n }\n }\n}"],"sourceRoot":""}]);
|
|
32773
32957
|
// Exports
|
|
32774
32958
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
32775
32959
|
|
|
@@ -32895,6 +33079,56 @@ module.exports = function (item) {
|
|
|
32895
33079
|
|
|
32896
33080
|
/***/ }),
|
|
32897
33081
|
|
|
33082
|
+
/***/ "./node_modules/diagram-js/lib/util/ModelUtil.js":
|
|
33083
|
+
/*!*******************************************************!*\
|
|
33084
|
+
!*** ./node_modules/diagram-js/lib/util/ModelUtil.js ***!
|
|
33085
|
+
\*******************************************************/
|
|
33086
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
33087
|
+
|
|
33088
|
+
__webpack_require__.r(__webpack_exports__);
|
|
33089
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
33090
|
+
/* harmony export */ isConnection: () => (/* binding */ isConnection),
|
|
33091
|
+
/* harmony export */ isLabel: () => (/* binding */ isLabel),
|
|
33092
|
+
/* harmony export */ isRoot: () => (/* binding */ isRoot)
|
|
33093
|
+
/* harmony export */ });
|
|
33094
|
+
/* harmony import */ var min_dash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! min-dash */ "./node_modules/min-dash/dist/index.esm.js");
|
|
33095
|
+
|
|
33096
|
+
|
|
33097
|
+
/**
|
|
33098
|
+
* Checks whether a value is an instance of Connection.
|
|
33099
|
+
*
|
|
33100
|
+
* @param {any} value
|
|
33101
|
+
*
|
|
33102
|
+
* @return {boolean}
|
|
33103
|
+
*/
|
|
33104
|
+
function isConnection(value) {
|
|
33105
|
+
return (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) && (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.has)(value, 'waypoints');
|
|
33106
|
+
}
|
|
33107
|
+
|
|
33108
|
+
/**
|
|
33109
|
+
* Checks whether a value is an instance of Label.
|
|
33110
|
+
*
|
|
33111
|
+
* @param {any} value
|
|
33112
|
+
*
|
|
33113
|
+
* @return {boolean}
|
|
33114
|
+
*/
|
|
33115
|
+
function isLabel(value) {
|
|
33116
|
+
return (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) && (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.has)(value, 'labelTarget');
|
|
33117
|
+
}
|
|
33118
|
+
|
|
33119
|
+
/**
|
|
33120
|
+
* Checks whether a value is an instance of Root.
|
|
33121
|
+
*
|
|
33122
|
+
* @param {any} value
|
|
33123
|
+
*
|
|
33124
|
+
* @return {boolean}
|
|
33125
|
+
*/
|
|
33126
|
+
function isRoot(value) {
|
|
33127
|
+
return (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) && (0,min_dash__WEBPACK_IMPORTED_MODULE_0__.isNil)(value.parent);
|
|
33128
|
+
}
|
|
33129
|
+
|
|
33130
|
+
/***/ }),
|
|
33131
|
+
|
|
32898
33132
|
/***/ "./node_modules/events/events.js":
|
|
32899
33133
|
/*!***************************************!*\
|
|
32900
33134
|
!*** ./node_modules/events/events.js ***!
|