@posiwise/flows 0.0.1 → 0.0.3
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/fesm2022/posiwise-flows.mjs +1864 -671
- package/fesm2022/posiwise-flows.mjs.map +1 -1
- package/package.json +1 -1
- package/types/posiwise-flows.d.ts +602 -136
|
@@ -1,41 +1,45 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Injectable, Input, NgModule, Output, ViewChild } from "@angular/core";
|
|
3
|
-
import * as
|
|
2
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, HostListener, Injectable, Input, NgModule, Output, ViewChild, afterEveryRender } from "@angular/core";
|
|
3
|
+
import * as i8 from "@angular/router";
|
|
4
4
|
import { RouterModule } from "@angular/router";
|
|
5
|
-
import
|
|
5
|
+
import * as i3$1 from "@posiwise/core-guards";
|
|
6
|
+
import { PageAccessGuard, TrackDirtyFormDirective } from "@posiwise/core-guards";
|
|
6
7
|
import { AppBaseComponent } from "@posiwise/app-base-component";
|
|
7
|
-
import { Subject, combineLatest, forkJoin, throwError, timer } from "rxjs";
|
|
8
|
-
import { catchError, distinctUntilChanged, exhaustMap, finalize, map, shareReplay, takeUntil, takeWhile, tap } from "rxjs/operators";
|
|
9
|
-
import { faArrowAltCircleLeft, faBolt, faCircleCheck, faCircleExclamation, faCode, faCodeBranch, faDiagramProject, faExpand, faEye, faLayerGroup, faMagnifyingGlass, faPaperPlane, faPenToSquare, faPlusCircle, faTableList, faTrash, faTriangleExclamation } from "@fortawesome/free-solid-svg-icons";
|
|
8
|
+
import { Subject, combineLatest, forkJoin, of, throwError, timer } from "rxjs";
|
|
9
|
+
import { catchError, distinctUntilChanged, exhaustMap, finalize, map, shareReplay, switchMap, takeUntil, takeWhile, tap } from "rxjs/operators";
|
|
10
|
+
import { faArrowAltCircleLeft, faBolt, faChevronDown, faChevronRight, faCircleCheck, faCircleExclamation, faCode, faCodeBranch, faCopy, faDiagramProject, faExpand, faEye, faLayerGroup, faMagnifyingGlass, faPaperPlane, faPenToSquare, faPlusCircle, faTableList, faTrash, faTriangleExclamation } from "@fortawesome/free-solid-svg-icons";
|
|
10
11
|
import { FLOWS_NODES_PATH, FLOWS_RUNS_PATH, FLOWS_RUN_POLL_INTERVAL_MS, FLOWS_VERSIONS_PATH, FLOWS_WORKFLOWS_PATH } from "@posiwise/flows-shared";
|
|
12
|
+
import * as i1$3 from "@posiwise/shared-product-services";
|
|
11
13
|
import { HelperService } from "@posiwise/helper-service";
|
|
12
|
-
import * as
|
|
13
|
-
import * as i2$2 from "@posiwise/app-loader";
|
|
14
|
+
import * as i4$1 from "@posiwise/app-loader";
|
|
14
15
|
import { AppLoaderModule } from "@posiwise/app-loader";
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
17
|
-
import * as i5 from "@posiwise/shared-components";
|
|
16
|
+
import * as i5 from "primeng/table";
|
|
17
|
+
import * as i6 from "@posiwise/shared-components";
|
|
18
18
|
import { SharedComponentsModule } from "@posiwise/shared-components";
|
|
19
|
-
import * as
|
|
19
|
+
import * as i2$3 from "@fortawesome/angular-fontawesome";
|
|
20
20
|
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
|
|
21
|
-
import * as
|
|
21
|
+
import * as i1$2 from "@angular/common";
|
|
22
22
|
import { CommonModule } from "@angular/common";
|
|
23
|
-
import * as
|
|
23
|
+
import * as i2$4 from "@jsverse/transloco";
|
|
24
24
|
import { TRANSLOCO_SCOPE } from "@jsverse/transloco";
|
|
25
|
-
import * as
|
|
25
|
+
import * as i1$1 from "primeng/tooltip";
|
|
26
|
+
import * as i13 from "@posiwise/pipes";
|
|
27
|
+
import { PipesModule } from "@posiwise/pipes";
|
|
28
|
+
import * as i3$2 from "@angular/forms";
|
|
26
29
|
import { FormsModule, ReactiveFormsModule, UntypedFormBuilder, Validators } from "@angular/forms";
|
|
27
30
|
import * as i4 from "primeng/select";
|
|
28
31
|
import * as i1 from "@posiwise/common-services";
|
|
29
32
|
import { PERMISSION_NAMES } from "@posiwise/common-utilities";
|
|
30
33
|
import { AreaExtensions, AreaPlugin } from "rete-area-plugin";
|
|
31
34
|
import { ClassicPreset, NodeEditor } from "rete";
|
|
32
|
-
import * as i2$
|
|
35
|
+
import * as i2$2 from "rete-angular-plugin/22";
|
|
33
36
|
import { AngularPlugin, Presets, ReteModule } from "rete-angular-plugin/22";
|
|
34
37
|
import { ConnectionPlugin, Presets as Presets$1 } from "rete-connection-plugin";
|
|
35
|
-
import * as i2 from "@posiwise/utils";
|
|
38
|
+
import * as i2$1 from "@posiwise/utils";
|
|
36
39
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
37
40
|
import * as i3 from "primeng/autocomplete";
|
|
38
41
|
import { AutoCompleteModule } from "primeng/autocomplete";
|
|
42
|
+
import * as i2 from "ngx-ui-switch";
|
|
39
43
|
import * as i9 from "primeng/iconfield";
|
|
40
44
|
import { IconFieldModule } from "primeng/iconfield";
|
|
41
45
|
import * as i10 from "primeng/inputicon";
|
|
@@ -53,10 +57,13 @@ const FLOWS_ICONS = {
|
|
|
53
57
|
versions: faLayerGroup,
|
|
54
58
|
search: faMagnifyingGlass,
|
|
55
59
|
publish: faCircleCheck,
|
|
60
|
+
duplicate: faCopy,
|
|
56
61
|
fit: faExpand,
|
|
57
62
|
diagram: faDiagramProject,
|
|
58
63
|
json: faCode,
|
|
59
|
-
warning: faTriangleExclamation
|
|
64
|
+
warning: faTriangleExclamation,
|
|
65
|
+
collapsed: faChevronRight,
|
|
66
|
+
expanded: faChevronDown
|
|
60
67
|
};
|
|
61
68
|
const FLOW_CATEGORY_ICONS = {
|
|
62
69
|
trigger: faBolt,
|
|
@@ -64,6 +71,57 @@ const FLOW_CATEGORY_ICONS = {
|
|
|
64
71
|
data: faTableList,
|
|
65
72
|
action: faPaperPlane
|
|
66
73
|
};
|
|
74
|
+
const FLOW_NODE_CATEGORIES = [
|
|
75
|
+
"trigger",
|
|
76
|
+
"logic",
|
|
77
|
+
"data",
|
|
78
|
+
"action"
|
|
79
|
+
];
|
|
80
|
+
const DEFAULT_FLOW_BRANCH = "next";
|
|
81
|
+
const FLOW_RETRY_DEFAULT = {
|
|
82
|
+
times: 3,
|
|
83
|
+
wait_seconds: 30
|
|
84
|
+
};
|
|
85
|
+
function emptyFlowGraph() {
|
|
86
|
+
return {
|
|
87
|
+
nodes: [],
|
|
88
|
+
edges: []
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function isRecord(value) {
|
|
92
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
93
|
+
}
|
|
94
|
+
function toFlowGraph(value) {
|
|
95
|
+
if (!isRecord(value)) return emptyFlowGraph();
|
|
96
|
+
const nodes = Array.isArray(value["nodes"]) ? value["nodes"] : [];
|
|
97
|
+
const edges = Array.isArray(value["edges"]) ? value["edges"] : [];
|
|
98
|
+
return {
|
|
99
|
+
nodes: nodes.filter((node) => isRecord(node) && typeof node["id"] === "string" && typeof node["type"] === "string"),
|
|
100
|
+
edges: edges.filter((edge) => isRecord(edge) && typeof edge["from"] === "string" && typeof edge["to"] === "string")
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function nextId(prefix, taken) {
|
|
104
|
+
const pattern = new RegExp(String.raw`^${prefix}(\d+)$`);
|
|
105
|
+
return `${prefix}${taken.reduce((max, id) => {
|
|
106
|
+
const match = pattern.exec(id);
|
|
107
|
+
return match ? Math.max(max, Number(match[1])) : max;
|
|
108
|
+
}, 0) + 1}`;
|
|
109
|
+
}
|
|
110
|
+
function nextFlowNodeId(nodes) {
|
|
111
|
+
return nextId("n", nodes.map((node) => node.id));
|
|
112
|
+
}
|
|
113
|
+
function nextFlowEdgeId(edges) {
|
|
114
|
+
return nextId("e", edges.map((edge) => edge.id ?? ""));
|
|
115
|
+
}
|
|
116
|
+
function flowNodeLabelKey(type) {
|
|
117
|
+
return `Flows.Nodes.${type}`;
|
|
118
|
+
}
|
|
119
|
+
function flowNodeWithRetry(node, retry) {
|
|
120
|
+
const next = { ...node };
|
|
121
|
+
if (retry) next.retry = retry;
|
|
122
|
+
else delete next.retry;
|
|
123
|
+
return next;
|
|
124
|
+
}
|
|
67
125
|
const BADGE_BASE = "pw-flow-badge";
|
|
68
126
|
function flowBadgeClass(tone) {
|
|
69
127
|
return `${BADGE_BASE} ${BADGE_BASE}--${tone}`;
|
|
@@ -100,6 +158,74 @@ function flowRunStepBadgeClass(status) {
|
|
|
100
158
|
default: return flowBadgeClass("info");
|
|
101
159
|
}
|
|
102
160
|
}
|
|
161
|
+
function flowRunScheduledFor(run) {
|
|
162
|
+
const payload = run?.trigger_payload;
|
|
163
|
+
return typeof payload?.scheduled_for === "string" ? payload.scheduled_for : null;
|
|
164
|
+
}
|
|
165
|
+
var FlowsNodeService = class FlowsNodeService {
|
|
166
|
+
constructor(api) {
|
|
167
|
+
this.api = api;
|
|
168
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
169
|
+
}
|
|
170
|
+
getNodes(subscriptionId) {
|
|
171
|
+
let nodes = this.cache.get(subscriptionId);
|
|
172
|
+
if (!nodes) {
|
|
173
|
+
nodes = this.api.getWithParams(FLOWS_NODES_PATH, { subscription_id: subscriptionId }).pipe(map((response) => response.flow_nodes), catchError((error) => {
|
|
174
|
+
this.cache.delete(subscriptionId);
|
|
175
|
+
return throwError(() => error);
|
|
176
|
+
}), shareReplay({
|
|
177
|
+
bufferSize: 1,
|
|
178
|
+
refCount: false
|
|
179
|
+
}));
|
|
180
|
+
this.cache.set(subscriptionId, nodes);
|
|
181
|
+
}
|
|
182
|
+
return nodes;
|
|
183
|
+
}
|
|
184
|
+
static {
|
|
185
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
186
|
+
minVersion: "12.0.0",
|
|
187
|
+
version: "22.2.0",
|
|
188
|
+
ngImport: i0,
|
|
189
|
+
type: FlowsNodeService,
|
|
190
|
+
deps: [{ token: i1$3.ProductsHttpService }],
|
|
191
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
static {
|
|
195
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
196
|
+
minVersion: "12.0.0",
|
|
197
|
+
version: "22.2.0",
|
|
198
|
+
ngImport: i0,
|
|
199
|
+
type: FlowsNodeService,
|
|
200
|
+
providedIn: "root"
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
205
|
+
minVersion: "12.0.0",
|
|
206
|
+
version: "22.2.0",
|
|
207
|
+
ngImport: i0,
|
|
208
|
+
type: FlowsNodeService,
|
|
209
|
+
decorators: [{
|
|
210
|
+
type: Injectable,
|
|
211
|
+
args: [{ providedIn: "root" }]
|
|
212
|
+
}],
|
|
213
|
+
ctorParameters: () => [{ type: i1$3.ProductsHttpService }]
|
|
214
|
+
});
|
|
215
|
+
const NO_FLOW_WORKFLOW_FIELDS = {
|
|
216
|
+
byNode: {},
|
|
217
|
+
ran: false
|
|
218
|
+
};
|
|
219
|
+
function flowNodeFieldsKey(nodeId, type) {
|
|
220
|
+
return `${nodeId}|${type ?? ""}`;
|
|
221
|
+
}
|
|
222
|
+
function toFlowWorkflowFields(rows) {
|
|
223
|
+
const list = rows ?? [];
|
|
224
|
+
return {
|
|
225
|
+
byNode: Object.fromEntries(list.map((row) => [flowNodeFieldsKey(row.node_id, row.node_type), row.item_fields])),
|
|
226
|
+
ran: list.length > 0
|
|
227
|
+
};
|
|
228
|
+
}
|
|
103
229
|
var FlowsRunService = class FlowsRunService {
|
|
104
230
|
constructor(api) {
|
|
105
231
|
this.api = api;
|
|
@@ -133,6 +259,9 @@ var FlowsRunService = class FlowsRunService {
|
|
|
133
259
|
hasUnsettledRun(response) {
|
|
134
260
|
return (response?.flow_runs ?? []).some((run) => !isFlowRunTerminal(run));
|
|
135
261
|
}
|
|
262
|
+
getWorkflowFields(workflowId, subscriptionId) {
|
|
263
|
+
return this.api.getWithParams(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/fields`, { subscription_id: subscriptionId }).pipe(map((response) => toFlowWorkflowFields(response.flow_workflow_fields)), catchError(() => of(NO_FLOW_WORKFLOW_FIELDS)));
|
|
264
|
+
}
|
|
136
265
|
definedQuery(query) {
|
|
137
266
|
const params = {};
|
|
138
267
|
if (query.status) params["status"] = query.status;
|
|
@@ -146,7 +275,7 @@ var FlowsRunService = class FlowsRunService {
|
|
|
146
275
|
version: "22.2.0",
|
|
147
276
|
ngImport: i0,
|
|
148
277
|
type: FlowsRunService,
|
|
149
|
-
deps: [{ token: i1$
|
|
278
|
+
deps: [{ token: i1$3.ProductsHttpService }],
|
|
150
279
|
target: i0.ɵɵFactoryTarget.Injectable
|
|
151
280
|
});
|
|
152
281
|
}
|
|
@@ -169,90 +298,157 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
169
298
|
type: Injectable,
|
|
170
299
|
args: [{ providedIn: "root" }]
|
|
171
300
|
}],
|
|
172
|
-
ctorParameters: () => [{ type: i1$
|
|
301
|
+
ctorParameters: () => [{ type: i1$3.ProductsHttpService }]
|
|
173
302
|
});
|
|
174
|
-
var
|
|
175
|
-
constructor(
|
|
176
|
-
|
|
177
|
-
this.flowsRunService = flowsRunService;
|
|
178
|
-
this.cdr = cdr;
|
|
179
|
-
this.destroy$ = new Subject();
|
|
180
|
-
this.loading = true;
|
|
181
|
-
this.notFound = false;
|
|
182
|
-
this.steps = [];
|
|
183
|
-
this.icons = FLOWS_ICONS;
|
|
184
|
-
this.openSteps = /* @__PURE__ */ new Set();
|
|
185
|
-
this.trackByStep = (_, step) => step.id;
|
|
303
|
+
var FlowsWorkflowService = class FlowsWorkflowService {
|
|
304
|
+
constructor(api) {
|
|
305
|
+
this.api = api;
|
|
186
306
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
this.watch(subscriptionId);
|
|
307
|
+
getWorkflows(subscriptionId, status, paging) {
|
|
308
|
+
return this.api.getWithParams(`${FLOWS_WORKFLOWS_PATH}/get_all`, {
|
|
309
|
+
subscription_id: subscriptionId,
|
|
310
|
+
...status ? { status } : {},
|
|
311
|
+
...HelperService.getPagingParams(paging)
|
|
195
312
|
});
|
|
196
313
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
this.watch$?.unsubscribe();
|
|
200
|
-
this.destroy$.next();
|
|
201
|
-
this.destroy$.complete();
|
|
314
|
+
getWorkflow(id, subscriptionId) {
|
|
315
|
+
return this.api.getWithParams(`${FLOWS_WORKFLOWS_PATH}/${id}`, { subscription_id: subscriptionId });
|
|
202
316
|
}
|
|
203
|
-
|
|
204
|
-
this.
|
|
317
|
+
getVersion(id, subscriptionId) {
|
|
318
|
+
return this.api.getWithParams(`${FLOWS_VERSIONS_PATH}/${id}`, { subscription_id: subscriptionId });
|
|
205
319
|
}
|
|
206
|
-
|
|
207
|
-
return
|
|
320
|
+
createWorkflow(subscriptionId, attrs) {
|
|
321
|
+
return this.api.post(FLOWS_WORKFLOWS_PATH, {
|
|
322
|
+
subscription_id: subscriptionId,
|
|
323
|
+
...attrs
|
|
324
|
+
});
|
|
208
325
|
}
|
|
209
|
-
|
|
210
|
-
return
|
|
326
|
+
updateWorkflow(id, subscriptionId, attrs) {
|
|
327
|
+
return this.api.put(`${FLOWS_WORKFLOWS_PATH}/${id}`, {
|
|
328
|
+
subscription_id: subscriptionId,
|
|
329
|
+
...attrs
|
|
330
|
+
});
|
|
211
331
|
}
|
|
212
|
-
|
|
213
|
-
return
|
|
332
|
+
deleteWorkflow(id, subscriptionId) {
|
|
333
|
+
return this.api.delete(`${FLOWS_WORKFLOWS_PATH}/${id}`, { params: { subscription_id: String(subscriptionId) } });
|
|
214
334
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
335
|
+
getVersions(workflowId, subscriptionId, paging) {
|
|
336
|
+
return this.api.getWithParams(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/versions`, {
|
|
337
|
+
subscription_id: subscriptionId,
|
|
338
|
+
...HelperService.getPagingParams(paging)
|
|
339
|
+
});
|
|
218
340
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
341
|
+
createVersion(workflowId, subscriptionId, graph) {
|
|
342
|
+
return this.api.post(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/versions`, {
|
|
343
|
+
subscription_id: subscriptionId,
|
|
344
|
+
graph
|
|
345
|
+
});
|
|
222
346
|
}
|
|
223
|
-
|
|
224
|
-
this.
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
this.run = detail.run;
|
|
228
|
-
this.steps = detail.steps?.flow_run_steps ?? [];
|
|
229
|
-
this.notFound = false;
|
|
230
|
-
this.settle();
|
|
231
|
-
},
|
|
232
|
-
error: () => this.fail()
|
|
347
|
+
updateVersion(id, subscriptionId, graph) {
|
|
348
|
+
return this.api.put(`${FLOWS_VERSIONS_PATH}/${id}`, {
|
|
349
|
+
subscription_id: subscriptionId,
|
|
350
|
+
graph
|
|
233
351
|
});
|
|
234
352
|
}
|
|
235
|
-
|
|
236
|
-
this.
|
|
353
|
+
checkGraph(workflowId, subscriptionId, graph) {
|
|
354
|
+
return this.api.post(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/versions/check`, {
|
|
355
|
+
subscription_id: subscriptionId,
|
|
356
|
+
graph
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
publishVersion(id, subscriptionId) {
|
|
360
|
+
return this.api.put(`${FLOWS_VERSIONS_PATH}/${id}/publish`, { subscription_id: subscriptionId });
|
|
361
|
+
}
|
|
362
|
+
publishChecked(workflowId, version, subscriptionId) {
|
|
363
|
+
return this.checkGraph(workflowId, subscriptionId, version.graph).pipe(switchMap((check) => check.valid ? this.publishVersion(version.id, subscriptionId) : of(check)));
|
|
364
|
+
}
|
|
365
|
+
static {
|
|
366
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
367
|
+
minVersion: "12.0.0",
|
|
368
|
+
version: "22.2.0",
|
|
369
|
+
ngImport: i0,
|
|
370
|
+
type: FlowsWorkflowService,
|
|
371
|
+
deps: [{ token: i1$3.ProductsHttpService }],
|
|
372
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
static {
|
|
376
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
377
|
+
minVersion: "12.0.0",
|
|
378
|
+
version: "22.2.0",
|
|
379
|
+
ngImport: i0,
|
|
380
|
+
type: FlowsWorkflowService,
|
|
381
|
+
providedIn: "root"
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
386
|
+
minVersion: "12.0.0",
|
|
387
|
+
version: "22.2.0",
|
|
388
|
+
ngImport: i0,
|
|
389
|
+
type: FlowsWorkflowService,
|
|
390
|
+
decorators: [{
|
|
391
|
+
type: Injectable,
|
|
392
|
+
args: [{ providedIn: "root" }]
|
|
393
|
+
}],
|
|
394
|
+
ctorParameters: () => [{ type: i1$3.ProductsHttpService }]
|
|
395
|
+
});
|
|
396
|
+
function flowRunProgress(steps, nodeIds) {
|
|
397
|
+
const count = (...statuses) => steps.filter((step) => statuses.includes(step.status)).length;
|
|
398
|
+
const stepped = new Set(steps.map((step) => step.node_id));
|
|
399
|
+
const waiting = nodeIds.filter((id) => !stepped.has(id)).length;
|
|
400
|
+
const total = steps.length + waiting;
|
|
401
|
+
const done = count("succeeded");
|
|
402
|
+
const failed = count("failed");
|
|
403
|
+
const skipped = count("skipped");
|
|
404
|
+
const settled = done + failed + skipped;
|
|
405
|
+
return {
|
|
406
|
+
done,
|
|
407
|
+
failed,
|
|
408
|
+
skipped,
|
|
409
|
+
settled,
|
|
410
|
+
running: count("pending", "running", "awaiting"),
|
|
411
|
+
waiting,
|
|
412
|
+
total,
|
|
413
|
+
percent: total ? Math.round(settled / total * 100) : 0
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
var FlowsRunProgressComponent = class FlowsRunProgressComponent {
|
|
417
|
+
constructor(cdr) {
|
|
418
|
+
this.cdr = cdr;
|
|
237
419
|
this.steps = [];
|
|
238
|
-
this.
|
|
239
|
-
this.
|
|
420
|
+
this.nodeIds = [];
|
|
421
|
+
this.progress = flowRunProgress([], []);
|
|
422
|
+
this.elapsed = null;
|
|
240
423
|
}
|
|
241
|
-
|
|
242
|
-
this.
|
|
243
|
-
|
|
424
|
+
get ended() {
|
|
425
|
+
return isFlowRunTerminal(this.run);
|
|
426
|
+
}
|
|
427
|
+
ngOnChanges() {
|
|
428
|
+
this.progress = flowRunProgress(this.steps, this.nodeIds);
|
|
429
|
+
this.updateElapsed();
|
|
430
|
+
if (this.ended) {
|
|
431
|
+
this.tick$?.unsubscribe();
|
|
432
|
+
this.tick$ = void 0;
|
|
433
|
+
} else if (!this.tick$) this.tick$ = timer(1e3, 1e3).subscribe(() => {
|
|
434
|
+
this.updateElapsed();
|
|
435
|
+
this.cdr.markForCheck();
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
ngOnDestroy() {
|
|
439
|
+
this.tick$?.unsubscribe();
|
|
440
|
+
}
|
|
441
|
+
updateElapsed() {
|
|
442
|
+
const until = this.ended ? this.run.finished_at : (/* @__PURE__ */ new Date()).toISOString();
|
|
443
|
+
this.elapsed = elapsedMs(this.run.started_at, until);
|
|
244
444
|
}
|
|
245
445
|
static {
|
|
246
446
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
247
447
|
minVersion: "12.0.0",
|
|
248
448
|
version: "22.2.0",
|
|
249
449
|
ngImport: i0,
|
|
250
|
-
type:
|
|
251
|
-
deps: [
|
|
252
|
-
{ token: i0.Injector },
|
|
253
|
-
{ token: FlowsRunService },
|
|
254
|
-
{ token: i0.ChangeDetectorRef }
|
|
255
|
-
],
|
|
450
|
+
type: FlowsRunProgressComponent,
|
|
451
|
+
deps: [{ token: i0.ChangeDetectorRef }],
|
|
256
452
|
target: i0.ɵɵFactoryTarget.Component
|
|
257
453
|
});
|
|
258
454
|
}
|
|
@@ -260,27 +456,143 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
260
456
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
261
457
|
minVersion: "17.0.0",
|
|
262
458
|
version: "22.2.0",
|
|
263
|
-
type:
|
|
459
|
+
type: FlowsRunProgressComponent,
|
|
264
460
|
isStandalone: false,
|
|
265
|
-
selector: "pw-flows-run-
|
|
266
|
-
|
|
461
|
+
selector: "pw-flows-run-progress",
|
|
462
|
+
inputs: {
|
|
463
|
+
run: "run",
|
|
464
|
+
steps: "steps",
|
|
465
|
+
nodeIds: "nodeIds"
|
|
466
|
+
},
|
|
467
|
+
usesOnChanges: true,
|
|
267
468
|
ngImport: i0,
|
|
268
|
-
template: "<div class=\"
|
|
269
|
-
styles: [".pw-
|
|
270
|
-
dependencies: [
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
469
|
+
template: "<div class=\"pw-run-progress\"\n data-testid=\"flow-run-progress\">\n <div class=\"pw-run-progress__head\">\n <span class=\"pw-run-progress__label\">\n {{ (ended ? 'Flows.Run.Progress.Finished' : 'Flows.Run.Progress.Running') | transloco: { settled: progress.settled, total: progress.total } }}\n </span>\n @if (elapsed !== null) {\n <span class=\"pw-run-progress__elapsed\">\n {{ elapsed / 1000 | number: '1.0-0' }}{{ 'Flows.Runs.SecondsSuffix' | transloco }}\n </span>\n }\n </div>\n\n <div class=\"progress pw-run-progress__bar\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"progress.percent\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-label]=\"'Flows.Run.Progress.Label' | transloco\">\n <!-- Width is the run's own percentage, so it cannot live in the stylesheet. -->\n <div class=\"progress-bar\"\n [class.is-failed]=\"progress.failed > 0\"\n [class.is-live]=\"!ended\"\n [style.width.%]=\"progress.percent\"></div>\n </div>\n\n <ul class=\"pw-run-progress__counts\">\n <li>{{ 'Flows.Run.Progress.Done' | transloco: { count: progress.done } }}</li>\n @if (progress.running) {\n <li class=\"is-running\">{{ 'Flows.Run.Progress.InProgress' | transloco: { count: progress.running } }}</li>\n }\n @if (progress.failed) {\n <li class=\"is-failed\">{{ 'Flows.Run.Progress.Failed' | transloco: { count: progress.failed } }}</li>\n }\n @if (progress.skipped) {\n <li>{{ 'Flows.Run.Progress.Skipped' | transloco: { count: progress.skipped } }}</li>\n }\n @if (progress.waiting) {\n <li>{{ (ended ? 'Flows.Run.Progress.NotRun' : 'Flows.Run.Progress.Waiting') | transloco: { count: progress.waiting } }}</li>\n }\n </ul>\n</div>\n",
|
|
470
|
+
styles: [".pw-run-progress{margin-bottom:16px}.pw-run-progress__head{display:flex;justify-content:space-between;gap:12px;margin-bottom:6px}.pw-run-progress__label{font-weight:600;color:#1a1d21}.pw-run-progress__elapsed{color:#5a6473}.pw-run-progress__bar{height:8px}.pw-run-progress__bar .progress-bar{background-color:var(--first);transition:width .4s ease}.pw-run-progress__bar .progress-bar.is-failed{background-color:#c0392b}.pw-run-progress__bar .progress-bar.is-live{background-image:linear-gradient(45deg,rgba(255,255,255,.2) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.2) 50%,rgba(255,255,255,.2) 75%,transparent 75%);background-size:16px 16px;animation:pw-run-progress-stripes 1s linear infinite}.pw-run-progress__counts{display:flex;flex-wrap:wrap;gap:4px 16px;list-style:none;padding:0;margin:8px 0 0;font-size:12px;color:#5a6473}.pw-run-progress__counts .is-running{color:#1a1d21}.pw-run-progress__counts .is-failed{color:#c0392b}@keyframes pw-run-progress-stripes{0%{background-position:16px 0}to{background-position:0 0}}@media(prefers-reduced-motion:reduce){.pw-run-progress__bar .progress-bar{transition:none}.pw-run-progress__bar .progress-bar.is-live{animation:none}}\n"],
|
|
471
|
+
dependencies: [{
|
|
472
|
+
kind: "pipe",
|
|
473
|
+
type: i1$2.DecimalPipe,
|
|
474
|
+
name: "number"
|
|
475
|
+
}, {
|
|
476
|
+
kind: "pipe",
|
|
477
|
+
type: i2$4.TranslocoPipe,
|
|
478
|
+
name: "transloco"
|
|
479
|
+
}]
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
484
|
+
minVersion: "12.0.0",
|
|
485
|
+
version: "22.2.0",
|
|
486
|
+
ngImport: i0,
|
|
487
|
+
type: FlowsRunProgressComponent,
|
|
488
|
+
decorators: [{
|
|
489
|
+
type: Component,
|
|
490
|
+
args: [{
|
|
491
|
+
selector: "pw-flows-run-progress",
|
|
492
|
+
standalone: false,
|
|
493
|
+
template: "<div class=\"pw-run-progress\"\n data-testid=\"flow-run-progress\">\n <div class=\"pw-run-progress__head\">\n <span class=\"pw-run-progress__label\">\n {{ (ended ? 'Flows.Run.Progress.Finished' : 'Flows.Run.Progress.Running') | transloco: { settled: progress.settled, total: progress.total } }}\n </span>\n @if (elapsed !== null) {\n <span class=\"pw-run-progress__elapsed\">\n {{ elapsed / 1000 | number: '1.0-0' }}{{ 'Flows.Runs.SecondsSuffix' | transloco }}\n </span>\n }\n </div>\n\n <div class=\"progress pw-run-progress__bar\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"progress.percent\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-label]=\"'Flows.Run.Progress.Label' | transloco\">\n <!-- Width is the run's own percentage, so it cannot live in the stylesheet. -->\n <div class=\"progress-bar\"\n [class.is-failed]=\"progress.failed > 0\"\n [class.is-live]=\"!ended\"\n [style.width.%]=\"progress.percent\"></div>\n </div>\n\n <ul class=\"pw-run-progress__counts\">\n <li>{{ 'Flows.Run.Progress.Done' | transloco: { count: progress.done } }}</li>\n @if (progress.running) {\n <li class=\"is-running\">{{ 'Flows.Run.Progress.InProgress' | transloco: { count: progress.running } }}</li>\n }\n @if (progress.failed) {\n <li class=\"is-failed\">{{ 'Flows.Run.Progress.Failed' | transloco: { count: progress.failed } }}</li>\n }\n @if (progress.skipped) {\n <li>{{ 'Flows.Run.Progress.Skipped' | transloco: { count: progress.skipped } }}</li>\n }\n @if (progress.waiting) {\n <li>{{ (ended ? 'Flows.Run.Progress.NotRun' : 'Flows.Run.Progress.Waiting') | transloco: { count: progress.waiting } }}</li>\n }\n </ul>\n</div>\n",
|
|
494
|
+
styles: [".pw-run-progress{margin-bottom:16px}.pw-run-progress__head{display:flex;justify-content:space-between;gap:12px;margin-bottom:6px}.pw-run-progress__label{font-weight:600;color:#1a1d21}.pw-run-progress__elapsed{color:#5a6473}.pw-run-progress__bar{height:8px}.pw-run-progress__bar .progress-bar{background-color:var(--first);transition:width .4s ease}.pw-run-progress__bar .progress-bar.is-failed{background-color:#c0392b}.pw-run-progress__bar .progress-bar.is-live{background-image:linear-gradient(45deg,rgba(255,255,255,.2) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.2) 50%,rgba(255,255,255,.2) 75%,transparent 75%);background-size:16px 16px;animation:pw-run-progress-stripes 1s linear infinite}.pw-run-progress__counts{display:flex;flex-wrap:wrap;gap:4px 16px;list-style:none;padding:0;margin:8px 0 0;font-size:12px;color:#5a6473}.pw-run-progress__counts .is-running{color:#1a1d21}.pw-run-progress__counts .is-failed{color:#c0392b}@keyframes pw-run-progress-stripes{0%{background-position:16px 0}to{background-position:0 0}}@media(prefers-reduced-motion:reduce){.pw-run-progress__bar .progress-bar{transition:none}.pw-run-progress__bar .progress-bar.is-live{animation:none}}\n"]
|
|
495
|
+
}]
|
|
496
|
+
}],
|
|
497
|
+
ctorParameters: () => [{ type: i0.ChangeDetectorRef }],
|
|
498
|
+
propDecorators: {
|
|
499
|
+
run: [{
|
|
500
|
+
type: Input,
|
|
501
|
+
args: [{ required: true }]
|
|
502
|
+
}],
|
|
503
|
+
steps: [{ type: Input }],
|
|
504
|
+
nodeIds: [{ type: Input }]
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
const PREFIX = "Flows.Run.Errors.";
|
|
508
|
+
const BY_CODE = {
|
|
509
|
+
awaiting_timeout: "Timeout",
|
|
510
|
+
no_credentials: "NoCredentials",
|
|
511
|
+
no_crm: "NoCrm",
|
|
512
|
+
output_too_large: "OutputTooLarge",
|
|
513
|
+
unsupported_action: "CannotRunHere",
|
|
514
|
+
unsupported_connector: "CannotRunHere",
|
|
515
|
+
unsupported_request: "CannotRunHere",
|
|
516
|
+
unsupported_shard: "CannotRunHere",
|
|
517
|
+
task_request_failed: "NotSent",
|
|
518
|
+
task_received_no_items: "NoItems",
|
|
519
|
+
email_recipients_invalid: "EmailRecipients",
|
|
520
|
+
no_shard_for_email: "EmailNotSent",
|
|
521
|
+
delivery_failed: "EmailNotSent",
|
|
522
|
+
user_not_in_subscription: "UserNotInSubscription",
|
|
523
|
+
split_out_requires_a_field: "FieldNotSet",
|
|
524
|
+
aggregate_requires_a_field: "FieldNotSet",
|
|
525
|
+
split_out_field_missing: "FieldMissing",
|
|
526
|
+
split_out_field_not_a_list: "FieldNotAList",
|
|
527
|
+
template_path_missing: "PlaceholderMissing",
|
|
528
|
+
set_fields_requires_an_object: "SetFieldsInvalid",
|
|
529
|
+
set_fields_received_a_non_object_item: "SetFieldsInvalid",
|
|
530
|
+
evaluation_failed: "ConditionFailed"
|
|
531
|
+
};
|
|
532
|
+
function callFailure(detail) {
|
|
533
|
+
const status = Number(/\b([45]\d\d)\b/.exec(detail)?.[1]);
|
|
534
|
+
if (status === 401 || status === 403) return "SignInRefused";
|
|
535
|
+
if (status === 404) return "NotFound";
|
|
536
|
+
if (status === 429) return "RateLimited";
|
|
537
|
+
return status >= 500 ? "ServiceError" : "CallFailed";
|
|
538
|
+
}
|
|
539
|
+
function flowStepErrorText(error) {
|
|
540
|
+
if (!error) return null;
|
|
541
|
+
const colon = error.indexOf(":");
|
|
542
|
+
const code = (colon === -1 ? error : error.slice(0, colon)).trim();
|
|
543
|
+
const detail = colon === -1 ? "" : error.slice(colon + 1).trim();
|
|
544
|
+
if (code === "integration_call_failed") return {
|
|
545
|
+
key: PREFIX + callFailure(detail),
|
|
546
|
+
params: {}
|
|
547
|
+
};
|
|
548
|
+
const known = BY_CODE[code];
|
|
549
|
+
return known ? {
|
|
550
|
+
key: PREFIX + known,
|
|
551
|
+
params: { detail }
|
|
552
|
+
} : {
|
|
553
|
+
key: PREFIX + "Unknown",
|
|
554
|
+
params: { detail: error }
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
var FlowsStepErrorComponent = class FlowsStepErrorComponent {
|
|
558
|
+
constructor() {
|
|
559
|
+
this.error = null;
|
|
560
|
+
this.retrying = false;
|
|
561
|
+
this.icons = FLOWS_ICONS;
|
|
562
|
+
this.text = null;
|
|
563
|
+
}
|
|
564
|
+
ngOnChanges() {
|
|
565
|
+
this.text = flowStepErrorText(this.error);
|
|
566
|
+
}
|
|
567
|
+
static {
|
|
568
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
569
|
+
minVersion: "12.0.0",
|
|
570
|
+
version: "22.2.0",
|
|
571
|
+
ngImport: i0,
|
|
572
|
+
type: FlowsStepErrorComponent,
|
|
573
|
+
deps: [],
|
|
574
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
static {
|
|
578
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
579
|
+
minVersion: "17.0.0",
|
|
580
|
+
version: "22.2.0",
|
|
581
|
+
type: FlowsStepErrorComponent,
|
|
582
|
+
isStandalone: false,
|
|
583
|
+
selector: "pw-flows-step-error",
|
|
584
|
+
inputs: {
|
|
585
|
+
error: "error",
|
|
586
|
+
retrying: "retrying"
|
|
587
|
+
},
|
|
588
|
+
usesOnChanges: true,
|
|
589
|
+
ngImport: i0,
|
|
590
|
+
template: "@if (text) {\n@let reason = text.key | transloco: text.params;\n<span class=\"pw-step-error\"\n [class.is-retrying]=\"retrying\"\n [pTooltip]=\"error\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon [icon]=\"retrying ? icons.warning : icons.error\"\n aria-hidden=\"true\"></fa-icon>\n</span>\n<small class=\"pw-step-error__text\"\n [class.is-retrying]=\"retrying\"\n data-testid=\"flow-step-error-text\">\n {{ retrying ? ('Flows.Run.Errors.LastTry' | transloco: { reason }) : reason }}\n</small>\n}\n",
|
|
591
|
+
styles: [":host{display:contents}.pw-step-error{margin-left:6px;color:#c0392b;cursor:help}.pw-step-error__text{display:block;max-width:280px;margin-top:4px;color:#c0392b;white-space:normal;overflow-wrap:anywhere}.pw-step-error.is-retrying,.pw-step-error__text.is-retrying{color:#8a6d00}\n"],
|
|
592
|
+
dependencies: [
|
|
281
593
|
{
|
|
282
594
|
kind: "directive",
|
|
283
|
-
type:
|
|
595
|
+
type: i1$1.Tooltip,
|
|
284
596
|
selector: "[pTooltip]",
|
|
285
597
|
inputs: [
|
|
286
598
|
"tooltipPosition",
|
|
@@ -308,7 +620,205 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
308
620
|
},
|
|
309
621
|
{
|
|
310
622
|
kind: "component",
|
|
311
|
-
type:
|
|
623
|
+
type: i2$3.FaIconComponent,
|
|
624
|
+
selector: "fa-icon",
|
|
625
|
+
inputs: [
|
|
626
|
+
"icon",
|
|
627
|
+
"title",
|
|
628
|
+
"animation",
|
|
629
|
+
"mask",
|
|
630
|
+
"flip",
|
|
631
|
+
"size",
|
|
632
|
+
"pull",
|
|
633
|
+
"border",
|
|
634
|
+
"inverse",
|
|
635
|
+
"symbol",
|
|
636
|
+
"rotate",
|
|
637
|
+
"fixedWidth",
|
|
638
|
+
"transform",
|
|
639
|
+
"a11yRole"
|
|
640
|
+
],
|
|
641
|
+
outputs: [
|
|
642
|
+
"iconChange",
|
|
643
|
+
"titleChange",
|
|
644
|
+
"animationChange",
|
|
645
|
+
"maskChange",
|
|
646
|
+
"flipChange",
|
|
647
|
+
"sizeChange",
|
|
648
|
+
"pullChange",
|
|
649
|
+
"borderChange",
|
|
650
|
+
"inverseChange",
|
|
651
|
+
"symbolChange",
|
|
652
|
+
"rotateChange",
|
|
653
|
+
"fixedWidthChange",
|
|
654
|
+
"transformChange",
|
|
655
|
+
"a11yRoleChange"
|
|
656
|
+
]
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
kind: "pipe",
|
|
660
|
+
type: i2$4.TranslocoPipe,
|
|
661
|
+
name: "transloco"
|
|
662
|
+
}
|
|
663
|
+
]
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
668
|
+
minVersion: "12.0.0",
|
|
669
|
+
version: "22.2.0",
|
|
670
|
+
ngImport: i0,
|
|
671
|
+
type: FlowsStepErrorComponent,
|
|
672
|
+
decorators: [{
|
|
673
|
+
type: Component,
|
|
674
|
+
args: [{
|
|
675
|
+
selector: "pw-flows-step-error",
|
|
676
|
+
standalone: false,
|
|
677
|
+
template: "@if (text) {\n@let reason = text.key | transloco: text.params;\n<span class=\"pw-step-error\"\n [class.is-retrying]=\"retrying\"\n [pTooltip]=\"error\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon [icon]=\"retrying ? icons.warning : icons.error\"\n aria-hidden=\"true\"></fa-icon>\n</span>\n<small class=\"pw-step-error__text\"\n [class.is-retrying]=\"retrying\"\n data-testid=\"flow-step-error-text\">\n {{ retrying ? ('Flows.Run.Errors.LastTry' | transloco: { reason }) : reason }}\n</small>\n}\n",
|
|
678
|
+
styles: [":host{display:contents}.pw-step-error{margin-left:6px;color:#c0392b;cursor:help}.pw-step-error__text{display:block;max-width:280px;margin-top:4px;color:#c0392b;white-space:normal;overflow-wrap:anywhere}.pw-step-error.is-retrying,.pw-step-error__text.is-retrying{color:#8a6d00}\n"]
|
|
679
|
+
}]
|
|
680
|
+
}],
|
|
681
|
+
propDecorators: {
|
|
682
|
+
error: [{ type: Input }],
|
|
683
|
+
retrying: [{ type: Input }]
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBaseComponent {
|
|
687
|
+
constructor(injector, flowsRunService, workflowService, nodeService, cdr) {
|
|
688
|
+
super(injector);
|
|
689
|
+
this.flowsRunService = flowsRunService;
|
|
690
|
+
this.workflowService = workflowService;
|
|
691
|
+
this.nodeService = nodeService;
|
|
692
|
+
this.cdr = cdr;
|
|
693
|
+
this.destroy$ = new Subject();
|
|
694
|
+
this.loading = true;
|
|
695
|
+
this.notFound = false;
|
|
696
|
+
this.steps = [];
|
|
697
|
+
this.icons = FLOWS_ICONS;
|
|
698
|
+
this.openSteps = /* @__PURE__ */ new Set();
|
|
699
|
+
this.trackByStep = (_, step) => step.id;
|
|
700
|
+
this.labelKey = flowNodeLabelKey;
|
|
701
|
+
this.scheduledFor = flowRunScheduledFor;
|
|
702
|
+
this.nodeTypes = {};
|
|
703
|
+
this.nodeIds = [];
|
|
704
|
+
this.definitions = {};
|
|
705
|
+
}
|
|
706
|
+
ngOnInit() {
|
|
707
|
+
combineLatest([this.route.params.pipe(map((params) => Number(params["id"]))), this.getUserSubscriptionId()]).pipe(distinctUntilChanged(([prevRun, prevSub], [nextRun, nextSub]) => prevRun === nextRun && prevSub === nextSub), takeUntil(this.destroy$)).subscribe(([runId, subscriptionId]) => {
|
|
708
|
+
this.runId = runId;
|
|
709
|
+
if (!subscriptionId || !this.runId) {
|
|
710
|
+
this.fail();
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
this.watch(subscriptionId);
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
ngOnDestroy() {
|
|
717
|
+
super.ngOnDestroy();
|
|
718
|
+
this.watch$?.unsubscribe();
|
|
719
|
+
this.destroy$.next();
|
|
720
|
+
this.destroy$.complete();
|
|
721
|
+
}
|
|
722
|
+
back() {
|
|
723
|
+
this.router.navigate(["runs"], { relativeTo: this.route.parent });
|
|
724
|
+
}
|
|
725
|
+
runBadgeClass(status) {
|
|
726
|
+
return flowRunBadgeClass(status);
|
|
727
|
+
}
|
|
728
|
+
stepBadgeClass(status) {
|
|
729
|
+
return flowRunStepBadgeClass(status);
|
|
730
|
+
}
|
|
731
|
+
elapsed(from, to) {
|
|
732
|
+
return elapsedMs(from, to);
|
|
733
|
+
}
|
|
734
|
+
toggleItems(stepId) {
|
|
735
|
+
if (!this.openSteps.delete(stepId)) this.openSteps.add(stepId);
|
|
736
|
+
}
|
|
737
|
+
asJson(value) {
|
|
738
|
+
if (value === null || value === void 0) return "—";
|
|
739
|
+
return JSON.stringify(value, null, 2);
|
|
740
|
+
}
|
|
741
|
+
watch(subscriptionId) {
|
|
742
|
+
this.watch$?.unsubscribe();
|
|
743
|
+
this.watch$ = this.flowsRunService.watchRun(this.runId, subscriptionId).pipe(takeUntil(this.destroy$)).subscribe({
|
|
744
|
+
next: (detail) => {
|
|
745
|
+
this.run = detail.run;
|
|
746
|
+
this.steps = detail.steps?.flow_run_steps ?? [];
|
|
747
|
+
this.nameNodes(subscriptionId);
|
|
748
|
+
this.notFound = false;
|
|
749
|
+
this.settle();
|
|
750
|
+
},
|
|
751
|
+
error: () => this.fail()
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
nameNodes(subscriptionId) {
|
|
755
|
+
const versionId = this.run?.flow_version_id;
|
|
756
|
+
if (!versionId || versionId === this.namedVersionId) return;
|
|
757
|
+
this.namedVersionId = versionId;
|
|
758
|
+
forkJoin({
|
|
759
|
+
version: this.workflowService.getVersion(versionId, subscriptionId),
|
|
760
|
+
nodes: this.nodeService.getNodes(subscriptionId)
|
|
761
|
+
}).pipe(takeUntil(this.destroy$)).subscribe({
|
|
762
|
+
next: ({ version, nodes }) => {
|
|
763
|
+
this.nodeTypes = Object.fromEntries(toFlowGraph(version.graph).nodes.map((node) => [node.id, node.type]));
|
|
764
|
+
this.nodeIds = Object.keys(this.nodeTypes);
|
|
765
|
+
this.definitions = Object.fromEntries(nodes.map((node) => [node.type, node]));
|
|
766
|
+
this.cdr.markForCheck();
|
|
767
|
+
},
|
|
768
|
+
error: () => void 0
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
fail() {
|
|
772
|
+
this.run = void 0;
|
|
773
|
+
this.steps = [];
|
|
774
|
+
this.notFound = true;
|
|
775
|
+
this.settle();
|
|
776
|
+
}
|
|
777
|
+
settle() {
|
|
778
|
+
this.loading = false;
|
|
779
|
+
this.cdr.markForCheck();
|
|
780
|
+
}
|
|
781
|
+
static {
|
|
782
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
783
|
+
minVersion: "12.0.0",
|
|
784
|
+
version: "22.2.0",
|
|
785
|
+
ngImport: i0,
|
|
786
|
+
type: FlowsRunInspectorComponent,
|
|
787
|
+
deps: [
|
|
788
|
+
{ token: i0.Injector },
|
|
789
|
+
{ token: FlowsRunService },
|
|
790
|
+
{ token: FlowsWorkflowService },
|
|
791
|
+
{ token: FlowsNodeService },
|
|
792
|
+
{ token: i0.ChangeDetectorRef }
|
|
793
|
+
],
|
|
794
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
static {
|
|
798
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
799
|
+
minVersion: "17.0.0",
|
|
800
|
+
version: "22.2.0",
|
|
801
|
+
type: FlowsRunInspectorComponent,
|
|
802
|
+
isStandalone: false,
|
|
803
|
+
selector: "pw-flows-run-inspector",
|
|
804
|
+
usesInheritance: true,
|
|
805
|
+
ngImport: i0,
|
|
806
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex align-items-center\">\n <a href=\"javascript:void(0)\"\n class=\"previous\"\n [attr.aria-label]=\"'Flows.Run.Back' | transloco\"\n (click)=\"back()\"><fa-icon [icon]=\"icons.back\"\n aria-hidden=\"true\"></fa-icon></a>\n <h3 class=\"m-subheader__title m-subheader__title--separator\">\n <!-- 🔴 Id only from the resolved run: showing it from the URL confirms a foreign run exists. -->\n <span>{{\n run\n ? ('Flows.Run.Title' | transloco: { id: runId })\n : ('Flows.Run.TitleUnknown' | transloco)\n }}</span>\n </h3>\n </div>\n</div>\n\n<pw-loader [isVisible]=\"loading\"></pw-loader>\n\n@if (!loading) {\n@if (notFound || !run) {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Run.NotFound' | transloco\"></pw-no-data>\n} @else {\n<div class=\"row mt-3\">\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Status' | transloco }}</span>\n <span class=\"pw-run-meta__value\">\n <span [class]=\"runBadgeClass(run.status)\">\n {{ 'Flows.Status.' + run.status | transloco }}\n </span>\n </span>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Workflow' | transloco }}</span>\n <a class=\"pw-run-meta__value\"\n [routerLink]=\"['../../workflows', run.flow_workflow_id, 'versions']\">{{ run.flow_workflow_name || '#' + run.flow_workflow_id }}</a>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Version' | transloco }}</span>\n <a class=\"pw-run-meta__value\"\n [routerLink]=\"['../../workflows', run.flow_workflow_id, 'versions']\"\n [queryParams]=\"{ version: run.flow_version_id }\">{{ 'Flows.Runs.VersionLabel' | transloco: { number: run.flow_version_number } }}</a>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Started' | transloco }}</span>\n <span class=\"pw-run-meta__value\">{{ run.started_at ? (run.started_at | dateFormat: 'datetime') : '—' }}</span>\n </div>\n </div>\n\n @if (scheduledFor(run); as slot) {\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\"\n data-testid=\"flow-run-scheduled-for\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Run.ScheduledFor' | transloco }}</span>\n <span class=\"pw-run-meta__value\">{{ slot | dateFormat: 'datetime' }}</span>\n </div>\n </div>\n }\n\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Finished' | transloco }}</span>\n <span class=\"pw-run-meta__value\">{{ run.finished_at ? (run.finished_at | dateFormat: 'datetime') : '—' }}</span>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Duration' | transloco }}</span>\n <span class=\"pw-run-meta__value\">\n @if (elapsed(run.started_at, run.finished_at) !== null) {\n {{ elapsed(run.started_at, run.finished_at) / 1000 | number: '1.0-1'\n }}{{ 'Flows.Runs.SecondsSuffix' | transloco }}\n } @else {\n —\n }\n </span>\n </div>\n </div>\n\n @if (run.error) {\n <div class=\"col-12\">\n <div class=\"pw-run-error\"\n role=\"alert\">\n <span class=\"pw-run-error__label\">{{ 'Flows.Run.Meta.Error' | transloco }}</span>\n <span class=\"pw-run-error__message\">{{ run.error }}</span>\n </div>\n </div>\n }\n\n <div class=\"col-12\">\n <details class=\"pw-run-payload\">\n <summary>{{ 'Flows.Run.Meta.TriggerPayload' | transloco }}</summary>\n <pre class=\"pw-run-payload__json\">{{ asJson(run.trigger_payload) }}</pre>\n </details>\n </div>\n</div>\n\n<div class=\"row mt-4\">\n <div class=\"col-12\">\n <pw-flows-run-progress [run]=\"run\" [steps]=\"steps\" [nodeIds]=\"nodeIds\"></pw-flows-run-progress>\n <h4>{{ 'Flows.Run.Steps.Title' | transloco }}</h4>\n </div>\n</div>\n\n@if (steps.length) {\n<div class=\"primeng-datatable-container table-responsive mt-2\">\n <p-table [value]=\"steps\"\n dataKey=\"id\"\n [rowTrackBy]=\"trackByStep\">\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Run.Steps.Column.Node' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Run.Steps.Column.Attempts' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Started' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Duration' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Run.Steps.Column.Items' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-step>\n <tr>\n <td data-head=\"Node\">\n @let type = nodeTypes[step.node_id];\n @if (type) {\n @let key = labelKey(type);\n @let translated = key | transloco;\n {{ translated === key ? (definitions[type]?.label ?? type) : translated }}\n <small class=\"text-muted ms-1\">{{ step.node_id }}</small>\n } @else {\n {{ step.node_id }}\n }\n </td>\n <td data-head=\"Status\">\n <span [class]=\"stepBadgeClass(step.status)\">\n {{ (step.retry_at ? 'Flows.Status.retrying' : 'Flows.Status.' + step.status) | transloco }}\n </span>\n <pw-flows-step-error [error]=\"step.error\" [retrying]=\"!!step.retry_at\"></pw-flows-step-error>\n @if (step.retry_at) {\n <small class=\"d-block mt-1 text-muted\"\n data-testid=\"flow-step-next-try\">\n {{ 'Flows.Run.Steps.NextTry' | transloco: { time: (step.retry_at | dateFormat: 'datetime') } }}\n </small>\n }\n </td>\n <td data-head=\"Attempts\">{{ step.attempts }}</td>\n <td data-head=\"Started\">{{ step.started_at ? (step.started_at | dateFormat) : '—' }}</td>\n <td data-head=\"Duration\">\n @if (elapsed(step.started_at, step.finished_at) !== null) {\n {{ elapsed(step.started_at, step.finished_at) / 1000 | number: '1.0-1'\n }}{{ 'Flows.Runs.SecondsSuffix' | transloco }}\n } @else {\n —\n }\n </td>\n <td data-head=\"Items\">\n <button type=\"button\"\n class=\"btn btn-link p-0 pw-step-toggle\"\n [attr.aria-expanded]=\"openSteps.has(step.id)\"\n [attr.aria-controls]=\"'flow-step-items-' + step.id\"\n (click)=\"toggleItems(step.id)\">\n <fa-icon [icon]=\"openSteps.has(step.id) ? icons.expanded : icons.collapsed\" aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Run.Steps.Column.Items' | transloco }}\n </button>\n </td>\n </tr>\n <!-- Its own full-width row, so opening a step never resizes the columns above. -->\n @if (openSteps.has(step.id)) {\n <tr class=\"pw-step-items-row\">\n <td colspan=\"6\"\n [id]=\"'flow-step-items-' + step.id\">\n <div class=\"pw-step-items\">\n <span class=\"pw-step-items__label\">{{ 'Flows.Run.Steps.Input' | transloco }}</span>\n <pre class=\"pw-step-items__json\">{{ asJson(step.input_items) }}</pre>\n <span class=\"pw-step-items__label\">{{ 'Flows.Run.Steps.Output' | transloco }}</span>\n <pre class=\"pw-step-items__json\">{{ asJson(step.output_items) }}</pre>\n </div>\n </td>\n </tr>\n }\n </ng-template>\n </p-table>\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Run.Steps.Empty' | transloco\"></pw-no-data>\n}\n}\n}\n",
|
|
807
|
+
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.pw-run-meta{display:flex;flex-direction:column;margin-bottom:16px}.pw-run-meta__label{height:18px;line-height:18px;margin-bottom:8px;font-size:11px;font-weight:600;letter-spacing:.01em;color:#5a6473}.pw-run-meta__value{line-height:18px;color:#1a1d21;overflow-wrap:anywhere}.pw-run-error{display:flex;flex-direction:column;gap:2px;background-color:#fbeae8;border:1px solid #f3d3cf;border-radius:6px;padding:10px 12px;margin-bottom:12px}.pw-run-error__label{font-size:11px;font-weight:600;letter-spacing:.01em;color:#c0392b}.pw-run-error__message{color:#1a1d21;overflow-wrap:anywhere}.pw-run-payload{margin-bottom:8px}.pw-run-payload__json{max-height:240px;overflow:auto;background-color:#f5f7fa;border:1px solid #e2e5ea;border-radius:6px;padding:8px 10px;margin:6px 0 0}.pw-step-items{display:flex;flex-direction:column;gap:2px}.pw-step-items__label{font-size:11px;font-weight:600;color:#5a6473;letter-spacing:.01em}.pw-step-items__json{max-height:320px;overflow:auto;background-color:#f5f7fa;border:1px solid #e2e5ea;border-radius:6px;padding:6px 8px;margin:0 0 6px}.pw-step-toggle{display:inline-flex;align-items:center;gap:6px;color:inherit;text-decoration:none}.pw-step-items-row td{padding-top:0}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}\n"],
|
|
808
|
+
dependencies: [
|
|
809
|
+
{
|
|
810
|
+
kind: "component",
|
|
811
|
+
type: i4$1.AppLoaderComponent,
|
|
812
|
+
selector: "pw-loader",
|
|
813
|
+
inputs: [
|
|
814
|
+
"isVisible",
|
|
815
|
+
"closeOnOutsideClick",
|
|
816
|
+
"autoCloseTimeOut"
|
|
817
|
+
]
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
kind: "component",
|
|
821
|
+
type: i5.Table,
|
|
312
822
|
selector: "p-table",
|
|
313
823
|
inputs: [
|
|
314
824
|
"frozenColumns",
|
|
@@ -421,7 +931,7 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
421
931
|
},
|
|
422
932
|
{
|
|
423
933
|
kind: "component",
|
|
424
|
-
type:
|
|
934
|
+
type: i6.NoDataComponent,
|
|
425
935
|
selector: "pw-no-data",
|
|
426
936
|
inputs: [
|
|
427
937
|
"message",
|
|
@@ -431,7 +941,7 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
431
941
|
},
|
|
432
942
|
{
|
|
433
943
|
kind: "component",
|
|
434
|
-
type:
|
|
944
|
+
type: i2$3.FaIconComponent,
|
|
435
945
|
selector: "fa-icon",
|
|
436
946
|
inputs: [
|
|
437
947
|
"icon",
|
|
@@ -468,7 +978,7 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
468
978
|
},
|
|
469
979
|
{
|
|
470
980
|
kind: "directive",
|
|
471
|
-
type:
|
|
981
|
+
type: i8.RouterLink,
|
|
472
982
|
selector: "[routerLink]",
|
|
473
983
|
inputs: [
|
|
474
984
|
"target",
|
|
@@ -485,20 +995,36 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
485
995
|
"routerLink"
|
|
486
996
|
]
|
|
487
997
|
},
|
|
998
|
+
{
|
|
999
|
+
kind: "component",
|
|
1000
|
+
type: FlowsRunProgressComponent,
|
|
1001
|
+
selector: "pw-flows-run-progress",
|
|
1002
|
+
inputs: [
|
|
1003
|
+
"run",
|
|
1004
|
+
"steps",
|
|
1005
|
+
"nodeIds"
|
|
1006
|
+
]
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
kind: "component",
|
|
1010
|
+
type: FlowsStepErrorComponent,
|
|
1011
|
+
selector: "pw-flows-step-error",
|
|
1012
|
+
inputs: ["error", "retrying"]
|
|
1013
|
+
},
|
|
488
1014
|
{
|
|
489
1015
|
kind: "pipe",
|
|
490
|
-
type:
|
|
1016
|
+
type: i1$2.DecimalPipe,
|
|
491
1017
|
name: "number"
|
|
492
1018
|
},
|
|
493
1019
|
{
|
|
494
1020
|
kind: "pipe",
|
|
495
|
-
type:
|
|
496
|
-
name: "
|
|
1021
|
+
type: i2$4.TranslocoPipe,
|
|
1022
|
+
name: "transloco"
|
|
497
1023
|
},
|
|
498
1024
|
{
|
|
499
1025
|
kind: "pipe",
|
|
500
|
-
type:
|
|
501
|
-
name: "
|
|
1026
|
+
type: i13.DateFormatPipe,
|
|
1027
|
+
name: "dateFormat"
|
|
502
1028
|
}
|
|
503
1029
|
]
|
|
504
1030
|
});
|
|
@@ -514,114 +1040,35 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
514
1040
|
args: [{
|
|
515
1041
|
selector: "pw-flows-run-inspector",
|
|
516
1042
|
standalone: false,
|
|
517
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex align-items-center\">\n <a href=\"javascript:void(0)\"\n class=\"previous\"\n [attr.aria-label]=\"'Flows.Run.Back' | transloco\"\n (click)=\"back()\"><fa-icon [icon]=\"icons.back\"\n aria-hidden=\"true\"></fa-icon></a>\n <h3 class=\"m-subheader__title m-subheader__title--separator\">\n <!-- 🔴 Id only from the resolved run: showing it from the URL confirms a foreign run exists. -->\n <span>{{\n run\n ? ('Flows.Run.Title' | transloco: { id: runId })\n : ('Flows.Run.TitleUnknown' | transloco)\n }}</span>\n </h3>\n </div>\n</div>\n\n<pw-loader [isVisible]=\"loading\"></pw-loader>\n\n@if (!loading) {\n@if (notFound || !run) {\n<pw-no-data [message]=\"'Flows.Run.NotFound' | transloco\"></pw-no-data>\n} @else {\n<div class=\"row mt-3\">\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Status' | transloco }}</span>\n <span class=\"pw-run-meta__value\">\n <span [class]=\"runBadgeClass(run.status)\">\n {{ 'Flows.Status.' + run.status | transloco }}\n </span>\n </span>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Workflow' | transloco }}</span>\n <a class=\"pw-run-meta__value\"\n [routerLink]=\"['../../workflows', run.flow_workflow_id, 'versions']\">{{ run.flow_workflow_name || '#' + run.flow_workflow_id }}</a>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Version' | transloco }}</span>\n <a class=\"pw-run-meta__value\"\n [routerLink]=\"['../../workflows', run.flow_workflow_id, 'versions']\"\n [queryParams]=\"{ version: run.flow_version_id }\">{{ 'Flows.Runs.VersionLabel' | transloco: { number: run.flow_version_number } }}</a>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Started' | transloco }}</span>\n <span class=\"pw-run-meta__value\">{{ run.started_at ? (run.started_at |
|
|
518
|
-
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.pw-run-meta{display:flex;flex-direction:column;margin-bottom:16px}.pw-run-meta__label{height:18px;line-height:18px;margin-bottom:8px;font-size:11px;font-weight:600;letter-spacing:.01em;color:#5a6473}.pw-run-meta__value{line-height:18px;color:#1a1d21;overflow-wrap:anywhere}.pw-run-error{display:flex;flex-direction:column;gap:2px;background-color:#fbeae8;border:1px solid #f3d3cf;border-radius:6px;padding:10px 12px;margin-bottom:12px}.pw-run-error__label{font-size:11px;font-weight:600;letter-spacing:.01em;color:#c0392b}.pw-run-error__message{color:#1a1d21;overflow-wrap:anywhere}.pw-run-payload{margin-bottom:8px}.pw-run-payload__json{max-height:240px;overflow:auto;background-color:#f5f7fa;border:1px solid #e2e5ea;border-radius:6px;padding:8px 10px;margin:6px 0 0}.pw-step-
|
|
1043
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex align-items-center\">\n <a href=\"javascript:void(0)\"\n class=\"previous\"\n [attr.aria-label]=\"'Flows.Run.Back' | transloco\"\n (click)=\"back()\"><fa-icon [icon]=\"icons.back\"\n aria-hidden=\"true\"></fa-icon></a>\n <h3 class=\"m-subheader__title m-subheader__title--separator\">\n <!-- 🔴 Id only from the resolved run: showing it from the URL confirms a foreign run exists. -->\n <span>{{\n run\n ? ('Flows.Run.Title' | transloco: { id: runId })\n : ('Flows.Run.TitleUnknown' | transloco)\n }}</span>\n </h3>\n </div>\n</div>\n\n<pw-loader [isVisible]=\"loading\"></pw-loader>\n\n@if (!loading) {\n@if (notFound || !run) {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Run.NotFound' | transloco\"></pw-no-data>\n} @else {\n<div class=\"row mt-3\">\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Status' | transloco }}</span>\n <span class=\"pw-run-meta__value\">\n <span [class]=\"runBadgeClass(run.status)\">\n {{ 'Flows.Status.' + run.status | transloco }}\n </span>\n </span>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Workflow' | transloco }}</span>\n <a class=\"pw-run-meta__value\"\n [routerLink]=\"['../../workflows', run.flow_workflow_id, 'versions']\">{{ run.flow_workflow_name || '#' + run.flow_workflow_id }}</a>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Version' | transloco }}</span>\n <a class=\"pw-run-meta__value\"\n [routerLink]=\"['../../workflows', run.flow_workflow_id, 'versions']\"\n [queryParams]=\"{ version: run.flow_version_id }\">{{ 'Flows.Runs.VersionLabel' | transloco: { number: run.flow_version_number } }}</a>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Started' | transloco }}</span>\n <span class=\"pw-run-meta__value\">{{ run.started_at ? (run.started_at | dateFormat: 'datetime') : '—' }}</span>\n </div>\n </div>\n\n @if (scheduledFor(run); as slot) {\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\"\n data-testid=\"flow-run-scheduled-for\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Run.ScheduledFor' | transloco }}</span>\n <span class=\"pw-run-meta__value\">{{ slot | dateFormat: 'datetime' }}</span>\n </div>\n </div>\n }\n\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Finished' | transloco }}</span>\n <span class=\"pw-run-meta__value\">{{ run.finished_at ? (run.finished_at | dateFormat: 'datetime') : '—' }}</span>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4\">\n <div class=\"pw-run-meta\">\n <span class=\"pw-run-meta__label\">{{ 'Flows.Runs.Column.Duration' | transloco }}</span>\n <span class=\"pw-run-meta__value\">\n @if (elapsed(run.started_at, run.finished_at) !== null) {\n {{ elapsed(run.started_at, run.finished_at) / 1000 | number: '1.0-1'\n }}{{ 'Flows.Runs.SecondsSuffix' | transloco }}\n } @else {\n —\n }\n </span>\n </div>\n </div>\n\n @if (run.error) {\n <div class=\"col-12\">\n <div class=\"pw-run-error\"\n role=\"alert\">\n <span class=\"pw-run-error__label\">{{ 'Flows.Run.Meta.Error' | transloco }}</span>\n <span class=\"pw-run-error__message\">{{ run.error }}</span>\n </div>\n </div>\n }\n\n <div class=\"col-12\">\n <details class=\"pw-run-payload\">\n <summary>{{ 'Flows.Run.Meta.TriggerPayload' | transloco }}</summary>\n <pre class=\"pw-run-payload__json\">{{ asJson(run.trigger_payload) }}</pre>\n </details>\n </div>\n</div>\n\n<div class=\"row mt-4\">\n <div class=\"col-12\">\n <pw-flows-run-progress [run]=\"run\" [steps]=\"steps\" [nodeIds]=\"nodeIds\"></pw-flows-run-progress>\n <h4>{{ 'Flows.Run.Steps.Title' | transloco }}</h4>\n </div>\n</div>\n\n@if (steps.length) {\n<div class=\"primeng-datatable-container table-responsive mt-2\">\n <p-table [value]=\"steps\"\n dataKey=\"id\"\n [rowTrackBy]=\"trackByStep\">\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Run.Steps.Column.Node' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Run.Steps.Column.Attempts' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Started' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Duration' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Run.Steps.Column.Items' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-step>\n <tr>\n <td data-head=\"Node\">\n @let type = nodeTypes[step.node_id];\n @if (type) {\n @let key = labelKey(type);\n @let translated = key | transloco;\n {{ translated === key ? (definitions[type]?.label ?? type) : translated }}\n <small class=\"text-muted ms-1\">{{ step.node_id }}</small>\n } @else {\n {{ step.node_id }}\n }\n </td>\n <td data-head=\"Status\">\n <span [class]=\"stepBadgeClass(step.status)\">\n {{ (step.retry_at ? 'Flows.Status.retrying' : 'Flows.Status.' + step.status) | transloco }}\n </span>\n <pw-flows-step-error [error]=\"step.error\" [retrying]=\"!!step.retry_at\"></pw-flows-step-error>\n @if (step.retry_at) {\n <small class=\"d-block mt-1 text-muted\"\n data-testid=\"flow-step-next-try\">\n {{ 'Flows.Run.Steps.NextTry' | transloco: { time: (step.retry_at | dateFormat: 'datetime') } }}\n </small>\n }\n </td>\n <td data-head=\"Attempts\">{{ step.attempts }}</td>\n <td data-head=\"Started\">{{ step.started_at ? (step.started_at | dateFormat) : '—' }}</td>\n <td data-head=\"Duration\">\n @if (elapsed(step.started_at, step.finished_at) !== null) {\n {{ elapsed(step.started_at, step.finished_at) / 1000 | number: '1.0-1'\n }}{{ 'Flows.Runs.SecondsSuffix' | transloco }}\n } @else {\n —\n }\n </td>\n <td data-head=\"Items\">\n <button type=\"button\"\n class=\"btn btn-link p-0 pw-step-toggle\"\n [attr.aria-expanded]=\"openSteps.has(step.id)\"\n [attr.aria-controls]=\"'flow-step-items-' + step.id\"\n (click)=\"toggleItems(step.id)\">\n <fa-icon [icon]=\"openSteps.has(step.id) ? icons.expanded : icons.collapsed\" aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Run.Steps.Column.Items' | transloco }}\n </button>\n </td>\n </tr>\n <!-- Its own full-width row, so opening a step never resizes the columns above. -->\n @if (openSteps.has(step.id)) {\n <tr class=\"pw-step-items-row\">\n <td colspan=\"6\"\n [id]=\"'flow-step-items-' + step.id\">\n <div class=\"pw-step-items\">\n <span class=\"pw-step-items__label\">{{ 'Flows.Run.Steps.Input' | transloco }}</span>\n <pre class=\"pw-step-items__json\">{{ asJson(step.input_items) }}</pre>\n <span class=\"pw-step-items__label\">{{ 'Flows.Run.Steps.Output' | transloco }}</span>\n <pre class=\"pw-step-items__json\">{{ asJson(step.output_items) }}</pre>\n </div>\n </td>\n </tr>\n }\n </ng-template>\n </p-table>\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Run.Steps.Empty' | transloco\"></pw-no-data>\n}\n}\n}\n",
|
|
1044
|
+
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.pw-run-meta{display:flex;flex-direction:column;margin-bottom:16px}.pw-run-meta__label{height:18px;line-height:18px;margin-bottom:8px;font-size:11px;font-weight:600;letter-spacing:.01em;color:#5a6473}.pw-run-meta__value{line-height:18px;color:#1a1d21;overflow-wrap:anywhere}.pw-run-error{display:flex;flex-direction:column;gap:2px;background-color:#fbeae8;border:1px solid #f3d3cf;border-radius:6px;padding:10px 12px;margin-bottom:12px}.pw-run-error__label{font-size:11px;font-weight:600;letter-spacing:.01em;color:#c0392b}.pw-run-error__message{color:#1a1d21;overflow-wrap:anywhere}.pw-run-payload{margin-bottom:8px}.pw-run-payload__json{max-height:240px;overflow:auto;background-color:#f5f7fa;border:1px solid #e2e5ea;border-radius:6px;padding:8px 10px;margin:6px 0 0}.pw-step-items{display:flex;flex-direction:column;gap:2px}.pw-step-items__label{font-size:11px;font-weight:600;color:#5a6473;letter-spacing:.01em}.pw-step-items__json{max-height:320px;overflow:auto;background-color:#f5f7fa;border:1px solid #e2e5ea;border-radius:6px;padding:6px 8px;margin:0 0 6px}.pw-step-toggle{display:inline-flex;align-items:center;gap:6px;color:inherit;text-decoration:none}.pw-step-items-row td{padding-top:0}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}\n"]
|
|
519
1045
|
}]
|
|
520
1046
|
}],
|
|
521
1047
|
ctorParameters: () => [
|
|
522
1048
|
{ type: i0.Injector },
|
|
523
1049
|
{ type: FlowsRunService },
|
|
1050
|
+
{ type: FlowsWorkflowService },
|
|
1051
|
+
{ type: FlowsNodeService },
|
|
524
1052
|
{ type: i0.ChangeDetectorRef }
|
|
525
1053
|
]
|
|
526
1054
|
});
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
...attrs
|
|
545
|
-
});
|
|
546
|
-
}
|
|
547
|
-
updateWorkflow(id, subscriptionId, attrs) {
|
|
548
|
-
return this.api.put(`${FLOWS_WORKFLOWS_PATH}/${id}`, {
|
|
549
|
-
subscription_id: subscriptionId,
|
|
550
|
-
...attrs
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
deleteWorkflow(id, subscriptionId) {
|
|
554
|
-
return this.api.delete(`${FLOWS_WORKFLOWS_PATH}/${id}`, { params: { subscription_id: String(subscriptionId) } });
|
|
555
|
-
}
|
|
556
|
-
getVersions(workflowId, subscriptionId, paging) {
|
|
557
|
-
return this.api.getWithParams(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/versions`, {
|
|
558
|
-
subscription_id: subscriptionId,
|
|
559
|
-
...HelperService.getPagingParams(paging)
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
createVersion(workflowId, subscriptionId, graph) {
|
|
563
|
-
return this.api.post(`${FLOWS_WORKFLOWS_PATH}/${workflowId}/versions`, {
|
|
564
|
-
subscription_id: subscriptionId,
|
|
565
|
-
graph
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
|
-
updateVersion(id, subscriptionId, graph) {
|
|
569
|
-
return this.api.put(`${FLOWS_VERSIONS_PATH}/${id}`, {
|
|
570
|
-
subscription_id: subscriptionId,
|
|
571
|
-
graph
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
publishVersion(id, subscriptionId) {
|
|
575
|
-
return this.api.put(`${FLOWS_VERSIONS_PATH}/${id}/publish`, { subscription_id: subscriptionId });
|
|
576
|
-
}
|
|
577
|
-
static {
|
|
578
|
-
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
579
|
-
minVersion: "12.0.0",
|
|
580
|
-
version: "22.2.0",
|
|
581
|
-
ngImport: i0,
|
|
582
|
-
type: FlowsWorkflowService,
|
|
583
|
-
deps: [{ token: i1$1.ProductsHttpService }],
|
|
584
|
-
target: i0.ɵɵFactoryTarget.Injectable
|
|
585
|
-
});
|
|
586
|
-
}
|
|
587
|
-
static {
|
|
588
|
-
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
589
|
-
minVersion: "12.0.0",
|
|
590
|
-
version: "22.2.0",
|
|
591
|
-
ngImport: i0,
|
|
592
|
-
type: FlowsWorkflowService,
|
|
593
|
-
providedIn: "root"
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
};
|
|
597
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
598
|
-
minVersion: "12.0.0",
|
|
599
|
-
version: "22.2.0",
|
|
600
|
-
ngImport: i0,
|
|
601
|
-
type: FlowsWorkflowService,
|
|
602
|
-
decorators: [{
|
|
603
|
-
type: Injectable,
|
|
604
|
-
args: [{ providedIn: "root" }]
|
|
605
|
-
}],
|
|
606
|
-
ctorParameters: () => [{ type: i1$1.ProductsHttpService }]
|
|
607
|
-
});
|
|
608
|
-
const OPTIONS_PAGE = {
|
|
609
|
-
page: 1,
|
|
610
|
-
page_size: 200
|
|
611
|
-
};
|
|
612
|
-
var FlowsRunsFiltersComponent = class FlowsRunsFiltersComponent {
|
|
613
|
-
constructor(translation, workflowService, cdr) {
|
|
614
|
-
this.translation = translation;
|
|
615
|
-
this.workflowService = workflowService;
|
|
616
|
-
this.cdr = cdr;
|
|
617
|
-
this.queryChange = new EventEmitter();
|
|
618
|
-
this.destroy$ = new Subject();
|
|
619
|
-
this.status = null;
|
|
620
|
-
this.workflowId = null;
|
|
621
|
-
this.versionId = null;
|
|
622
|
-
this.statusOptions = [];
|
|
623
|
-
this.workflowOptions = [];
|
|
624
|
-
this.versionOptions = [];
|
|
1055
|
+
const OPTIONS_PAGE = {
|
|
1056
|
+
page: 1,
|
|
1057
|
+
page_size: 200
|
|
1058
|
+
};
|
|
1059
|
+
var FlowsRunsFiltersComponent = class FlowsRunsFiltersComponent {
|
|
1060
|
+
constructor(translation, workflowService, cdr) {
|
|
1061
|
+
this.translation = translation;
|
|
1062
|
+
this.workflowService = workflowService;
|
|
1063
|
+
this.cdr = cdr;
|
|
1064
|
+
this.queryChange = new EventEmitter();
|
|
1065
|
+
this.destroy$ = new Subject();
|
|
1066
|
+
this.status = null;
|
|
1067
|
+
this.workflowId = null;
|
|
1068
|
+
this.versionId = null;
|
|
1069
|
+
this.statusOptions = [];
|
|
1070
|
+
this.workflowOptions = [];
|
|
1071
|
+
this.versionOptions = [];
|
|
625
1072
|
}
|
|
626
1073
|
ngOnInit() {
|
|
627
1074
|
this.translation.selectTranslation("flows").pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
@@ -682,7 +1129,7 @@ var FlowsRunsFiltersComponent = class FlowsRunsFiltersComponent {
|
|
|
682
1129
|
ngImport: i0,
|
|
683
1130
|
type: FlowsRunsFiltersComponent,
|
|
684
1131
|
deps: [
|
|
685
|
-
{ token:
|
|
1132
|
+
{ token: i2$4.TranslocoService },
|
|
686
1133
|
{ token: FlowsWorkflowService },
|
|
687
1134
|
{ token: i0.ChangeDetectorRef }
|
|
688
1135
|
],
|
|
@@ -703,12 +1150,12 @@ var FlowsRunsFiltersComponent = class FlowsRunsFiltersComponent {
|
|
|
703
1150
|
dependencies: [
|
|
704
1151
|
{
|
|
705
1152
|
kind: "directive",
|
|
706
|
-
type: i3$
|
|
1153
|
+
type: i3$2.NgControlStatus,
|
|
707
1154
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
708
1155
|
},
|
|
709
1156
|
{
|
|
710
1157
|
kind: "directive",
|
|
711
|
-
type: i3$
|
|
1158
|
+
type: i3$2.NgModel,
|
|
712
1159
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
713
1160
|
inputs: [
|
|
714
1161
|
"name",
|
|
@@ -791,7 +1238,7 @@ var FlowsRunsFiltersComponent = class FlowsRunsFiltersComponent {
|
|
|
791
1238
|
},
|
|
792
1239
|
{
|
|
793
1240
|
kind: "pipe",
|
|
794
|
-
type:
|
|
1241
|
+
type: i2$4.TranslocoPipe,
|
|
795
1242
|
name: "transloco"
|
|
796
1243
|
}
|
|
797
1244
|
]
|
|
@@ -812,7 +1259,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
812
1259
|
}]
|
|
813
1260
|
}],
|
|
814
1261
|
ctorParameters: () => [
|
|
815
|
-
{ type:
|
|
1262
|
+
{ type: i2$4.TranslocoService },
|
|
816
1263
|
{ type: FlowsWorkflowService },
|
|
817
1264
|
{ type: i0.ChangeDetectorRef }
|
|
818
1265
|
],
|
|
@@ -930,22 +1377,25 @@ var FlowsRunsComponent = class FlowsRunsComponent extends AppBaseComponent {
|
|
|
930
1377
|
selector: "pw-flows-runs",
|
|
931
1378
|
usesInheritance: true,
|
|
932
1379
|
ngImport: i0,
|
|
933
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Runs.Title' | transloco }}</h2>\n </div>\n</div>\n\n<pw-
|
|
1380
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Runs.Title' | transloco }}</h2>\n </div>\n</div>\n\n@if (loading) {\n<pw-skeleton-table [rows]=\"8\" [columns]=\"7\" [showCaption]=\"true\" />\n}\n\n@if (!loading) {\n@if (totalRecordsUnFilter > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table #dt\n [value]=\"runs\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\">\n <ng-template #caption>\n <pw-flows-runs-filters [subscriptionId]=\"subscriptionId\"\n (queryChange)=\"onQuery($event)\" />\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Run' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Workflow' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Version' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Started' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Duration' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-two\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-run>\n <tr>\n <td data-head=\"Run\">#{{ run.id }}</td>\n <td data-head=\"Workflow\">\n <a [routerLink]=\"versionsLink(run)\">{{ run.flow_workflow_name || '#' + run.flow_workflow_id }}</a>\n </td>\n <td data-head=\"Version\">\n <a [routerLink]=\"versionsLink(run)\"\n [queryParams]=\"{ version: run.flow_version_id }\">{{ 'Flows.Runs.VersionLabel' | transloco: { number: run.flow_version_number } }}</a>\n </td>\n <td data-head=\"Status\">\n <span [class]=\"badgeClass(run.status)\">\n {{ 'Flows.Status.' + run.status | transloco }}\n </span>\n </td>\n <td data-head=\"Started\">{{ run.started_at ? (run.started_at | dateFormat) : '—' }}</td>\n <td data-head=\"Duration\">\n @if (duration(run) !== null) {\n {{ duration(run) / 1000 | number: '1.0-1' }}{{ 'Flows.Runs.SecondsSuffix' | transloco }}\n } @else {\n —\n }\n </td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"'Flows.Runs.Inspect' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.inspect\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Runs.Inspect' | transloco\"\n (click)=\"inspect(run)\"\n (keydown.enter)=\"inspect(run)\"></fa-icon>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"runs.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Runs.Empty' | transloco\" [description]=\"'Flows.Runs.EmptyDescription' | transloco\"></pw-no-data>\n}\n}\n",
|
|
934
1381
|
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}\n"],
|
|
935
1382
|
dependencies: [
|
|
936
1383
|
{
|
|
937
1384
|
kind: "component",
|
|
938
|
-
type:
|
|
939
|
-
selector: "pw-
|
|
1385
|
+
type: i4$1.SkeletonTableComponent,
|
|
1386
|
+
selector: "pw-skeleton-table",
|
|
940
1387
|
inputs: [
|
|
941
|
-
"
|
|
942
|
-
"
|
|
943
|
-
"
|
|
1388
|
+
"rows",
|
|
1389
|
+
"columns",
|
|
1390
|
+
"showHeader",
|
|
1391
|
+
"showCaption",
|
|
1392
|
+
"density",
|
|
1393
|
+
"delay"
|
|
944
1394
|
]
|
|
945
1395
|
},
|
|
946
1396
|
{
|
|
947
1397
|
kind: "directive",
|
|
948
|
-
type:
|
|
1398
|
+
type: i1$1.Tooltip,
|
|
949
1399
|
selector: "[pTooltip]",
|
|
950
1400
|
inputs: [
|
|
951
1401
|
"tooltipPosition",
|
|
@@ -973,7 +1423,7 @@ var FlowsRunsComponent = class FlowsRunsComponent extends AppBaseComponent {
|
|
|
973
1423
|
},
|
|
974
1424
|
{
|
|
975
1425
|
kind: "component",
|
|
976
|
-
type:
|
|
1426
|
+
type: i5.Table,
|
|
977
1427
|
selector: "p-table",
|
|
978
1428
|
inputs: [
|
|
979
1429
|
"frozenColumns",
|
|
@@ -1086,7 +1536,7 @@ var FlowsRunsComponent = class FlowsRunsComponent extends AppBaseComponent {
|
|
|
1086
1536
|
},
|
|
1087
1537
|
{
|
|
1088
1538
|
kind: "component",
|
|
1089
|
-
type:
|
|
1539
|
+
type: i6.NoDataComponent,
|
|
1090
1540
|
selector: "pw-no-data",
|
|
1091
1541
|
inputs: [
|
|
1092
1542
|
"message",
|
|
@@ -1096,13 +1546,13 @@ var FlowsRunsComponent = class FlowsRunsComponent extends AppBaseComponent {
|
|
|
1096
1546
|
},
|
|
1097
1547
|
{
|
|
1098
1548
|
kind: "component",
|
|
1099
|
-
type:
|
|
1549
|
+
type: i6.RecordsSummaryComponent,
|
|
1100
1550
|
selector: "pw-records-summary",
|
|
1101
1551
|
inputs: ["showing", "total"]
|
|
1102
1552
|
},
|
|
1103
1553
|
{
|
|
1104
1554
|
kind: "component",
|
|
1105
|
-
type:
|
|
1555
|
+
type: i2$3.FaIconComponent,
|
|
1106
1556
|
selector: "fa-icon",
|
|
1107
1557
|
inputs: [
|
|
1108
1558
|
"icon",
|
|
@@ -1139,7 +1589,7 @@ var FlowsRunsComponent = class FlowsRunsComponent extends AppBaseComponent {
|
|
|
1139
1589
|
},
|
|
1140
1590
|
{
|
|
1141
1591
|
kind: "directive",
|
|
1142
|
-
type:
|
|
1592
|
+
type: i8.RouterLink,
|
|
1143
1593
|
selector: "[routerLink]",
|
|
1144
1594
|
inputs: [
|
|
1145
1595
|
"target",
|
|
@@ -1165,18 +1615,18 @@ var FlowsRunsComponent = class FlowsRunsComponent extends AppBaseComponent {
|
|
|
1165
1615
|
},
|
|
1166
1616
|
{
|
|
1167
1617
|
kind: "pipe",
|
|
1168
|
-
type:
|
|
1618
|
+
type: i1$2.DecimalPipe,
|
|
1169
1619
|
name: "number"
|
|
1170
1620
|
},
|
|
1171
1621
|
{
|
|
1172
1622
|
kind: "pipe",
|
|
1173
|
-
type:
|
|
1174
|
-
name: "
|
|
1623
|
+
type: i2$4.TranslocoPipe,
|
|
1624
|
+
name: "transloco"
|
|
1175
1625
|
},
|
|
1176
1626
|
{
|
|
1177
1627
|
kind: "pipe",
|
|
1178
|
-
type:
|
|
1179
|
-
name: "
|
|
1628
|
+
type: i13.DateFormatPipe,
|
|
1629
|
+
name: "dateFormat"
|
|
1180
1630
|
}
|
|
1181
1631
|
]
|
|
1182
1632
|
});
|
|
@@ -1192,7 +1642,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1192
1642
|
args: [{
|
|
1193
1643
|
selector: "pw-flows-runs",
|
|
1194
1644
|
standalone: false,
|
|
1195
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Runs.Title' | transloco }}</h2>\n </div>\n</div>\n\n<pw-
|
|
1645
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Runs.Title' | transloco }}</h2>\n </div>\n</div>\n\n@if (loading) {\n<pw-skeleton-table [rows]=\"8\" [columns]=\"7\" [showCaption]=\"true\" />\n}\n\n@if (!loading) {\n@if (totalRecordsUnFilter > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table #dt\n [value]=\"runs\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\">\n <ng-template #caption>\n <pw-flows-runs-filters [subscriptionId]=\"subscriptionId\"\n (queryChange)=\"onQuery($event)\" />\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Run' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Workflow' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Version' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Started' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Duration' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-two\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-run>\n <tr>\n <td data-head=\"Run\">#{{ run.id }}</td>\n <td data-head=\"Workflow\">\n <a [routerLink]=\"versionsLink(run)\">{{ run.flow_workflow_name || '#' + run.flow_workflow_id }}</a>\n </td>\n <td data-head=\"Version\">\n <a [routerLink]=\"versionsLink(run)\"\n [queryParams]=\"{ version: run.flow_version_id }\">{{ 'Flows.Runs.VersionLabel' | transloco: { number: run.flow_version_number } }}</a>\n </td>\n <td data-head=\"Status\">\n <span [class]=\"badgeClass(run.status)\">\n {{ 'Flows.Status.' + run.status | transloco }}\n </span>\n </td>\n <td data-head=\"Started\">{{ run.started_at ? (run.started_at | dateFormat) : '—' }}</td>\n <td data-head=\"Duration\">\n @if (duration(run) !== null) {\n {{ duration(run) / 1000 | number: '1.0-1' }}{{ 'Flows.Runs.SecondsSuffix' | transloco }}\n } @else {\n —\n }\n </td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"'Flows.Runs.Inspect' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.inspect\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Runs.Inspect' | transloco\"\n (click)=\"inspect(run)\"\n (keydown.enter)=\"inspect(run)\"></fa-icon>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"runs.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Runs.Empty' | transloco\" [description]=\"'Flows.Runs.EmptyDescription' | transloco\"></pw-no-data>\n}\n}\n",
|
|
1196
1646
|
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}\n"]
|
|
1197
1647
|
}]
|
|
1198
1648
|
}],
|
|
@@ -1238,7 +1688,7 @@ var FlowsTabsComponent = class FlowsTabsComponent {
|
|
|
1238
1688
|
isInline: true,
|
|
1239
1689
|
dependencies: [{
|
|
1240
1690
|
kind: "component",
|
|
1241
|
-
type:
|
|
1691
|
+
type: i6.PwTabsComponent,
|
|
1242
1692
|
selector: "pw-tabs",
|
|
1243
1693
|
inputs: ["items", "withSubscription"]
|
|
1244
1694
|
}]
|
|
@@ -1292,8 +1742,8 @@ function flowWorkflowBadgeClass(status) {
|
|
|
1292
1742
|
default: return flowBadgeClass("muted");
|
|
1293
1743
|
}
|
|
1294
1744
|
}
|
|
1295
|
-
function flowVersionEditorTitleKey(version) {
|
|
1296
|
-
if (!version) return "Flows.Versions.Editor.CreateTitle";
|
|
1745
|
+
function flowVersionEditorTitleKey(version, duplicateOf = null) {
|
|
1746
|
+
if (!version) return duplicateOf ? "Flows.Versions.Editor.DuplicateTitle" : "Flows.Versions.Editor.CreateTitle";
|
|
1297
1747
|
return isFlowVersionPublished(version) ? "Flows.Versions.Editor.ViewTitle" : "Flows.Versions.Editor.EditTitle";
|
|
1298
1748
|
}
|
|
1299
1749
|
function flowRouteContext(params$, subscriptionId$) {
|
|
@@ -1344,7 +1794,10 @@ var FlowsWorkflowFormComponent = class FlowsWorkflowFormComponent extends AppBas
|
|
|
1344
1794
|
this.saving = true;
|
|
1345
1795
|
const attrs = this.form.value;
|
|
1346
1796
|
(this.isEdit ? this.workflowService.updateWorkflow(this.workflowId, this.subscriptionId, attrs) : this.workflowService.createWorkflow(this.subscriptionId, attrs)).pipe(takeUntil(this.destroy$)).subscribe({
|
|
1347
|
-
next: () =>
|
|
1797
|
+
next: () => {
|
|
1798
|
+
this.form.markAsPristine();
|
|
1799
|
+
this.back();
|
|
1800
|
+
},
|
|
1348
1801
|
error: () => {
|
|
1349
1802
|
this.saving = false;
|
|
1350
1803
|
this.cdr.markForCheck();
|
|
@@ -1404,38 +1857,38 @@ var FlowsWorkflowFormComponent = class FlowsWorkflowFormComponent extends AppBas
|
|
|
1404
1857
|
selector: "pw-flows-workflow-form",
|
|
1405
1858
|
usesInheritance: true,
|
|
1406
1859
|
ngImport: i0,
|
|
1407
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">\n {{ (isEdit ? 'Flows.WorkflowForm.EditTitle' : 'Flows.WorkflowForm.CreateTitle') | transloco }}\n </h2>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-secondary\"\n (click)=\"back()\">\n <fa-icon [icon]=\"icons.back\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Back' | transloco }}\n </button>\n </div>\n</div>\n\n<pw-loader [isVisible]=\"loading\"></pw-loader>\n\n@if (!loading) {\n@if (notFound) {\n<pw-no-data [message]=\"'Flows.WorkflowForm.NotFound' | transloco\"></pw-no-data>\n} @else {\n<form [formGroup]=\"form\"\n (ngSubmit)=\"save()\"\n class=\"mt-3\">\n <h3>{{ 'Flows.WorkflowForm.Section.Details' | transloco }}</h3>\n <div class=\"row\">\n <!-- md-8/md-4 rather than the pattern default so the row fills the page. -->\n <pw-input-container class=\"col-12 col-md-8\"\n [label]=\"'Flows.WorkflowForm.Name' | transloco\"\n name=\"name\"\n controlId=\"flows-workflow-name\"\n [required]=\"true\"\n errorMsg=\"Flows.WorkflowForm.NameError\">\n <input type=\"text\"\n id=\"flows-workflow-name\"\n class=\"form-control\"\n maxlength=\"255\"\n [placeholder]=\"'Flows.WorkflowForm.NamePlaceholder' | transloco\"\n [attr.aria-label]=\"'Flows.WorkflowForm.Name' | transloco\"\n formControlName=\"name\" />\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-4\"\n [label]=\"'Flows.WorkflowForm.Status' | transloco\"\n name=\"status\"\n controlId=\"flows-workflow-status\"\n [required]=\"true\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"Flows.WorkflowForm.StatusError\">\n <!-- No [showClear]: Grape restricts status to STATUSES, so a blank 400s. -->\n <p-select inputId=\"flows-workflow-status\"\n styleClass=\"w-100\"\n [options]=\"statusOptions\"\n optionValue=\"value\"\n formControlName=\"status\"\n [attr.aria-labelledby]=\"'flows-workflow-status-label'\"\n appendTo=\"body\">\n </p-select>\n </pw-input-container>\n\n <pw-input-container class=\"col-12\"\n [label]=\"'Flows.WorkflowForm.Description' | transloco\"\n name=\"description\"\n controlId=\"flows-workflow-description\">\n <textarea id=\"flows-workflow-description\"\n class=\"form-control\"\n rows=\"3\"\n [placeholder]=\"'Flows.WorkflowForm.DescriptionPlaceholder' | transloco\"\n [attr.aria-label]=\"'Flows.WorkflowForm.Description' | transloco\"\n formControlName=\"description\"></textarea>\n </pw-input-container>\n </div>\n\n <div class=\"mb-3 col-12 text-end mt-3\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"back()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button name=\"submit\"\n type=\"submit\"\n class=\"btn btn-primary\"\n [disabled]=\"saving\">\n {{ 'Button.Submit' | transloco }}\n </button>\n </div>\n</form>\n}\n}\n",
|
|
1408
|
-
styles: [":host form>h3{display:block;border-top:1px solid #e2e5ea;margin-top:2rem;padding-top:1.25rem}:host form>h3:first-child{border-top:0;margin-top:.5rem;padding-top:0}\n"],
|
|
1860
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">\n {{ (isEdit ? 'Flows.WorkflowForm.EditTitle' : 'Flows.WorkflowForm.CreateTitle') | transloco }}\n </h2>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-secondary\"\n (click)=\"back()\">\n <fa-icon [icon]=\"icons.back\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Back' | transloco }}\n </button>\n </div>\n</div>\n\n<pw-loader [isVisible]=\"loading\"></pw-loader>\n\n@if (!loading) {\n@if (notFound) {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.WorkflowForm.NotFound' | transloco\"></pw-no-data>\n} @else {\n<form [formGroup]=\"form\"\n (ngSubmit)=\"save()\"\n class=\"mt-3\">\n <h3>{{ 'Flows.WorkflowForm.Section.Details' | transloco }}</h3>\n <div class=\"row\">\n <!-- md-8/md-4 rather than the pattern default so the row fills the page. -->\n <pw-input-container class=\"col-12 col-md-8\"\n [label]=\"'Flows.WorkflowForm.Name' | transloco\"\n name=\"name\"\n controlId=\"flows-workflow-name\"\n [required]=\"true\"\n errorMsg=\"Flows.WorkflowForm.NameError\">\n <input type=\"text\"\n id=\"flows-workflow-name\"\n class=\"form-control\"\n maxlength=\"255\"\n [placeholder]=\"'Flows.WorkflowForm.NamePlaceholder' | transloco\"\n [attr.aria-label]=\"'Flows.WorkflowForm.Name' | transloco\"\n formControlName=\"name\" />\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-4\"\n [label]=\"'Flows.WorkflowForm.Status' | transloco\"\n name=\"status\"\n controlId=\"flows-workflow-status\"\n [required]=\"true\"\n [useAriaLabelledbyOnly]=\"true\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Flows.WorkflowForm.StatusHint' | transloco\"\n errorMsg=\"Flows.WorkflowForm.StatusError\">\n <!-- No [showClear]: Grape restricts status to STATUSES, so a blank 400s. -->\n <p-select inputId=\"flows-workflow-status\"\n styleClass=\"w-100\"\n [options]=\"statusOptions\"\n optionValue=\"value\"\n formControlName=\"status\"\n [attr.aria-labelledby]=\"'flows-workflow-status-label'\"\n appendTo=\"body\">\n </p-select>\n </pw-input-container>\n\n <pw-input-container class=\"col-12\"\n [label]=\"'Flows.WorkflowForm.Description' | transloco\"\n name=\"description\"\n controlId=\"flows-workflow-description\">\n <textarea id=\"flows-workflow-description\"\n class=\"form-control\"\n rows=\"3\"\n [placeholder]=\"'Flows.WorkflowForm.DescriptionPlaceholder' | transloco\"\n [attr.aria-label]=\"'Flows.WorkflowForm.Description' | transloco\"\n formControlName=\"description\"></textarea>\n </pw-input-container>\n </div>\n\n <div class=\"mb-3 col-12 text-end mt-3\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"back()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button name=\"submit\"\n type=\"submit\"\n class=\"btn btn-primary\"\n [disabled]=\"saving\">\n {{ 'Button.Submit' | transloco }}\n </button>\n </div>\n</form>\n}\n}\n",
|
|
1861
|
+
styles: [":host ::ng-deep .info-circle{display:inline-block;margin-left:.35em;vertical-align:baseline}:host ::ng-deep .info-circle:after{position:static;font-size:inherit;line-height:inherit}:host form>h3{display:block;border-top:1px solid #e2e5ea;margin-top:2rem;padding-top:1.25rem}:host form>h3:first-child{border-top:0;margin-top:.5rem;padding-top:0}\n"],
|
|
1409
1862
|
dependencies: [
|
|
1410
1863
|
{
|
|
1411
1864
|
kind: "directive",
|
|
1412
|
-
type: i3$
|
|
1865
|
+
type: i3$2.ɵNgNoValidate,
|
|
1413
1866
|
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
1414
1867
|
},
|
|
1415
1868
|
{
|
|
1416
1869
|
kind: "directive",
|
|
1417
|
-
type: i3$
|
|
1870
|
+
type: i3$2.DefaultValueAccessor,
|
|
1418
1871
|
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
1419
1872
|
},
|
|
1420
1873
|
{
|
|
1421
1874
|
kind: "directive",
|
|
1422
|
-
type: i3$
|
|
1875
|
+
type: i3$2.NgControlStatus,
|
|
1423
1876
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
1424
1877
|
},
|
|
1425
1878
|
{
|
|
1426
1879
|
kind: "directive",
|
|
1427
|
-
type: i3$
|
|
1880
|
+
type: i3$2.NgControlStatusGroup,
|
|
1428
1881
|
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
1429
1882
|
},
|
|
1430
1883
|
{
|
|
1431
1884
|
kind: "directive",
|
|
1432
|
-
type: i3$
|
|
1885
|
+
type: i3$2.MaxLengthValidator,
|
|
1433
1886
|
selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",
|
|
1434
1887
|
inputs: ["maxlength"]
|
|
1435
1888
|
},
|
|
1436
1889
|
{
|
|
1437
1890
|
kind: "directive",
|
|
1438
|
-
type: i3$
|
|
1891
|
+
type: i3$2.FormGroupDirective,
|
|
1439
1892
|
selector: "[formGroup]",
|
|
1440
1893
|
inputs: ["formGroup"],
|
|
1441
1894
|
outputs: ["ngSubmit"],
|
|
@@ -1443,7 +1896,7 @@ var FlowsWorkflowFormComponent = class FlowsWorkflowFormComponent extends AppBas
|
|
|
1443
1896
|
},
|
|
1444
1897
|
{
|
|
1445
1898
|
kind: "directive",
|
|
1446
|
-
type: i3$
|
|
1899
|
+
type: i3$2.FormControlName,
|
|
1447
1900
|
selector: "[formControlName]",
|
|
1448
1901
|
inputs: [
|
|
1449
1902
|
"formControlName",
|
|
@@ -1452,9 +1905,14 @@ var FlowsWorkflowFormComponent = class FlowsWorkflowFormComponent extends AppBas
|
|
|
1452
1905
|
],
|
|
1453
1906
|
outputs: ["ngModelChange"]
|
|
1454
1907
|
},
|
|
1908
|
+
{
|
|
1909
|
+
kind: "directive",
|
|
1910
|
+
type: i3$1.TrackDirtyFormDirective,
|
|
1911
|
+
selector: "[formGroup]:not([formGroupSkipDirty])"
|
|
1912
|
+
},
|
|
1455
1913
|
{
|
|
1456
1914
|
kind: "component",
|
|
1457
|
-
type:
|
|
1915
|
+
type: i4$1.AppLoaderComponent,
|
|
1458
1916
|
selector: "pw-loader",
|
|
1459
1917
|
inputs: [
|
|
1460
1918
|
"isVisible",
|
|
@@ -1534,7 +1992,7 @@ var FlowsWorkflowFormComponent = class FlowsWorkflowFormComponent extends AppBas
|
|
|
1534
1992
|
},
|
|
1535
1993
|
{
|
|
1536
1994
|
kind: "component",
|
|
1537
|
-
type:
|
|
1995
|
+
type: i6.InputContainerComponent,
|
|
1538
1996
|
selector: "pw-input-container",
|
|
1539
1997
|
inputs: [
|
|
1540
1998
|
"name",
|
|
@@ -1557,7 +2015,7 @@ var FlowsWorkflowFormComponent = class FlowsWorkflowFormComponent extends AppBas
|
|
|
1557
2015
|
},
|
|
1558
2016
|
{
|
|
1559
2017
|
kind: "component",
|
|
1560
|
-
type:
|
|
2018
|
+
type: i6.NoDataComponent,
|
|
1561
2019
|
selector: "pw-no-data",
|
|
1562
2020
|
inputs: [
|
|
1563
2021
|
"message",
|
|
@@ -1567,7 +2025,7 @@ var FlowsWorkflowFormComponent = class FlowsWorkflowFormComponent extends AppBas
|
|
|
1567
2025
|
},
|
|
1568
2026
|
{
|
|
1569
2027
|
kind: "component",
|
|
1570
|
-
type:
|
|
2028
|
+
type: i2$3.FaIconComponent,
|
|
1571
2029
|
selector: "fa-icon",
|
|
1572
2030
|
inputs: [
|
|
1573
2031
|
"icon",
|
|
@@ -1604,7 +2062,7 @@ var FlowsWorkflowFormComponent = class FlowsWorkflowFormComponent extends AppBas
|
|
|
1604
2062
|
},
|
|
1605
2063
|
{
|
|
1606
2064
|
kind: "pipe",
|
|
1607
|
-
type:
|
|
2065
|
+
type: i2$4.TranslocoPipe,
|
|
1608
2066
|
name: "transloco"
|
|
1609
2067
|
}
|
|
1610
2068
|
]
|
|
@@ -1621,8 +2079,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1621
2079
|
args: [{
|
|
1622
2080
|
selector: "pw-flows-workflow-form",
|
|
1623
2081
|
standalone: false,
|
|
1624
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">\n {{ (isEdit ? 'Flows.WorkflowForm.EditTitle' : 'Flows.WorkflowForm.CreateTitle') | transloco }}\n </h2>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-secondary\"\n (click)=\"back()\">\n <fa-icon [icon]=\"icons.back\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Back' | transloco }}\n </button>\n </div>\n</div>\n\n<pw-loader [isVisible]=\"loading\"></pw-loader>\n\n@if (!loading) {\n@if (notFound) {\n<pw-no-data [message]=\"'Flows.WorkflowForm.NotFound' | transloco\"></pw-no-data>\n} @else {\n<form [formGroup]=\"form\"\n (ngSubmit)=\"save()\"\n class=\"mt-3\">\n <h3>{{ 'Flows.WorkflowForm.Section.Details' | transloco }}</h3>\n <div class=\"row\">\n <!-- md-8/md-4 rather than the pattern default so the row fills the page. -->\n <pw-input-container class=\"col-12 col-md-8\"\n [label]=\"'Flows.WorkflowForm.Name' | transloco\"\n name=\"name\"\n controlId=\"flows-workflow-name\"\n [required]=\"true\"\n errorMsg=\"Flows.WorkflowForm.NameError\">\n <input type=\"text\"\n id=\"flows-workflow-name\"\n class=\"form-control\"\n maxlength=\"255\"\n [placeholder]=\"'Flows.WorkflowForm.NamePlaceholder' | transloco\"\n [attr.aria-label]=\"'Flows.WorkflowForm.Name' | transloco\"\n formControlName=\"name\" />\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-4\"\n [label]=\"'Flows.WorkflowForm.Status' | transloco\"\n name=\"status\"\n controlId=\"flows-workflow-status\"\n [required]=\"true\"\n [useAriaLabelledbyOnly]=\"true\"\n errorMsg=\"Flows.WorkflowForm.StatusError\">\n <!-- No [showClear]: Grape restricts status to STATUSES, so a blank 400s. -->\n <p-select inputId=\"flows-workflow-status\"\n styleClass=\"w-100\"\n [options]=\"statusOptions\"\n optionValue=\"value\"\n formControlName=\"status\"\n [attr.aria-labelledby]=\"'flows-workflow-status-label'\"\n appendTo=\"body\">\n </p-select>\n </pw-input-container>\n\n <pw-input-container class=\"col-12\"\n [label]=\"'Flows.WorkflowForm.Description' | transloco\"\n name=\"description\"\n controlId=\"flows-workflow-description\">\n <textarea id=\"flows-workflow-description\"\n class=\"form-control\"\n rows=\"3\"\n [placeholder]=\"'Flows.WorkflowForm.DescriptionPlaceholder' | transloco\"\n [attr.aria-label]=\"'Flows.WorkflowForm.Description' | transloco\"\n formControlName=\"description\"></textarea>\n </pw-input-container>\n </div>\n\n <div class=\"mb-3 col-12 text-end mt-3\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"back()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button name=\"submit\"\n type=\"submit\"\n class=\"btn btn-primary\"\n [disabled]=\"saving\">\n {{ 'Button.Submit' | transloco }}\n </button>\n </div>\n</form>\n}\n}\n",
|
|
1625
|
-
styles: [":host form>h3{display:block;border-top:1px solid #e2e5ea;margin-top:2rem;padding-top:1.25rem}:host form>h3:first-child{border-top:0;margin-top:.5rem;padding-top:0}\n"]
|
|
2082
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">\n {{ (isEdit ? 'Flows.WorkflowForm.EditTitle' : 'Flows.WorkflowForm.CreateTitle') | transloco }}\n </h2>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-secondary\"\n (click)=\"back()\">\n <fa-icon [icon]=\"icons.back\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Back' | transloco }}\n </button>\n </div>\n</div>\n\n<pw-loader [isVisible]=\"loading\"></pw-loader>\n\n@if (!loading) {\n@if (notFound) {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.WorkflowForm.NotFound' | transloco\"></pw-no-data>\n} @else {\n<form [formGroup]=\"form\"\n (ngSubmit)=\"save()\"\n class=\"mt-3\">\n <h3>{{ 'Flows.WorkflowForm.Section.Details' | transloco }}</h3>\n <div class=\"row\">\n <!-- md-8/md-4 rather than the pattern default so the row fills the page. -->\n <pw-input-container class=\"col-12 col-md-8\"\n [label]=\"'Flows.WorkflowForm.Name' | transloco\"\n name=\"name\"\n controlId=\"flows-workflow-name\"\n [required]=\"true\"\n errorMsg=\"Flows.WorkflowForm.NameError\">\n <input type=\"text\"\n id=\"flows-workflow-name\"\n class=\"form-control\"\n maxlength=\"255\"\n [placeholder]=\"'Flows.WorkflowForm.NamePlaceholder' | transloco\"\n [attr.aria-label]=\"'Flows.WorkflowForm.Name' | transloco\"\n formControlName=\"name\" />\n </pw-input-container>\n\n <pw-input-container class=\"col-12 col-md-4\"\n [label]=\"'Flows.WorkflowForm.Status' | transloco\"\n name=\"status\"\n controlId=\"flows-workflow-status\"\n [required]=\"true\"\n [useAriaLabelledbyOnly]=\"true\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Flows.WorkflowForm.StatusHint' | transloco\"\n errorMsg=\"Flows.WorkflowForm.StatusError\">\n <!-- No [showClear]: Grape restricts status to STATUSES, so a blank 400s. -->\n <p-select inputId=\"flows-workflow-status\"\n styleClass=\"w-100\"\n [options]=\"statusOptions\"\n optionValue=\"value\"\n formControlName=\"status\"\n [attr.aria-labelledby]=\"'flows-workflow-status-label'\"\n appendTo=\"body\">\n </p-select>\n </pw-input-container>\n\n <pw-input-container class=\"col-12\"\n [label]=\"'Flows.WorkflowForm.Description' | transloco\"\n name=\"description\"\n controlId=\"flows-workflow-description\">\n <textarea id=\"flows-workflow-description\"\n class=\"form-control\"\n rows=\"3\"\n [placeholder]=\"'Flows.WorkflowForm.DescriptionPlaceholder' | transloco\"\n [attr.aria-label]=\"'Flows.WorkflowForm.Description' | transloco\"\n formControlName=\"description\"></textarea>\n </pw-input-container>\n </div>\n\n <div class=\"mb-3 col-12 text-end mt-3\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"back()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button name=\"submit\"\n type=\"submit\"\n class=\"btn btn-primary\"\n [disabled]=\"saving\">\n {{ 'Button.Submit' | transloco }}\n </button>\n </div>\n</form>\n}\n}\n",
|
|
2083
|
+
styles: [":host ::ng-deep .info-circle{display:inline-block;margin-left:.35em;vertical-align:baseline}:host ::ng-deep .info-circle:after{position:static;font-size:inherit;line-height:inherit}:host form>h3{display:block;border-top:1px solid #e2e5ea;margin-top:2rem;padding-top:1.25rem}:host form>h3:first-child{border-top:0;margin-top:.5rem;padding-top:0}\n"]
|
|
1626
2084
|
}]
|
|
1627
2085
|
}],
|
|
1628
2086
|
ctorParameters: () => [
|
|
@@ -1631,102 +2089,30 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1631
2089
|
{ type: i0.ChangeDetectorRef }
|
|
1632
2090
|
]
|
|
1633
2091
|
});
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
nodes: nodes.filter((node) => isRecord(node) && typeof node["id"] === "string" && typeof node["type"] === "string"),
|
|
1656
|
-
edges: edges.filter((edge) => isRecord(edge) && typeof edge["from"] === "string" && typeof edge["to"] === "string")
|
|
1657
|
-
};
|
|
1658
|
-
}
|
|
1659
|
-
function nextId(prefix, taken) {
|
|
1660
|
-
const pattern = new RegExp(String.raw`^${prefix}(\d+)$`);
|
|
1661
|
-
return `${prefix}${taken.reduce((max, id) => {
|
|
1662
|
-
const match = pattern.exec(id);
|
|
1663
|
-
return match ? Math.max(max, Number(match[1])) : max;
|
|
1664
|
-
}, 0) + 1}`;
|
|
1665
|
-
}
|
|
1666
|
-
function nextFlowNodeId(nodes) {
|
|
1667
|
-
return nextId("n", nodes.map((node) => node.id));
|
|
1668
|
-
}
|
|
1669
|
-
function nextFlowEdgeId(edges) {
|
|
1670
|
-
return nextId("e", edges.map((edge) => edge.id ?? ""));
|
|
1671
|
-
}
|
|
1672
|
-
function flowNodeLabelKey(type) {
|
|
1673
|
-
return `Flows.Nodes.${type}`;
|
|
1674
|
-
}
|
|
1675
|
-
var FlowsNodeService = class FlowsNodeService {
|
|
1676
|
-
constructor(api) {
|
|
1677
|
-
this.api = api;
|
|
1678
|
-
this.cache = /* @__PURE__ */ new Map();
|
|
1679
|
-
}
|
|
1680
|
-
getNodes(subscriptionId) {
|
|
1681
|
-
let nodes = this.cache.get(subscriptionId);
|
|
1682
|
-
if (!nodes) {
|
|
1683
|
-
nodes = this.api.getWithParams(FLOWS_NODES_PATH, { subscription_id: subscriptionId }).pipe(map((response) => response.flow_nodes), catchError((error) => {
|
|
1684
|
-
this.cache.delete(subscriptionId);
|
|
1685
|
-
return throwError(() => error);
|
|
1686
|
-
}), shareReplay({
|
|
1687
|
-
bufferSize: 1,
|
|
1688
|
-
refCount: false
|
|
1689
|
-
}));
|
|
1690
|
-
this.cache.set(subscriptionId, nodes);
|
|
2092
|
+
var FlowVersionEditorState = class {
|
|
2093
|
+
constructor() {
|
|
2094
|
+
this.open = false;
|
|
2095
|
+
this.version = null;
|
|
2096
|
+
this.duplicateOf = null;
|
|
2097
|
+
this.check = null;
|
|
2098
|
+
}
|
|
2099
|
+
show(version, duplicateOf = null, check = null) {
|
|
2100
|
+
this.open = true;
|
|
2101
|
+
this.version = version;
|
|
2102
|
+
this.duplicateOf = duplicateOf;
|
|
2103
|
+
this.check = check;
|
|
2104
|
+
}
|
|
2105
|
+
close() {
|
|
2106
|
+
this.show(null);
|
|
2107
|
+
this.open = false;
|
|
2108
|
+
}
|
|
2109
|
+
published(version) {
|
|
2110
|
+
if (this.open && this.version?.id === version.id) {
|
|
2111
|
+
this.version = version;
|
|
2112
|
+
this.check = null;
|
|
1691
2113
|
}
|
|
1692
|
-
return nodes;
|
|
1693
|
-
}
|
|
1694
|
-
static {
|
|
1695
|
-
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
1696
|
-
minVersion: "12.0.0",
|
|
1697
|
-
version: "22.2.0",
|
|
1698
|
-
ngImport: i0,
|
|
1699
|
-
type: FlowsNodeService,
|
|
1700
|
-
deps: [{ token: i1$1.ProductsHttpService }],
|
|
1701
|
-
target: i0.ɵɵFactoryTarget.Injectable
|
|
1702
|
-
});
|
|
1703
|
-
}
|
|
1704
|
-
static {
|
|
1705
|
-
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1706
|
-
minVersion: "12.0.0",
|
|
1707
|
-
version: "22.2.0",
|
|
1708
|
-
ngImport: i0,
|
|
1709
|
-
type: FlowsNodeService,
|
|
1710
|
-
providedIn: "root"
|
|
1711
|
-
});
|
|
1712
2114
|
}
|
|
1713
2115
|
};
|
|
1714
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1715
|
-
minVersion: "12.0.0",
|
|
1716
|
-
version: "22.2.0",
|
|
1717
|
-
ngImport: i0,
|
|
1718
|
-
type: FlowsNodeService,
|
|
1719
|
-
decorators: [{
|
|
1720
|
-
type: Injectable,
|
|
1721
|
-
args: [{ providedIn: "root" }]
|
|
1722
|
-
}],
|
|
1723
|
-
ctorParameters: () => [{ type: i1$1.ProductsHttpService }]
|
|
1724
|
-
});
|
|
1725
|
-
const FLOW_SCHEDULE_PAYLOAD_FIELDS = [
|
|
1726
|
-
"trigger_id",
|
|
1727
|
-
"trigger_type",
|
|
1728
|
-
"scheduled_for"
|
|
1729
|
-
];
|
|
1730
2116
|
function upstreamOf(graph, nodeId) {
|
|
1731
2117
|
const seen = /* @__PURE__ */ new Set();
|
|
1732
2118
|
const queue = [nodeId];
|
|
@@ -1745,7 +2131,183 @@ function conditionFieldSuggestions(graph, nodeId) {
|
|
|
1745
2131
|
const fields = node.params?.["fields"];
|
|
1746
2132
|
return fields && typeof fields === "object" && !Array.isArray(fields) ? Object.keys(fields) : [];
|
|
1747
2133
|
});
|
|
1748
|
-
return [
|
|
2134
|
+
return [...new Set(setKeys)];
|
|
2135
|
+
}
|
|
2136
|
+
function flowIncoming(graph, walk) {
|
|
2137
|
+
const entering = /* @__PURE__ */ new Set();
|
|
2138
|
+
const into = (id) => {
|
|
2139
|
+
if (entering.has(id)) return walk.none();
|
|
2140
|
+
entering.add(id);
|
|
2141
|
+
const found = walk.combine(graph.edges.filter((edge) => edge.to === id).map((edge) => edge.branch === "error" ? walk.failed(edge.from, into(edge.from)) : walk.outOf(edge.from)));
|
|
2142
|
+
entering.delete(id);
|
|
2143
|
+
return found;
|
|
2144
|
+
};
|
|
2145
|
+
return into;
|
|
2146
|
+
}
|
|
2147
|
+
const NONE = {
|
|
2148
|
+
names: [],
|
|
2149
|
+
lists: {}
|
|
2150
|
+
};
|
|
2151
|
+
const FLOW_ERROR_FIELDS = {
|
|
2152
|
+
names: ["error"],
|
|
2153
|
+
lists: {}
|
|
2154
|
+
};
|
|
2155
|
+
const NO_FIELDS = ["trigger.schedule", "trigger.manual"];
|
|
2156
|
+
function unique(names) {
|
|
2157
|
+
return [...new Set(names)];
|
|
2158
|
+
}
|
|
2159
|
+
function union(all) {
|
|
2160
|
+
const lists = {};
|
|
2161
|
+
all.forEach((fields) => Object.entries(fields.lists).forEach(([name, entries]) => {
|
|
2162
|
+
lists[name] = unique([...lists[name] ?? [], ...entries]);
|
|
2163
|
+
}));
|
|
2164
|
+
return {
|
|
2165
|
+
names: unique(all.flatMap((fields) => fields.names)),
|
|
2166
|
+
lists
|
|
2167
|
+
};
|
|
2168
|
+
}
|
|
2169
|
+
function text(node, key) {
|
|
2170
|
+
const value = node.params?.[key];
|
|
2171
|
+
return typeof value === "string" ? value : "";
|
|
2172
|
+
}
|
|
2173
|
+
function setKeys(node) {
|
|
2174
|
+
const fields = node.params?.["fields"];
|
|
2175
|
+
return fields && typeof fields === "object" && !Array.isArray(fields) ? Object.keys(fields) : [];
|
|
2176
|
+
}
|
|
2177
|
+
function leaving(node, incoming, definition) {
|
|
2178
|
+
switch (node.type) {
|
|
2179
|
+
case "data.split_out": return {
|
|
2180
|
+
names: incoming.lists[text(node, "field")] ?? [],
|
|
2181
|
+
lists: {}
|
|
2182
|
+
};
|
|
2183
|
+
case "data.aggregate": return text(node, "field") ? {
|
|
2184
|
+
names: [text(node, "field")],
|
|
2185
|
+
lists: { [text(node, "field")]: incoming.names }
|
|
2186
|
+
} : NONE;
|
|
2187
|
+
case "data.set_fields": return {
|
|
2188
|
+
names: unique([...incoming.names, ...setKeys(node)]),
|
|
2189
|
+
lists: incoming.lists
|
|
2190
|
+
};
|
|
2191
|
+
default: {
|
|
2192
|
+
const own = definition?.item_fields ?? NONE;
|
|
2193
|
+
return definition?.passes_items ? union([incoming, own]) : own;
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
function flowFieldWalk(graph, definitions, learned = {}) {
|
|
2198
|
+
const byType = new Map(definitions.map((definition) => [definition.type, definition]));
|
|
2199
|
+
const nodes = new Map(graph.nodes.map((node) => [node.id, node]));
|
|
2200
|
+
const known = /* @__PURE__ */ new Map();
|
|
2201
|
+
const walking = /* @__PURE__ */ new Set();
|
|
2202
|
+
const into = flowIncoming(graph, {
|
|
2203
|
+
outOf: (id) => outOf(id),
|
|
2204
|
+
failed: (_, reached) => union([reached, FLOW_ERROR_FIELDS]),
|
|
2205
|
+
combine: union,
|
|
2206
|
+
none: () => NONE
|
|
2207
|
+
});
|
|
2208
|
+
const outOf = (id) => {
|
|
2209
|
+
const node = nodes.get(id);
|
|
2210
|
+
if (!node || walking.has(id) || NO_FIELDS.includes(node.type)) return NONE;
|
|
2211
|
+
if (!known.has(id)) {
|
|
2212
|
+
walking.add(id);
|
|
2213
|
+
const expected = leaving(node, into(id), byType.get(node.type));
|
|
2214
|
+
const seen = learned[flowNodeFieldsKey(id, node.type)];
|
|
2215
|
+
known.set(id, seen ? union([expected, seen]) : expected);
|
|
2216
|
+
walking.delete(id);
|
|
2217
|
+
}
|
|
2218
|
+
return known.get(id);
|
|
2219
|
+
};
|
|
2220
|
+
return {
|
|
2221
|
+
into,
|
|
2222
|
+
outOf
|
|
2223
|
+
};
|
|
2224
|
+
}
|
|
2225
|
+
function flowFieldsInto(graph, nodeId, definitions, learned = {}) {
|
|
2226
|
+
return flowFieldWalk(graph, definitions, learned).into(nodeId);
|
|
2227
|
+
}
|
|
2228
|
+
function flowFieldsPossible(graph, nodeId) {
|
|
2229
|
+
const types = new Map(graph.nodes.map((node) => [node.id, node.type]));
|
|
2230
|
+
const before = (id) => graph.edges.filter((e) => e.to === id).map((e) => e.from);
|
|
2231
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2232
|
+
const queue = before(nodeId);
|
|
2233
|
+
while (queue.length) {
|
|
2234
|
+
const id = queue.pop();
|
|
2235
|
+
if (!seen.has(id)) {
|
|
2236
|
+
seen.add(id);
|
|
2237
|
+
if (!NO_FIELDS.includes(types.get(id) ?? "")) return true;
|
|
2238
|
+
queue.push(...before(id));
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
return false;
|
|
2242
|
+
}
|
|
2243
|
+
const RESHAPES = ["data.split_out", "data.aggregate"];
|
|
2244
|
+
function merge(groups) {
|
|
2245
|
+
const merged = /* @__PURE__ */ new Map();
|
|
2246
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2247
|
+
groups.forEach((group) => group.forEach((fields, source) => {
|
|
2248
|
+
const names = fields.names.filter((name) => !seen.has(name));
|
|
2249
|
+
names.forEach((name) => seen.add(name));
|
|
2250
|
+
const before = merged.get(source) ?? {
|
|
2251
|
+
names: [],
|
|
2252
|
+
lists: {}
|
|
2253
|
+
};
|
|
2254
|
+
const lists = Object.fromEntries(names.filter((n) => fields.lists[n]).map((n) => [n, fields.lists[n]]));
|
|
2255
|
+
merged.set(source, {
|
|
2256
|
+
names: [...before.names, ...names],
|
|
2257
|
+
lists: {
|
|
2258
|
+
...before.lists,
|
|
2259
|
+
...lists
|
|
2260
|
+
}
|
|
2261
|
+
});
|
|
2262
|
+
}));
|
|
2263
|
+
return merged;
|
|
2264
|
+
}
|
|
2265
|
+
function flowFieldSources(graph, nodeId, definitions, learned = {}) {
|
|
2266
|
+
const walk = flowFieldWalk(graph, definitions, learned);
|
|
2267
|
+
const byType = new Map(definitions.map((definition) => [definition.type, definition]));
|
|
2268
|
+
const nodes = new Map(graph.nodes.map((node) => [node.id, node]));
|
|
2269
|
+
const known = /* @__PURE__ */ new Map();
|
|
2270
|
+
const into = flowIncoming(graph, {
|
|
2271
|
+
outOf: (id) => outOf(id),
|
|
2272
|
+
failed: (id, reached) => merge([/* @__PURE__ */ new Map([[id, FLOW_ERROR_FIELDS]]), reached]),
|
|
2273
|
+
combine: merge,
|
|
2274
|
+
none: () => /* @__PURE__ */ new Map()
|
|
2275
|
+
});
|
|
2276
|
+
const outOf = (id) => {
|
|
2277
|
+
const node = nodes.get(id);
|
|
2278
|
+
if (!node || known.has(id)) return known.get(id) ?? /* @__PURE__ */ new Map();
|
|
2279
|
+
known.set(id, /* @__PURE__ */ new Map());
|
|
2280
|
+
const passes = !RESHAPES.includes(node.type) && !!byType.get(node.type)?.passes_items;
|
|
2281
|
+
const before = node.type === "data.set_fields" || passes ? into(id) : /* @__PURE__ */ new Map();
|
|
2282
|
+
const inherited = new Set([...before.values()].flatMap((fields) => fields.names));
|
|
2283
|
+
const leaving = walk.outOf(id);
|
|
2284
|
+
const made = {
|
|
2285
|
+
...leaving,
|
|
2286
|
+
names: leaving.names.filter((name) => !inherited.has(name))
|
|
2287
|
+
};
|
|
2288
|
+
known.set(id, merge([/* @__PURE__ */ new Map([[id, made]]), before]));
|
|
2289
|
+
return known.get(id);
|
|
2290
|
+
};
|
|
2291
|
+
return [...into(nodeId)].filter(([, fields]) => fields.names.length).map(([source, fields]) => {
|
|
2292
|
+
const type = nodes.get(source)?.type ?? "";
|
|
2293
|
+
return {
|
|
2294
|
+
nodeId: source,
|
|
2295
|
+
type,
|
|
2296
|
+
label: byType.get(type)?.label ?? type,
|
|
2297
|
+
...fields
|
|
2298
|
+
};
|
|
2299
|
+
});
|
|
2300
|
+
}
|
|
2301
|
+
function flowNodeSelection(graph, node, definition, definitions, workflowFields) {
|
|
2302
|
+
const learned = workflowFields?.byNode ?? {};
|
|
2303
|
+
const incoming = flowFieldsInto(graph, node.id, definitions, learned);
|
|
2304
|
+
return {
|
|
2305
|
+
node,
|
|
2306
|
+
definition,
|
|
2307
|
+
fieldSuggestions: [.../* @__PURE__ */ new Set([...conditionFieldSuggestions(graph, node.id), ...incoming.names])],
|
|
2308
|
+
listSuggestions: Object.keys(incoming.lists),
|
|
2309
|
+
fieldSources: flowFieldsPossible(graph, node.id) ? flowFieldSources(graph, node.id, definitions, learned) : null
|
|
2310
|
+
};
|
|
1749
2311
|
}
|
|
1750
2312
|
const FLOW_SOCKET = new ClassicPreset.Socket("flow");
|
|
1751
2313
|
var FlowCanvasNode = class extends ClassicPreset.Node {
|
|
@@ -1977,7 +2539,7 @@ var FlowsCanvasNodeComponent = class FlowsCanvasNodeComponent {
|
|
|
1977
2539
|
dependencies: [
|
|
1978
2540
|
{
|
|
1979
2541
|
kind: "component",
|
|
1980
|
-
type:
|
|
2542
|
+
type: i2$3.FaIconComponent,
|
|
1981
2543
|
selector: "fa-icon",
|
|
1982
2544
|
inputs: [
|
|
1983
2545
|
"icon",
|
|
@@ -2014,13 +2576,13 @@ var FlowsCanvasNodeComponent = class FlowsCanvasNodeComponent {
|
|
|
2014
2576
|
},
|
|
2015
2577
|
{
|
|
2016
2578
|
kind: "directive",
|
|
2017
|
-
type: i2$
|
|
2579
|
+
type: i2$2.RefDirective,
|
|
2018
2580
|
selector: "[refComponent]",
|
|
2019
2581
|
inputs: ["data", "emit"]
|
|
2020
2582
|
},
|
|
2021
2583
|
{
|
|
2022
2584
|
kind: "pipe",
|
|
2023
|
-
type:
|
|
2585
|
+
type: i2$4.TranslocoPipe,
|
|
2024
2586
|
name: "transloco"
|
|
2025
2587
|
}
|
|
2026
2588
|
]
|
|
@@ -2142,11 +2704,12 @@ function setupFlowCanvas(container, injector) {
|
|
|
2142
2704
|
area.use(connection);
|
|
2143
2705
|
area.use(render);
|
|
2144
2706
|
AreaExtensions.simpleNodesOrder(area);
|
|
2145
|
-
AreaExtensions.selectableNodes(area, AreaExtensions.selector(), { accumulating: { active: () => false } });
|
|
2707
|
+
const selectable = AreaExtensions.selectableNodes(area, AreaExtensions.selector(), { accumulating: { active: () => false } });
|
|
2146
2708
|
return {
|
|
2147
2709
|
editor,
|
|
2148
2710
|
area,
|
|
2149
|
-
connection
|
|
2711
|
+
connection,
|
|
2712
|
+
selectNode: (nodeId) => selectable.select(nodeId, false)
|
|
2150
2713
|
};
|
|
2151
2714
|
}
|
|
2152
2715
|
const GRID_GAP = {
|
|
@@ -2205,8 +2768,15 @@ var FlowCanvasEditor = class {
|
|
|
2205
2768
|
async addNode(node) {
|
|
2206
2769
|
await this.rete.editor.addNode(node);
|
|
2207
2770
|
await this.rete.area.translate(node.id, node.flowNode.position ?? placementFor(this.rete, this.container, node));
|
|
2771
|
+
await this.rete.selectNode(node.id);
|
|
2208
2772
|
this.listener.selected(node.id);
|
|
2209
2773
|
}
|
|
2774
|
+
async selectNode(nodeId) {
|
|
2775
|
+
if (this.rete.editor.getNode(nodeId)) {
|
|
2776
|
+
await this.rete.selectNode(nodeId);
|
|
2777
|
+
this.listener.selected(nodeId);
|
|
2778
|
+
}
|
|
2779
|
+
}
|
|
2210
2780
|
async removeNode(nodeId) {
|
|
2211
2781
|
const attached = this.rete.editor.getConnections().filter((c) => c.source === nodeId || c.target === nodeId);
|
|
2212
2782
|
for (const connection of attached) await this.rete.editor.removeConnection(connection.id);
|
|
@@ -2254,17 +2824,23 @@ var FlowsGraphCanvasComponent = class FlowsGraphCanvasComponent {
|
|
|
2254
2824
|
this.cdr = cdr;
|
|
2255
2825
|
this.graph = emptyFlowGraph();
|
|
2256
2826
|
this.definitions = [];
|
|
2827
|
+
this.workflowFields = null;
|
|
2257
2828
|
this.readOnly = false;
|
|
2258
2829
|
this.selectionChange = new EventEmitter();
|
|
2259
2830
|
this.graphChange = new EventEmitter();
|
|
2260
2831
|
this.dropped = new EventEmitter();
|
|
2261
2832
|
this.drawFailed = false;
|
|
2833
|
+
this.selected = null;
|
|
2262
2834
|
this.pending = Promise.resolve();
|
|
2263
2835
|
}
|
|
2264
2836
|
ngAfterViewInit() {
|
|
2265
2837
|
this.editor = new FlowCanvasEditor(this.host.nativeElement, this.injector, {
|
|
2266
|
-
selected: (nodeId) => this.selectionChange.emit(nodeId),
|
|
2267
|
-
changed: () =>
|
|
2838
|
+
selected: (nodeId) => this.selectionChange.emit(this.selected = nodeId),
|
|
2839
|
+
changed: () => {
|
|
2840
|
+
this.graphChange.emit();
|
|
2841
|
+
clearTimeout(this.reselect);
|
|
2842
|
+
this.reselect = setTimeout(() => this.selected && this.selectionChange.emit(this.selected));
|
|
2843
|
+
}
|
|
2268
2844
|
});
|
|
2269
2845
|
this.editor.setReadOnly(this.readOnly);
|
|
2270
2846
|
this.reload();
|
|
@@ -2273,6 +2849,7 @@ var FlowsGraphCanvasComponent = class FlowsGraphCanvasComponent {
|
|
|
2273
2849
|
if (!this.editor) return;
|
|
2274
2850
|
if (changes["readOnly"]) this.editor.setReadOnly(this.readOnly);
|
|
2275
2851
|
if (changes["graph"] || changes["definitions"]) this.reload();
|
|
2852
|
+
else if (changes["workflowFields"] && this.selected) this.selectionChange.emit(this.selected);
|
|
2276
2853
|
}
|
|
2277
2854
|
addNode(type) {
|
|
2278
2855
|
const definition = this.definitions.find((d) => d.type === type);
|
|
@@ -2280,11 +2857,15 @@ var FlowsGraphCanvasComponent = class FlowsGraphCanvasComponent {
|
|
|
2280
2857
|
return this.queue((editor) => {
|
|
2281
2858
|
const node = {
|
|
2282
2859
|
id: nextFlowNodeId(editor.toGraph().nodes),
|
|
2283
|
-
type
|
|
2860
|
+
type,
|
|
2861
|
+
...definition.category === "action" ? { retry: { ...FLOW_RETRY_DEFAULT } } : {}
|
|
2284
2862
|
};
|
|
2285
2863
|
return editor.addNode(createFlowCanvasNode(node, definition, definition.label));
|
|
2286
2864
|
});
|
|
2287
2865
|
}
|
|
2866
|
+
focusNode(nodeId) {
|
|
2867
|
+
return this.queue((editor) => editor.selectNode(nodeId));
|
|
2868
|
+
}
|
|
2288
2869
|
removeNode(nodeId) {
|
|
2289
2870
|
return this.queue((editor) => editor.removeNode(nodeId));
|
|
2290
2871
|
}
|
|
@@ -2293,11 +2874,8 @@ var FlowsGraphCanvasComponent = class FlowsGraphCanvasComponent {
|
|
|
2293
2874
|
}
|
|
2294
2875
|
selection(nodeId) {
|
|
2295
2876
|
const node = this.editor?.node(nodeId);
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
definition: node.definition,
|
|
2299
|
-
fieldSuggestions: conditionFieldSuggestions(this.toGraph(), nodeId)
|
|
2300
|
-
} : null;
|
|
2877
|
+
if (!node) return null;
|
|
2878
|
+
return flowNodeSelection(this.toGraph(), node.flowNode, node.definition, this.definitions, this.workflowFields);
|
|
2301
2879
|
}
|
|
2302
2880
|
toGraph() {
|
|
2303
2881
|
return this.editor?.toGraph() ?? emptyFlowGraph();
|
|
@@ -2306,6 +2884,7 @@ var FlowsGraphCanvasComponent = class FlowsGraphCanvasComponent {
|
|
|
2306
2884
|
return this.queue((editor) => editor.zoomToFit());
|
|
2307
2885
|
}
|
|
2308
2886
|
ngOnDestroy() {
|
|
2887
|
+
clearTimeout(this.reselect);
|
|
2309
2888
|
this.editor?.destroy();
|
|
2310
2889
|
this.editor = void 0;
|
|
2311
2890
|
}
|
|
@@ -2341,6 +2920,7 @@ var FlowsGraphCanvasComponent = class FlowsGraphCanvasComponent {
|
|
|
2341
2920
|
inputs: {
|
|
2342
2921
|
graph: "graph",
|
|
2343
2922
|
definitions: "definitions",
|
|
2923
|
+
workflowFields: "workflowFields",
|
|
2344
2924
|
readOnly: "readOnly"
|
|
2345
2925
|
},
|
|
2346
2926
|
outputs: {
|
|
@@ -2370,7 +2950,7 @@ var FlowsGraphCanvasComponent = class FlowsGraphCanvasComponent {
|
|
|
2370
2950
|
styles: [":host{display:block;position:relative;height:100%;overflow:hidden;background-color:#f7f8fa;background-image:radial-gradient(#cfd4dc 1px,transparent 1px);background-size:16px 16px}.pw-graph-canvas{width:100%;height:100%}.pw-graph-canvas__error{position:absolute;top:12px;left:12px;right:12px;margin:0;padding:8px 12px;border:1px solid #c0392b;border-radius:4px;background:#fff;color:#c0392b}\n"],
|
|
2371
2951
|
dependencies: [{
|
|
2372
2952
|
kind: "pipe",
|
|
2373
|
-
type:
|
|
2953
|
+
type: i2$4.TranslocoPipe,
|
|
2374
2954
|
name: "transloco"
|
|
2375
2955
|
}]
|
|
2376
2956
|
});
|
|
@@ -2401,6 +2981,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2401
2981
|
propDecorators: {
|
|
2402
2982
|
graph: [{ type: Input }],
|
|
2403
2983
|
definitions: [{ type: Input }],
|
|
2984
|
+
workflowFields: [{ type: Input }],
|
|
2404
2985
|
readOnly: [{
|
|
2405
2986
|
type: HostBinding,
|
|
2406
2987
|
args: ["class.is-read-only"]
|
|
@@ -2414,19 +2995,204 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2414
2995
|
}]
|
|
2415
2996
|
}
|
|
2416
2997
|
});
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
}
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2998
|
+
const FIELD_KINDS = {
|
|
2999
|
+
"trigger.schedule": {
|
|
3000
|
+
cron: "cron",
|
|
3001
|
+
timezone: "timezone"
|
|
3002
|
+
},
|
|
3003
|
+
"trigger.webhook": { path: "text" },
|
|
3004
|
+
"data.set_fields": { fields: "pairs" },
|
|
3005
|
+
"data.merge": { mode: "mode" },
|
|
3006
|
+
"data.split_out": { field: "list" },
|
|
3007
|
+
"action.email": {
|
|
3008
|
+
to: "email",
|
|
3009
|
+
subject: "text",
|
|
3010
|
+
body: "textarea"
|
|
3011
|
+
},
|
|
3012
|
+
"action.in_app_note": {
|
|
3013
|
+
user_id: "member",
|
|
3014
|
+
message: "textarea"
|
|
3015
|
+
},
|
|
3016
|
+
"action.push_notification": {
|
|
3017
|
+
user_id: "member",
|
|
3018
|
+
title: "text",
|
|
3019
|
+
message: "textarea"
|
|
3020
|
+
},
|
|
3021
|
+
"action.websocket": {
|
|
3022
|
+
user_ids: "members",
|
|
3023
|
+
payload: "json"
|
|
3024
|
+
}
|
|
3025
|
+
};
|
|
3026
|
+
function flowNodeFields(definition) {
|
|
3027
|
+
const kinds = FIELD_KINDS[definition.type] ?? {};
|
|
3028
|
+
return definition.params.map((key) => {
|
|
3029
|
+
const details = definition.param_details?.[key] ?? {};
|
|
3030
|
+
return {
|
|
3031
|
+
...details,
|
|
3032
|
+
key,
|
|
3033
|
+
kind: details.kind ?? kinds[key] ?? "text"
|
|
3034
|
+
};
|
|
3035
|
+
});
|
|
3036
|
+
}
|
|
3037
|
+
function flowNumberValue(value) {
|
|
3038
|
+
const text = typeof value === "string" ? value.trim() : value;
|
|
3039
|
+
return typeof text === "string" && /^-?\d+(\.\d+)?$/.test(text) ? Number(text) : text;
|
|
3040
|
+
}
|
|
3041
|
+
const FLOW_MERGE_MODES = ["append"];
|
|
3042
|
+
function flowParamLabelKey(key) {
|
|
3043
|
+
return `Flows.Params.${key}`;
|
|
3044
|
+
}
|
|
3045
|
+
function flowParamHelpKey(type, key) {
|
|
3046
|
+
return `Flows.ParamHelp.${type}.${key}`;
|
|
3047
|
+
}
|
|
3048
|
+
var FlowsGraphCheckComponent = class FlowsGraphCheckComponent {
|
|
3049
|
+
constructor(translation) {
|
|
3050
|
+
this.translation = translation;
|
|
3051
|
+
this.definitions = [];
|
|
3052
|
+
this.graph = null;
|
|
3053
|
+
this.result = null;
|
|
3054
|
+
this.icons = FLOWS_ICONS;
|
|
3055
|
+
this.rows = [];
|
|
3056
|
+
}
|
|
3057
|
+
ngOnChanges() {
|
|
3058
|
+
const nodes = this.graph?.nodes ?? [];
|
|
3059
|
+
const row = (issue, severity) => ({
|
|
3060
|
+
issue,
|
|
3061
|
+
severity,
|
|
3062
|
+
place: this.place(nodes.find((node) => node.id === issue.node_id)),
|
|
3063
|
+
text: this.describe(issue)
|
|
3064
|
+
});
|
|
3065
|
+
this.rows = this.result ? [...this.result.errors.map((i) => row(i, "error")), ...this.result.warnings.map((i) => row(i, "warning"))] : [];
|
|
3066
|
+
}
|
|
3067
|
+
goTo(issue) {
|
|
3068
|
+
if (!issue.node_id) return;
|
|
3069
|
+
const fieldId = issue.field ? `flow-node-${issue.node_id}-${issue.field}` : null;
|
|
3070
|
+
this.canvas.focusNode(issue.node_id).then(() => {
|
|
3071
|
+
setTimeout(() => fieldId ? document.getElementById(fieldId)?.focus() : void 0);
|
|
3072
|
+
});
|
|
3073
|
+
}
|
|
3074
|
+
place(node) {
|
|
3075
|
+
if (!node) return "";
|
|
3076
|
+
const key = flowNodeLabelKey(node.type);
|
|
3077
|
+
const label = this.translation.translate(key);
|
|
3078
|
+
return `${label === key ? this.definitions.find((d) => d.type === node.type)?.label ?? node.type : label} (${node.id})`;
|
|
3079
|
+
}
|
|
3080
|
+
describe(issue) {
|
|
3081
|
+
const fieldKey = issue.field ? flowParamLabelKey(issue.field) : "";
|
|
3082
|
+
const fieldLabel = fieldKey ? this.translation.translate(fieldKey) : "";
|
|
3083
|
+
const key = `Flows.Check.Codes.${issue.code}`;
|
|
3084
|
+
const text = this.translation.translate(key, { field: fieldLabel === fieldKey ? issue.field : fieldLabel });
|
|
3085
|
+
return text === key ? issue.message : text;
|
|
3086
|
+
}
|
|
3087
|
+
static {
|
|
3088
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
3089
|
+
minVersion: "12.0.0",
|
|
3090
|
+
version: "22.2.0",
|
|
3091
|
+
ngImport: i0,
|
|
3092
|
+
type: FlowsGraphCheckComponent,
|
|
3093
|
+
deps: [{ token: i2$4.TranslocoService }],
|
|
3094
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
3095
|
+
});
|
|
3096
|
+
}
|
|
3097
|
+
static {
|
|
3098
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3099
|
+
minVersion: "17.0.0",
|
|
3100
|
+
version: "22.2.0",
|
|
3101
|
+
type: FlowsGraphCheckComponent,
|
|
3102
|
+
isStandalone: false,
|
|
3103
|
+
selector: "pw-flows-graph-check",
|
|
3104
|
+
inputs: {
|
|
3105
|
+
canvas: "canvas",
|
|
3106
|
+
definitions: "definitions",
|
|
3107
|
+
graph: "graph",
|
|
3108
|
+
result: "result"
|
|
3109
|
+
},
|
|
3110
|
+
usesOnChanges: true,
|
|
3111
|
+
ngImport: i0,
|
|
3112
|
+
template: "@if (rows.length) {\n<div class=\"pw-graph-check\"\n role=\"alert\"\n data-testid=\"flow-check-result\">\n <p class=\"pw-graph-check__summary is-blocking\">\n {{ 'Flows.Check.Blocking' | transloco: { count: result?.errors?.length } }}\n </p>\n <ul class=\"pw-graph-check__list\">\n @for (row of rows; track $index) {\n <li [class]=\"'pw-graph-check__item is-' + row.severity\">\n <fa-icon [icon]=\"row.severity === 'error' ? icons.error : icons.warning\"\n aria-hidden=\"true\"></fa-icon>\n @if (row.issue.node_id) {\n <button type=\"button\"\n class=\"btn btn-link p-0 pw-graph-check__place\"\n data-testid=\"flow-check-go-to\"\n (click)=\"goTo(row.issue)\">{{ row.place || row.issue.node_id }}</button>\n }\n <span>{{ row.text }}</span>\n </li>\n }\n </ul>\n</div>\n}\n",
|
|
3113
|
+
styles: [":host{display:block}.pw-graph-check{border:1px solid #e2e5ea;border-radius:6px;padding:10px 12px;margin-bottom:8px}.pw-graph-check__summary{margin:0 0 6px;font-weight:600;color:#8a6d00}.pw-graph-check__summary.is-blocking{color:#c0392b}.pw-graph-check__list{list-style:none;padding:0;margin:0}.pw-graph-check__item{display:flex;align-items:baseline;gap:6px;padding:2px 0}.pw-graph-check__item.is-error fa-icon{color:#c0392b}.pw-graph-check__item.is-warning fa-icon{color:#b8860b}.pw-graph-check__place{white-space:nowrap}\n"],
|
|
3114
|
+
dependencies: [{
|
|
3115
|
+
kind: "component",
|
|
3116
|
+
type: i2$3.FaIconComponent,
|
|
3117
|
+
selector: "fa-icon",
|
|
3118
|
+
inputs: [
|
|
3119
|
+
"icon",
|
|
3120
|
+
"title",
|
|
3121
|
+
"animation",
|
|
3122
|
+
"mask",
|
|
3123
|
+
"flip",
|
|
3124
|
+
"size",
|
|
3125
|
+
"pull",
|
|
3126
|
+
"border",
|
|
3127
|
+
"inverse",
|
|
3128
|
+
"symbol",
|
|
3129
|
+
"rotate",
|
|
3130
|
+
"fixedWidth",
|
|
3131
|
+
"transform",
|
|
3132
|
+
"a11yRole"
|
|
3133
|
+
],
|
|
3134
|
+
outputs: [
|
|
3135
|
+
"iconChange",
|
|
3136
|
+
"titleChange",
|
|
3137
|
+
"animationChange",
|
|
3138
|
+
"maskChange",
|
|
3139
|
+
"flipChange",
|
|
3140
|
+
"sizeChange",
|
|
3141
|
+
"pullChange",
|
|
3142
|
+
"borderChange",
|
|
3143
|
+
"inverseChange",
|
|
3144
|
+
"symbolChange",
|
|
3145
|
+
"rotateChange",
|
|
3146
|
+
"fixedWidthChange",
|
|
3147
|
+
"transformChange",
|
|
3148
|
+
"a11yRoleChange"
|
|
3149
|
+
]
|
|
3150
|
+
}, {
|
|
3151
|
+
kind: "pipe",
|
|
3152
|
+
type: i2$4.TranslocoPipe,
|
|
3153
|
+
name: "transloco"
|
|
3154
|
+
}]
|
|
3155
|
+
});
|
|
3156
|
+
}
|
|
3157
|
+
};
|
|
3158
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
3159
|
+
minVersion: "12.0.0",
|
|
3160
|
+
version: "22.2.0",
|
|
3161
|
+
ngImport: i0,
|
|
3162
|
+
type: FlowsGraphCheckComponent,
|
|
3163
|
+
decorators: [{
|
|
3164
|
+
type: Component,
|
|
3165
|
+
args: [{
|
|
3166
|
+
selector: "pw-flows-graph-check",
|
|
3167
|
+
standalone: false,
|
|
3168
|
+
template: "@if (rows.length) {\n<div class=\"pw-graph-check\"\n role=\"alert\"\n data-testid=\"flow-check-result\">\n <p class=\"pw-graph-check__summary is-blocking\">\n {{ 'Flows.Check.Blocking' | transloco: { count: result?.errors?.length } }}\n </p>\n <ul class=\"pw-graph-check__list\">\n @for (row of rows; track $index) {\n <li [class]=\"'pw-graph-check__item is-' + row.severity\">\n <fa-icon [icon]=\"row.severity === 'error' ? icons.error : icons.warning\"\n aria-hidden=\"true\"></fa-icon>\n @if (row.issue.node_id) {\n <button type=\"button\"\n class=\"btn btn-link p-0 pw-graph-check__place\"\n data-testid=\"flow-check-go-to\"\n (click)=\"goTo(row.issue)\">{{ row.place || row.issue.node_id }}</button>\n }\n <span>{{ row.text }}</span>\n </li>\n }\n </ul>\n</div>\n}\n",
|
|
3169
|
+
styles: [":host{display:block}.pw-graph-check{border:1px solid #e2e5ea;border-radius:6px;padding:10px 12px;margin-bottom:8px}.pw-graph-check__summary{margin:0 0 6px;font-weight:600;color:#8a6d00}.pw-graph-check__summary.is-blocking{color:#c0392b}.pw-graph-check__list{list-style:none;padding:0;margin:0}.pw-graph-check__item{display:flex;align-items:baseline;gap:6px;padding:2px 0}.pw-graph-check__item.is-error fa-icon{color:#c0392b}.pw-graph-check__item.is-warning fa-icon{color:#b8860b}.pw-graph-check__place{white-space:nowrap}\n"]
|
|
3170
|
+
}]
|
|
3171
|
+
}],
|
|
3172
|
+
ctorParameters: () => [{ type: i2$4.TranslocoService }],
|
|
3173
|
+
propDecorators: {
|
|
3174
|
+
canvas: [{
|
|
3175
|
+
type: Input,
|
|
3176
|
+
args: [{ required: true }]
|
|
3177
|
+
}],
|
|
3178
|
+
definitions: [{ type: Input }],
|
|
3179
|
+
graph: [{ type: Input }],
|
|
3180
|
+
result: [{ type: Input }]
|
|
3181
|
+
}
|
|
3182
|
+
});
|
|
3183
|
+
var FlowsNodePaletteComponent = class FlowsNodePaletteComponent {
|
|
3184
|
+
constructor() {
|
|
3185
|
+
this.definitions = [];
|
|
3186
|
+
this.add = new EventEmitter();
|
|
3187
|
+
this.icons = FLOW_CATEGORY_ICONS;
|
|
3188
|
+
this.labelKey = flowNodeLabelKey;
|
|
3189
|
+
this.groups = [];
|
|
3190
|
+
}
|
|
3191
|
+
ngOnChanges() {
|
|
3192
|
+
this.groups = FLOW_NODE_CATEGORIES.map((category) => ({
|
|
3193
|
+
category,
|
|
3194
|
+
nodes: this.definitions.filter((d) => d.category === category && !d.retired)
|
|
3195
|
+
})).filter((group) => group.nodes.length);
|
|
2430
3196
|
}
|
|
2431
3197
|
static {
|
|
2432
3198
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
@@ -2453,7 +3219,7 @@ var FlowsNodePaletteComponent = class FlowsNodePaletteComponent {
|
|
|
2453
3219
|
styles: [".pw-node-palette{display:flex;flex-direction:column;gap:2px;padding:12px}.pw-node-palette__heading{margin:12px 0 4px;color:#7c8696;font-size:12px;font-weight:500;letter-spacing:.04em;text-transform:uppercase}.pw-node-palette__heading:first-child{margin-top:0}.pw-node-palette__item{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:1px solid transparent;border-radius:4px;background:none;color:#1a1d21;text-align:left;transition:background-color .15s ease-out,border-color .15s ease-out}.pw-node-palette__item:hover{background:#eef0f3}.pw-node-palette__item:focus-visible{border-color:var(--first);outline:none}.pw-node-palette__icon{width:16px;color:#5a6473}\n"],
|
|
2454
3220
|
dependencies: [{
|
|
2455
3221
|
kind: "component",
|
|
2456
|
-
type:
|
|
3222
|
+
type: i2$3.FaIconComponent,
|
|
2457
3223
|
selector: "fa-icon",
|
|
2458
3224
|
inputs: [
|
|
2459
3225
|
"icon",
|
|
@@ -2489,7 +3255,7 @@ var FlowsNodePaletteComponent = class FlowsNodePaletteComponent {
|
|
|
2489
3255
|
]
|
|
2490
3256
|
}, {
|
|
2491
3257
|
kind: "pipe",
|
|
2492
|
-
type:
|
|
3258
|
+
type: i2$4.TranslocoPipe,
|
|
2493
3259
|
name: "transloco"
|
|
2494
3260
|
}]
|
|
2495
3261
|
});
|
|
@@ -2514,44 +3280,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2514
3280
|
add: [{ type: Output }]
|
|
2515
3281
|
}
|
|
2516
3282
|
});
|
|
2517
|
-
const FIELD_KINDS = {
|
|
2518
|
-
"trigger.schedule": {
|
|
2519
|
-
cron: "cron",
|
|
2520
|
-
timezone: "timezone"
|
|
2521
|
-
},
|
|
2522
|
-
"trigger.webhook": { path: "text" },
|
|
2523
|
-
"data.set_fields": { fields: "pairs" },
|
|
2524
|
-
"data.merge": { mode: "mode" },
|
|
2525
|
-
"action.email": {
|
|
2526
|
-
to: "email",
|
|
2527
|
-
subject: "text",
|
|
2528
|
-
body: "textarea"
|
|
2529
|
-
},
|
|
2530
|
-
"action.in_app_note": {
|
|
2531
|
-
user_id: "member",
|
|
2532
|
-
message: "textarea"
|
|
2533
|
-
},
|
|
2534
|
-
"action.push_notification": {
|
|
2535
|
-
user_id: "member",
|
|
2536
|
-
title: "text",
|
|
2537
|
-
message: "textarea"
|
|
2538
|
-
},
|
|
2539
|
-
"action.websocket": {
|
|
2540
|
-
user_ids: "members",
|
|
2541
|
-
payload: "json"
|
|
2542
|
-
}
|
|
2543
|
-
};
|
|
2544
|
-
function flowNodeFields(definition) {
|
|
2545
|
-
const kinds = FIELD_KINDS[definition.type] ?? {};
|
|
2546
|
-
return definition.params.map((key) => ({
|
|
2547
|
-
key,
|
|
2548
|
-
kind: kinds[key] ?? "text"
|
|
2549
|
-
}));
|
|
2550
|
-
}
|
|
2551
|
-
const FLOW_MERGE_MODES = ["append"];
|
|
2552
|
-
function flowParamLabelKey(key) {
|
|
2553
|
-
return `Flows.Params.${key}`;
|
|
2554
|
-
}
|
|
2555
3283
|
const FLOW_CRON_MODES = [
|
|
2556
3284
|
"minutes",
|
|
2557
3285
|
"hourly",
|
|
@@ -2721,7 +3449,7 @@ var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
|
2721
3449
|
version: "22.2.0",
|
|
2722
3450
|
ngImport: i0,
|
|
2723
3451
|
type: FlowsCronFieldComponent,
|
|
2724
|
-
deps: [{ token:
|
|
3452
|
+
deps: [{ token: i2$4.TranslocoService }],
|
|
2725
3453
|
target: i0.ɵɵFactoryTarget.Component
|
|
2726
3454
|
});
|
|
2727
3455
|
}
|
|
@@ -2744,52 +3472,52 @@ var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
|
2744
3472
|
dependencies: [
|
|
2745
3473
|
{
|
|
2746
3474
|
kind: "directive",
|
|
2747
|
-
type: i3$
|
|
3475
|
+
type: i3$2.NgSelectOption,
|
|
2748
3476
|
selector: "option",
|
|
2749
3477
|
inputs: ["ngValue", "value"]
|
|
2750
3478
|
},
|
|
2751
3479
|
{
|
|
2752
3480
|
kind: "directive",
|
|
2753
|
-
type: i3$
|
|
3481
|
+
type: i3$2.ɵNgSelectMultipleOption,
|
|
2754
3482
|
selector: "option",
|
|
2755
3483
|
inputs: ["ngValue", "value"]
|
|
2756
3484
|
},
|
|
2757
3485
|
{
|
|
2758
3486
|
kind: "directive",
|
|
2759
|
-
type: i3$
|
|
3487
|
+
type: i3$2.DefaultValueAccessor,
|
|
2760
3488
|
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
2761
3489
|
},
|
|
2762
3490
|
{
|
|
2763
3491
|
kind: "directive",
|
|
2764
|
-
type: i3$
|
|
3492
|
+
type: i3$2.NumberValueAccessor,
|
|
2765
3493
|
selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
|
|
2766
3494
|
},
|
|
2767
3495
|
{
|
|
2768
3496
|
kind: "directive",
|
|
2769
|
-
type: i3$
|
|
3497
|
+
type: i3$2.SelectControlValueAccessor,
|
|
2770
3498
|
selector: "select:not([multiple]):not([ngNoCva])[formControlName],select:not([multiple]):not([ngNoCva])[formControl],select:not([multiple]):not([ngNoCva])[ngModel]",
|
|
2771
3499
|
inputs: ["compareWith"]
|
|
2772
3500
|
},
|
|
2773
3501
|
{
|
|
2774
3502
|
kind: "directive",
|
|
2775
|
-
type: i3$
|
|
3503
|
+
type: i3$2.NgControlStatus,
|
|
2776
3504
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
2777
3505
|
},
|
|
2778
3506
|
{
|
|
2779
3507
|
kind: "directive",
|
|
2780
|
-
type: i3$
|
|
3508
|
+
type: i3$2.MinValidator,
|
|
2781
3509
|
selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
|
|
2782
3510
|
inputs: ["min"]
|
|
2783
3511
|
},
|
|
2784
3512
|
{
|
|
2785
3513
|
kind: "directive",
|
|
2786
|
-
type: i3$
|
|
3514
|
+
type: i3$2.MaxValidator,
|
|
2787
3515
|
selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]",
|
|
2788
3516
|
inputs: ["max"]
|
|
2789
3517
|
},
|
|
2790
3518
|
{
|
|
2791
3519
|
kind: "directive",
|
|
2792
|
-
type: i3$
|
|
3520
|
+
type: i3$2.NgModel,
|
|
2793
3521
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
2794
3522
|
inputs: [
|
|
2795
3523
|
"name",
|
|
@@ -2802,7 +3530,7 @@ var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
|
2802
3530
|
},
|
|
2803
3531
|
{
|
|
2804
3532
|
kind: "pipe",
|
|
2805
|
-
type:
|
|
3533
|
+
type: i2$4.TranslocoPipe,
|
|
2806
3534
|
name: "transloco"
|
|
2807
3535
|
}
|
|
2808
3536
|
]
|
|
@@ -2822,7 +3550,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2822
3550
|
template: "<div class=\"d-flex flex-column gap-2\">\n <select class=\"form-select\"\n [id]=\"inputId\"\n [disabled]=\"readOnly\"\n [ngModel]=\"schedule.mode\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"setMode($event)\">\n @for (mode of modes; track mode) {\n <option [ngValue]=\"mode\">{{ 'Flows.Schedule.Mode.' + mode | transloco }}</option>\n }\n </select>\n\n @switch (schedule.mode) {\n @case ('minutes') {\n <select class=\"form-select\"\n [attr.aria-label]=\"'Flows.Schedule.Every' | transloco\"\n [disabled]=\"readOnly\"\n [ngModel]=\"schedule.every\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"update({ every: $event })\">\n @for (every of everyOptions; track every) {\n <option [ngValue]=\"every\">{{ 'Flows.Schedule.EveryMinutes' | transloco: { count: every } }}</option>\n }\n </select>\n }\n @case ('hourly') {\n <input class=\"form-control\"\n type=\"number\"\n min=\"0\"\n max=\"59\"\n [attr.aria-label]=\"'Flows.Schedule.Minute' | transloco\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"schedule.minute\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"update({ minute: +$event })\" />\n }\n @case ('custom') {\n <input class=\"form-control\"\n type=\"text\"\n placeholder=\"0 9 * * 1-5\"\n [attr.aria-label]=\"'Flows.Schedule.Mode.custom' | transloco\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"schedule.custom\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"update({ custom: $event })\" />\n }\n @default {\n <div class=\"d-flex gap-2\">\n @if (schedule.mode === 'weekly') {\n <select class=\"form-select\"\n [attr.aria-label]=\"'Flows.Schedule.Weekday' | transloco\"\n [disabled]=\"readOnly\"\n [ngModel]=\"schedule.weekday\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"update({ weekday: $event })\">\n @for (day of weekdays; track day.value) {\n <option [ngValue]=\"day.value\">{{ day.label }}</option>\n }\n </select>\n }\n @if (schedule.mode === 'monthly') {\n <select class=\"form-select\"\n [attr.aria-label]=\"'Flows.Schedule.Monthday' | transloco\"\n [disabled]=\"readOnly\"\n [ngModel]=\"schedule.monthday\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"update({ monthday: $event })\">\n @for (day of monthdays; track day) {\n <option [ngValue]=\"day\">{{ day }}</option>\n }\n </select>\n }\n <input class=\"form-control\"\n type=\"time\"\n [attr.aria-label]=\"'Flows.Schedule.Time' | transloco\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"time\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"setTime($event)\" />\n </div>\n }\n }\n\n @if (schedule.mode !== 'custom') {\n <small class=\"text-muted\">\n {{ 'Flows.Schedule.Summary.' + schedule.mode | transloco: { count: schedule.every, minute: schedule.minute, time: time, weekday: weekdayLabel, day: schedule.monthday } }}\n </small>\n }\n</div>\n"
|
|
2823
3551
|
}]
|
|
2824
3552
|
}],
|
|
2825
|
-
ctorParameters: () => [{ type:
|
|
3553
|
+
ctorParameters: () => [{ type: i2$4.TranslocoService }],
|
|
2826
3554
|
propDecorators: {
|
|
2827
3555
|
value: [{ type: Input }],
|
|
2828
3556
|
inputId: [{ type: Input }],
|
|
@@ -2884,12 +3612,12 @@ var FlowsTimezoneFieldComponent = class FlowsTimezoneFieldComponent {
|
|
|
2884
3612
|
dependencies: [
|
|
2885
3613
|
{
|
|
2886
3614
|
kind: "directive",
|
|
2887
|
-
type: i3$
|
|
3615
|
+
type: i3$2.NgControlStatus,
|
|
2888
3616
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
2889
3617
|
},
|
|
2890
3618
|
{
|
|
2891
3619
|
kind: "directive",
|
|
2892
|
-
type: i3$
|
|
3620
|
+
type: i3$2.NgModel,
|
|
2893
3621
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
2894
3622
|
inputs: [
|
|
2895
3623
|
"name",
|
|
@@ -2972,7 +3700,7 @@ var FlowsTimezoneFieldComponent = class FlowsTimezoneFieldComponent {
|
|
|
2972
3700
|
},
|
|
2973
3701
|
{
|
|
2974
3702
|
kind: "pipe",
|
|
2975
|
-
type:
|
|
3703
|
+
type: i2$4.TranslocoPipe,
|
|
2976
3704
|
name: "transloco"
|
|
2977
3705
|
}
|
|
2978
3706
|
]
|
|
@@ -3089,17 +3817,17 @@ var FlowsJsonFieldComponent = class FlowsJsonFieldComponent {
|
|
|
3089
3817
|
dependencies: [
|
|
3090
3818
|
{
|
|
3091
3819
|
kind: "directive",
|
|
3092
|
-
type: i3$
|
|
3820
|
+
type: i3$2.DefaultValueAccessor,
|
|
3093
3821
|
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
3094
3822
|
},
|
|
3095
3823
|
{
|
|
3096
3824
|
kind: "directive",
|
|
3097
|
-
type: i3$
|
|
3825
|
+
type: i3$2.NgControlStatus,
|
|
3098
3826
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
3099
3827
|
},
|
|
3100
3828
|
{
|
|
3101
3829
|
kind: "directive",
|
|
3102
|
-
type: i3$
|
|
3830
|
+
type: i3$2.NgModel,
|
|
3103
3831
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
3104
3832
|
inputs: [
|
|
3105
3833
|
"name",
|
|
@@ -3112,13 +3840,13 @@ var FlowsJsonFieldComponent = class FlowsJsonFieldComponent {
|
|
|
3112
3840
|
},
|
|
3113
3841
|
{
|
|
3114
3842
|
kind: "component",
|
|
3115
|
-
type: i2.FieldErrorDisplayComponent,
|
|
3843
|
+
type: i2$1.FieldErrorDisplayComponent,
|
|
3116
3844
|
selector: "pw-field-error-display",
|
|
3117
3845
|
inputs: ["errorMsg", "displayError"]
|
|
3118
3846
|
},
|
|
3119
3847
|
{
|
|
3120
3848
|
kind: "pipe",
|
|
3121
|
-
type:
|
|
3849
|
+
type: i2$4.TranslocoPipe,
|
|
3122
3850
|
name: "transloco"
|
|
3123
3851
|
}
|
|
3124
3852
|
]
|
|
@@ -3378,7 +4106,7 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
3378
4106
|
ngImport: i0,
|
|
3379
4107
|
type: FlowsConditionFieldComponent,
|
|
3380
4108
|
deps: [
|
|
3381
|
-
{ token:
|
|
4109
|
+
{ token: i2$4.TranslocoService },
|
|
3382
4110
|
{ token: i0.ChangeDetectorRef },
|
|
3383
4111
|
{ token: i0.DestroyRef }
|
|
3384
4112
|
],
|
|
@@ -3406,29 +4134,29 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
3406
4134
|
dependencies: [
|
|
3407
4135
|
{
|
|
3408
4136
|
kind: "directive",
|
|
3409
|
-
type: i3$
|
|
4137
|
+
type: i3$2.NgSelectOption,
|
|
3410
4138
|
selector: "option",
|
|
3411
4139
|
inputs: ["ngValue", "value"]
|
|
3412
4140
|
},
|
|
3413
4141
|
{
|
|
3414
4142
|
kind: "directive",
|
|
3415
|
-
type: i3$
|
|
4143
|
+
type: i3$2.ɵNgSelectMultipleOption,
|
|
3416
4144
|
selector: "option",
|
|
3417
4145
|
inputs: ["ngValue", "value"]
|
|
3418
4146
|
},
|
|
3419
4147
|
{
|
|
3420
4148
|
kind: "directive",
|
|
3421
|
-
type: i3$
|
|
4149
|
+
type: i3$2.DefaultValueAccessor,
|
|
3422
4150
|
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
3423
4151
|
},
|
|
3424
4152
|
{
|
|
3425
4153
|
kind: "directive",
|
|
3426
|
-
type: i3$
|
|
4154
|
+
type: i3$2.NgControlStatus,
|
|
3427
4155
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
3428
4156
|
},
|
|
3429
4157
|
{
|
|
3430
4158
|
kind: "directive",
|
|
3431
|
-
type: i3$
|
|
4159
|
+
type: i3$2.NgModel,
|
|
3432
4160
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
3433
4161
|
inputs: [
|
|
3434
4162
|
"name",
|
|
@@ -3441,7 +4169,7 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
3441
4169
|
},
|
|
3442
4170
|
{
|
|
3443
4171
|
kind: "directive",
|
|
3444
|
-
type:
|
|
4172
|
+
type: i1$1.Tooltip,
|
|
3445
4173
|
selector: "[pTooltip]",
|
|
3446
4174
|
inputs: [
|
|
3447
4175
|
"tooltipPosition",
|
|
@@ -3539,7 +4267,7 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
3539
4267
|
},
|
|
3540
4268
|
{
|
|
3541
4269
|
kind: "component",
|
|
3542
|
-
type:
|
|
4270
|
+
type: i2$3.FaIconComponent,
|
|
3543
4271
|
selector: "fa-icon",
|
|
3544
4272
|
inputs: [
|
|
3545
4273
|
"icon",
|
|
@@ -3587,7 +4315,7 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
3587
4315
|
},
|
|
3588
4316
|
{
|
|
3589
4317
|
kind: "pipe",
|
|
3590
|
-
type:
|
|
4318
|
+
type: i2$4.TranslocoPipe,
|
|
3591
4319
|
name: "transloco"
|
|
3592
4320
|
}
|
|
3593
4321
|
]
|
|
@@ -3609,7 +4337,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3609
4337
|
}]
|
|
3610
4338
|
}],
|
|
3611
4339
|
ctorParameters: () => [
|
|
3612
|
-
{ type:
|
|
4340
|
+
{ type: i2$4.TranslocoService },
|
|
3613
4341
|
{ type: i0.ChangeDetectorRef },
|
|
3614
4342
|
{ type: i0.DestroyRef }
|
|
3615
4343
|
],
|
|
@@ -3687,17 +4415,17 @@ var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
|
3687
4415
|
dependencies: [
|
|
3688
4416
|
{
|
|
3689
4417
|
kind: "directive",
|
|
3690
|
-
type: i3$
|
|
4418
|
+
type: i3$2.DefaultValueAccessor,
|
|
3691
4419
|
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
3692
4420
|
},
|
|
3693
4421
|
{
|
|
3694
4422
|
kind: "directive",
|
|
3695
|
-
type: i3$
|
|
4423
|
+
type: i3$2.NgControlStatus,
|
|
3696
4424
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
3697
4425
|
},
|
|
3698
4426
|
{
|
|
3699
4427
|
kind: "directive",
|
|
3700
|
-
type: i3$
|
|
4428
|
+
type: i3$2.NgModel,
|
|
3701
4429
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
3702
4430
|
inputs: [
|
|
3703
4431
|
"name",
|
|
@@ -3710,7 +4438,7 @@ var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
|
3710
4438
|
},
|
|
3711
4439
|
{
|
|
3712
4440
|
kind: "directive",
|
|
3713
|
-
type:
|
|
4441
|
+
type: i1$1.Tooltip,
|
|
3714
4442
|
selector: "[pTooltip]",
|
|
3715
4443
|
inputs: [
|
|
3716
4444
|
"tooltipPosition",
|
|
@@ -3738,7 +4466,7 @@ var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
|
3738
4466
|
},
|
|
3739
4467
|
{
|
|
3740
4468
|
kind: "component",
|
|
3741
|
-
type:
|
|
4469
|
+
type: i2$3.FaIconComponent,
|
|
3742
4470
|
selector: "fa-icon",
|
|
3743
4471
|
inputs: [
|
|
3744
4472
|
"icon",
|
|
@@ -3775,7 +4503,7 @@ var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
|
3775
4503
|
},
|
|
3776
4504
|
{
|
|
3777
4505
|
kind: "pipe",
|
|
3778
|
-
type:
|
|
4506
|
+
type: i2$4.TranslocoPipe,
|
|
3779
4507
|
name: "transloco"
|
|
3780
4508
|
}
|
|
3781
4509
|
]
|
|
@@ -3877,35 +4605,438 @@ var FlowsMemberFieldComponent = class FlowsMemberFieldComponent {
|
|
|
3877
4605
|
});
|
|
3878
4606
|
this.selection = this.multiple ? chosen : chosen[0] ?? null;
|
|
3879
4607
|
}
|
|
3880
|
-
complete(query) {
|
|
3881
|
-
this.search?.unsubscribe();
|
|
3882
|
-
this.search = this.members.search(this.subscriptionId, query).subscribe({
|
|
3883
|
-
next: (members) => {
|
|
3884
|
-
this.failed = false;
|
|
3885
|
-
this.suggestions = members;
|
|
3886
|
-
this.cdr.markForCheck();
|
|
3887
|
-
},
|
|
3888
|
-
error: () => {
|
|
3889
|
-
this.failed = true;
|
|
3890
|
-
this.suggestions = [];
|
|
3891
|
-
this.cdr.markForCheck();
|
|
4608
|
+
complete(query) {
|
|
4609
|
+
this.search?.unsubscribe();
|
|
4610
|
+
this.search = this.members.search(this.subscriptionId, query).subscribe({
|
|
4611
|
+
next: (members) => {
|
|
4612
|
+
this.failed = false;
|
|
4613
|
+
this.suggestions = members;
|
|
4614
|
+
this.cdr.markForCheck();
|
|
4615
|
+
},
|
|
4616
|
+
error: () => {
|
|
4617
|
+
this.failed = true;
|
|
4618
|
+
this.suggestions = [];
|
|
4619
|
+
this.cdr.markForCheck();
|
|
4620
|
+
}
|
|
4621
|
+
});
|
|
4622
|
+
}
|
|
4623
|
+
changed(selection) {
|
|
4624
|
+
if (Array.isArray(selection)) this.valueChange.emit(selection.map((member) => member.id));
|
|
4625
|
+
else this.valueChange.emit(selection?.id);
|
|
4626
|
+
}
|
|
4627
|
+
ngOnDestroy() {
|
|
4628
|
+
this.search?.unsubscribe();
|
|
4629
|
+
}
|
|
4630
|
+
static {
|
|
4631
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4632
|
+
minVersion: "12.0.0",
|
|
4633
|
+
version: "22.2.0",
|
|
4634
|
+
ngImport: i0,
|
|
4635
|
+
type: FlowsMemberFieldComponent,
|
|
4636
|
+
deps: [{ token: FlowsMemberService }, { token: i0.ChangeDetectorRef }],
|
|
4637
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
4638
|
+
});
|
|
4639
|
+
}
|
|
4640
|
+
static {
|
|
4641
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4642
|
+
minVersion: "17.0.0",
|
|
4643
|
+
version: "22.2.0",
|
|
4644
|
+
type: FlowsMemberFieldComponent,
|
|
4645
|
+
isStandalone: false,
|
|
4646
|
+
selector: "pw-flows-member-field",
|
|
4647
|
+
inputs: {
|
|
4648
|
+
value: "value",
|
|
4649
|
+
multiple: "multiple",
|
|
4650
|
+
subscriptionId: "subscriptionId",
|
|
4651
|
+
inputId: "inputId",
|
|
4652
|
+
readOnly: "readOnly"
|
|
4653
|
+
},
|
|
4654
|
+
outputs: { valueChange: "valueChange" },
|
|
4655
|
+
usesOnChanges: true,
|
|
4656
|
+
ngImport: i0,
|
|
4657
|
+
template: "<p-auto-complete class=\"w-100\"\n [inputId]=\"inputId\"\n [ngModel]=\"selection\"\n [ngModelOptions]=\"{ standalone: true }\"\n [suggestions]=\"suggestions\"\n [multiple]=\"multiple\"\n [forceSelection]=\"true\"\n [disabled]=\"readOnly\"\n [minQueryLength]=\"1\"\n [delay]=\"250\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'Flows.Inspector.NoMembers' | transloco\"\n optionLabel=\"name\"\n dataKey=\"id\"\n appendTo=\"body\"\n (completeMethod)=\"complete($event.query)\"\n (ngModelChange)=\"changed($event)\">\n <ng-template let-member\n #item>\n <div class=\"d-flex flex-column\">\n <span>{{ member.name }}</span>\n <small class=\"text-muted\">{{ member.email }}</small>\n </div>\n </ng-template>\n</p-auto-complete>\n@if (failed) {\n<pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Inspector.MembersUnavailable' | transloco\">\n</pw-field-error-display>\n}\n",
|
|
4658
|
+
dependencies: [
|
|
4659
|
+
{
|
|
4660
|
+
kind: "directive",
|
|
4661
|
+
type: i3$2.NgControlStatus,
|
|
4662
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
4663
|
+
},
|
|
4664
|
+
{
|
|
4665
|
+
kind: "directive",
|
|
4666
|
+
type: i3$2.NgModel,
|
|
4667
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
4668
|
+
inputs: [
|
|
4669
|
+
"name",
|
|
4670
|
+
"disabled",
|
|
4671
|
+
"ngModel",
|
|
4672
|
+
"ngModelOptions"
|
|
4673
|
+
],
|
|
4674
|
+
outputs: ["ngModelChange"],
|
|
4675
|
+
exportAs: ["ngModel"]
|
|
4676
|
+
},
|
|
4677
|
+
{
|
|
4678
|
+
kind: "component",
|
|
4679
|
+
type: i3.AutoComplete,
|
|
4680
|
+
selector: "p-autocomplete, p-auto-complete",
|
|
4681
|
+
inputs: [
|
|
4682
|
+
"minQueryLength",
|
|
4683
|
+
"delay",
|
|
4684
|
+
"panelStyle",
|
|
4685
|
+
"panelStyleClass",
|
|
4686
|
+
"inputStyle",
|
|
4687
|
+
"inputId",
|
|
4688
|
+
"inputStyleClass",
|
|
4689
|
+
"placeholder",
|
|
4690
|
+
"readonly",
|
|
4691
|
+
"scrollHeight",
|
|
4692
|
+
"lazy",
|
|
4693
|
+
"virtualScroll",
|
|
4694
|
+
"virtualScrollItemSize",
|
|
4695
|
+
"virtualScrollOptions",
|
|
4696
|
+
"autoHighlight",
|
|
4697
|
+
"forceSelection",
|
|
4698
|
+
"type",
|
|
4699
|
+
"autoZIndex",
|
|
4700
|
+
"baseZIndex",
|
|
4701
|
+
"ariaLabel",
|
|
4702
|
+
"dropdownAriaLabel",
|
|
4703
|
+
"ariaLabelledBy",
|
|
4704
|
+
"dropdownIcon",
|
|
4705
|
+
"unique",
|
|
4706
|
+
"group",
|
|
4707
|
+
"completeOnFocus",
|
|
4708
|
+
"showClear",
|
|
4709
|
+
"dropdown",
|
|
4710
|
+
"showEmptyMessage",
|
|
4711
|
+
"dropdownMode",
|
|
4712
|
+
"multiple",
|
|
4713
|
+
"addOnTab",
|
|
4714
|
+
"tabindex",
|
|
4715
|
+
"dataKey",
|
|
4716
|
+
"emptyMessage",
|
|
4717
|
+
"autofocus",
|
|
4718
|
+
"autocomplete",
|
|
4719
|
+
"optionGroupChildren",
|
|
4720
|
+
"optionGroupLabel",
|
|
4721
|
+
"overlayOptions",
|
|
4722
|
+
"suggestions",
|
|
4723
|
+
"optionLabel",
|
|
4724
|
+
"optionValue",
|
|
4725
|
+
"id",
|
|
4726
|
+
"searchMessage",
|
|
4727
|
+
"emptySelectionMessage",
|
|
4728
|
+
"selectionMessage",
|
|
4729
|
+
"autoOptionFocus",
|
|
4730
|
+
"selectOnFocus",
|
|
4731
|
+
"searchLocale",
|
|
4732
|
+
"optionDisabled",
|
|
4733
|
+
"focusOnHover",
|
|
4734
|
+
"typeahead",
|
|
4735
|
+
"addOnBlur",
|
|
4736
|
+
"separator",
|
|
4737
|
+
"appendTo",
|
|
4738
|
+
"motionOptions"
|
|
4739
|
+
],
|
|
4740
|
+
outputs: [
|
|
4741
|
+
"completeMethod",
|
|
4742
|
+
"onSelect",
|
|
4743
|
+
"onUnselect",
|
|
4744
|
+
"onAdd",
|
|
4745
|
+
"onFocus",
|
|
4746
|
+
"onBlur",
|
|
4747
|
+
"onDropdownClick",
|
|
4748
|
+
"onClear",
|
|
4749
|
+
"onInputKeydown",
|
|
4750
|
+
"onKeyUp",
|
|
4751
|
+
"onShow",
|
|
4752
|
+
"onHide",
|
|
4753
|
+
"onLazyLoad"
|
|
4754
|
+
]
|
|
4755
|
+
},
|
|
4756
|
+
{
|
|
4757
|
+
kind: "component",
|
|
4758
|
+
type: i2$1.FieldErrorDisplayComponent,
|
|
4759
|
+
selector: "pw-field-error-display",
|
|
4760
|
+
inputs: ["errorMsg", "displayError"]
|
|
4761
|
+
},
|
|
4762
|
+
{
|
|
4763
|
+
kind: "pipe",
|
|
4764
|
+
type: i2$4.TranslocoPipe,
|
|
4765
|
+
name: "transloco"
|
|
4766
|
+
}
|
|
4767
|
+
]
|
|
4768
|
+
});
|
|
4769
|
+
}
|
|
4770
|
+
};
|
|
4771
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
4772
|
+
minVersion: "12.0.0",
|
|
4773
|
+
version: "22.2.0",
|
|
4774
|
+
ngImport: i0,
|
|
4775
|
+
type: FlowsMemberFieldComponent,
|
|
4776
|
+
decorators: [{
|
|
4777
|
+
type: Component,
|
|
4778
|
+
args: [{
|
|
4779
|
+
selector: "pw-flows-member-field",
|
|
4780
|
+
standalone: false,
|
|
4781
|
+
template: "<p-auto-complete class=\"w-100\"\n [inputId]=\"inputId\"\n [ngModel]=\"selection\"\n [ngModelOptions]=\"{ standalone: true }\"\n [suggestions]=\"suggestions\"\n [multiple]=\"multiple\"\n [forceSelection]=\"true\"\n [disabled]=\"readOnly\"\n [minQueryLength]=\"1\"\n [delay]=\"250\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'Flows.Inspector.NoMembers' | transloco\"\n optionLabel=\"name\"\n dataKey=\"id\"\n appendTo=\"body\"\n (completeMethod)=\"complete($event.query)\"\n (ngModelChange)=\"changed($event)\">\n <ng-template let-member\n #item>\n <div class=\"d-flex flex-column\">\n <span>{{ member.name }}</span>\n <small class=\"text-muted\">{{ member.email }}</small>\n </div>\n </ng-template>\n</p-auto-complete>\n@if (failed) {\n<pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Inspector.MembersUnavailable' | transloco\">\n</pw-field-error-display>\n}\n"
|
|
4782
|
+
}]
|
|
4783
|
+
}],
|
|
4784
|
+
ctorParameters: () => [{ type: FlowsMemberService }, { type: i0.ChangeDetectorRef }],
|
|
4785
|
+
propDecorators: {
|
|
4786
|
+
value: [{ type: Input }],
|
|
4787
|
+
multiple: [{ type: Input }],
|
|
4788
|
+
subscriptionId: [{ type: Input }],
|
|
4789
|
+
inputId: [{ type: Input }],
|
|
4790
|
+
readOnly: [{ type: Input }],
|
|
4791
|
+
valueChange: [{ type: Output }]
|
|
4792
|
+
}
|
|
4793
|
+
});
|
|
4794
|
+
function toIds(value) {
|
|
4795
|
+
return (Array.isArray(value) ? value : [value]).map(Number).filter((id) => Number.isInteger(id) && id > 0);
|
|
4796
|
+
}
|
|
4797
|
+
var FlowsRetryFieldComponent = class FlowsRetryFieldComponent {
|
|
4798
|
+
constructor() {
|
|
4799
|
+
this.readOnly = false;
|
|
4800
|
+
this.valueChange = new EventEmitter();
|
|
4801
|
+
}
|
|
4802
|
+
toggle(on) {
|
|
4803
|
+
this.valueChange.emit(on ? { ...FLOW_RETRY_DEFAULT } : void 0);
|
|
4804
|
+
}
|
|
4805
|
+
set(key, text, max) {
|
|
4806
|
+
const number = Math.min(Math.max(Math.round(Number(text)) || 1, 1), max);
|
|
4807
|
+
this.valueChange.emit({
|
|
4808
|
+
...this.value ?? FLOW_RETRY_DEFAULT,
|
|
4809
|
+
[key]: number
|
|
4810
|
+
});
|
|
4811
|
+
}
|
|
4812
|
+
static {
|
|
4813
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4814
|
+
minVersion: "12.0.0",
|
|
4815
|
+
version: "22.2.0",
|
|
4816
|
+
ngImport: i0,
|
|
4817
|
+
type: FlowsRetryFieldComponent,
|
|
4818
|
+
deps: [],
|
|
4819
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
4820
|
+
});
|
|
4821
|
+
}
|
|
4822
|
+
static {
|
|
4823
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4824
|
+
minVersion: "17.0.0",
|
|
4825
|
+
version: "22.2.0",
|
|
4826
|
+
type: FlowsRetryFieldComponent,
|
|
4827
|
+
isStandalone: false,
|
|
4828
|
+
selector: "pw-flows-retry-field",
|
|
4829
|
+
inputs: {
|
|
4830
|
+
value: "value",
|
|
4831
|
+
inputId: "inputId",
|
|
4832
|
+
readOnly: "readOnly"
|
|
4833
|
+
},
|
|
4834
|
+
outputs: { valueChange: "valueChange" },
|
|
4835
|
+
ngImport: i0,
|
|
4836
|
+
template: "<pw-input-container [label]=\"'Flows.Inspector.Retry' | transloco\"\n name=\"retry\"\n [controlId]=\"inputId\"\n [useAriaLabelledbyOnly]=\"true\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Flows.Inspector.RetryHint' | transloco\">\n <ui-switch size=\"small\"\n [id]=\"inputId\"\n [checked]=\"!!value\"\n [disabled]=\"readOnly\"\n [attr.aria-labelledby]=\"inputId + '-label'\"\n (change)=\"toggle($event)\"></ui-switch>\n</pw-input-container>\n\n@if (value) {\n<pw-input-container [label]=\"'Flows.Inspector.RetryTimes' | transloco\"\n name=\"retry_times\"\n [controlId]=\"inputId + '-times'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Flows.Inspector.RetryTimesHint' | transloco\">\n <input class=\"form-control\"\n type=\"number\"\n min=\"1\"\n max=\"5\"\n [id]=\"inputId + '-times'\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value.times\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"set('times', $event, 5)\" />\n</pw-input-container>\n\n<pw-input-container [label]=\"'Flows.Inspector.RetryWait' | transloco\"\n name=\"retry_wait_seconds\"\n [controlId]=\"inputId + '-wait'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Flows.Inspector.RetryWaitHint' | transloco\">\n <input class=\"form-control\"\n type=\"number\"\n min=\"1\"\n max=\"300\"\n [id]=\"inputId + '-wait'\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value.wait_seconds\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"set('wait_seconds', $event, 300)\" />\n</pw-input-container>\n}\n",
|
|
4837
|
+
dependencies: [
|
|
4838
|
+
{
|
|
4839
|
+
kind: "directive",
|
|
4840
|
+
type: i3$2.DefaultValueAccessor,
|
|
4841
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
4842
|
+
},
|
|
4843
|
+
{
|
|
4844
|
+
kind: "directive",
|
|
4845
|
+
type: i3$2.NumberValueAccessor,
|
|
4846
|
+
selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
|
|
4847
|
+
},
|
|
4848
|
+
{
|
|
4849
|
+
kind: "directive",
|
|
4850
|
+
type: i3$2.NgControlStatus,
|
|
4851
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
4852
|
+
},
|
|
4853
|
+
{
|
|
4854
|
+
kind: "directive",
|
|
4855
|
+
type: i3$2.MinValidator,
|
|
4856
|
+
selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
|
|
4857
|
+
inputs: ["min"]
|
|
4858
|
+
},
|
|
4859
|
+
{
|
|
4860
|
+
kind: "directive",
|
|
4861
|
+
type: i3$2.MaxValidator,
|
|
4862
|
+
selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]",
|
|
4863
|
+
inputs: ["max"]
|
|
4864
|
+
},
|
|
4865
|
+
{
|
|
4866
|
+
kind: "directive",
|
|
4867
|
+
type: i3$2.NgModel,
|
|
4868
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
4869
|
+
inputs: [
|
|
4870
|
+
"name",
|
|
4871
|
+
"disabled",
|
|
4872
|
+
"ngModel",
|
|
4873
|
+
"ngModelOptions"
|
|
4874
|
+
],
|
|
4875
|
+
outputs: ["ngModelChange"],
|
|
4876
|
+
exportAs: ["ngModel"]
|
|
4877
|
+
},
|
|
4878
|
+
{
|
|
4879
|
+
kind: "component",
|
|
4880
|
+
type: i2.UiSwitchComponent,
|
|
4881
|
+
selector: "ui-switch",
|
|
4882
|
+
inputs: [
|
|
4883
|
+
"size",
|
|
4884
|
+
"color",
|
|
4885
|
+
"switchOffColor",
|
|
4886
|
+
"switchColor",
|
|
4887
|
+
"defaultBgColor",
|
|
4888
|
+
"defaultBoColor",
|
|
4889
|
+
"checkedLabel",
|
|
4890
|
+
"uncheckedLabel",
|
|
4891
|
+
"checkedTextColor",
|
|
4892
|
+
"uncheckedTextColor",
|
|
4893
|
+
"beforeChange",
|
|
4894
|
+
"ariaLabel",
|
|
4895
|
+
"checked",
|
|
4896
|
+
"disabled",
|
|
4897
|
+
"reverse",
|
|
4898
|
+
"loading"
|
|
4899
|
+
],
|
|
4900
|
+
outputs: [
|
|
4901
|
+
"change",
|
|
4902
|
+
"changeEvent",
|
|
4903
|
+
"valueChange"
|
|
4904
|
+
]
|
|
4905
|
+
},
|
|
4906
|
+
{
|
|
4907
|
+
kind: "component",
|
|
4908
|
+
type: i6.InputContainerComponent,
|
|
4909
|
+
selector: "pw-input-container",
|
|
4910
|
+
inputs: [
|
|
4911
|
+
"name",
|
|
4912
|
+
"controlId",
|
|
4913
|
+
"useAriaLabelledbyOnly",
|
|
4914
|
+
"label",
|
|
4915
|
+
"labelClass",
|
|
4916
|
+
"tooltipPosition",
|
|
4917
|
+
"required",
|
|
4918
|
+
"errorMsg",
|
|
4919
|
+
"isReadOnly",
|
|
4920
|
+
"showTooltip",
|
|
4921
|
+
"tooltipText",
|
|
4922
|
+
"showTriangle",
|
|
4923
|
+
"afterLabel",
|
|
4924
|
+
"showAfterLabel",
|
|
4925
|
+
"showTriangleText",
|
|
4926
|
+
"isLeftTooltip"
|
|
4927
|
+
]
|
|
4928
|
+
},
|
|
4929
|
+
{
|
|
4930
|
+
kind: "pipe",
|
|
4931
|
+
type: i2$4.TranslocoPipe,
|
|
4932
|
+
name: "transloco"
|
|
4933
|
+
}
|
|
4934
|
+
]
|
|
4935
|
+
});
|
|
4936
|
+
}
|
|
4937
|
+
};
|
|
4938
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
4939
|
+
minVersion: "12.0.0",
|
|
4940
|
+
version: "22.2.0",
|
|
4941
|
+
ngImport: i0,
|
|
4942
|
+
type: FlowsRetryFieldComponent,
|
|
4943
|
+
decorators: [{
|
|
4944
|
+
type: Component,
|
|
4945
|
+
args: [{
|
|
4946
|
+
selector: "pw-flows-retry-field",
|
|
4947
|
+
standalone: false,
|
|
4948
|
+
template: "<pw-input-container [label]=\"'Flows.Inspector.Retry' | transloco\"\n name=\"retry\"\n [controlId]=\"inputId\"\n [useAriaLabelledbyOnly]=\"true\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Flows.Inspector.RetryHint' | transloco\">\n <ui-switch size=\"small\"\n [id]=\"inputId\"\n [checked]=\"!!value\"\n [disabled]=\"readOnly\"\n [attr.aria-labelledby]=\"inputId + '-label'\"\n (change)=\"toggle($event)\"></ui-switch>\n</pw-input-container>\n\n@if (value) {\n<pw-input-container [label]=\"'Flows.Inspector.RetryTimes' | transloco\"\n name=\"retry_times\"\n [controlId]=\"inputId + '-times'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Flows.Inspector.RetryTimesHint' | transloco\">\n <input class=\"form-control\"\n type=\"number\"\n min=\"1\"\n max=\"5\"\n [id]=\"inputId + '-times'\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value.times\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"set('times', $event, 5)\" />\n</pw-input-container>\n\n<pw-input-container [label]=\"'Flows.Inspector.RetryWait' | transloco\"\n name=\"retry_wait_seconds\"\n [controlId]=\"inputId + '-wait'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Flows.Inspector.RetryWaitHint' | transloco\">\n <input class=\"form-control\"\n type=\"number\"\n min=\"1\"\n max=\"300\"\n [id]=\"inputId + '-wait'\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value.wait_seconds\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"set('wait_seconds', $event, 300)\" />\n</pw-input-container>\n}\n"
|
|
4949
|
+
}]
|
|
4950
|
+
}],
|
|
4951
|
+
propDecorators: {
|
|
4952
|
+
value: [{ type: Input }],
|
|
4953
|
+
inputId: [{ type: Input }],
|
|
4954
|
+
readOnly: [{ type: Input }],
|
|
4955
|
+
valueChange: [{ type: Output }]
|
|
4956
|
+
}
|
|
4957
|
+
});
|
|
4958
|
+
const TEXT_TYPES = [
|
|
4959
|
+
"text",
|
|
4960
|
+
"search",
|
|
4961
|
+
"url"
|
|
4962
|
+
];
|
|
4963
|
+
const FIELD_NAME_BOX = "-field";
|
|
4964
|
+
const SEARCH_FROM = 12;
|
|
4965
|
+
function isTextBox(element) {
|
|
4966
|
+
return element instanceof HTMLTextAreaElement || element instanceof HTMLInputElement && TEXT_TYPES.includes(element.type);
|
|
4967
|
+
}
|
|
4968
|
+
var FlowsAvailableFieldsComponent = class FlowsAvailableFieldsComponent {
|
|
4969
|
+
constructor(host, cdr) {
|
|
4970
|
+
this.host = host;
|
|
4971
|
+
this.sources = [];
|
|
4972
|
+
this.readOnly = false;
|
|
4973
|
+
this.firstRun = false;
|
|
4974
|
+
this.nodeType = "";
|
|
4975
|
+
this.labelKey = flowNodeLabelKey;
|
|
4976
|
+
this.query = "";
|
|
4977
|
+
this.names = false;
|
|
4978
|
+
afterEveryRender(() => {
|
|
4979
|
+
const names = this.takesNames();
|
|
4980
|
+
if (names !== this.names) {
|
|
4981
|
+
this.names = names;
|
|
4982
|
+
cdr.markForCheck();
|
|
3892
4983
|
}
|
|
3893
4984
|
});
|
|
3894
4985
|
}
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
4986
|
+
get searchable() {
|
|
4987
|
+
const count = (source) => source.names.filter((name) => this.fits(source.lists[name] ? "list" : "value", this.names)).length + (this.fits("entry", this.names) ? Object.values(source.lists).flat().length : 0);
|
|
4988
|
+
return this.sources.reduce((total, source) => total + count(source), 0) > SEARCH_FROM;
|
|
3898
4989
|
}
|
|
3899
|
-
|
|
3900
|
-
this.
|
|
4990
|
+
remember(target) {
|
|
4991
|
+
const panel = this.host.nativeElement.closest(".pw-node-inspector");
|
|
4992
|
+
if (isTextBox(target) && panel?.contains(target) && !target.closest("pw-flows-condition-field") && !this.host.nativeElement.contains(target)) {
|
|
4993
|
+
this.box = target;
|
|
4994
|
+
this.names = this.takesNames();
|
|
4995
|
+
}
|
|
4996
|
+
}
|
|
4997
|
+
takesNames() {
|
|
4998
|
+
return !!this.target()?.id.endsWith(FIELD_NAME_BOX);
|
|
4999
|
+
}
|
|
5000
|
+
offers(source, names) {
|
|
5001
|
+
const lists = Object.keys(source.lists);
|
|
5002
|
+
return source.names.some((name) => this.fits(lists.includes(name) ? "list" : "value", names)) || lists.length > 0 && this.fits("entry", names);
|
|
5003
|
+
}
|
|
5004
|
+
matches(name) {
|
|
5005
|
+
return !this.query || name.toLowerCase().includes(this.query.trim().toLowerCase());
|
|
5006
|
+
}
|
|
5007
|
+
fits(kind, names) {
|
|
5008
|
+
if (!names) return true;
|
|
5009
|
+
return this.nodeType === "data.split_out" ? kind === "list" : kind !== "entry";
|
|
5010
|
+
}
|
|
5011
|
+
placeholder(field, names) {
|
|
5012
|
+
return names ? field : `{{${field}}}`;
|
|
5013
|
+
}
|
|
5014
|
+
entry(list, key) {
|
|
5015
|
+
return `${list}.*.${key}`;
|
|
5016
|
+
}
|
|
5017
|
+
insert(field) {
|
|
5018
|
+
const box = this.target();
|
|
5019
|
+
const names = this.takesNames();
|
|
5020
|
+
if (this.readOnly || !box?.isConnected || box.readOnly) return;
|
|
5021
|
+
box.focus();
|
|
5022
|
+
if (names) box.value = field;
|
|
5023
|
+
else box.setRangeText(this.placeholder(field, names), box.selectionStart ?? box.value.length, box.selectionEnd ?? box.value.length, "end");
|
|
5024
|
+
box.dispatchEvent(new Event("input", { bubbles: true }));
|
|
5025
|
+
}
|
|
5026
|
+
target() {
|
|
5027
|
+
return this.box?.isConnected ? this.box : this.onlyBox();
|
|
5028
|
+
}
|
|
5029
|
+
onlyBox() {
|
|
5030
|
+
const boxes = [...this.host.nativeElement.closest(".pw-node-inspector")?.querySelectorAll("input, textarea") ?? []].filter((element) => isTextBox(element) && !element.closest("pw-flows-condition-field") && !this.host.nativeElement.contains(element));
|
|
5031
|
+
return boxes.length === 1 ? boxes[0] : void 0;
|
|
3901
5032
|
}
|
|
3902
5033
|
static {
|
|
3903
5034
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
3904
5035
|
minVersion: "12.0.0",
|
|
3905
5036
|
version: "22.2.0",
|
|
3906
5037
|
ngImport: i0,
|
|
3907
|
-
type:
|
|
3908
|
-
deps: [{ token:
|
|
5038
|
+
type: FlowsAvailableFieldsComponent,
|
|
5039
|
+
deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }],
|
|
3909
5040
|
target: i0.ɵɵFactoryTarget.Component
|
|
3910
5041
|
});
|
|
3911
5042
|
}
|
|
@@ -3913,127 +5044,80 @@ var FlowsMemberFieldComponent = class FlowsMemberFieldComponent {
|
|
|
3913
5044
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3914
5045
|
minVersion: "17.0.0",
|
|
3915
5046
|
version: "22.2.0",
|
|
3916
|
-
type:
|
|
5047
|
+
type: FlowsAvailableFieldsComponent,
|
|
3917
5048
|
isStandalone: false,
|
|
3918
|
-
selector: "pw-flows-
|
|
5049
|
+
selector: "pw-flows-available-fields",
|
|
3919
5050
|
inputs: {
|
|
3920
|
-
|
|
3921
|
-
multiple: "multiple",
|
|
3922
|
-
subscriptionId: "subscriptionId",
|
|
5051
|
+
sources: "sources",
|
|
3923
5052
|
inputId: "inputId",
|
|
3924
|
-
readOnly: "readOnly"
|
|
5053
|
+
readOnly: "readOnly",
|
|
5054
|
+
firstRun: "firstRun",
|
|
5055
|
+
nodeType: "nodeType"
|
|
3925
5056
|
},
|
|
3926
|
-
|
|
3927
|
-
usesOnChanges: true,
|
|
5057
|
+
host: { listeners: { "document:focusin": "remember($event.target)" } },
|
|
3928
5058
|
ngImport: i0,
|
|
3929
|
-
template: "<
|
|
5059
|
+
template: "<pw-input-container [label]=\"'Flows.Inspector.AvailableFields' | transloco\"\n name=\"available_fields\"\n [controlId]=\"inputId\"\n [useAriaLabelledbyOnly]=\"true\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Flows.Inspector.AvailableFieldsHint' | transloco\">\n @if (sources.length) {\n <div [id]=\"inputId\"\n class=\"pw-available-fields\"\n role=\"group\"\n [attr.aria-labelledby]=\"inputId + '-label'\">\n @if (searchable) {\n <input type=\"search\"\n class=\"form-control form-control-sm pw-available-fields__search\"\n data-testid=\"flow-available-fields-search\"\n [placeholder]=\"'Flows.Inspector.SearchFields' | transloco\"\n [attr.aria-label]=\"'Flows.Inspector.SearchFields' | transloco\"\n [value]=\"query\"\n (input)=\"query = $any($event.target).value\">\n }\n <div class=\"pw-available-fields__groups\"\n data-testid=\"flow-available-fields-groups\">\n @for (source of sources; track source.nodeId) {\n @if (offers(source, names)) {\n @let key = labelKey(source.type);\n @let translated = key | transloco;\n <section class=\"pw-available-fields__group\">\n <p class=\"pw-available-fields__from\"\n [attr.data-testid]=\"'flow-available-fields-from-' + source.nodeId\">\n {{ translated === key ? source.label : translated }}\n <span class=\"pw-available-fields__id\">{{ source.nodeId }}</span>\n </p>\n <div class=\"pw-available-fields__chips\">\n @for (field of source.names; track field) {\n @let kind = source.lists[field] ? 'list' : 'value';\n @if (matches(field) && fits(kind, names)) {\n <button type=\"button\"\n class=\"pw-available-fields__chip\"\n [disabled]=\"readOnly\"\n [attr.data-testid]=\"'flow-available-field-' + field\"\n [pTooltip]=\"placeholder(field, names)\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"insert(field)\">{{ field }}</button>\n }\n }\n </div>\n @if (fits('entry', names)) {\n @for (list of source.lists | keyvalue; track list.key) {\n <details class=\"pw-available-fields__list\"\n [open]=\"!!query\">\n <summary>{{ 'Flows.Inspector.FieldsIn' | transloco: { list: list.key, count: list.value.length } }}</summary>\n <div class=\"pw-available-fields__chips\">\n @for (field of list.value; track field) {\n @if (matches(field)) {\n <button type=\"button\"\n class=\"pw-available-fields__chip\"\n [disabled]=\"readOnly\"\n [attr.data-testid]=\"'flow-available-field-' + entry(list.key, field)\"\n [pTooltip]=\"placeholder(entry(list.key, field), names)\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"insert(entry(list.key, field))\">{{ field }}</button>\n }\n }\n </div>\n </details>\n }\n }\n </section>\n }\n }\n </div>\n </div>\n } @else {\n <p class=\"pw-available-fields__none\"\n data-testid=\"flow-available-fields-none\">{{ (firstRun ? 'Flows.Inspector.FirstRunFields' : 'Flows.Inspector.NoAvailableFields') | transloco }}</p>\n }\n</pw-input-container>\n",
|
|
5060
|
+
styles: [".pw-available-fields{display:flex;flex-direction:column;gap:10px}.pw-available-fields__search{max-width:100%}.pw-available-fields__groups{display:flex;flex-direction:column;gap:10px;max-height:220px;overflow-y:auto;padding-right:4px}.pw-available-fields__group+.pw-available-fields__group{border-top:1px solid #e2e5ea;padding-top:10px}.pw-available-fields__from{margin:0 0 6px;font-size:12px;font-weight:600;color:#1a1d21}.pw-available-fields__id{margin-left:4px;font-weight:400;color:#7c8696}.pw-available-fields__chips{display:flex;flex-wrap:wrap;gap:4px}.pw-available-fields__chip{border:1px solid #d5dae1;border-radius:4px;background-color:#f5f7fa;color:#1a1d21;padding:1px 8px;font-size:12px;line-height:20px;cursor:pointer}.pw-available-fields__chip:hover:not(:disabled){border-color:var(--first);background-color:#fff}.pw-available-fields__chip:disabled{cursor:not-allowed;opacity:.4}.pw-available-fields__list{margin-top:6px}.pw-available-fields__list summary{cursor:pointer;margin-bottom:4px;font-size:12px;color:#5a6473}.pw-available-fields__none{margin:0;color:#5a6473;font-size:12px}\n"],
|
|
3930
5061
|
dependencies: [
|
|
3931
5062
|
{
|
|
3932
5063
|
kind: "directive",
|
|
3933
|
-
type:
|
|
3934
|
-
selector: "[
|
|
3935
|
-
},
|
|
3936
|
-
{
|
|
3937
|
-
kind: "directive",
|
|
3938
|
-
type: i3$1.NgModel,
|
|
3939
|
-
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
5064
|
+
type: i1$1.Tooltip,
|
|
5065
|
+
selector: "[pTooltip]",
|
|
3940
5066
|
inputs: [
|
|
3941
|
-
"
|
|
3942
|
-
"
|
|
3943
|
-
"
|
|
3944
|
-
"
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
5067
|
+
"tooltipPosition",
|
|
5068
|
+
"tooltipEvent",
|
|
5069
|
+
"positionStyle",
|
|
5070
|
+
"tooltipStyleClass",
|
|
5071
|
+
"tooltipZIndex",
|
|
5072
|
+
"escape",
|
|
5073
|
+
"showDelay",
|
|
5074
|
+
"hideDelay",
|
|
5075
|
+
"life",
|
|
5076
|
+
"positionTop",
|
|
5077
|
+
"positionLeft",
|
|
5078
|
+
"autoHide",
|
|
5079
|
+
"fitContent",
|
|
5080
|
+
"hideOnEscape",
|
|
5081
|
+
"showOnEllipsis",
|
|
5082
|
+
"pTooltip",
|
|
5083
|
+
"tooltipDisabled",
|
|
5084
|
+
"tooltipOptions",
|
|
5085
|
+
"appendTo",
|
|
5086
|
+
"pTooltipPT",
|
|
5087
|
+
"pTooltipUnstyled"
|
|
5088
|
+
]
|
|
3948
5089
|
},
|
|
3949
5090
|
{
|
|
3950
5091
|
kind: "component",
|
|
3951
|
-
type:
|
|
3952
|
-
selector: "
|
|
5092
|
+
type: i6.InputContainerComponent,
|
|
5093
|
+
selector: "pw-input-container",
|
|
3953
5094
|
inputs: [
|
|
3954
|
-
"
|
|
3955
|
-
"
|
|
3956
|
-
"
|
|
3957
|
-
"
|
|
3958
|
-
"
|
|
3959
|
-
"
|
|
3960
|
-
"
|
|
3961
|
-
"
|
|
3962
|
-
"
|
|
3963
|
-
"
|
|
3964
|
-
"
|
|
3965
|
-
"
|
|
3966
|
-
"
|
|
3967
|
-
"
|
|
3968
|
-
"
|
|
3969
|
-
"
|
|
3970
|
-
"type",
|
|
3971
|
-
"autoZIndex",
|
|
3972
|
-
"baseZIndex",
|
|
3973
|
-
"ariaLabel",
|
|
3974
|
-
"dropdownAriaLabel",
|
|
3975
|
-
"ariaLabelledBy",
|
|
3976
|
-
"dropdownIcon",
|
|
3977
|
-
"unique",
|
|
3978
|
-
"group",
|
|
3979
|
-
"completeOnFocus",
|
|
3980
|
-
"showClear",
|
|
3981
|
-
"dropdown",
|
|
3982
|
-
"showEmptyMessage",
|
|
3983
|
-
"dropdownMode",
|
|
3984
|
-
"multiple",
|
|
3985
|
-
"addOnTab",
|
|
3986
|
-
"tabindex",
|
|
3987
|
-
"dataKey",
|
|
3988
|
-
"emptyMessage",
|
|
3989
|
-
"autofocus",
|
|
3990
|
-
"autocomplete",
|
|
3991
|
-
"optionGroupChildren",
|
|
3992
|
-
"optionGroupLabel",
|
|
3993
|
-
"overlayOptions",
|
|
3994
|
-
"suggestions",
|
|
3995
|
-
"optionLabel",
|
|
3996
|
-
"optionValue",
|
|
3997
|
-
"id",
|
|
3998
|
-
"searchMessage",
|
|
3999
|
-
"emptySelectionMessage",
|
|
4000
|
-
"selectionMessage",
|
|
4001
|
-
"autoOptionFocus",
|
|
4002
|
-
"selectOnFocus",
|
|
4003
|
-
"searchLocale",
|
|
4004
|
-
"optionDisabled",
|
|
4005
|
-
"focusOnHover",
|
|
4006
|
-
"typeahead",
|
|
4007
|
-
"addOnBlur",
|
|
4008
|
-
"separator",
|
|
4009
|
-
"appendTo",
|
|
4010
|
-
"motionOptions"
|
|
4011
|
-
],
|
|
4012
|
-
outputs: [
|
|
4013
|
-
"completeMethod",
|
|
4014
|
-
"onSelect",
|
|
4015
|
-
"onUnselect",
|
|
4016
|
-
"onAdd",
|
|
4017
|
-
"onFocus",
|
|
4018
|
-
"onBlur",
|
|
4019
|
-
"onDropdownClick",
|
|
4020
|
-
"onClear",
|
|
4021
|
-
"onInputKeydown",
|
|
4022
|
-
"onKeyUp",
|
|
4023
|
-
"onShow",
|
|
4024
|
-
"onHide",
|
|
4025
|
-
"onLazyLoad"
|
|
5095
|
+
"name",
|
|
5096
|
+
"controlId",
|
|
5097
|
+
"useAriaLabelledbyOnly",
|
|
5098
|
+
"label",
|
|
5099
|
+
"labelClass",
|
|
5100
|
+
"tooltipPosition",
|
|
5101
|
+
"required",
|
|
5102
|
+
"errorMsg",
|
|
5103
|
+
"isReadOnly",
|
|
5104
|
+
"showTooltip",
|
|
5105
|
+
"tooltipText",
|
|
5106
|
+
"showTriangle",
|
|
5107
|
+
"afterLabel",
|
|
5108
|
+
"showAfterLabel",
|
|
5109
|
+
"showTriangleText",
|
|
5110
|
+
"isLeftTooltip"
|
|
4026
5111
|
]
|
|
4027
5112
|
},
|
|
4028
5113
|
{
|
|
4029
|
-
kind: "
|
|
4030
|
-
type:
|
|
4031
|
-
|
|
4032
|
-
inputs: ["errorMsg", "displayError"]
|
|
5114
|
+
kind: "pipe",
|
|
5115
|
+
type: i1$2.KeyValuePipe,
|
|
5116
|
+
name: "keyvalue"
|
|
4033
5117
|
},
|
|
4034
5118
|
{
|
|
4035
5119
|
kind: "pipe",
|
|
4036
|
-
type:
|
|
5120
|
+
type: i2$4.TranslocoPipe,
|
|
4037
5121
|
name: "transloco"
|
|
4038
5122
|
}
|
|
4039
5123
|
]
|
|
@@ -4044,33 +5128,38 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4044
5128
|
minVersion: "12.0.0",
|
|
4045
5129
|
version: "22.2.0",
|
|
4046
5130
|
ngImport: i0,
|
|
4047
|
-
type:
|
|
5131
|
+
type: FlowsAvailableFieldsComponent,
|
|
4048
5132
|
decorators: [{
|
|
4049
5133
|
type: Component,
|
|
4050
5134
|
args: [{
|
|
4051
|
-
selector: "pw-flows-
|
|
5135
|
+
selector: "pw-flows-available-fields",
|
|
4052
5136
|
standalone: false,
|
|
4053
|
-
template: "<
|
|
5137
|
+
template: "<pw-input-container [label]=\"'Flows.Inspector.AvailableFields' | transloco\"\n name=\"available_fields\"\n [controlId]=\"inputId\"\n [useAriaLabelledbyOnly]=\"true\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Flows.Inspector.AvailableFieldsHint' | transloco\">\n @if (sources.length) {\n <div [id]=\"inputId\"\n class=\"pw-available-fields\"\n role=\"group\"\n [attr.aria-labelledby]=\"inputId + '-label'\">\n @if (searchable) {\n <input type=\"search\"\n class=\"form-control form-control-sm pw-available-fields__search\"\n data-testid=\"flow-available-fields-search\"\n [placeholder]=\"'Flows.Inspector.SearchFields' | transloco\"\n [attr.aria-label]=\"'Flows.Inspector.SearchFields' | transloco\"\n [value]=\"query\"\n (input)=\"query = $any($event.target).value\">\n }\n <div class=\"pw-available-fields__groups\"\n data-testid=\"flow-available-fields-groups\">\n @for (source of sources; track source.nodeId) {\n @if (offers(source, names)) {\n @let key = labelKey(source.type);\n @let translated = key | transloco;\n <section class=\"pw-available-fields__group\">\n <p class=\"pw-available-fields__from\"\n [attr.data-testid]=\"'flow-available-fields-from-' + source.nodeId\">\n {{ translated === key ? source.label : translated }}\n <span class=\"pw-available-fields__id\">{{ source.nodeId }}</span>\n </p>\n <div class=\"pw-available-fields__chips\">\n @for (field of source.names; track field) {\n @let kind = source.lists[field] ? 'list' : 'value';\n @if (matches(field) && fits(kind, names)) {\n <button type=\"button\"\n class=\"pw-available-fields__chip\"\n [disabled]=\"readOnly\"\n [attr.data-testid]=\"'flow-available-field-' + field\"\n [pTooltip]=\"placeholder(field, names)\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"insert(field)\">{{ field }}</button>\n }\n }\n </div>\n @if (fits('entry', names)) {\n @for (list of source.lists | keyvalue; track list.key) {\n <details class=\"pw-available-fields__list\"\n [open]=\"!!query\">\n <summary>{{ 'Flows.Inspector.FieldsIn' | transloco: { list: list.key, count: list.value.length } }}</summary>\n <div class=\"pw-available-fields__chips\">\n @for (field of list.value; track field) {\n @if (matches(field)) {\n <button type=\"button\"\n class=\"pw-available-fields__chip\"\n [disabled]=\"readOnly\"\n [attr.data-testid]=\"'flow-available-field-' + entry(list.key, field)\"\n [pTooltip]=\"placeholder(entry(list.key, field), names)\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"insert(entry(list.key, field))\">{{ field }}</button>\n }\n }\n </div>\n </details>\n }\n }\n </section>\n }\n }\n </div>\n </div>\n } @else {\n <p class=\"pw-available-fields__none\"\n data-testid=\"flow-available-fields-none\">{{ (firstRun ? 'Flows.Inspector.FirstRunFields' : 'Flows.Inspector.NoAvailableFields') | transloco }}</p>\n }\n</pw-input-container>\n",
|
|
5138
|
+
styles: [".pw-available-fields{display:flex;flex-direction:column;gap:10px}.pw-available-fields__search{max-width:100%}.pw-available-fields__groups{display:flex;flex-direction:column;gap:10px;max-height:220px;overflow-y:auto;padding-right:4px}.pw-available-fields__group+.pw-available-fields__group{border-top:1px solid #e2e5ea;padding-top:10px}.pw-available-fields__from{margin:0 0 6px;font-size:12px;font-weight:600;color:#1a1d21}.pw-available-fields__id{margin-left:4px;font-weight:400;color:#7c8696}.pw-available-fields__chips{display:flex;flex-wrap:wrap;gap:4px}.pw-available-fields__chip{border:1px solid #d5dae1;border-radius:4px;background-color:#f5f7fa;color:#1a1d21;padding:1px 8px;font-size:12px;line-height:20px;cursor:pointer}.pw-available-fields__chip:hover:not(:disabled){border-color:var(--first);background-color:#fff}.pw-available-fields__chip:disabled{cursor:not-allowed;opacity:.4}.pw-available-fields__list{margin-top:6px}.pw-available-fields__list summary{cursor:pointer;margin-bottom:4px;font-size:12px;color:#5a6473}.pw-available-fields__none{margin:0;color:#5a6473;font-size:12px}\n"]
|
|
4054
5139
|
}]
|
|
4055
5140
|
}],
|
|
4056
|
-
ctorParameters: () => [{ type:
|
|
5141
|
+
ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }],
|
|
4057
5142
|
propDecorators: {
|
|
4058
|
-
|
|
4059
|
-
multiple: [{ type: Input }],
|
|
4060
|
-
subscriptionId: [{ type: Input }],
|
|
5143
|
+
sources: [{ type: Input }],
|
|
4061
5144
|
inputId: [{ type: Input }],
|
|
4062
5145
|
readOnly: [{ type: Input }],
|
|
4063
|
-
|
|
5146
|
+
firstRun: [{ type: Input }],
|
|
5147
|
+
nodeType: [{ type: Input }],
|
|
5148
|
+
remember: [{
|
|
5149
|
+
type: HostListener,
|
|
5150
|
+
args: ["document:focusin", ["$event.target"]]
|
|
5151
|
+
}]
|
|
4064
5152
|
}
|
|
4065
5153
|
});
|
|
4066
|
-
function toIds(value) {
|
|
4067
|
-
return (Array.isArray(value) ? value : [value]).map(Number).filter((id) => Number.isInteger(id) && id > 0);
|
|
4068
|
-
}
|
|
4069
5154
|
var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
4070
|
-
constructor(translation, cdr, destroyRef) {
|
|
5155
|
+
constructor(translation, cdr, destroyRef, host) {
|
|
5156
|
+
this.host = host;
|
|
4071
5157
|
this.definition = null;
|
|
4072
5158
|
this.readOnly = false;
|
|
4073
5159
|
this.fieldSuggestions = [];
|
|
5160
|
+
this.listSuggestions = [];
|
|
5161
|
+
this.fieldSources = [];
|
|
5162
|
+
this.firstRun = false;
|
|
4074
5163
|
this.nodeChange = new EventEmitter();
|
|
4075
5164
|
this.remove = new EventEmitter();
|
|
4076
5165
|
this.icons = FLOWS_ICONS;
|
|
@@ -4078,6 +5167,8 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
4078
5167
|
this.defaultMergeMode = FLOW_MERGE_MODES[0];
|
|
4079
5168
|
this.labelKey = flowNodeLabelKey;
|
|
4080
5169
|
this.paramLabelKey = flowParamLabelKey;
|
|
5170
|
+
this.paramHelpKey = flowParamHelpKey;
|
|
5171
|
+
this.numberValue = flowNumberValue;
|
|
4081
5172
|
this.fields = [];
|
|
4082
5173
|
this.conditionNotAnObject = false;
|
|
4083
5174
|
translation.selectTranslation("flows").pipe(takeUntilDestroyed(destroyRef)).subscribe(() => {
|
|
@@ -4089,16 +5180,27 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
4089
5180
|
});
|
|
4090
5181
|
}
|
|
4091
5182
|
ngOnChanges(changes) {
|
|
4092
|
-
this.fields = this.definition ? flowNodeFields(this.definition) : []
|
|
5183
|
+
this.fields = (this.definition ? flowNodeFields(this.definition) : []).map((field) => ({
|
|
5184
|
+
...field,
|
|
5185
|
+
id: this.fieldId(field.key)
|
|
5186
|
+
}));
|
|
4093
5187
|
const previous = changes["node"]?.previousValue;
|
|
4094
5188
|
if (previous?.id !== this.node.id) {
|
|
4095
5189
|
this.conditionNotAnObject = false;
|
|
4096
5190
|
this.leaving = previous;
|
|
5191
|
+
this.saveFieldBeingTyped();
|
|
4097
5192
|
}
|
|
4098
5193
|
}
|
|
5194
|
+
saveFieldBeingTyped() {
|
|
5195
|
+
const focused = document.activeElement;
|
|
5196
|
+
if (focused instanceof HTMLElement && this.host.nativeElement.contains(focused)) focused.blur();
|
|
5197
|
+
}
|
|
4099
5198
|
ngAfterViewChecked() {
|
|
4100
5199
|
this.leaving = void 0;
|
|
4101
5200
|
}
|
|
5201
|
+
kindOf(field) {
|
|
5202
|
+
return field.kind === "list" && !this.listSuggestions.length ? "text" : field.kind;
|
|
5203
|
+
}
|
|
4102
5204
|
fieldId(key) {
|
|
4103
5205
|
return `flow-node-${this.node.id}-${key}`;
|
|
4104
5206
|
}
|
|
@@ -4115,6 +5217,9 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
4115
5217
|
params
|
|
4116
5218
|
});
|
|
4117
5219
|
}
|
|
5220
|
+
setRetry(retry) {
|
|
5221
|
+
this.emit(flowNodeWithRetry(this.leaving ?? this.node, retry));
|
|
5222
|
+
}
|
|
4118
5223
|
setCondition(condition) {
|
|
4119
5224
|
const next = { ...this.leaving ?? this.node };
|
|
4120
5225
|
this.conditionNotAnObject = false;
|
|
@@ -4138,9 +5243,10 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
4138
5243
|
ngImport: i0,
|
|
4139
5244
|
type: FlowsNodeInspectorComponent,
|
|
4140
5245
|
deps: [
|
|
4141
|
-
{ token:
|
|
5246
|
+
{ token: i2$4.TranslocoService },
|
|
4142
5247
|
{ token: i0.ChangeDetectorRef },
|
|
4143
|
-
{ token: i0.DestroyRef }
|
|
5248
|
+
{ token: i0.DestroyRef },
|
|
5249
|
+
{ token: i0.ElementRef }
|
|
4144
5250
|
],
|
|
4145
5251
|
target: i0.ɵɵFactoryTarget.Component
|
|
4146
5252
|
});
|
|
@@ -4157,7 +5263,10 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
4157
5263
|
definition: "definition",
|
|
4158
5264
|
subscriptionId: "subscriptionId",
|
|
4159
5265
|
readOnly: "readOnly",
|
|
4160
|
-
fieldSuggestions: "fieldSuggestions"
|
|
5266
|
+
fieldSuggestions: "fieldSuggestions",
|
|
5267
|
+
listSuggestions: "listSuggestions",
|
|
5268
|
+
fieldSources: "fieldSources",
|
|
5269
|
+
firstRun: "firstRun"
|
|
4161
5270
|
},
|
|
4162
5271
|
outputs: {
|
|
4163
5272
|
nodeChange: "nodeChange",
|
|
@@ -4165,22 +5274,22 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
4165
5274
|
},
|
|
4166
5275
|
usesOnChanges: true,
|
|
4167
5276
|
ngImport: i0,
|
|
4168
|
-
template: "<aside class=\"pw-node-inspector\"\n data-testid=\"flow-inspector\">\n @let key = labelKey(node.type);\n @let translated = key | transloco;\n <header class=\"pw-node-inspector__head\">\n <div>\n <h4 class=\"pw-node-inspector__title\">{{ translated === key ? (definition?.label ?? node.type) : translated }}</h4>\n <span class=\"pw-node-inspector__id\">{{ node.id }} · {{ node.type }}</span>\n </div>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-node-inspector__remove\"\n data-testid=\"flow-node-remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveNode' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveNode' | transloco\"\n appendTo=\"body\"\n (click)=\"remove.emit()\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </header>\n\n @if (!definition) {\n <p class=\"pw-node-inspector__note\"\n data-testid=\"flow-node-unknown\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Inspector.UnknownType' | transloco }}\n </p>\n }\n\n @for (field of fields; track field.
|
|
4169
|
-
styles: [".pw-node-inspector{display:flex;flex-direction:column;gap:16px;padding:16px}.pw-node-inspector__head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding-bottom:12px;border-bottom:1px solid #e2e5ea}.pw-node-inspector__title{margin:0}.pw-node-inspector__id{color:#7c8696;font-size:12px;font-variant-numeric:tabular-nums}.pw-node-inspector__remove{color:#5a6473}.pw-node-inspector__field{display:block}.pw-node-inspector__note
|
|
5277
|
+
template: "<aside class=\"pw-node-inspector\"\n data-testid=\"flow-inspector\">\n @let key = labelKey(node.type);\n @let translated = key | transloco;\n <header class=\"pw-node-inspector__head\">\n <div>\n <h4 class=\"pw-node-inspector__title\">{{ translated === key ? (definition?.label ?? node.type) : translated }}</h4>\n <span class=\"pw-node-inspector__id\">{{ node.id }} · {{ node.type }}</span>\n </div>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-node-inspector__remove\"\n data-testid=\"flow-node-remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveNode' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveNode' | transloco\"\n appendTo=\"body\"\n (click)=\"remove.emit()\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </header>\n\n @if (!definition) {\n <p class=\"pw-node-inspector__note\"\n data-testid=\"flow-node-unknown\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Inspector.UnknownType' | transloco }}\n </p>\n }\n\n @if (definition && definition.category !== 'trigger' && fieldSources) {\n <pw-flows-available-fields class=\"pw-node-inspector__field\"\n data-testid=\"flow-available-fields\"\n [inputId]=\"fieldId('available-fields')\"\n [sources]=\"fieldSources\" [firstRun]=\"firstRun\" [nodeType]=\"node.type\"\n [readOnly]=\"readOnly\"></pw-flows-available-fields>\n }\n\n @for (field of fields; track field.id) {\n @let id = field.id;\n @let paramKey = paramLabelKey(field.key);\n @let paramLabel = paramKey | transloco;\n @let helpKey = paramHelpKey(node.type, field.key);\n @let helpText = helpKey | transloco;\n @let help = field.description || (helpText === helpKey ? '' : helpText);\n <pw-input-container class=\"pw-node-inspector__field\"\n [label]=\"field.label || (paramLabel === paramKey ? field.key : paramLabel)\"\n [required]=\"!!field.required\"\n [name]=\"field.key\"\n [controlId]=\"id\"\n [showTooltip]=\"!!help\"\n [tooltipText]=\"help\">\n @switch (kindOf(field)) {\n @case ('textarea') {\n <textarea class=\"form-control\"\n rows=\"4\"\n [id]=\"id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"param(field.key)\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"setParam(field.key, $event)\"></textarea>\n }\n @case ('cron') {\n <pw-flows-cron-field [inputId]=\"id\"\n [value]=\"param(field.key)\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-cron-field>\n }\n @case ('timezone') {\n <pw-flows-timezone-field [inputId]=\"id\"\n [value]=\"param(field.key)\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-timezone-field>\n }\n @case ('pairs') {\n <pw-flows-pairs-field [inputId]=\"id\"\n [value]=\"param(field.key)\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-pairs-field>\n }\n @case ('json') {\n <pw-flows-json-field [inputId]=\"id\"\n [value]=\"param(field.key)\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-json-field>\n }\n @case ('member') {\n <pw-flows-member-field [inputId]=\"id\"\n [value]=\"param(field.key)\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-member-field>\n }\n @case ('members') {\n <pw-flows-member-field [inputId]=\"id\"\n [multiple]=\"true\"\n [value]=\"param(field.key)\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-member-field>\n }\n @case ('mode') {\n <p-select [inputId]=\"id\"\n [options]=\"mergeModes\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"param(field.key) ?? defaultMergeMode\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"setParam(field.key, $event)\"></p-select>\n }\n @case ('list') {\n <p-select [inputId]=\"id\"\n [options]=\"listSuggestions\"\n [editable]=\"true\"\n [placeholder]=\"'Flows.Inspector.SelectList' | transloco\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"param(field.key)\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"setParam(field.key, $event ?? undefined)\"></p-select>\n }\n @case ('select') {\n <p-select [inputId]=\"id\"\n [options]=\"field.options ?? []\"\n [placeholder]=\"field.placeholder ?? ''\"\n [showClear]=\"!field.required\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"param(field.key)\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"setParam(field.key, $event ?? undefined)\"></p-select>\n }\n @case ('number') {\n <input class=\"form-control\"\n type=\"text\"\n inputmode=\"decimal\"\n [id]=\"id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"param(field.key)\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"setParam(field.key, numberValue($event))\" />\n }\n @default {\n <input class=\"form-control\" type=\"text\" autocomplete=\"off\"\n [attr.inputmode]=\"field.kind === 'email' ? 'email' : null\"\n [id]=\"id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"param(field.key)\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"setParam(field.key, $event)\" />\n }\n }\n </pw-input-container>\n }\n\n @if (definition?.condition) {\n @let conditionKey = paramHelpKey(node.type, 'condition');\n @let conditionText = conditionKey | transloco;\n @let conditionHelp = conditionText === conditionKey ? '' : conditionText;\n <pw-input-container class=\"pw-node-inspector__field\"\n [label]=\"'Flows.Inspector.Condition' | transloco\"\n name=\"condition\"\n [controlId]=\"fieldId('condition')\"\n [showTooltip]=\"!!conditionHelp\"\n [tooltipText]=\"conditionHelp\">\n <pw-flows-condition-field [inputId]=\"fieldId('condition')\"\n [value]=\"node.condition\"\n [suggestions]=\"fieldSuggestions\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setCondition($event)\"></pw-flows-condition-field>\n @if (conditionNotAnObject) {\n <pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Inspector.ConditionNotAnObject' | transloco\">\n </pw-field-error-display>\n }\n </pw-input-container>\n }\n\n @if (definition?.category === 'action') {\n <div class=\"pw-node-inspector__field\"\n data-testid=\"flow-node-retry\">\n <pw-flows-retry-field [inputId]=\"fieldId('retry')\"\n [value]=\"node.retry\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setRetry($event)\"></pw-flows-retry-field>\n </div>\n }\n\n @if (definition && !fields.length && !definition.condition) {\n <p class=\"pw-node-inspector__note\">{{ 'Flows.Inspector.NoSettings' | transloco }}</p>\n }\n</aside>\n",
|
|
5278
|
+
styles: [".pw-node-inspector ::ng-deep .info-circle{display:inline-block;margin-left:.35em;vertical-align:baseline}.pw-node-inspector ::ng-deep .info-circle:after{position:static;font-size:inherit;line-height:inherit}.pw-node-inspector{display:flex;flex-direction:column;gap:16px;padding:16px}.pw-node-inspector__head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding-bottom:12px;border-bottom:1px solid #e2e5ea}.pw-node-inspector__title{margin:0}.pw-node-inspector__id{color:#7c8696;font-size:12px;font-variant-numeric:tabular-nums}.pw-node-inspector__remove{color:#5a6473}.pw-node-inspector__field{display:block}.pw-node-inspector__note{margin:0;color:#5a6473;font-size:12px}\n"],
|
|
4170
5279
|
dependencies: [
|
|
4171
5280
|
{
|
|
4172
5281
|
kind: "directive",
|
|
4173
|
-
type: i3$
|
|
5282
|
+
type: i3$2.DefaultValueAccessor,
|
|
4174
5283
|
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
4175
5284
|
},
|
|
4176
5285
|
{
|
|
4177
5286
|
kind: "directive",
|
|
4178
|
-
type: i3$
|
|
5287
|
+
type: i3$2.NgControlStatus,
|
|
4179
5288
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
4180
5289
|
},
|
|
4181
5290
|
{
|
|
4182
5291
|
kind: "directive",
|
|
4183
|
-
type: i3$
|
|
5292
|
+
type: i3$2.NgModel,
|
|
4184
5293
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
4185
5294
|
inputs: [
|
|
4186
5295
|
"name",
|
|
@@ -4193,7 +5302,7 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
4193
5302
|
},
|
|
4194
5303
|
{
|
|
4195
5304
|
kind: "directive",
|
|
4196
|
-
type:
|
|
5305
|
+
type: i1$1.Tooltip,
|
|
4197
5306
|
selector: "[pTooltip]",
|
|
4198
5307
|
inputs: [
|
|
4199
5308
|
"tooltipPosition",
|
|
@@ -4291,13 +5400,13 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
4291
5400
|
},
|
|
4292
5401
|
{
|
|
4293
5402
|
kind: "component",
|
|
4294
|
-
type: i2.FieldErrorDisplayComponent,
|
|
5403
|
+
type: i2$1.FieldErrorDisplayComponent,
|
|
4295
5404
|
selector: "pw-field-error-display",
|
|
4296
5405
|
inputs: ["errorMsg", "displayError"]
|
|
4297
5406
|
},
|
|
4298
5407
|
{
|
|
4299
5408
|
kind: "component",
|
|
4300
|
-
type:
|
|
5409
|
+
type: i6.InputContainerComponent,
|
|
4301
5410
|
selector: "pw-input-container",
|
|
4302
5411
|
inputs: [
|
|
4303
5412
|
"name",
|
|
@@ -4320,7 +5429,7 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
4320
5429
|
},
|
|
4321
5430
|
{
|
|
4322
5431
|
kind: "component",
|
|
4323
|
-
type:
|
|
5432
|
+
type: i2$3.FaIconComponent,
|
|
4324
5433
|
selector: "fa-icon",
|
|
4325
5434
|
inputs: [
|
|
4326
5435
|
"icon",
|
|
@@ -4424,9 +5533,32 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
4424
5533
|
],
|
|
4425
5534
|
outputs: ["valueChange"]
|
|
4426
5535
|
},
|
|
5536
|
+
{
|
|
5537
|
+
kind: "component",
|
|
5538
|
+
type: FlowsRetryFieldComponent,
|
|
5539
|
+
selector: "pw-flows-retry-field",
|
|
5540
|
+
inputs: [
|
|
5541
|
+
"value",
|
|
5542
|
+
"inputId",
|
|
5543
|
+
"readOnly"
|
|
5544
|
+
],
|
|
5545
|
+
outputs: ["valueChange"]
|
|
5546
|
+
},
|
|
5547
|
+
{
|
|
5548
|
+
kind: "component",
|
|
5549
|
+
type: FlowsAvailableFieldsComponent,
|
|
5550
|
+
selector: "pw-flows-available-fields",
|
|
5551
|
+
inputs: [
|
|
5552
|
+
"sources",
|
|
5553
|
+
"inputId",
|
|
5554
|
+
"readOnly",
|
|
5555
|
+
"firstRun",
|
|
5556
|
+
"nodeType"
|
|
5557
|
+
]
|
|
5558
|
+
},
|
|
4427
5559
|
{
|
|
4428
5560
|
kind: "pipe",
|
|
4429
|
-
type:
|
|
5561
|
+
type: i2$4.TranslocoPipe,
|
|
4430
5562
|
name: "transloco"
|
|
4431
5563
|
}
|
|
4432
5564
|
]
|
|
@@ -4443,14 +5575,15 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4443
5575
|
args: [{
|
|
4444
5576
|
selector: "pw-flows-node-inspector",
|
|
4445
5577
|
standalone: false,
|
|
4446
|
-
template: "<aside class=\"pw-node-inspector\"\n data-testid=\"flow-inspector\">\n @let key = labelKey(node.type);\n @let translated = key | transloco;\n <header class=\"pw-node-inspector__head\">\n <div>\n <h4 class=\"pw-node-inspector__title\">{{ translated === key ? (definition?.label ?? node.type) : translated }}</h4>\n <span class=\"pw-node-inspector__id\">{{ node.id }} · {{ node.type }}</span>\n </div>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-node-inspector__remove\"\n data-testid=\"flow-node-remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveNode' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveNode' | transloco\"\n appendTo=\"body\"\n (click)=\"remove.emit()\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </header>\n\n @if (!definition) {\n <p class=\"pw-node-inspector__note\"\n data-testid=\"flow-node-unknown\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Inspector.UnknownType' | transloco }}\n </p>\n }\n\n @for (field of fields; track field.
|
|
4447
|
-
styles: [".pw-node-inspector{display:flex;flex-direction:column;gap:16px;padding:16px}.pw-node-inspector__head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding-bottom:12px;border-bottom:1px solid #e2e5ea}.pw-node-inspector__title{margin:0}.pw-node-inspector__id{color:#7c8696;font-size:12px;font-variant-numeric:tabular-nums}.pw-node-inspector__remove{color:#5a6473}.pw-node-inspector__field{display:block}.pw-node-inspector__note
|
|
5578
|
+
template: "<aside class=\"pw-node-inspector\"\n data-testid=\"flow-inspector\">\n @let key = labelKey(node.type);\n @let translated = key | transloco;\n <header class=\"pw-node-inspector__head\">\n <div>\n <h4 class=\"pw-node-inspector__title\">{{ translated === key ? (definition?.label ?? node.type) : translated }}</h4>\n <span class=\"pw-node-inspector__id\">{{ node.id }} · {{ node.type }}</span>\n </div>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-node-inspector__remove\"\n data-testid=\"flow-node-remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveNode' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveNode' | transloco\"\n appendTo=\"body\"\n (click)=\"remove.emit()\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </header>\n\n @if (!definition) {\n <p class=\"pw-node-inspector__note\"\n data-testid=\"flow-node-unknown\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Inspector.UnknownType' | transloco }}\n </p>\n }\n\n @if (definition && definition.category !== 'trigger' && fieldSources) {\n <pw-flows-available-fields class=\"pw-node-inspector__field\"\n data-testid=\"flow-available-fields\"\n [inputId]=\"fieldId('available-fields')\"\n [sources]=\"fieldSources\" [firstRun]=\"firstRun\" [nodeType]=\"node.type\"\n [readOnly]=\"readOnly\"></pw-flows-available-fields>\n }\n\n @for (field of fields; track field.id) {\n @let id = field.id;\n @let paramKey = paramLabelKey(field.key);\n @let paramLabel = paramKey | transloco;\n @let helpKey = paramHelpKey(node.type, field.key);\n @let helpText = helpKey | transloco;\n @let help = field.description || (helpText === helpKey ? '' : helpText);\n <pw-input-container class=\"pw-node-inspector__field\"\n [label]=\"field.label || (paramLabel === paramKey ? field.key : paramLabel)\"\n [required]=\"!!field.required\"\n [name]=\"field.key\"\n [controlId]=\"id\"\n [showTooltip]=\"!!help\"\n [tooltipText]=\"help\">\n @switch (kindOf(field)) {\n @case ('textarea') {\n <textarea class=\"form-control\"\n rows=\"4\"\n [id]=\"id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"param(field.key)\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"setParam(field.key, $event)\"></textarea>\n }\n @case ('cron') {\n <pw-flows-cron-field [inputId]=\"id\"\n [value]=\"param(field.key)\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-cron-field>\n }\n @case ('timezone') {\n <pw-flows-timezone-field [inputId]=\"id\"\n [value]=\"param(field.key)\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-timezone-field>\n }\n @case ('pairs') {\n <pw-flows-pairs-field [inputId]=\"id\"\n [value]=\"param(field.key)\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-pairs-field>\n }\n @case ('json') {\n <pw-flows-json-field [inputId]=\"id\"\n [value]=\"param(field.key)\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-json-field>\n }\n @case ('member') {\n <pw-flows-member-field [inputId]=\"id\"\n [value]=\"param(field.key)\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-member-field>\n }\n @case ('members') {\n <pw-flows-member-field [inputId]=\"id\"\n [multiple]=\"true\"\n [value]=\"param(field.key)\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-member-field>\n }\n @case ('mode') {\n <p-select [inputId]=\"id\"\n [options]=\"mergeModes\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"param(field.key) ?? defaultMergeMode\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"setParam(field.key, $event)\"></p-select>\n }\n @case ('list') {\n <p-select [inputId]=\"id\"\n [options]=\"listSuggestions\"\n [editable]=\"true\"\n [placeholder]=\"'Flows.Inspector.SelectList' | transloco\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"param(field.key)\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"setParam(field.key, $event ?? undefined)\"></p-select>\n }\n @case ('select') {\n <p-select [inputId]=\"id\"\n [options]=\"field.options ?? []\"\n [placeholder]=\"field.placeholder ?? ''\"\n [showClear]=\"!field.required\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"param(field.key)\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"setParam(field.key, $event ?? undefined)\"></p-select>\n }\n @case ('number') {\n <input class=\"form-control\"\n type=\"text\"\n inputmode=\"decimal\"\n [id]=\"id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"param(field.key)\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"setParam(field.key, numberValue($event))\" />\n }\n @default {\n <input class=\"form-control\" type=\"text\" autocomplete=\"off\"\n [attr.inputmode]=\"field.kind === 'email' ? 'email' : null\"\n [id]=\"id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"param(field.key)\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"setParam(field.key, $event)\" />\n }\n }\n </pw-input-container>\n }\n\n @if (definition?.condition) {\n @let conditionKey = paramHelpKey(node.type, 'condition');\n @let conditionText = conditionKey | transloco;\n @let conditionHelp = conditionText === conditionKey ? '' : conditionText;\n <pw-input-container class=\"pw-node-inspector__field\"\n [label]=\"'Flows.Inspector.Condition' | transloco\"\n name=\"condition\"\n [controlId]=\"fieldId('condition')\"\n [showTooltip]=\"!!conditionHelp\"\n [tooltipText]=\"conditionHelp\">\n <pw-flows-condition-field [inputId]=\"fieldId('condition')\"\n [value]=\"node.condition\"\n [suggestions]=\"fieldSuggestions\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setCondition($event)\"></pw-flows-condition-field>\n @if (conditionNotAnObject) {\n <pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Inspector.ConditionNotAnObject' | transloco\">\n </pw-field-error-display>\n }\n </pw-input-container>\n }\n\n @if (definition?.category === 'action') {\n <div class=\"pw-node-inspector__field\"\n data-testid=\"flow-node-retry\">\n <pw-flows-retry-field [inputId]=\"fieldId('retry')\"\n [value]=\"node.retry\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setRetry($event)\"></pw-flows-retry-field>\n </div>\n }\n\n @if (definition && !fields.length && !definition.condition) {\n <p class=\"pw-node-inspector__note\">{{ 'Flows.Inspector.NoSettings' | transloco }}</p>\n }\n</aside>\n",
|
|
5579
|
+
styles: [".pw-node-inspector ::ng-deep .info-circle{display:inline-block;margin-left:.35em;vertical-align:baseline}.pw-node-inspector ::ng-deep .info-circle:after{position:static;font-size:inherit;line-height:inherit}.pw-node-inspector{display:flex;flex-direction:column;gap:16px;padding:16px}.pw-node-inspector__head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding-bottom:12px;border-bottom:1px solid #e2e5ea}.pw-node-inspector__title{margin:0}.pw-node-inspector__id{color:#7c8696;font-size:12px;font-variant-numeric:tabular-nums}.pw-node-inspector__remove{color:#5a6473}.pw-node-inspector__field{display:block}.pw-node-inspector__note{margin:0;color:#5a6473;font-size:12px}\n"]
|
|
4448
5580
|
}]
|
|
4449
5581
|
}],
|
|
4450
5582
|
ctorParameters: () => [
|
|
4451
|
-
{ type:
|
|
5583
|
+
{ type: i2$4.TranslocoService },
|
|
4452
5584
|
{ type: i0.ChangeDetectorRef },
|
|
4453
|
-
{ type: i0.DestroyRef }
|
|
5585
|
+
{ type: i0.DestroyRef },
|
|
5586
|
+
{ type: i0.ElementRef }
|
|
4454
5587
|
],
|
|
4455
5588
|
propDecorators: {
|
|
4456
5589
|
node: [{ type: Input }],
|
|
@@ -4458,17 +5591,23 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4458
5591
|
subscriptionId: [{ type: Input }],
|
|
4459
5592
|
readOnly: [{ type: Input }],
|
|
4460
5593
|
fieldSuggestions: [{ type: Input }],
|
|
5594
|
+
listSuggestions: [{ type: Input }],
|
|
5595
|
+
fieldSources: [{ type: Input }],
|
|
5596
|
+
firstRun: [{ type: Input }],
|
|
4461
5597
|
nodeChange: [{ type: Output }],
|
|
4462
5598
|
remove: [{ type: Output }]
|
|
4463
5599
|
}
|
|
4464
5600
|
});
|
|
4465
5601
|
var FlowsVersionEditorComponent = class FlowsVersionEditorComponent {
|
|
4466
|
-
constructor(workflowService, nodeService, cdr) {
|
|
5602
|
+
constructor(workflowService, nodeService, runService, cdr) {
|
|
4467
5603
|
this.workflowService = workflowService;
|
|
4468
5604
|
this.nodeService = nodeService;
|
|
5605
|
+
this.runService = runService;
|
|
4469
5606
|
this.cdr = cdr;
|
|
4470
5607
|
this.destroy$ = new Subject();
|
|
4471
5608
|
this.version = null;
|
|
5609
|
+
this.duplicateOf = null;
|
|
5610
|
+
this.check = null;
|
|
4472
5611
|
this.saved = new EventEmitter();
|
|
4473
5612
|
this.cancelled = new EventEmitter();
|
|
4474
5613
|
this.icons = FLOWS_ICONS;
|
|
@@ -4486,9 +5625,10 @@ var FlowsVersionEditorComponent = class FlowsVersionEditorComponent {
|
|
|
4486
5625
|
return !!this.version && isFlowVersionPublished(this.version);
|
|
4487
5626
|
}
|
|
4488
5627
|
get headingKey() {
|
|
4489
|
-
return flowVersionEditorTitleKey(this.version);
|
|
5628
|
+
return flowVersionEditorTitleKey(this.version, this.duplicateOf);
|
|
4490
5629
|
}
|
|
4491
5630
|
ngOnInit() {
|
|
5631
|
+
this.workflowFields$ = this.runService.getWorkflowFields(this.workflowId, this.subscriptionId).pipe(shareReplay(1));
|
|
4492
5632
|
this.nodeService.getNodes(this.subscriptionId).pipe(finalize(() => {
|
|
4493
5633
|
this.loading = false;
|
|
4494
5634
|
this.cdr.markForCheck();
|
|
@@ -4498,8 +5638,9 @@ var FlowsVersionEditorComponent = class FlowsVersionEditorComponent {
|
|
|
4498
5638
|
});
|
|
4499
5639
|
}
|
|
4500
5640
|
ngOnChanges(changes) {
|
|
4501
|
-
if (!changes["version"]) return;
|
|
4502
|
-
this.
|
|
5641
|
+
if (!changes["version"] && !changes["duplicateOf"]) return;
|
|
5642
|
+
const copied = this.duplicateOf && JSON.parse(JSON.stringify(this.duplicateOf.graph ?? null));
|
|
5643
|
+
this.graph = toFlowGraph(this.version?.graph ?? copied);
|
|
4503
5644
|
this.view = "canvas";
|
|
4504
5645
|
this.select(null);
|
|
4505
5646
|
this.dropped = [];
|
|
@@ -4550,6 +5691,7 @@ var FlowsVersionEditorComponent = class FlowsVersionEditorComponent {
|
|
|
4550
5691
|
deps: [
|
|
4551
5692
|
{ token: FlowsWorkflowService },
|
|
4552
5693
|
{ token: FlowsNodeService },
|
|
5694
|
+
{ token: FlowsRunService },
|
|
4553
5695
|
{ token: i0.ChangeDetectorRef }
|
|
4554
5696
|
],
|
|
4555
5697
|
target: i0.ɵɵFactoryTarget.Component
|
|
@@ -4564,8 +5706,10 @@ var FlowsVersionEditorComponent = class FlowsVersionEditorComponent {
|
|
|
4564
5706
|
selector: "pw-flows-version-editor",
|
|
4565
5707
|
inputs: {
|
|
4566
5708
|
version: "version",
|
|
5709
|
+
duplicateOf: "duplicateOf",
|
|
4567
5710
|
workflowId: "workflowId",
|
|
4568
|
-
subscriptionId: "subscriptionId"
|
|
5711
|
+
subscriptionId: "subscriptionId",
|
|
5712
|
+
check: "check"
|
|
4569
5713
|
},
|
|
4570
5714
|
outputs: {
|
|
4571
5715
|
saved: "saved",
|
|
@@ -4579,12 +5723,12 @@ var FlowsVersionEditorComponent = class FlowsVersionEditorComponent {
|
|
|
4579
5723
|
}],
|
|
4580
5724
|
usesOnChanges: true,
|
|
4581
5725
|
ngImport: i0,
|
|
4582
|
-
template: "<div class=\"pw-version-editor mt-3\">\n <h3>{{ headingKey | transloco }}</h3>\n\n <pw-loader [isVisible]=\"loading\"></pw-loader>\n\n @if (!loading) {\n @if (loadFailed) {\n <pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Canvas.LoadFailed' | transloco\">\n </pw-field-error-display>\n } @else {\n <div class=\"pw-version-editor__toolbar\">\n <div class=\"btn-group\"\n role=\"tablist\">\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-canvas\"\n [class.active]=\"view === 'canvas'\"\n [attr.aria-selected]=\"view === 'canvas'\"\n (click)=\"show('canvas')\">\n <fa-icon [icon]=\"icons.diagram\"></fa-icon>\n {{ 'Flows.Canvas.Diagram' | transloco }}\n </button>\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-json\"\n [class.active]=\"view === 'json'\"\n [attr.aria-selected]=\"view === 'json'\"\n (click)=\"show('json')\">\n <fa-icon [icon]=\"icons.json\"></fa-icon>\n {{ 'Flows.Canvas.Json' | transloco }}\n </button>\n </div>\n @if (view === 'canvas') {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-fit\"\n (click)=\"canvas.zoomToFit()\">\n <fa-icon [icon]=\"icons.fit\"></fa-icon>\n {{ 'Flows.Canvas.Fit' | transloco }}\n </button>\n }\n </div>\n\n @if (dropped.length) {\n <p class=\"pw-version-editor__warning\"\n role=\"alert\"\n data-testid=\"flow-dropped-edges\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Canvas.Dropped' | transloco: { count: dropped.length } }}\n </p>\n }\n\n <div class=\"pw-version-editor__workspace\"\n [class.is-read-only]=\"readOnly\"\n [hidden]=\"view !== 'canvas'\">\n @if (!readOnly) {\n <pw-flows-node-palette class=\"pw-version-editor__palette\"\n [definitions]=\"definitions\"\n (add)=\"canvas.addNode($event)\"></pw-flows-node-palette>\n }\n <pw-flows-graph-canvas #canvas\n class=\"pw-version-editor__canvas\"\n [graph]=\"graph\"\n [definitions]=\"definitions\"\n [readOnly]=\"readOnly\"\n (selectionChange)=\"select($event)\"\n (dropped)=\"dropped = $event\"></pw-flows-graph-canvas>\n <div class=\"pw-version-editor__side\">\n @if (selection) {\n <pw-flows-node-inspector [node]=\"selection.node\"\n [definition]=\"selection.definition\"\n [fieldSuggestions]=\"selection.fieldSuggestions\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (nodeChange)=\"updateSelected($event)\"\n (remove)=\"removeSelected()\"></pw-flows-node-inspector>\n } @else {\n <p class=\"pw-version-editor__hint\">{{ (readOnly ? 'Flows.Canvas.SelectToView' : 'Flows.Canvas.SelectToEdit') | transloco }}</p>\n }\n </div>\n </div>\n\n @if (view === 'json') {\n <pre class=\"pw-version-editor__json\"\n data-testid=\"flow-json\">{{ json }}</pre>\n }\n }\n }\n\n <div class=\"mb-3 col-12 text-end mt-3\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"cancel()\">\n {{ (readOnly ? 'Flows.Versions.Editor.Close' : 'Button.Cancel') | transloco }}\n </button>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"saving || loading || loadFailed\"\n (click)=\"save()\">\n {{ 'Button.Submit' | transloco }}\n </button>\n }\n </div>\n</div>\n",
|
|
4583
|
-
styles: [":host .pw-version-editor>h3{display:block;border-top:1px solid #e2e5ea;margin-top:2rem;padding-top:1.25rem}.pw-version-editor__toolbar{display:flex;align-items:center;
|
|
5726
|
+
template: "<div class=\"pw-version-editor mt-3\">\n <h3>{{ headingKey | transloco: { number: duplicateOf?.version } }}</h3>\n\n <pw-loader [isVisible]=\"loading\"></pw-loader>\n\n @if (!loading) {\n @if (loadFailed) {\n <pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Canvas.LoadFailed' | transloco\">\n </pw-field-error-display>\n } @else {\n <div class=\"pw-version-editor__toolbar\">\n <div class=\"btn-group me-auto\"\n role=\"tablist\">\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-canvas\"\n [class.active]=\"view === 'canvas'\"\n [attr.aria-selected]=\"view === 'canvas'\"\n (click)=\"show('canvas')\">\n <fa-icon [icon]=\"icons.diagram\"></fa-icon>\n {{ 'Flows.Canvas.Diagram' | transloco }}\n </button>\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-json\"\n [class.active]=\"view === 'json'\"\n [attr.aria-selected]=\"view === 'json'\"\n (click)=\"show('json')\">\n <fa-icon [icon]=\"icons.json\"></fa-icon>\n {{ 'Flows.Canvas.Json' | transloco }}\n </button>\n </div>\n @if (view === 'canvas') {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-fit\"\n (click)=\"canvas.zoomToFit()\">\n <fa-icon [icon]=\"icons.fit\"></fa-icon>\n {{ 'Flows.Canvas.Fit' | transloco }}\n </button>\n }\n </div>\n\n @if (check && !readOnly) {\n <pw-flows-graph-check [canvas]=\"canvas\"\n [definitions]=\"definitions\"\n [graph]=\"graph\"\n [result]=\"check\"></pw-flows-graph-check>\n }\n\n @if (dropped.length) {\n <p class=\"pw-version-editor__warning\"\n role=\"alert\"\n data-testid=\"flow-dropped-edges\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Canvas.Dropped' | transloco: { count: dropped.length } }}\n </p>\n }\n\n @let fields = workflowFields$ | async;\n <div class=\"pw-version-editor__workspace\"\n [class.is-read-only]=\"readOnly\"\n [hidden]=\"view !== 'canvas'\">\n @if (!readOnly) {\n <pw-flows-node-palette class=\"pw-version-editor__palette\"\n [definitions]=\"definitions\"\n (add)=\"canvas.addNode($event)\"></pw-flows-node-palette>\n }\n <pw-flows-graph-canvas #canvas\n class=\"pw-version-editor__canvas\"\n [graph]=\"graph\"\n [definitions]=\"definitions\"\n [workflowFields]=\"fields\"\n [readOnly]=\"readOnly\"\n (selectionChange)=\"select($event)\"\n (dropped)=\"dropped = $event\"></pw-flows-graph-canvas>\n <div class=\"pw-version-editor__side\">\n @if (selection) {\n <pw-flows-node-inspector [node]=\"selection.node\"\n [definition]=\"selection.definition\"\n [fieldSuggestions]=\"selection.fieldSuggestions\"\n [fieldSources]=\"selection.fieldSources\"\n [listSuggestions]=\"selection.listSuggestions\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n [firstRun]=\"!!fields && !fields.ran\"\n (nodeChange)=\"updateSelected($event)\"\n (remove)=\"removeSelected()\"></pw-flows-node-inspector>\n } @else {\n <p class=\"pw-version-editor__hint\">{{ (readOnly ? 'Flows.Canvas.SelectToView' : 'Flows.Canvas.SelectToEdit') | transloco }}</p>\n }\n </div>\n </div>\n\n @if (view === 'json') {\n <pre class=\"pw-version-editor__json\"\n data-testid=\"flow-json\">{{ json }}</pre>\n }\n }\n }\n\n <div class=\"mb-3 col-12 text-end mt-3\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"cancel()\">\n {{ (readOnly ? 'Flows.Versions.Editor.Close' : 'Button.Cancel') | transloco }}\n </button>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"saving || loading || loadFailed\"\n (click)=\"save()\">\n {{ 'Button.Submit' | transloco }}\n </button>\n }\n </div>\n</div>\n",
|
|
5727
|
+
styles: [":host .pw-version-editor>h3{display:block;border-top:1px solid #e2e5ea;margin-top:2rem;padding-top:1.25rem}.pw-version-editor__toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:8px}.pw-version-editor__warning{display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid #b7791f;border-radius:4px;color:#b7791f}.pw-version-editor__workspace{display:grid;grid-template-columns:200px minmax(0,1fr) 300px;height:560px;border:1px solid #e2e5ea;border-radius:8px;overflow:hidden}.pw-version-editor__workspace.is-read-only{grid-template-columns:minmax(0,1fr) 300px}.pw-version-editor__palette,.pw-version-editor__side{overflow-y:auto;background:#fff}.pw-version-editor__palette{border-right:1px solid #e2e5ea}.pw-version-editor__side{border-left:1px solid #e2e5ea}.pw-version-editor__hint{margin:0;padding:16px;color:#7c8696}.pw-version-editor__json{max-height:560px;margin:0;padding:12px;overflow:auto;border:1px solid #e2e5ea;border-radius:8px;background:#f7f8fa}@media(max-width:991px){.pw-version-editor__workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:auto 420px auto;height:auto}.pw-version-editor__workspace.is-read-only{grid-template-columns:minmax(0,1fr);grid-template-rows:420px auto}.pw-version-editor__palette{max-height:200px;border-right:0;border-bottom:1px solid #e2e5ea}.pw-version-editor__side{border-left:0;border-top:1px solid #e2e5ea}}\n"],
|
|
4584
5728
|
dependencies: [
|
|
4585
5729
|
{
|
|
4586
5730
|
kind: "component",
|
|
4587
|
-
type:
|
|
5731
|
+
type: i4$1.AppLoaderComponent,
|
|
4588
5732
|
selector: "pw-loader",
|
|
4589
5733
|
inputs: [
|
|
4590
5734
|
"isVisible",
|
|
@@ -4594,13 +5738,13 @@ var FlowsVersionEditorComponent = class FlowsVersionEditorComponent {
|
|
|
4594
5738
|
},
|
|
4595
5739
|
{
|
|
4596
5740
|
kind: "component",
|
|
4597
|
-
type: i2.FieldErrorDisplayComponent,
|
|
5741
|
+
type: i2$1.FieldErrorDisplayComponent,
|
|
4598
5742
|
selector: "pw-field-error-display",
|
|
4599
5743
|
inputs: ["errorMsg", "displayError"]
|
|
4600
5744
|
},
|
|
4601
5745
|
{
|
|
4602
5746
|
kind: "component",
|
|
4603
|
-
type:
|
|
5747
|
+
type: i2$3.FaIconComponent,
|
|
4604
5748
|
selector: "fa-icon",
|
|
4605
5749
|
inputs: [
|
|
4606
5750
|
"icon",
|
|
@@ -4635,6 +5779,17 @@ var FlowsVersionEditorComponent = class FlowsVersionEditorComponent {
|
|
|
4635
5779
|
"a11yRoleChange"
|
|
4636
5780
|
]
|
|
4637
5781
|
},
|
|
5782
|
+
{
|
|
5783
|
+
kind: "component",
|
|
5784
|
+
type: FlowsGraphCheckComponent,
|
|
5785
|
+
selector: "pw-flows-graph-check",
|
|
5786
|
+
inputs: [
|
|
5787
|
+
"canvas",
|
|
5788
|
+
"definitions",
|
|
5789
|
+
"graph",
|
|
5790
|
+
"result"
|
|
5791
|
+
]
|
|
5792
|
+
},
|
|
4638
5793
|
{
|
|
4639
5794
|
kind: "component",
|
|
4640
5795
|
type: FlowsGraphCanvasComponent,
|
|
@@ -4642,6 +5797,7 @@ var FlowsVersionEditorComponent = class FlowsVersionEditorComponent {
|
|
|
4642
5797
|
inputs: [
|
|
4643
5798
|
"graph",
|
|
4644
5799
|
"definitions",
|
|
5800
|
+
"workflowFields",
|
|
4645
5801
|
"readOnly"
|
|
4646
5802
|
],
|
|
4647
5803
|
outputs: [
|
|
@@ -4666,13 +5822,21 @@ var FlowsVersionEditorComponent = class FlowsVersionEditorComponent {
|
|
|
4666
5822
|
"definition",
|
|
4667
5823
|
"subscriptionId",
|
|
4668
5824
|
"readOnly",
|
|
4669
|
-
"fieldSuggestions"
|
|
5825
|
+
"fieldSuggestions",
|
|
5826
|
+
"listSuggestions",
|
|
5827
|
+
"fieldSources",
|
|
5828
|
+
"firstRun"
|
|
4670
5829
|
],
|
|
4671
5830
|
outputs: ["nodeChange", "remove"]
|
|
4672
5831
|
},
|
|
4673
5832
|
{
|
|
4674
5833
|
kind: "pipe",
|
|
4675
|
-
type:
|
|
5834
|
+
type: i1$2.AsyncPipe,
|
|
5835
|
+
name: "async"
|
|
5836
|
+
},
|
|
5837
|
+
{
|
|
5838
|
+
kind: "pipe",
|
|
5839
|
+
type: i2$4.TranslocoPipe,
|
|
4676
5840
|
name: "transloco"
|
|
4677
5841
|
}
|
|
4678
5842
|
]
|
|
@@ -4689,19 +5853,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4689
5853
|
args: [{
|
|
4690
5854
|
selector: "pw-flows-version-editor",
|
|
4691
5855
|
standalone: false,
|
|
4692
|
-
template: "<div class=\"pw-version-editor mt-3\">\n <h3>{{ headingKey | transloco }}</h3>\n\n <pw-loader [isVisible]=\"loading\"></pw-loader>\n\n @if (!loading) {\n @if (loadFailed) {\n <pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Canvas.LoadFailed' | transloco\">\n </pw-field-error-display>\n } @else {\n <div class=\"pw-version-editor__toolbar\">\n <div class=\"btn-group\"\n role=\"tablist\">\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-canvas\"\n [class.active]=\"view === 'canvas'\"\n [attr.aria-selected]=\"view === 'canvas'\"\n (click)=\"show('canvas')\">\n <fa-icon [icon]=\"icons.diagram\"></fa-icon>\n {{ 'Flows.Canvas.Diagram' | transloco }}\n </button>\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-json\"\n [class.active]=\"view === 'json'\"\n [attr.aria-selected]=\"view === 'json'\"\n (click)=\"show('json')\">\n <fa-icon [icon]=\"icons.json\"></fa-icon>\n {{ 'Flows.Canvas.Json' | transloco }}\n </button>\n </div>\n @if (view === 'canvas') {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-fit\"\n (click)=\"canvas.zoomToFit()\">\n <fa-icon [icon]=\"icons.fit\"></fa-icon>\n {{ 'Flows.Canvas.Fit' | transloco }}\n </button>\n }\n </div>\n\n @if (dropped.length) {\n <p class=\"pw-version-editor__warning\"\n role=\"alert\"\n data-testid=\"flow-dropped-edges\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Canvas.Dropped' | transloco: { count: dropped.length } }}\n </p>\n }\n\n <div class=\"pw-version-editor__workspace\"\n [class.is-read-only]=\"readOnly\"\n [hidden]=\"view !== 'canvas'\">\n @if (!readOnly) {\n <pw-flows-node-palette class=\"pw-version-editor__palette\"\n [definitions]=\"definitions\"\n (add)=\"canvas.addNode($event)\"></pw-flows-node-palette>\n }\n <pw-flows-graph-canvas #canvas\n class=\"pw-version-editor__canvas\"\n [graph]=\"graph\"\n [definitions]=\"definitions\"\n [readOnly]=\"readOnly\"\n (selectionChange)=\"select($event)\"\n (dropped)=\"dropped = $event\"></pw-flows-graph-canvas>\n <div class=\"pw-version-editor__side\">\n @if (selection) {\n <pw-flows-node-inspector [node]=\"selection.node\"\n [definition]=\"selection.definition\"\n [fieldSuggestions]=\"selection.fieldSuggestions\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (nodeChange)=\"updateSelected($event)\"\n (remove)=\"removeSelected()\"></pw-flows-node-inspector>\n } @else {\n <p class=\"pw-version-editor__hint\">{{ (readOnly ? 'Flows.Canvas.SelectToView' : 'Flows.Canvas.SelectToEdit') | transloco }}</p>\n }\n </div>\n </div>\n\n @if (view === 'json') {\n <pre class=\"pw-version-editor__json\"\n data-testid=\"flow-json\">{{ json }}</pre>\n }\n }\n }\n\n <div class=\"mb-3 col-12 text-end mt-3\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"cancel()\">\n {{ (readOnly ? 'Flows.Versions.Editor.Close' : 'Button.Cancel') | transloco }}\n </button>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"saving || loading || loadFailed\"\n (click)=\"save()\">\n {{ 'Button.Submit' | transloco }}\n </button>\n }\n </div>\n</div>\n",
|
|
4693
|
-
styles: [":host .pw-version-editor>h3{display:block;border-top:1px solid #e2e5ea;margin-top:2rem;padding-top:1.25rem}.pw-version-editor__toolbar{display:flex;align-items:center;
|
|
5856
|
+
template: "<div class=\"pw-version-editor mt-3\">\n <h3>{{ headingKey | transloco: { number: duplicateOf?.version } }}</h3>\n\n <pw-loader [isVisible]=\"loading\"></pw-loader>\n\n @if (!loading) {\n @if (loadFailed) {\n <pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Canvas.LoadFailed' | transloco\">\n </pw-field-error-display>\n } @else {\n <div class=\"pw-version-editor__toolbar\">\n <div class=\"btn-group me-auto\"\n role=\"tablist\">\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-canvas\"\n [class.active]=\"view === 'canvas'\"\n [attr.aria-selected]=\"view === 'canvas'\"\n (click)=\"show('canvas')\">\n <fa-icon [icon]=\"icons.diagram\"></fa-icon>\n {{ 'Flows.Canvas.Diagram' | transloco }}\n </button>\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-json\"\n [class.active]=\"view === 'json'\"\n [attr.aria-selected]=\"view === 'json'\"\n (click)=\"show('json')\">\n <fa-icon [icon]=\"icons.json\"></fa-icon>\n {{ 'Flows.Canvas.Json' | transloco }}\n </button>\n </div>\n @if (view === 'canvas') {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-fit\"\n (click)=\"canvas.zoomToFit()\">\n <fa-icon [icon]=\"icons.fit\"></fa-icon>\n {{ 'Flows.Canvas.Fit' | transloco }}\n </button>\n }\n </div>\n\n @if (check && !readOnly) {\n <pw-flows-graph-check [canvas]=\"canvas\"\n [definitions]=\"definitions\"\n [graph]=\"graph\"\n [result]=\"check\"></pw-flows-graph-check>\n }\n\n @if (dropped.length) {\n <p class=\"pw-version-editor__warning\"\n role=\"alert\"\n data-testid=\"flow-dropped-edges\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Canvas.Dropped' | transloco: { count: dropped.length } }}\n </p>\n }\n\n @let fields = workflowFields$ | async;\n <div class=\"pw-version-editor__workspace\"\n [class.is-read-only]=\"readOnly\"\n [hidden]=\"view !== 'canvas'\">\n @if (!readOnly) {\n <pw-flows-node-palette class=\"pw-version-editor__palette\"\n [definitions]=\"definitions\"\n (add)=\"canvas.addNode($event)\"></pw-flows-node-palette>\n }\n <pw-flows-graph-canvas #canvas\n class=\"pw-version-editor__canvas\"\n [graph]=\"graph\"\n [definitions]=\"definitions\"\n [workflowFields]=\"fields\"\n [readOnly]=\"readOnly\"\n (selectionChange)=\"select($event)\"\n (dropped)=\"dropped = $event\"></pw-flows-graph-canvas>\n <div class=\"pw-version-editor__side\">\n @if (selection) {\n <pw-flows-node-inspector [node]=\"selection.node\"\n [definition]=\"selection.definition\"\n [fieldSuggestions]=\"selection.fieldSuggestions\"\n [fieldSources]=\"selection.fieldSources\"\n [listSuggestions]=\"selection.listSuggestions\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n [firstRun]=\"!!fields && !fields.ran\"\n (nodeChange)=\"updateSelected($event)\"\n (remove)=\"removeSelected()\"></pw-flows-node-inspector>\n } @else {\n <p class=\"pw-version-editor__hint\">{{ (readOnly ? 'Flows.Canvas.SelectToView' : 'Flows.Canvas.SelectToEdit') | transloco }}</p>\n }\n </div>\n </div>\n\n @if (view === 'json') {\n <pre class=\"pw-version-editor__json\"\n data-testid=\"flow-json\">{{ json }}</pre>\n }\n }\n }\n\n <div class=\"mb-3 col-12 text-end mt-3\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"cancel()\">\n {{ (readOnly ? 'Flows.Versions.Editor.Close' : 'Button.Cancel') | transloco }}\n </button>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"saving || loading || loadFailed\"\n (click)=\"save()\">\n {{ 'Button.Submit' | transloco }}\n </button>\n }\n </div>\n</div>\n",
|
|
5857
|
+
styles: [":host .pw-version-editor>h3{display:block;border-top:1px solid #e2e5ea;margin-top:2rem;padding-top:1.25rem}.pw-version-editor__toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:8px}.pw-version-editor__warning{display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid #b7791f;border-radius:4px;color:#b7791f}.pw-version-editor__workspace{display:grid;grid-template-columns:200px minmax(0,1fr) 300px;height:560px;border:1px solid #e2e5ea;border-radius:8px;overflow:hidden}.pw-version-editor__workspace.is-read-only{grid-template-columns:minmax(0,1fr) 300px}.pw-version-editor__palette,.pw-version-editor__side{overflow-y:auto;background:#fff}.pw-version-editor__palette{border-right:1px solid #e2e5ea}.pw-version-editor__side{border-left:1px solid #e2e5ea}.pw-version-editor__hint{margin:0;padding:16px;color:#7c8696}.pw-version-editor__json{max-height:560px;margin:0;padding:12px;overflow:auto;border:1px solid #e2e5ea;border-radius:8px;background:#f7f8fa}@media(max-width:991px){.pw-version-editor__workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:auto 420px auto;height:auto}.pw-version-editor__workspace.is-read-only{grid-template-columns:minmax(0,1fr);grid-template-rows:420px auto}.pw-version-editor__palette{max-height:200px;border-right:0;border-bottom:1px solid #e2e5ea}.pw-version-editor__side{border-left:0;border-top:1px solid #e2e5ea}}\n"]
|
|
4694
5858
|
}]
|
|
4695
5859
|
}],
|
|
4696
5860
|
ctorParameters: () => [
|
|
4697
5861
|
{ type: FlowsWorkflowService },
|
|
4698
5862
|
{ type: FlowsNodeService },
|
|
5863
|
+
{ type: FlowsRunService },
|
|
4699
5864
|
{ type: i0.ChangeDetectorRef }
|
|
4700
5865
|
],
|
|
4701
5866
|
propDecorators: {
|
|
4702
5867
|
version: [{ type: Input }],
|
|
5868
|
+
duplicateOf: [{ type: Input }],
|
|
4703
5869
|
workflowId: [{ type: Input }],
|
|
4704
5870
|
subscriptionId: [{ type: Input }],
|
|
5871
|
+
check: [{ type: Input }],
|
|
4705
5872
|
saved: [{ type: Output }],
|
|
4706
5873
|
cancelled: [{ type: Output }],
|
|
4707
5874
|
canvas: [{
|
|
@@ -4722,8 +5889,7 @@ var FlowsWorkflowVersionsComponent = class FlowsWorkflowVersionsComponent extend
|
|
|
4722
5889
|
this.workflowName = "";
|
|
4723
5890
|
this.versions = [];
|
|
4724
5891
|
this.totalRecords = 0;
|
|
4725
|
-
this.
|
|
4726
|
-
this.editorVersion = null;
|
|
5892
|
+
this.editor = new FlowVersionEditorState();
|
|
4727
5893
|
this.requestedVersionId = null;
|
|
4728
5894
|
this.icons = FLOWS_ICONS;
|
|
4729
5895
|
this.isPublished = isFlowVersionPublished;
|
|
@@ -4749,13 +5915,14 @@ var FlowsWorkflowVersionsComponent = class FlowsWorkflowVersionsComponent extend
|
|
|
4749
5915
|
this.destroy$.next();
|
|
4750
5916
|
this.destroy$.complete();
|
|
4751
5917
|
}
|
|
4752
|
-
openEditor(version = null) {
|
|
4753
|
-
this.
|
|
4754
|
-
|
|
5918
|
+
openEditor(version = null, duplicateOf = null) {
|
|
5919
|
+
this.editor.show(version, duplicateOf);
|
|
5920
|
+
}
|
|
5921
|
+
duplicate(version) {
|
|
5922
|
+
this.openEditor(null, version);
|
|
4755
5923
|
}
|
|
4756
5924
|
closeEditor() {
|
|
4757
|
-
this.
|
|
4758
|
-
this.editorVersion = null;
|
|
5925
|
+
this.editor.close();
|
|
4759
5926
|
}
|
|
4760
5927
|
onVersionSaved() {
|
|
4761
5928
|
this.closeEditor();
|
|
@@ -4764,18 +5931,21 @@ var FlowsWorkflowVersionsComponent = class FlowsWorkflowVersionsComponent extend
|
|
|
4764
5931
|
publish(version) {
|
|
4765
5932
|
if (this.publishing) return;
|
|
4766
5933
|
this.publishing = true;
|
|
4767
|
-
this.workflowService.
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
error: () => {
|
|
4774
|
-
this.publishing = false;
|
|
4775
|
-
this.cdr.markForCheck();
|
|
4776
|
-
}
|
|
5934
|
+
this.workflowService.publishChecked(this.workflowId, version, this.subscriptionId).pipe(finalize(() => {
|
|
5935
|
+
this.publishing = false;
|
|
5936
|
+
this.cdr.markForCheck();
|
|
5937
|
+
}), takeUntil(this.destroy$)).subscribe({
|
|
5938
|
+
next: (outcome) => this.publishOutcome(version, outcome),
|
|
5939
|
+
error: () => null
|
|
4777
5940
|
});
|
|
4778
5941
|
}
|
|
5942
|
+
publishOutcome(version, outcome) {
|
|
5943
|
+
if ("valid" in outcome) this.editor.show(version, null, outcome);
|
|
5944
|
+
else {
|
|
5945
|
+
this.editor.published(outcome);
|
|
5946
|
+
this.load();
|
|
5947
|
+
}
|
|
5948
|
+
}
|
|
4779
5949
|
back() {
|
|
4780
5950
|
this.router.navigate(["workflows"], { relativeTo: this.route.parent });
|
|
4781
5951
|
}
|
|
@@ -4807,7 +5977,7 @@ var FlowsWorkflowVersionsComponent = class FlowsWorkflowVersionsComponent extend
|
|
|
4807
5977
|
openRequestedVersion() {
|
|
4808
5978
|
const version = this.versions.find(({ id }) => id === this.requestedVersionId);
|
|
4809
5979
|
this.requestedVersionId = null;
|
|
4810
|
-
if (version) this.openEditor(version);
|
|
5980
|
+
if (version || !this.totalRecords && !this.editor.open) this.openEditor(version ?? null);
|
|
4811
5981
|
}
|
|
4812
5982
|
settle() {
|
|
4813
5983
|
this.loading = false;
|
|
@@ -4837,22 +6007,25 @@ var FlowsWorkflowVersionsComponent = class FlowsWorkflowVersionsComponent extend
|
|
|
4837
6007
|
selector: "pw-flows-workflow-versions",
|
|
4838
6008
|
usesInheritance: true,
|
|
4839
6009
|
ngImport: i0,
|
|
4840
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">\n {{ 'Flows.Versions.Title' | transloco }}\n @if (workflowName) {\n <span class=\"pw-versions-subject\">{{ workflowName }}</span>\n }\n </h2>\n <div>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary me-2\"\n [disabled]=\"
|
|
6010
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">\n {{ 'Flows.Versions.Title' | transloco }}\n @if (workflowName) {\n <span class=\"pw-versions-subject\">{{ workflowName }}</span>\n }\n </h2>\n <div>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary me-2\"\n [disabled]=\"editor.open\"\n (click)=\"openEditor()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Versions.Create' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-secondary\"\n (click)=\"back()\">\n <fa-icon [icon]=\"icons.back\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Back' | transloco }}\n </button>\n </div>\n </div>\n</div>\n\n@if (loading) {\n<pw-skeleton-table [rows]=\"8\" [columns]=\"5\" [showCaption]=\"false\" />\n}\n\n@if (!loading) {\n@if (notFound) {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Versions.NotFound' | transloco\"></pw-no-data>\n} @else {\n@if (versions.length > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table [value]=\"versions\">\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Version' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.State' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Published' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Created' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-version>\n <tr>\n <td data-head=\"Version\">{{ version.version }}</td>\n <td data-head=\"State\">\n <span [class]=\"badgeClass(version)\">\n {{ (isPublished(version) ? 'Flows.Versions.State.Published' : 'Flows.Versions.State.Draft') | transloco }}\n </span>\n </td>\n <td data-head=\"Published\">\n {{ version.published_at ? (version.published_at | dateFormat) : '—' }}\n </td>\n <td data-head=\"Created\">{{ version.created_at | dateFormat }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"(isPublished(version) ? 'Flows.Versions.Action.View' : 'Flows.Versions.Action.Edit') | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon [class]=\"isPublished(version) ? 'cta1-icon' : 'edit-icon'\"\n [icon]=\"isPublished(version) ? icons.inspect : icons.edit\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"(isPublished(version) ? 'Flows.Versions.Action.View' : 'Flows.Versions.Action.Edit') | transloco\"\n (click)=\"openEditor(version)\"\n (keydown.enter)=\"openEditor(version)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Versions.Action.Duplicate' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.duplicate\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Versions.Action.Duplicate' | transloco\"\n (click)=\"duplicate(version)\"\n (keydown.enter)=\"duplicate(version)\"></fa-icon>\n </li>\n <!-- Hiding this is courtesy; protect_endpoint! is the control. -->\n @if (!isPublished(version) && canPublish) {\n <li [pTooltip]=\"'Flows.Versions.Action.Publish' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.publish\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Versions.Action.Publish' | transloco\"\n (click)=\"publish(version)\"\n (keydown.enter)=\"publish(version)\"></fa-icon>\n </li>\n }\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"versions.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Versions.Empty' | transloco\" [description]=\"'Flows.Versions.EmptyDescription' | transloco\"></pw-no-data>\n}\n\n@if (editor.open) {\n<pw-flows-version-editor [version]=\"editor.version\"\n [duplicateOf]=\"editor.duplicateOf\"\n [workflowId]=\"workflowId\"\n [subscriptionId]=\"subscriptionId\"\n [check]=\"editor.check\"\n (saved)=\"onVersionSaved()\"\n (cancelled)=\"closeEditor()\">\n</pw-flows-version-editor>\n}\n}\n}\n",
|
|
4841
6011
|
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.pw-versions-subject{margin-left:.5rem;color:#5a6473;font-weight:400}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}\n"],
|
|
4842
6012
|
dependencies: [
|
|
4843
6013
|
{
|
|
4844
6014
|
kind: "component",
|
|
4845
|
-
type:
|
|
4846
|
-
selector: "pw-
|
|
6015
|
+
type: i4$1.SkeletonTableComponent,
|
|
6016
|
+
selector: "pw-skeleton-table",
|
|
4847
6017
|
inputs: [
|
|
4848
|
-
"
|
|
4849
|
-
"
|
|
4850
|
-
"
|
|
6018
|
+
"rows",
|
|
6019
|
+
"columns",
|
|
6020
|
+
"showHeader",
|
|
6021
|
+
"showCaption",
|
|
6022
|
+
"density",
|
|
6023
|
+
"delay"
|
|
4851
6024
|
]
|
|
4852
6025
|
},
|
|
4853
6026
|
{
|
|
4854
6027
|
kind: "directive",
|
|
4855
|
-
type:
|
|
6028
|
+
type: i1$1.Tooltip,
|
|
4856
6029
|
selector: "[pTooltip]",
|
|
4857
6030
|
inputs: [
|
|
4858
6031
|
"tooltipPosition",
|
|
@@ -4880,7 +6053,7 @@ var FlowsWorkflowVersionsComponent = class FlowsWorkflowVersionsComponent extend
|
|
|
4880
6053
|
},
|
|
4881
6054
|
{
|
|
4882
6055
|
kind: "component",
|
|
4883
|
-
type:
|
|
6056
|
+
type: i5.Table,
|
|
4884
6057
|
selector: "p-table",
|
|
4885
6058
|
inputs: [
|
|
4886
6059
|
"frozenColumns",
|
|
@@ -4993,7 +6166,7 @@ var FlowsWorkflowVersionsComponent = class FlowsWorkflowVersionsComponent extend
|
|
|
4993
6166
|
},
|
|
4994
6167
|
{
|
|
4995
6168
|
kind: "component",
|
|
4996
|
-
type:
|
|
6169
|
+
type: i6.NoDataComponent,
|
|
4997
6170
|
selector: "pw-no-data",
|
|
4998
6171
|
inputs: [
|
|
4999
6172
|
"message",
|
|
@@ -5003,13 +6176,13 @@ var FlowsWorkflowVersionsComponent = class FlowsWorkflowVersionsComponent extend
|
|
|
5003
6176
|
},
|
|
5004
6177
|
{
|
|
5005
6178
|
kind: "component",
|
|
5006
|
-
type:
|
|
6179
|
+
type: i6.RecordsSummaryComponent,
|
|
5007
6180
|
selector: "pw-records-summary",
|
|
5008
6181
|
inputs: ["showing", "total"]
|
|
5009
6182
|
},
|
|
5010
6183
|
{
|
|
5011
6184
|
kind: "component",
|
|
5012
|
-
type:
|
|
6185
|
+
type: i2$3.FaIconComponent,
|
|
5013
6186
|
selector: "fa-icon",
|
|
5014
6187
|
inputs: [
|
|
5015
6188
|
"icon",
|
|
@@ -5050,20 +6223,22 @@ var FlowsWorkflowVersionsComponent = class FlowsWorkflowVersionsComponent extend
|
|
|
5050
6223
|
selector: "pw-flows-version-editor",
|
|
5051
6224
|
inputs: [
|
|
5052
6225
|
"version",
|
|
6226
|
+
"duplicateOf",
|
|
5053
6227
|
"workflowId",
|
|
5054
|
-
"subscriptionId"
|
|
6228
|
+
"subscriptionId",
|
|
6229
|
+
"check"
|
|
5055
6230
|
],
|
|
5056
6231
|
outputs: ["saved", "cancelled"]
|
|
5057
6232
|
},
|
|
5058
6233
|
{
|
|
5059
6234
|
kind: "pipe",
|
|
5060
|
-
type:
|
|
5061
|
-
name: "
|
|
6235
|
+
type: i2$4.TranslocoPipe,
|
|
6236
|
+
name: "transloco"
|
|
5062
6237
|
},
|
|
5063
6238
|
{
|
|
5064
6239
|
kind: "pipe",
|
|
5065
|
-
type:
|
|
5066
|
-
name: "
|
|
6240
|
+
type: i13.DateFormatPipe,
|
|
6241
|
+
name: "dateFormat"
|
|
5067
6242
|
}
|
|
5068
6243
|
]
|
|
5069
6244
|
});
|
|
@@ -5079,7 +6254,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5079
6254
|
args: [{
|
|
5080
6255
|
selector: "pw-flows-workflow-versions",
|
|
5081
6256
|
standalone: false,
|
|
5082
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">\n {{ 'Flows.Versions.Title' | transloco }}\n @if (workflowName) {\n <span class=\"pw-versions-subject\">{{ workflowName }}</span>\n }\n </h2>\n <div>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary me-2\"\n [disabled]=\"
|
|
6257
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">\n {{ 'Flows.Versions.Title' | transloco }}\n @if (workflowName) {\n <span class=\"pw-versions-subject\">{{ workflowName }}</span>\n }\n </h2>\n <div>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary me-2\"\n [disabled]=\"editor.open\"\n (click)=\"openEditor()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Versions.Create' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-secondary\"\n (click)=\"back()\">\n <fa-icon [icon]=\"icons.back\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Back' | transloco }}\n </button>\n </div>\n </div>\n</div>\n\n@if (loading) {\n<pw-skeleton-table [rows]=\"8\" [columns]=\"5\" [showCaption]=\"false\" />\n}\n\n@if (!loading) {\n@if (notFound) {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Versions.NotFound' | transloco\"></pw-no-data>\n} @else {\n@if (versions.length > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table [value]=\"versions\">\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Version' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.State' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Published' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Created' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-version>\n <tr>\n <td data-head=\"Version\">{{ version.version }}</td>\n <td data-head=\"State\">\n <span [class]=\"badgeClass(version)\">\n {{ (isPublished(version) ? 'Flows.Versions.State.Published' : 'Flows.Versions.State.Draft') | transloco }}\n </span>\n </td>\n <td data-head=\"Published\">\n {{ version.published_at ? (version.published_at | dateFormat) : '—' }}\n </td>\n <td data-head=\"Created\">{{ version.created_at | dateFormat }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"(isPublished(version) ? 'Flows.Versions.Action.View' : 'Flows.Versions.Action.Edit') | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon [class]=\"isPublished(version) ? 'cta1-icon' : 'edit-icon'\"\n [icon]=\"isPublished(version) ? icons.inspect : icons.edit\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"(isPublished(version) ? 'Flows.Versions.Action.View' : 'Flows.Versions.Action.Edit') | transloco\"\n (click)=\"openEditor(version)\"\n (keydown.enter)=\"openEditor(version)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Versions.Action.Duplicate' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.duplicate\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Versions.Action.Duplicate' | transloco\"\n (click)=\"duplicate(version)\"\n (keydown.enter)=\"duplicate(version)\"></fa-icon>\n </li>\n <!-- Hiding this is courtesy; protect_endpoint! is the control. -->\n @if (!isPublished(version) && canPublish) {\n <li [pTooltip]=\"'Flows.Versions.Action.Publish' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.publish\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Versions.Action.Publish' | transloco\"\n (click)=\"publish(version)\"\n (keydown.enter)=\"publish(version)\"></fa-icon>\n </li>\n }\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"versions.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Versions.Empty' | transloco\" [description]=\"'Flows.Versions.EmptyDescription' | transloco\"></pw-no-data>\n}\n\n@if (editor.open) {\n<pw-flows-version-editor [version]=\"editor.version\"\n [duplicateOf]=\"editor.duplicateOf\"\n [workflowId]=\"workflowId\"\n [subscriptionId]=\"subscriptionId\"\n [check]=\"editor.check\"\n (saved)=\"onVersionSaved()\"\n (cancelled)=\"closeEditor()\">\n</pw-flows-version-editor>\n}\n}\n}\n",
|
|
5083
6258
|
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.pw-versions-subject{margin-left:.5rem;color:#5a6473;font-weight:400}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}\n"]
|
|
5084
6259
|
}]
|
|
5085
6260
|
}],
|
|
@@ -5205,7 +6380,7 @@ var FlowsWorkflowsComponent = class FlowsWorkflowsComponent extends AppBaseCompo
|
|
|
5205
6380
|
deps: [
|
|
5206
6381
|
{ token: i0.Injector },
|
|
5207
6382
|
{ token: FlowsWorkflowService },
|
|
5208
|
-
{ token:
|
|
6383
|
+
{ token: i6.ConfirmDialogService },
|
|
5209
6384
|
{ token: i0.ChangeDetectorRef }
|
|
5210
6385
|
],
|
|
5211
6386
|
target: i0.ɵɵFactoryTarget.Component
|
|
@@ -5220,17 +6395,17 @@ var FlowsWorkflowsComponent = class FlowsWorkflowsComponent extends AppBaseCompo
|
|
|
5220
6395
|
selector: "pw-flows-workflows",
|
|
5221
6396
|
usesInheritance: true,
|
|
5222
6397
|
ngImport: i0,
|
|
5223
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Workflows.Title' | transloco }}</h2>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"createWorkflow()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Create' | transloco }}\n </button>\n </div>\n</div>\n\n<pw-
|
|
6398
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Workflows.Title' | transloco }}</h2>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"createWorkflow()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Create' | transloco }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n<pw-skeleton-table [rows]=\"8\" [columns]=\"5\" [showCaption]=\"true\" />\n}\n\n@if (!loading) {\n@if (totalRecordsUnFilter > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table #dt\n [value]=\"workflows\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n filterDelay=\"1000\">\n <ng-template #caption>\n <div class=\"search-filter\">\n <div class=\"col-12 col-sm-4\">\n <p-select inputId=\"flows-workflows-status\"\n [options]=\"statusOptions\"\n optionValue=\"value\"\n [placeholder]=\"'Flows.Workflows.Filter.Status' | transloco\"\n [showClear]=\"true\"\n [(ngModel)]=\"status\"\n (onChange)=\"filterByStatus($event.value)\"\n appendTo=\"body\">\n </p-select>\n </div>\n <!-- No ngModel — onLazyLoad is the single writer of searchText. -->\n <div class=\"text-end\">\n <label for=\"flows-workflows-search\"\n class=\"visually-hidden\">{{ 'Flows.Workflows.Filter.SearchLabel' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><fa-icon [icon]=\"icons.search\"\n aria-hidden=\"true\"></fa-icon></p-inputicon>\n <input #searchInput\n type=\"text\"\n id=\"flows-workflows-search\"\n name=\"flows-workflows-search\"\n pInputText\n [placeholder]=\"'Flows.Workflows.Filter.Search' | transloco\"\n (input)=\"dt.filterGlobal(searchInput.value, 'contains')\" />\n </p-iconfield>\n </div>\n </div>\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Name' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Description' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Created' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-workflow>\n <tr>\n <td data-head=\"Name\">{{ workflow.name }}</td>\n <td data-head=\"Description\">{{ workflow.description || '—' }}</td>\n <td data-head=\"Status\">\n <span [class]=\"badgeClass(workflow.status)\">\n {{ 'Flows.WorkflowStatus.' + workflow.status | transloco }}\n </span>\n </td>\n <td data-head=\"Created\">{{ workflow.created_at | dateFormat }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"'Flows.Workflows.Action.Versions' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.versions\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Versions' | transloco\"\n (click)=\"openVersions(workflow)\"\n (keydown.enter)=\"openVersions(workflow)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Workflows.Action.Edit' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"edit-icon\"\n [icon]=\"icons.edit\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Edit' | transloco\"\n (click)=\"editWorkflow(workflow)\"\n (keydown.enter)=\"editWorkflow(workflow)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Workflows.Action.Delete' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"delete-icon\"\n [icon]=\"icons.delete\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Delete' | transloco\"\n (click)=\"deleteWorkflow(workflow)\"\n (keydown.enter)=\"deleteWorkflow(workflow)\"></fa-icon>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"workflows.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Workflows.Empty' | transloco\" [description]=\"'Flows.Workflows.EmptyDescription' | transloco\"></pw-no-data>\n}\n}\n",
|
|
5224
6399
|
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}.primeng-datatable-container td[data-head=Name]{min-width:200px;font-weight:600;color:#1a1d21}.primeng-datatable-container td[data-head=Description]{min-width:220px;color:#5a6473}\n"],
|
|
5225
6400
|
dependencies: [
|
|
5226
6401
|
{
|
|
5227
6402
|
kind: "directive",
|
|
5228
|
-
type: i3$
|
|
6403
|
+
type: i3$2.NgControlStatus,
|
|
5229
6404
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
5230
6405
|
},
|
|
5231
6406
|
{
|
|
5232
6407
|
kind: "directive",
|
|
5233
|
-
type: i3$
|
|
6408
|
+
type: i3$2.NgModel,
|
|
5234
6409
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
5235
6410
|
inputs: [
|
|
5236
6411
|
"name",
|
|
@@ -5243,17 +6418,20 @@ var FlowsWorkflowsComponent = class FlowsWorkflowsComponent extends AppBaseCompo
|
|
|
5243
6418
|
},
|
|
5244
6419
|
{
|
|
5245
6420
|
kind: "component",
|
|
5246
|
-
type:
|
|
5247
|
-
selector: "pw-
|
|
6421
|
+
type: i4$1.SkeletonTableComponent,
|
|
6422
|
+
selector: "pw-skeleton-table",
|
|
5248
6423
|
inputs: [
|
|
5249
|
-
"
|
|
5250
|
-
"
|
|
5251
|
-
"
|
|
6424
|
+
"rows",
|
|
6425
|
+
"columns",
|
|
6426
|
+
"showHeader",
|
|
6427
|
+
"showCaption",
|
|
6428
|
+
"density",
|
|
6429
|
+
"delay"
|
|
5252
6430
|
]
|
|
5253
6431
|
},
|
|
5254
6432
|
{
|
|
5255
6433
|
kind: "directive",
|
|
5256
|
-
type:
|
|
6434
|
+
type: i1$1.Tooltip,
|
|
5257
6435
|
selector: "[pTooltip]",
|
|
5258
6436
|
inputs: [
|
|
5259
6437
|
"tooltipPosition",
|
|
@@ -5281,7 +6459,7 @@ var FlowsWorkflowsComponent = class FlowsWorkflowsComponent extends AppBaseCompo
|
|
|
5281
6459
|
},
|
|
5282
6460
|
{
|
|
5283
6461
|
kind: "component",
|
|
5284
|
-
type:
|
|
6462
|
+
type: i5.Table,
|
|
5285
6463
|
selector: "p-table",
|
|
5286
6464
|
inputs: [
|
|
5287
6465
|
"frozenColumns",
|
|
@@ -5464,7 +6642,7 @@ var FlowsWorkflowsComponent = class FlowsWorkflowsComponent extends AppBaseCompo
|
|
|
5464
6642
|
},
|
|
5465
6643
|
{
|
|
5466
6644
|
kind: "component",
|
|
5467
|
-
type:
|
|
6645
|
+
type: i6.NoDataComponent,
|
|
5468
6646
|
selector: "pw-no-data",
|
|
5469
6647
|
inputs: [
|
|
5470
6648
|
"message",
|
|
@@ -5474,13 +6652,13 @@ var FlowsWorkflowsComponent = class FlowsWorkflowsComponent extends AppBaseCompo
|
|
|
5474
6652
|
},
|
|
5475
6653
|
{
|
|
5476
6654
|
kind: "component",
|
|
5477
|
-
type:
|
|
6655
|
+
type: i6.RecordsSummaryComponent,
|
|
5478
6656
|
selector: "pw-records-summary",
|
|
5479
6657
|
inputs: ["showing", "total"]
|
|
5480
6658
|
},
|
|
5481
6659
|
{
|
|
5482
6660
|
kind: "component",
|
|
5483
|
-
type:
|
|
6661
|
+
type: i2$3.FaIconComponent,
|
|
5484
6662
|
selector: "fa-icon",
|
|
5485
6663
|
inputs: [
|
|
5486
6664
|
"icon",
|
|
@@ -5543,13 +6721,13 @@ var FlowsWorkflowsComponent = class FlowsWorkflowsComponent extends AppBaseCompo
|
|
|
5543
6721
|
},
|
|
5544
6722
|
{
|
|
5545
6723
|
kind: "pipe",
|
|
5546
|
-
type:
|
|
5547
|
-
name: "
|
|
6724
|
+
type: i2$4.TranslocoPipe,
|
|
6725
|
+
name: "transloco"
|
|
5548
6726
|
},
|
|
5549
6727
|
{
|
|
5550
6728
|
kind: "pipe",
|
|
5551
|
-
type:
|
|
5552
|
-
name: "
|
|
6729
|
+
type: i13.DateFormatPipe,
|
|
6730
|
+
name: "dateFormat"
|
|
5553
6731
|
}
|
|
5554
6732
|
]
|
|
5555
6733
|
});
|
|
@@ -5565,14 +6743,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5565
6743
|
args: [{
|
|
5566
6744
|
selector: "pw-flows-workflows",
|
|
5567
6745
|
standalone: false,
|
|
5568
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Workflows.Title' | transloco }}</h2>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"createWorkflow()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Create' | transloco }}\n </button>\n </div>\n</div>\n\n<pw-
|
|
6746
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Workflows.Title' | transloco }}</h2>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"createWorkflow()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Create' | transloco }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n<pw-skeleton-table [rows]=\"8\" [columns]=\"5\" [showCaption]=\"true\" />\n}\n\n@if (!loading) {\n@if (totalRecordsUnFilter > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table #dt\n [value]=\"workflows\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n filterDelay=\"1000\">\n <ng-template #caption>\n <div class=\"search-filter\">\n <div class=\"col-12 col-sm-4\">\n <p-select inputId=\"flows-workflows-status\"\n [options]=\"statusOptions\"\n optionValue=\"value\"\n [placeholder]=\"'Flows.Workflows.Filter.Status' | transloco\"\n [showClear]=\"true\"\n [(ngModel)]=\"status\"\n (onChange)=\"filterByStatus($event.value)\"\n appendTo=\"body\">\n </p-select>\n </div>\n <!-- No ngModel — onLazyLoad is the single writer of searchText. -->\n <div class=\"text-end\">\n <label for=\"flows-workflows-search\"\n class=\"visually-hidden\">{{ 'Flows.Workflows.Filter.SearchLabel' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><fa-icon [icon]=\"icons.search\"\n aria-hidden=\"true\"></fa-icon></p-inputicon>\n <input #searchInput\n type=\"text\"\n id=\"flows-workflows-search\"\n name=\"flows-workflows-search\"\n pInputText\n [placeholder]=\"'Flows.Workflows.Filter.Search' | transloco\"\n (input)=\"dt.filterGlobal(searchInput.value, 'contains')\" />\n </p-iconfield>\n </div>\n </div>\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Name' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Description' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Created' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-workflow>\n <tr>\n <td data-head=\"Name\">{{ workflow.name }}</td>\n <td data-head=\"Description\">{{ workflow.description || '—' }}</td>\n <td data-head=\"Status\">\n <span [class]=\"badgeClass(workflow.status)\">\n {{ 'Flows.WorkflowStatus.' + workflow.status | transloco }}\n </span>\n </td>\n <td data-head=\"Created\">{{ workflow.created_at | dateFormat }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"'Flows.Workflows.Action.Versions' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.versions\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Versions' | transloco\"\n (click)=\"openVersions(workflow)\"\n (keydown.enter)=\"openVersions(workflow)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Workflows.Action.Edit' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"edit-icon\"\n [icon]=\"icons.edit\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Edit' | transloco\"\n (click)=\"editWorkflow(workflow)\"\n (keydown.enter)=\"editWorkflow(workflow)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Workflows.Action.Delete' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"delete-icon\"\n [icon]=\"icons.delete\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Delete' | transloco\"\n (click)=\"deleteWorkflow(workflow)\"\n (keydown.enter)=\"deleteWorkflow(workflow)\"></fa-icon>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"workflows.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Workflows.Empty' | transloco\" [description]=\"'Flows.Workflows.EmptyDescription' | transloco\"></pw-no-data>\n}\n}\n",
|
|
5569
6747
|
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}.primeng-datatable-container td[data-head=Name]{min-width:200px;font-weight:600;color:#1a1d21}.primeng-datatable-container td[data-head=Description]{min-width:220px;color:#5a6473}\n"]
|
|
5570
6748
|
}]
|
|
5571
6749
|
}],
|
|
5572
6750
|
ctorParameters: () => [
|
|
5573
6751
|
{ type: i0.Injector },
|
|
5574
6752
|
{ type: FlowsWorkflowService },
|
|
5575
|
-
{ type:
|
|
6753
|
+
{ type: i6.ConfirmDialogService },
|
|
5576
6754
|
{ type: i0.ChangeDetectorRef }
|
|
5577
6755
|
]
|
|
5578
6756
|
});
|
|
@@ -5634,7 +6812,7 @@ var FlowsPrivateRoutingModule = class FlowsPrivateRoutingModule {
|
|
|
5634
6812
|
version: "22.2.0",
|
|
5635
6813
|
ngImport: i0,
|
|
5636
6814
|
type: FlowsPrivateRoutingModule,
|
|
5637
|
-
imports: [
|
|
6815
|
+
imports: [i8.RouterModule],
|
|
5638
6816
|
exports: [RouterModule]
|
|
5639
6817
|
});
|
|
5640
6818
|
}
|
|
@@ -5684,11 +6862,14 @@ var FlowsPrivateModule = class FlowsPrivateModule {
|
|
|
5684
6862
|
FlowsWorkflowFormComponent,
|
|
5685
6863
|
FlowsWorkflowVersionsComponent,
|
|
5686
6864
|
FlowsVersionEditorComponent,
|
|
6865
|
+
FlowsGraphCheckComponent,
|
|
5687
6866
|
FlowsRunsComponent,
|
|
5688
6867
|
FlowsRunsFiltersComponent,
|
|
5689
6868
|
FlowsCronFieldComponent,
|
|
5690
6869
|
FlowsTimezoneFieldComponent,
|
|
5691
6870
|
FlowsRunInspectorComponent,
|
|
6871
|
+
FlowsRunProgressComponent,
|
|
6872
|
+
FlowsStepErrorComponent,
|
|
5692
6873
|
FlowsGraphCanvasComponent,
|
|
5693
6874
|
FlowsCanvasNodeComponent,
|
|
5694
6875
|
FlowsCanvasSocketComponent,
|
|
@@ -5698,15 +6879,19 @@ var FlowsPrivateModule = class FlowsPrivateModule {
|
|
|
5698
6879
|
FlowsJsonFieldComponent,
|
|
5699
6880
|
FlowsConditionFieldComponent,
|
|
5700
6881
|
FlowsPairsFieldComponent,
|
|
5701
|
-
FlowsMemberFieldComponent
|
|
6882
|
+
FlowsMemberFieldComponent,
|
|
6883
|
+
FlowsRetryFieldComponent,
|
|
6884
|
+
FlowsAvailableFieldsComponent
|
|
5702
6885
|
],
|
|
5703
6886
|
imports: [
|
|
5704
6887
|
CommonModule,
|
|
5705
6888
|
FormsModule,
|
|
5706
6889
|
ReactiveFormsModule,
|
|
6890
|
+
TrackDirtyFormDirective,
|
|
5707
6891
|
CoreTranslocoModule,
|
|
5708
6892
|
AppLoaderModule,
|
|
5709
6893
|
SharedComponentsModule,
|
|
6894
|
+
PipesModule,
|
|
5710
6895
|
FontAwesomeModule,
|
|
5711
6896
|
IconFieldModule,
|
|
5712
6897
|
InputIconModule,
|
|
@@ -5737,6 +6922,7 @@ var FlowsPrivateModule = class FlowsPrivateModule {
|
|
|
5737
6922
|
CoreTranslocoModule,
|
|
5738
6923
|
AppLoaderModule,
|
|
5739
6924
|
SharedComponentsModule,
|
|
6925
|
+
PipesModule,
|
|
5740
6926
|
FontAwesomeModule,
|
|
5741
6927
|
IconFieldModule,
|
|
5742
6928
|
InputIconModule,
|
|
@@ -5760,9 +6946,11 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5760
6946
|
CommonModule,
|
|
5761
6947
|
FormsModule,
|
|
5762
6948
|
ReactiveFormsModule,
|
|
6949
|
+
TrackDirtyFormDirective,
|
|
5763
6950
|
CoreTranslocoModule,
|
|
5764
6951
|
AppLoaderModule,
|
|
5765
6952
|
SharedComponentsModule,
|
|
6953
|
+
PipesModule,
|
|
5766
6954
|
FontAwesomeModule,
|
|
5767
6955
|
IconFieldModule,
|
|
5768
6956
|
InputIconModule,
|
|
@@ -5784,11 +6972,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5784
6972
|
FlowsWorkflowFormComponent,
|
|
5785
6973
|
FlowsWorkflowVersionsComponent,
|
|
5786
6974
|
FlowsVersionEditorComponent,
|
|
6975
|
+
FlowsGraphCheckComponent,
|
|
5787
6976
|
FlowsRunsComponent,
|
|
5788
6977
|
FlowsRunsFiltersComponent,
|
|
5789
6978
|
FlowsCronFieldComponent,
|
|
5790
6979
|
FlowsTimezoneFieldComponent,
|
|
5791
6980
|
FlowsRunInspectorComponent,
|
|
6981
|
+
FlowsRunProgressComponent,
|
|
6982
|
+
FlowsStepErrorComponent,
|
|
5792
6983
|
FlowsGraphCanvasComponent,
|
|
5793
6984
|
FlowsCanvasNodeComponent,
|
|
5794
6985
|
FlowsCanvasSocketComponent,
|
|
@@ -5798,7 +6989,9 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5798
6989
|
FlowsJsonFieldComponent,
|
|
5799
6990
|
FlowsConditionFieldComponent,
|
|
5800
6991
|
FlowsPairsFieldComponent,
|
|
5801
|
-
FlowsMemberFieldComponent
|
|
6992
|
+
FlowsMemberFieldComponent,
|
|
6993
|
+
FlowsRetryFieldComponent,
|
|
6994
|
+
FlowsAvailableFieldsComponent
|
|
5802
6995
|
]
|
|
5803
6996
|
}]
|
|
5804
6997
|
}]
|