ebta-workflow-prod 1.1.3 → 4.0.2
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/.eslintrc.js +7 -0
- package/.vscode/extensions.json +3 -0
- package/.vscode/settings.json +3 -0
- package/README.md +26 -0
- package/build/2983859c0d77824ec8db.svg +1 -0
- package/build/4168d659d55fd94368bc.svg +1 -0
- package/build/641b2c17e92b0e885b9f.svg +1 -0
- package/build/882445a26a4f3964786f.svg +1 -0
- package/build/activitypack.json +1 -1
- package/build/b280e967312a55101032.svg +1 -0
- package/build/main.js +2 -2
- package/build/main.js.LICENSE.txt +99 -0
- package/certs/localhost+2-key.pem +28 -0
- package/certs/localhost+2.pem +26 -0
- package/index.html +58 -0
- package/package.json +43 -7
- package/public/img/background.svg +3 -3
- package/public/img/compass.svg +3 -3
- package/public/img/grab.svg +3 -3
- package/public/img/grabbing.svg +3 -3
- package/public/img/sprites.svg +14 -14
- package/src/activities/AppendObjects.ts +40 -0
- package/src/activities/Base64ToFile.ts +56 -0
- package/src/activities/CreateGraphicLayer.ts +85 -0
- package/src/activities/DrapGeometry.ts +99 -0
- package/src/activities/GetElementByDataLayoutID.ts +58 -0
- package/src/activities/GetSesionStorage.ts +36 -0
- package/src/activities/GetTaskStatus.ts +56 -0
- package/src/activities/GetUserToken.ts +102 -0
- package/src/activities/GetvGISDetails copy.ts +110 -0
- package/src/activities/GetvGISDetails.ts +110 -0
- package/src/activities/HTMLextractor.ts +188 -0
- package/src/activities/LegendCreator.ts +155 -0
- package/src/activities/MergeObjects.ts +61 -0
- package/src/activities/PDFMapGenerator.ts +729 -0
- package/src/activities/RequestChecker.ts +94 -0
- package/src/activities/Sample.ts +41 -0
- package/src/activities/SetSessionStorage.ts +57 -0
- package/src/activities/SliceLine.ts +61 -0
- package/src/elements/AttributeFilter.tsx +1867 -0
- package/src/elements/CircularSlider.tsx +67 -0
- package/src/elements/CsColorPicker.tsx +140 -0
- package/src/elements/DropDownMenu.tsx +282 -0
- package/src/elements/HeaderwithHelp.tsx +178 -0
- package/src/elements/ItemSearcher.tsx +1035 -0
- package/src/elements/ItemSearcher_v2.tsx +1071 -0
- package/src/elements/LineChartMui.tsx +50 -0
- package/src/elements/MenueBar.tsx +118 -0
- package/src/elements/MultipleAutoCompleteCS.tsx +145 -0
- package/src/elements/SampleInput.tsx +38 -0
- package/src/elements/SingleAutoCompleteCS.tsx +133 -0
- package/src/elements/TableRadioGoup.tsx +163 -0
- package/src/elements/Timeline.tsx +104 -0
- package/src/elements/ToggleButtonGroup.tsx +129 -0
- package/src/elements/Viewer360.tsx +71 -0
- package/src/elements/modules/AttributeFilterEasyComp.tsx +253 -0
- package/src/index.ts +43 -0
- package/src/main.ts +15 -0
- package/src/styles/imageSlider.css +34 -0
- package/tsconfig.json +12 -0
- package/uuid.js +7 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable @typescript-eslint/unbound-method */
|
|
3
|
+
import type { IActivityHandler } from "@vertigis/workflow";
|
|
4
|
+
|
|
5
|
+
/** An interface that defines the inputs of the activity. */
|
|
6
|
+
interface RequestCheckerInputs {}
|
|
7
|
+
|
|
8
|
+
/** An interface that defines the outputs of the activity. */
|
|
9
|
+
interface RequestCheckerOutputs {
|
|
10
|
+
/**
|
|
11
|
+
* @description True if there is still any pending request.
|
|
12
|
+
*/
|
|
13
|
+
result: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @displayName RequestChecker
|
|
18
|
+
* @category EBTA Utilities
|
|
19
|
+
* @description Check if there is any pending HTTP request
|
|
20
|
+
*/
|
|
21
|
+
export default class RequestCheckerActivity implements IActivityHandler {
|
|
22
|
+
// Track ongoing XMLHttpRequests
|
|
23
|
+
private static activeXHRs: XMLHttpRequest[] = [];
|
|
24
|
+
|
|
25
|
+
// Track ongoing Fetch requests
|
|
26
|
+
private static activeFetches: Promise<Response>[] = [];
|
|
27
|
+
|
|
28
|
+
constructor() {
|
|
29
|
+
// Monkey patch XMLHttpRequest to track active requests
|
|
30
|
+
const xhrProto = XMLHttpRequest.prototype as any;
|
|
31
|
+
|
|
32
|
+
const originalOpen = xhrProto.open;
|
|
33
|
+
const originalAbort = xhrProto.abort;
|
|
34
|
+
|
|
35
|
+
xhrProto.open = function (
|
|
36
|
+
this: XMLHttpRequest,
|
|
37
|
+
method: string,
|
|
38
|
+
url: string,
|
|
39
|
+
async?: boolean,
|
|
40
|
+
username?: string | null,
|
|
41
|
+
password?: string | null
|
|
42
|
+
): void {
|
|
43
|
+
RequestCheckerActivity.activeXHRs.push(this);
|
|
44
|
+
this.addEventListener("loadend", () => {
|
|
45
|
+
const index = RequestCheckerActivity.activeXHRs.indexOf(this);
|
|
46
|
+
if (index > -1) {
|
|
47
|
+
RequestCheckerActivity.activeXHRs.splice(index, 1);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return originalOpen.call(this, method, url, async, username, password);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
xhrProto.abort = function (this: XMLHttpRequest): void {
|
|
54
|
+
const index = RequestCheckerActivity.activeXHRs.indexOf(this);
|
|
55
|
+
if (index > -1) {
|
|
56
|
+
RequestCheckerActivity.activeXHRs.splice(index, 1);
|
|
57
|
+
}
|
|
58
|
+
return originalAbort.call(this);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// Monkey patch global fetch to track active promises
|
|
62
|
+
const originalFetch = window.fetch.bind(window);
|
|
63
|
+
(window as any).fetch = (...args: Parameters<typeof fetch>) => {
|
|
64
|
+
const fetchPromise = originalFetch(...args);
|
|
65
|
+
RequestCheckerActivity.activeFetches.push(fetchPromise);
|
|
66
|
+
|
|
67
|
+
void fetchPromise
|
|
68
|
+
.then(() => {
|
|
69
|
+
const index = RequestCheckerActivity.activeFetches.indexOf(fetchPromise);
|
|
70
|
+
if (index > -1) {
|
|
71
|
+
RequestCheckerActivity.activeFetches.splice(index, 1);
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
.catch(() => {
|
|
75
|
+
const index = RequestCheckerActivity.activeFetches.indexOf(fetchPromise);
|
|
76
|
+
if (index > -1) {
|
|
77
|
+
RequestCheckerActivity.activeFetches.splice(index, 1);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
return fetchPromise;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
execute(inputs: RequestCheckerInputs): RequestCheckerOutputs {
|
|
86
|
+
// Check both XMLHttpRequests and Fetch requests
|
|
87
|
+
const hasPendingXHR = RequestCheckerActivity.activeXHRs.length > 0;
|
|
88
|
+
const hasPendingFetch = RequestCheckerActivity.activeFetches.length > 0;
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
result: hasPendingXHR || hasPendingFetch,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { IActivityHandler } from "@vertigis/workflow";
|
|
2
|
+
|
|
3
|
+
/** An interface that defines the inputs of the activity. */
|
|
4
|
+
interface SampleInputs {
|
|
5
|
+
/**
|
|
6
|
+
* @displayName Input 1
|
|
7
|
+
* @description The first input to the activity.
|
|
8
|
+
* @required
|
|
9
|
+
*/
|
|
10
|
+
input1: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @displayName Input 2
|
|
14
|
+
* @description The second input to the activity.
|
|
15
|
+
*/
|
|
16
|
+
input2?: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** An interface that defines the outputs of the activity. */
|
|
20
|
+
interface SampleOutputs {
|
|
21
|
+
/**
|
|
22
|
+
* @description The result of the activity.
|
|
23
|
+
*/
|
|
24
|
+
result: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @displayName Sample
|
|
29
|
+
* @category Custom Activities
|
|
30
|
+
* @description sample for first prod-activity
|
|
31
|
+
*/
|
|
32
|
+
export default class SampleActivity implements IActivityHandler {
|
|
33
|
+
/** Perform the execution logic of the activity. */
|
|
34
|
+
execute(inputs: SampleInputs): SampleOutputs {
|
|
35
|
+
return {
|
|
36
|
+
result: `input1: ${inputs.input1}, input2: ${
|
|
37
|
+
inputs.input2 || "undefined"
|
|
38
|
+
}`,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { IActivityHandler } from "@vertigis/workflow";
|
|
2
|
+
|
|
3
|
+
/** An interface that defines the inputs of the activity. */
|
|
4
|
+
interface SetSessionStorageItemActivityInputs {
|
|
5
|
+
/**
|
|
6
|
+
* @displayName keyName
|
|
7
|
+
* @description A string containing the name of the key you want to create/update.
|
|
8
|
+
* @required
|
|
9
|
+
*/
|
|
10
|
+
keyName: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @displayName keyValue
|
|
14
|
+
* @description A string containing the value you want to give the key you are creating/updating.
|
|
15
|
+
* @required
|
|
16
|
+
*/
|
|
17
|
+
keyValue: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/** An interface that defines the outputs of the activity. */
|
|
22
|
+
interface SetSessionStorageItemActivityOutputs {
|
|
23
|
+
/**
|
|
24
|
+
* @description The result of the activity.
|
|
25
|
+
*/
|
|
26
|
+
result: object;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @displayName Set SessionStorage Item
|
|
32
|
+
* @category EBTA Utilities
|
|
33
|
+
* @description Add an item to browser SessionStorage object 1.1
|
|
34
|
+
*/
|
|
35
|
+
export default class SetSessionStorageItemActivity implements IActivityHandler {
|
|
36
|
+
/** Perform the execution logic of the activity. */
|
|
37
|
+
async execute(inputs: SetSessionStorageItemActivityInputs): Promise<SetSessionStorageItemActivityOutputs> {
|
|
38
|
+
const { keyName, keyValue } = inputs;
|
|
39
|
+
let message = "";
|
|
40
|
+
|
|
41
|
+
if (typeof(keyName) !== "undefined" && keyName !== null) {
|
|
42
|
+
if (typeof(keyValue) !== "undefined" && keyValue !== null) {
|
|
43
|
+
sessionStorage.setItem(keyName, keyValue);
|
|
44
|
+
message = "Wrote value to SessionStorage";
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
message = "Could not write value to SessionStorage"
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
result: {
|
|
51
|
+
"message": message,
|
|
52
|
+
"keyName": keyName,
|
|
53
|
+
"keyValue": keyValue
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { IActivityHandler } from "@vertigis/workflow";
|
|
2
|
+
import { lineString, lineSliceAlong, length } from "@turf/turf";
|
|
3
|
+
|
|
4
|
+
/** An interface that defines the inputs of the activity. */
|
|
5
|
+
interface SliceLineInputs {
|
|
6
|
+
/**
|
|
7
|
+
* @displayName Path
|
|
8
|
+
* @description an array of path coordinates.
|
|
9
|
+
* @required
|
|
10
|
+
*/
|
|
11
|
+
path: [];
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @displayName start
|
|
15
|
+
* @description start distance to slice
|
|
16
|
+
* @required
|
|
17
|
+
*/
|
|
18
|
+
start: number;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @displayName end
|
|
22
|
+
* @description end distance to slice
|
|
23
|
+
* @required
|
|
24
|
+
*/
|
|
25
|
+
end: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** An interface that defines the outputs of the activity. */
|
|
29
|
+
interface SliceLineOutputs {
|
|
30
|
+
/**
|
|
31
|
+
* @description The result of the activity.
|
|
32
|
+
*/
|
|
33
|
+
result: object;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function sliceLine(path: [], start: number, stop: number) {
|
|
37
|
+
const line = lineString(path);
|
|
38
|
+
const linelength = length(line, { units: "meters" });
|
|
39
|
+
|
|
40
|
+
if (stop > linelength) {
|
|
41
|
+
stop = linelength;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const sliced = lineSliceAlong(line, start, stop, { units: "meters" });
|
|
45
|
+
return sliced;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @displayName Slice Line
|
|
50
|
+
* @category Geocortex
|
|
51
|
+
* @description Slice Line based on start and end distance - Ver 1.01
|
|
52
|
+
*/
|
|
53
|
+
export default class SliceLineActivity implements IActivityHandler {
|
|
54
|
+
/** Perform the execution logic of the activity. */
|
|
55
|
+
execute(inputs: SliceLineInputs): SliceLineOutputs {
|
|
56
|
+
const result = sliceLine(inputs.path, inputs.start, inputs.end);
|
|
57
|
+
return {
|
|
58
|
+
result: result,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|