@posiwise/flows 0.0.9 → 0.0.10
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 +1310 -895
- package/fesm2022/posiwise-flows.mjs.map +1 -1
- package/package.json +1 -1
- package/types/posiwise-flows.d.ts +155 -28
|
@@ -170,8 +170,19 @@ var FlowsNodeService = class FlowsNodeService {
|
|
|
170
170
|
constructor(api) {
|
|
171
171
|
this.api = api;
|
|
172
172
|
this.cache = /* @__PURE__ */ new Map();
|
|
173
|
+
this.refetched = /* @__PURE__ */ new Set();
|
|
174
|
+
}
|
|
175
|
+
getNodes(subscriptionId, needed = []) {
|
|
176
|
+
return this.cached(subscriptionId).pipe(switchMap((nodes) => {
|
|
177
|
+
const known = new Set(nodes.map((node) => node.type));
|
|
178
|
+
const missing = needed.filter((type) => !known.has(type)).map((type) => `${subscriptionId}:${type}`).filter((key) => !this.refetched.has(key));
|
|
179
|
+
if (missing.length === 0) return of(nodes);
|
|
180
|
+
missing.forEach((key) => this.refetched.add(key));
|
|
181
|
+
this.cache.delete(subscriptionId);
|
|
182
|
+
return this.cached(subscriptionId);
|
|
183
|
+
}));
|
|
173
184
|
}
|
|
174
|
-
|
|
185
|
+
cached(subscriptionId) {
|
|
175
186
|
let nodes = this.cache.get(subscriptionId);
|
|
176
187
|
if (!nodes) {
|
|
177
188
|
nodes = this.api.getWithParams(FLOWS_NODES_PATH, { subscription_id: subscriptionId }).pipe(map((response) => response.flow_nodes), catchError((error) => {
|
|
@@ -424,6 +435,19 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
424
435
|
}],
|
|
425
436
|
ctorParameters: () => [{ type: i1$3.ProductsHttpService }]
|
|
426
437
|
});
|
|
438
|
+
function loadRunNodeNames(workflows, nodes, versionId, subscriptionId) {
|
|
439
|
+
return forkJoin({
|
|
440
|
+
version: workflows.getVersion(versionId, subscriptionId),
|
|
441
|
+
list: nodes.getNodes(subscriptionId)
|
|
442
|
+
}).pipe(switchMap(({ version }) => {
|
|
443
|
+
const graph = toFlowGraph(version.graph);
|
|
444
|
+
const types = graph.nodes.map((node) => node.type);
|
|
445
|
+
return nodes.getNodes(subscriptionId, types).pipe(map((definitions) => ({
|
|
446
|
+
nodeTypes: Object.fromEntries(graph.nodes.map((node) => [node.id, node.type])),
|
|
447
|
+
definitions: Object.fromEntries(definitions.map((node) => [node.type, node]))
|
|
448
|
+
})));
|
|
449
|
+
}));
|
|
450
|
+
}
|
|
427
451
|
function flowRunProgress(steps, nodeIds) {
|
|
428
452
|
const count = (...statuses) => steps.filter((step) => statuses.includes(step.status)).length;
|
|
429
453
|
const stepped = new Set(steps.map((step) => step.node_id));
|
|
@@ -586,6 +610,9 @@ const BY_CODE = {
|
|
|
586
610
|
task_request_failed: "NotSent",
|
|
587
611
|
task_received_no_items: "NoItems",
|
|
588
612
|
task_failed: "TaskFailed",
|
|
613
|
+
ai_not_configured: "AiNotConfigured",
|
|
614
|
+
ai_decide_failed: "AiFailed",
|
|
615
|
+
ai_decide_received_no_items: "NoItems",
|
|
589
616
|
email_recipients_invalid: "EmailRecipients",
|
|
590
617
|
no_shard_for_email: "EmailNotSent",
|
|
591
618
|
delivery_failed: "NotDelivered",
|
|
@@ -607,6 +634,7 @@ const BY_CODE = {
|
|
|
607
634
|
};
|
|
608
635
|
const ITEM_LIMITS = {
|
|
609
636
|
task_too_many_items: "50",
|
|
637
|
+
ai_decide_too_many_items: "20",
|
|
610
638
|
email_too_many_items: "50",
|
|
611
639
|
split_out_too_many_items: "500",
|
|
612
640
|
aggregate_too_many_items: "500"
|
|
@@ -943,6 +971,55 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
943
971
|
definitions: [{ type: Input }]
|
|
944
972
|
}
|
|
945
973
|
});
|
|
974
|
+
const INDENT = 2;
|
|
975
|
+
var FlowJsonLinesPipe = class FlowJsonLinesPipe {
|
|
976
|
+
transform(value) {
|
|
977
|
+
if (value === null || value === void 0) return [{
|
|
978
|
+
depth: 0,
|
|
979
|
+
text: "—"
|
|
980
|
+
}];
|
|
981
|
+
return JSON.stringify(value, null, INDENT).split("\n").map((line) => {
|
|
982
|
+
const text = line.trimStart();
|
|
983
|
+
return {
|
|
984
|
+
depth: (line.length - text.length) / INDENT,
|
|
985
|
+
text
|
|
986
|
+
};
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
static {
|
|
990
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
991
|
+
minVersion: "12.0.0",
|
|
992
|
+
version: "22.2.3",
|
|
993
|
+
ngImport: i0,
|
|
994
|
+
type: FlowJsonLinesPipe,
|
|
995
|
+
deps: [],
|
|
996
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
static {
|
|
1000
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
1001
|
+
minVersion: "14.0.0",
|
|
1002
|
+
version: "22.2.3",
|
|
1003
|
+
ngImport: i0,
|
|
1004
|
+
type: FlowJsonLinesPipe,
|
|
1005
|
+
isStandalone: false,
|
|
1006
|
+
name: "flowJsonLines"
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
};
|
|
1010
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1011
|
+
minVersion: "12.0.0",
|
|
1012
|
+
version: "22.2.3",
|
|
1013
|
+
ngImport: i0,
|
|
1014
|
+
type: FlowJsonLinesPipe,
|
|
1015
|
+
decorators: [{
|
|
1016
|
+
type: Pipe,
|
|
1017
|
+
args: [{
|
|
1018
|
+
name: "flowJsonLines",
|
|
1019
|
+
standalone: false
|
|
1020
|
+
}]
|
|
1021
|
+
}]
|
|
1022
|
+
});
|
|
946
1023
|
var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBaseComponent {
|
|
947
1024
|
constructor(injector, flowsRunService, workflowService, nodeService, cdr) {
|
|
948
1025
|
super(injector);
|
|
@@ -994,10 +1071,6 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
994
1071
|
toggleItems(stepId) {
|
|
995
1072
|
if (!this.openSteps.delete(stepId)) this.openSteps.add(stepId);
|
|
996
1073
|
}
|
|
997
|
-
asJson(value) {
|
|
998
|
-
if (value === null || value === void 0) return "—";
|
|
999
|
-
return JSON.stringify(value, null, 2);
|
|
1000
|
-
}
|
|
1001
1074
|
watch(subscriptionId) {
|
|
1002
1075
|
this.watch$?.unsubscribe();
|
|
1003
1076
|
this.watch$ = this.flowsRunService.watchRun(this.runId, subscriptionId).pipe(takeUntil(this.destroy$)).subscribe({
|
|
@@ -1015,14 +1088,11 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
1015
1088
|
const versionId = this.run?.flow_version_id;
|
|
1016
1089
|
if (!versionId || versionId === this.namedVersionId) return;
|
|
1017
1090
|
this.namedVersionId = versionId;
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
this.nodeTypes = Object.fromEntries(toFlowGraph(version.graph).nodes.map((node) => [node.id, node.type]));
|
|
1024
|
-
this.nodeIds = Object.keys(this.nodeTypes);
|
|
1025
|
-
this.definitions = Object.fromEntries(nodes.map((node) => [node.type, node]));
|
|
1091
|
+
loadRunNodeNames(this.workflowService, this.nodeService, versionId, subscriptionId).pipe(takeUntil(this.destroy$)).subscribe({
|
|
1092
|
+
next: ({ nodeTypes, definitions }) => {
|
|
1093
|
+
this.nodeTypes = nodeTypes;
|
|
1094
|
+
this.nodeIds = Object.keys(nodeTypes);
|
|
1095
|
+
this.definitions = definitions;
|
|
1026
1096
|
this.cdr.markForCheck();
|
|
1027
1097
|
},
|
|
1028
1098
|
error: () => void 0
|
|
@@ -1063,8 +1133,8 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
1063
1133
|
selector: "pw-flows-run-inspector",
|
|
1064
1134
|
usesInheritance: true,
|
|
1065
1135
|
ngImport: i0,
|
|
1066
|
-
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 <pw-flows-run-error [error]=\"run.error\" [steps]=\"steps\" [nodeTypes]=\"nodeTypes\" [definitions]=\"definitions\"></pw-flows-run-error>\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\"
|
|
1067
|
-
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-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"],
|
|
1136
|
+
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 <pw-flows-run-error [error]=\"run.error\" [steps]=\"steps\" [nodeTypes]=\"nodeTypes\" [definitions]=\"definitions\"></pw-flows-run-error>\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\">@for (line of run.trigger_payload | flowJsonLines; track $index) {<span class=\"pw-json-line\" [style.--pw-json-depth]=\"line.depth\">{{ line.text }}</span>}</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\" [source]=\"step.error_source\"\n [product]=\"definitions[nodeTypes[step.node_id]]?.product_key\"></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\">@for (line of step.input_items | flowJsonLines; track $index) {<span class=\"pw-json-line\" [style.--pw-json-depth]=\"line.depth\">{{ line.text }}</span>}</pre>\n <span class=\"pw-step-items__label\">{{ 'Flows.Run.Steps.Output' | transloco }}</span>\n <pre class=\"pw-step-items__json\">@for (line of step.output_items | flowJsonLines; track $index) {<span class=\"pw-json-line\" [style.--pw-json-depth]=\"line.depth\">{{ line.text }}</span>}</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",
|
|
1137
|
+
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-payload{margin-bottom:8px}.pw-run-payload__json{max-height:240px;overflow:auto;white-space:normal;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;white-space:normal;background-color:#f5f7fa;border:1px solid #e2e5ea;border-radius:6px;padding:6px 8px;margin:0 0 6px}.pw-json-line{display:block;padding-left:calc(var(--pw-json-depth, 0) * 2ch);white-space:pre-wrap;overflow-wrap:anywhere}.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"],
|
|
1068
1138
|
dependencies: [
|
|
1069
1139
|
{
|
|
1070
1140
|
kind: "component",
|
|
@@ -1301,6 +1371,11 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
1301
1371
|
kind: "pipe",
|
|
1302
1372
|
type: i14.DateFormatPipe,
|
|
1303
1373
|
name: "dateFormat"
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
kind: "pipe",
|
|
1377
|
+
type: FlowJsonLinesPipe,
|
|
1378
|
+
name: "flowJsonLines"
|
|
1304
1379
|
}
|
|
1305
1380
|
]
|
|
1306
1381
|
});
|
|
@@ -1316,8 +1391,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1316
1391
|
args: [{
|
|
1317
1392
|
selector: "pw-flows-run-inspector",
|
|
1318
1393
|
standalone: false,
|
|
1319
|
-
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 <pw-flows-run-error [error]=\"run.error\" [steps]=\"steps\" [nodeTypes]=\"nodeTypes\" [definitions]=\"definitions\"></pw-flows-run-error>\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\"
|
|
1320
|
-
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-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"]
|
|
1394
|
+
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 <pw-flows-run-error [error]=\"run.error\" [steps]=\"steps\" [nodeTypes]=\"nodeTypes\" [definitions]=\"definitions\"></pw-flows-run-error>\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\">@for (line of run.trigger_payload | flowJsonLines; track $index) {<span class=\"pw-json-line\" [style.--pw-json-depth]=\"line.depth\">{{ line.text }}</span>}</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\" [source]=\"step.error_source\"\n [product]=\"definitions[nodeTypes[step.node_id]]?.product_key\"></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\">@for (line of step.input_items | flowJsonLines; track $index) {<span class=\"pw-json-line\" [style.--pw-json-depth]=\"line.depth\">{{ line.text }}</span>}</pre>\n <span class=\"pw-step-items__label\">{{ 'Flows.Run.Steps.Output' | transloco }}</span>\n <pre class=\"pw-step-items__json\">@for (line of step.output_items | flowJsonLines; track $index) {<span class=\"pw-json-line\" [style.--pw-json-depth]=\"line.depth\">{{ line.text }}</span>}</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",
|
|
1395
|
+
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-payload{margin-bottom:8px}.pw-run-payload__json{max-height:240px;overflow:auto;white-space:normal;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;white-space:normal;background-color:#f5f7fa;border:1px solid #e2e5ea;border-radius:6px;padding:6px 8px;margin:0 0 6px}.pw-json-line{display:block;padding-left:calc(var(--pw-json-depth, 0) * 2ch);white-space:pre-wrap;overflow-wrap:anywhere}.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"]
|
|
1321
1396
|
}]
|
|
1322
1397
|
}],
|
|
1323
1398
|
ctorParameters: () => [
|
|
@@ -2766,6 +2841,15 @@ function flowNodeSelection(graph, node, definition, definitions, workflowFields)
|
|
|
2766
2841
|
fieldSources: flowFieldsPossible(graph, node.id) ? flowFieldSources(graph, node.id, definitions, learned) : null
|
|
2767
2842
|
};
|
|
2768
2843
|
}
|
|
2844
|
+
function flowAiChoices(node) {
|
|
2845
|
+
const choices = node.params?.["choices"];
|
|
2846
|
+
return Array.isArray(choices) ? choices.filter((choice) => !!choice && typeof choice === "object") : [];
|
|
2847
|
+
}
|
|
2848
|
+
function flowNodeOutputs(node, definition) {
|
|
2849
|
+
if (node.type !== "logic.ai_decide") return definition.outputs;
|
|
2850
|
+
const names = flowAiChoices(node).map((choice) => choice.name).filter((name) => typeof name === "string" && name.trim() !== "");
|
|
2851
|
+
return [.../* @__PURE__ */ new Set([...definition.outputs, ...names])];
|
|
2852
|
+
}
|
|
2769
2853
|
const FLOW_SOCKET = new ClassicPreset.Socket("flow");
|
|
2770
2854
|
var FlowCanvasNode = class extends ClassicPreset.Node {
|
|
2771
2855
|
constructor(flowNode, definition, label, hasInput, outputs) {
|
|
@@ -2776,8 +2860,22 @@ var FlowCanvasNode = class extends ClassicPreset.Node {
|
|
|
2776
2860
|
this.height = 0;
|
|
2777
2861
|
this.id = flowNode.id;
|
|
2778
2862
|
if (hasInput) this.addInput("in", new ClassicPreset.Input(FLOW_SOCKET, "", true));
|
|
2779
|
-
outputs.forEach((branch) => this.
|
|
2780
|
-
this.
|
|
2863
|
+
outputs.forEach((branch) => this.addBranch(branch));
|
|
2864
|
+
this.fitHeight();
|
|
2865
|
+
}
|
|
2866
|
+
syncOutputs(outputs) {
|
|
2867
|
+
const removed = Object.keys(this.outputs).filter((branch) => !outputs.includes(branch));
|
|
2868
|
+
removed.forEach((branch) => this.removeOutput(branch));
|
|
2869
|
+
outputs.filter((branch) => !this.hasOutput(branch)).forEach((branch) => this.addBranch(branch));
|
|
2870
|
+
this.fitHeight();
|
|
2871
|
+
return removed;
|
|
2872
|
+
}
|
|
2873
|
+
addBranch(branch) {
|
|
2874
|
+
this.addOutput(branch, new ClassicPreset.Output(FLOW_SOCKET, branch === "next" ? "" : branch));
|
|
2875
|
+
}
|
|
2876
|
+
fitHeight() {
|
|
2877
|
+
const outputs = Object.keys(this.outputs).length;
|
|
2878
|
+
this.height = 56 + Math.max(outputs, this.hasInput("in") ? 1 : 0) * 36;
|
|
2781
2879
|
}
|
|
2782
2880
|
};
|
|
2783
2881
|
var FlowCanvasConnection = class extends ClassicPreset.Connection {};
|
|
@@ -2785,7 +2883,7 @@ function branchOf(edge) {
|
|
|
2785
2883
|
return edge.branch ?? "next";
|
|
2786
2884
|
}
|
|
2787
2885
|
function outputsFor(node, definition, edges) {
|
|
2788
|
-
if (definition) return definition
|
|
2886
|
+
if (definition) return flowNodeOutputs(node, definition);
|
|
2789
2887
|
const used = edges.filter((edge) => edge.from === node.id).map(branchOf);
|
|
2790
2888
|
return [.../* @__PURE__ */ new Set([DEFAULT_FLOW_BRANCH, ...used])];
|
|
2791
2889
|
}
|
|
@@ -3244,10 +3342,19 @@ var FlowCanvasEditor = class {
|
|
|
3244
3342
|
const node = this.rete.editor.getNode(nodeId);
|
|
3245
3343
|
if (node) {
|
|
3246
3344
|
node.flowNode = flowNode;
|
|
3345
|
+
if (node.definition) {
|
|
3346
|
+
const outputs = flowNodeOutputs(flowNode, node.definition);
|
|
3347
|
+
await this.removeBranches(node, Object.keys(node.outputs).filter((branch) => !outputs.includes(branch)));
|
|
3348
|
+
node.syncOutputs(outputs);
|
|
3349
|
+
}
|
|
3247
3350
|
await this.rete.area.update("node", nodeId);
|
|
3248
3351
|
this.listener.changed();
|
|
3249
3352
|
}
|
|
3250
3353
|
}
|
|
3354
|
+
async removeBranches(node, branches) {
|
|
3355
|
+
const gone = this.rete.editor.getConnections().filter((c) => c.source === node.id && branches.includes(c.sourceOutput));
|
|
3356
|
+
for (const connection of gone) await this.rete.editor.removeConnection(connection.id);
|
|
3357
|
+
}
|
|
3251
3358
|
node(nodeId) {
|
|
3252
3359
|
return this.rete.editor.getNode(nodeId);
|
|
3253
3360
|
}
|
|
@@ -3461,6 +3568,11 @@ const FIELD_KINDS = {
|
|
|
3461
3568
|
"data.set_fields": { fields: "pairs" },
|
|
3462
3569
|
"data.merge": { mode: "mode" },
|
|
3463
3570
|
"data.split_out": { field: "list" },
|
|
3571
|
+
"logic.ai_decide": {
|
|
3572
|
+
instructions: "textarea",
|
|
3573
|
+
choices: "choices",
|
|
3574
|
+
min_confidence: "number"
|
|
3575
|
+
},
|
|
3464
3576
|
"action.email": {
|
|
3465
3577
|
to: "email",
|
|
3466
3578
|
subject: "text",
|
|
@@ -3737,176 +3849,164 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3737
3849
|
add: [{ type: Output }]
|
|
3738
3850
|
}
|
|
3739
3851
|
});
|
|
3740
|
-
const
|
|
3741
|
-
"
|
|
3742
|
-
"
|
|
3743
|
-
"
|
|
3744
|
-
"
|
|
3745
|
-
"
|
|
3746
|
-
"
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
5,
|
|
3751
|
-
10,
|
|
3752
|
-
15,
|
|
3753
|
-
30
|
|
3852
|
+
const FLOW_CONDITION_OPERATORS = [
|
|
3853
|
+
"eq",
|
|
3854
|
+
"neq",
|
|
3855
|
+
"gt",
|
|
3856
|
+
"gte",
|
|
3857
|
+
"lt",
|
|
3858
|
+
"lte",
|
|
3859
|
+
"contains",
|
|
3860
|
+
"empty",
|
|
3861
|
+
"not_empty"
|
|
3754
3862
|
];
|
|
3755
|
-
const
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
custom: ""
|
|
3863
|
+
const LOGIC_OPS = {
|
|
3864
|
+
"==": "eq",
|
|
3865
|
+
"!=": "neq",
|
|
3866
|
+
">": "gt",
|
|
3867
|
+
">=": "gte",
|
|
3868
|
+
"<": "lt",
|
|
3869
|
+
"<=": "lte"
|
|
3763
3870
|
};
|
|
3764
|
-
const
|
|
3765
|
-
|
|
3766
|
-
[
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
];
|
|
3772
|
-
function toFlowCron(schedule) {
|
|
3773
|
-
const { minute, hour } = schedule;
|
|
3774
|
-
switch (schedule.mode) {
|
|
3775
|
-
case "minutes": return schedule.every === 1 ? "* * * * *" : `*/${schedule.every} * * * *`;
|
|
3776
|
-
case "hourly": return `${minute} * * * *`;
|
|
3777
|
-
case "daily": return `${minute} ${hour} * * *`;
|
|
3778
|
-
case "weekly": return `${minute} ${hour} * * ${schedule.weekday}`;
|
|
3779
|
-
case "monthly": return `${minute} ${hour} ${schedule.monthday} * *`;
|
|
3780
|
-
default: return schedule.custom.trim();
|
|
3781
|
-
}
|
|
3871
|
+
const OP_LOGIC = Object.fromEntries(Object.entries(LOGIC_OPS).map(([logic, op]) => [op, logic]));
|
|
3872
|
+
function isNumericOperator(operator) {
|
|
3873
|
+
return [
|
|
3874
|
+
"gt",
|
|
3875
|
+
"gte",
|
|
3876
|
+
"lt",
|
|
3877
|
+
"lte"
|
|
3878
|
+
].includes(operator);
|
|
3782
3879
|
}
|
|
3783
|
-
function
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
const match = pattern.exec(text);
|
|
3788
|
-
if (match) return fromMatch(mode, match.slice(1).map((part) => part === void 0 ? void 0 : Number(part)));
|
|
3789
|
-
}
|
|
3880
|
+
function takesValue(operator) {
|
|
3881
|
+
return operator !== "empty" && operator !== "not_empty";
|
|
3882
|
+
}
|
|
3883
|
+
function emptyFlowConditionRule() {
|
|
3790
3884
|
return {
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3885
|
+
field: "",
|
|
3886
|
+
operator: "eq",
|
|
3887
|
+
value: "",
|
|
3888
|
+
valueType: "text"
|
|
3794
3889
|
};
|
|
3795
3890
|
}
|
|
3796
|
-
function
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3891
|
+
function typedValue(rule) {
|
|
3892
|
+
if (rule.valueType === "boolean") return rule.value === "true";
|
|
3893
|
+
return isNumericOperator(rule.operator) || rule.valueType === "number" ? Number(rule.value) : rule.value;
|
|
3894
|
+
}
|
|
3895
|
+
function isCompleteRule(rule) {
|
|
3896
|
+
if (!rule.field.trim()) return false;
|
|
3897
|
+
if (!takesValue(rule.operator)) return true;
|
|
3898
|
+
return isNumericOperator(rule.operator) || rule.valueType === "number" ? rule.value.trim() !== "" && Number.isFinite(Number(rule.value)) : true;
|
|
3899
|
+
}
|
|
3900
|
+
function ruleToLogic(rule) {
|
|
3901
|
+
const field = { var: rule.field.trim() };
|
|
3902
|
+
switch (rule.operator) {
|
|
3903
|
+
case "contains": return { in: [typedValue(rule), field] };
|
|
3904
|
+
case "empty": return { "==": [field, null] };
|
|
3905
|
+
case "not_empty": return { "!=": [field, null] };
|
|
3906
|
+
default: return { [OP_LOGIC[rule.operator]]: [field, typedValue(rule)] };
|
|
3907
|
+
}
|
|
3908
|
+
}
|
|
3909
|
+
function toJsonLogic(group) {
|
|
3910
|
+
if (!group.rules.length || !group.rules.every(isCompleteRule)) return;
|
|
3911
|
+
const logic = group.rules.map(ruleToLogic);
|
|
3912
|
+
return logic.length === 1 ? logic[0] : { [group.combinator === "all" ? "and" : "or"]: logic };
|
|
3913
|
+
}
|
|
3914
|
+
function asRecord(value) {
|
|
3915
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
3916
|
+
}
|
|
3917
|
+
function fieldOf(value) {
|
|
3918
|
+
const record = asRecord(value);
|
|
3919
|
+
const keys = record ? Object.keys(record) : [];
|
|
3920
|
+
return keys.length === 1 && keys[0] === "var" && typeof record?.["var"] === "string" ? record["var"] : null;
|
|
3921
|
+
}
|
|
3922
|
+
function valueRule(field, operator, value) {
|
|
3923
|
+
if (typeof value === "number") return {
|
|
3924
|
+
field,
|
|
3925
|
+
operator,
|
|
3926
|
+
value: String(value),
|
|
3927
|
+
valueType: "number"
|
|
3800
3928
|
};
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
case "weekly": return {
|
|
3823
|
-
...base,
|
|
3824
|
-
minute: a,
|
|
3825
|
-
hour: b,
|
|
3826
|
-
weekday: c
|
|
3827
|
-
};
|
|
3828
|
-
default: return c >= 1 && c <= 28 ? {
|
|
3829
|
-
...base,
|
|
3830
|
-
minute: a,
|
|
3831
|
-
hour: b,
|
|
3832
|
-
monthday: c
|
|
3833
|
-
} : {
|
|
3834
|
-
...base,
|
|
3835
|
-
mode: "custom",
|
|
3836
|
-
custom: `${a} ${b} ${c} * *`
|
|
3837
|
-
};
|
|
3929
|
+
if (typeof value === "boolean") return {
|
|
3930
|
+
field,
|
|
3931
|
+
operator,
|
|
3932
|
+
value: String(value),
|
|
3933
|
+
valueType: "boolean"
|
|
3934
|
+
};
|
|
3935
|
+
return typeof value === "string" ? {
|
|
3936
|
+
field,
|
|
3937
|
+
operator,
|
|
3938
|
+
value,
|
|
3939
|
+
valueType: "text"
|
|
3940
|
+
} : null;
|
|
3941
|
+
}
|
|
3942
|
+
function logicToRule(logic) {
|
|
3943
|
+
const record = asRecord(logic);
|
|
3944
|
+
const [op] = record ? Object.keys(record) : [];
|
|
3945
|
+
const args = record && Object.keys(record).length === 1 ? record[op] : null;
|
|
3946
|
+
if (!Array.isArray(args) || args.length !== 2) return null;
|
|
3947
|
+
if (op === "in") {
|
|
3948
|
+
const field = fieldOf(args[1]);
|
|
3949
|
+
return field ? valueRule(field, "contains", args[0]) : null;
|
|
3838
3950
|
}
|
|
3951
|
+
const field = fieldOf(args[0]);
|
|
3952
|
+
const operator = LOGIC_OPS[op];
|
|
3953
|
+
if (!field || !operator) return null;
|
|
3954
|
+
if (args[1] === null && (operator === "eq" || operator === "neq")) return {
|
|
3955
|
+
field,
|
|
3956
|
+
operator: operator === "eq" ? "empty" : "not_empty",
|
|
3957
|
+
value: "",
|
|
3958
|
+
valueType: "text"
|
|
3959
|
+
};
|
|
3960
|
+
return valueRule(field, operator, args[1]);
|
|
3839
3961
|
}
|
|
3840
|
-
function
|
|
3841
|
-
|
|
3962
|
+
function fromJsonLogic(logic) {
|
|
3963
|
+
const record = asRecord(logic);
|
|
3964
|
+
if (!record) return logic === void 0 || logic === null ? {
|
|
3965
|
+
combinator: "all",
|
|
3966
|
+
rules: []
|
|
3967
|
+
} : null;
|
|
3968
|
+
const [key] = Object.keys(record);
|
|
3969
|
+
const nested = Object.keys(record).length === 1 && (key === "and" || key === "or") ? record[key] : null;
|
|
3970
|
+
const rules = (Array.isArray(nested) ? nested : [logic]).map(logicToRule);
|
|
3971
|
+
if (rules.includes(null)) return null;
|
|
3972
|
+
return {
|
|
3973
|
+
combinator: key === "or" ? "any" : "all",
|
|
3974
|
+
rules
|
|
3975
|
+
};
|
|
3842
3976
|
}
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
3846
|
-
constructor(translation) {
|
|
3847
|
-
this.translation = translation;
|
|
3977
|
+
var FlowsJsonFieldComponent = class FlowsJsonFieldComponent {
|
|
3978
|
+
constructor() {
|
|
3848
3979
|
this.readOnly = false;
|
|
3849
3980
|
this.valueChange = new EventEmitter();
|
|
3850
|
-
this.
|
|
3851
|
-
this.
|
|
3852
|
-
this.monthdays = Array.from({ length: 28 }, (_, i) => i + 1);
|
|
3853
|
-
this.schedule = fromFlowCron(void 0);
|
|
3854
|
-
this.weekdays = [];
|
|
3855
|
-
const format = new Intl.DateTimeFormat(this.translation.getActiveLang(), {
|
|
3856
|
-
weekday: "long",
|
|
3857
|
-
timeZone: "UTC"
|
|
3858
|
-
});
|
|
3859
|
-
this.weekdays = [
|
|
3860
|
-
0,
|
|
3861
|
-
1,
|
|
3862
|
-
2,
|
|
3863
|
-
3,
|
|
3864
|
-
4,
|
|
3865
|
-
5,
|
|
3866
|
-
6
|
|
3867
|
-
].map((value) => ({
|
|
3868
|
-
value,
|
|
3869
|
-
label: format.format(A_SUNDAY + value * DAY_MS)
|
|
3870
|
-
}));
|
|
3981
|
+
this.text = "";
|
|
3982
|
+
this.invalid = false;
|
|
3871
3983
|
}
|
|
3872
3984
|
ngOnChanges() {
|
|
3873
|
-
|
|
3874
|
-
this.
|
|
3875
|
-
}
|
|
3876
|
-
get time() {
|
|
3877
|
-
return flowCronTime(this.schedule);
|
|
3878
|
-
}
|
|
3879
|
-
get weekdayLabel() {
|
|
3880
|
-
return this.weekdays[this.schedule.weekday]?.label ?? "";
|
|
3881
|
-
}
|
|
3882
|
-
setMode(mode) {
|
|
3883
|
-
this.update({
|
|
3884
|
-
mode,
|
|
3885
|
-
custom: mode === "custom" ? toFlowCron(this.schedule) : this.schedule.custom
|
|
3886
|
-
});
|
|
3887
|
-
}
|
|
3888
|
-
setTime(time) {
|
|
3889
|
-
const [hour, minute] = (time || "00:00").split(":").map(Number);
|
|
3890
|
-
this.update({
|
|
3891
|
-
hour,
|
|
3892
|
-
minute
|
|
3893
|
-
});
|
|
3985
|
+
this.text = this.value === void 0 ? "" : JSON.stringify(this.value, null, 2);
|
|
3986
|
+
this.invalid = false;
|
|
3894
3987
|
}
|
|
3895
|
-
|
|
3896
|
-
this.
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3988
|
+
commit() {
|
|
3989
|
+
if (this.readOnly) return;
|
|
3990
|
+
if (!this.text.trim()) {
|
|
3991
|
+
this.invalid = false;
|
|
3992
|
+
this.valueChange.emit(void 0);
|
|
3993
|
+
return;
|
|
3994
|
+
}
|
|
3995
|
+
try {
|
|
3996
|
+
const parsed = JSON.parse(this.text);
|
|
3997
|
+
this.invalid = false;
|
|
3998
|
+
this.valueChange.emit(parsed);
|
|
3999
|
+
} catch {
|
|
4000
|
+
this.invalid = true;
|
|
4001
|
+
}
|
|
3902
4002
|
}
|
|
3903
4003
|
static {
|
|
3904
4004
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
3905
4005
|
minVersion: "12.0.0",
|
|
3906
4006
|
version: "22.2.3",
|
|
3907
4007
|
ngImport: i0,
|
|
3908
|
-
type:
|
|
3909
|
-
deps: [
|
|
4008
|
+
type: FlowsJsonFieldComponent,
|
|
4009
|
+
deps: [],
|
|
3910
4010
|
target: i0.ɵɵFactoryTarget.Component
|
|
3911
4011
|
});
|
|
3912
4012
|
}
|
|
@@ -3914,9 +4014,9 @@ var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
|
3914
4014
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3915
4015
|
minVersion: "17.0.0",
|
|
3916
4016
|
version: "22.2.3",
|
|
3917
|
-
type:
|
|
4017
|
+
type: FlowsJsonFieldComponent,
|
|
3918
4018
|
isStandalone: false,
|
|
3919
|
-
selector: "pw-flows-
|
|
4019
|
+
selector: "pw-flows-json-field",
|
|
3920
4020
|
inputs: {
|
|
3921
4021
|
value: "value",
|
|
3922
4022
|
inputId: "inputId",
|
|
@@ -3925,53 +4025,38 @@ var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
|
3925
4025
|
outputs: { valueChange: "valueChange" },
|
|
3926
4026
|
usesOnChanges: true,
|
|
3927
4027
|
ngImport: i0,
|
|
3928
|
-
template:
|
|
4028
|
+
template: `
|
|
4029
|
+
<textarea
|
|
4030
|
+
class="form-control pw-json-field"
|
|
4031
|
+
rows="5"
|
|
4032
|
+
spellcheck="false"
|
|
4033
|
+
[id]="inputId"
|
|
4034
|
+
[readOnly]="readOnly"
|
|
4035
|
+
[(ngModel)]="text"
|
|
4036
|
+
[ngModelOptions]="{ standalone: true }"
|
|
4037
|
+
(blur)="commit()"
|
|
4038
|
+
></textarea>
|
|
4039
|
+
@if (invalid) {
|
|
4040
|
+
<pw-field-error-display
|
|
4041
|
+
[displayError]="true"
|
|
4042
|
+
[errorMsg]="'Flows.Versions.Editor.InvalidJson' | transloco"
|
|
4043
|
+
>
|
|
4044
|
+
</pw-field-error-display>
|
|
4045
|
+
}
|
|
4046
|
+
`,
|
|
4047
|
+
isInline: true,
|
|
4048
|
+
styles: [".pw-json-field{white-space:pre;overflow-x:auto}\n"],
|
|
3929
4049
|
dependencies: [
|
|
3930
|
-
{
|
|
3931
|
-
kind: "directive",
|
|
3932
|
-
type: i3$1.NgSelectOption,
|
|
3933
|
-
selector: "option",
|
|
3934
|
-
inputs: ["ngValue", "value"]
|
|
3935
|
-
},
|
|
3936
|
-
{
|
|
3937
|
-
kind: "directive",
|
|
3938
|
-
type: i3$1.ɵNgSelectMultipleOption,
|
|
3939
|
-
selector: "option",
|
|
3940
|
-
inputs: ["ngValue", "value"]
|
|
3941
|
-
},
|
|
3942
4050
|
{
|
|
3943
4051
|
kind: "directive",
|
|
3944
4052
|
type: i3$1.DefaultValueAccessor,
|
|
3945
4053
|
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]"
|
|
3946
4054
|
},
|
|
3947
|
-
{
|
|
3948
|
-
kind: "directive",
|
|
3949
|
-
type: i3$1.NumberValueAccessor,
|
|
3950
|
-
selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
|
|
3951
|
-
},
|
|
3952
|
-
{
|
|
3953
|
-
kind: "directive",
|
|
3954
|
-
type: i3$1.SelectControlValueAccessor,
|
|
3955
|
-
selector: "select:not([multiple]):not([ngNoCva])[formControlName],select:not([multiple]):not([ngNoCva])[formControl],select:not([multiple]):not([ngNoCva])[ngModel]",
|
|
3956
|
-
inputs: ["compareWith"]
|
|
3957
|
-
},
|
|
3958
4055
|
{
|
|
3959
4056
|
kind: "directive",
|
|
3960
4057
|
type: i3$1.NgControlStatus,
|
|
3961
4058
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
3962
4059
|
},
|
|
3963
|
-
{
|
|
3964
|
-
kind: "directive",
|
|
3965
|
-
type: i3$1.MinValidator,
|
|
3966
|
-
selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
|
|
3967
|
-
inputs: ["min"]
|
|
3968
|
-
},
|
|
3969
|
-
{
|
|
3970
|
-
kind: "directive",
|
|
3971
|
-
type: i3$1.MaxValidator,
|
|
3972
|
-
selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]",
|
|
3973
|
-
inputs: ["max"]
|
|
3974
|
-
},
|
|
3975
4060
|
{
|
|
3976
4061
|
kind: "directive",
|
|
3977
4062
|
type: i3$1.NgModel,
|
|
@@ -3985,6 +4070,12 @@ var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
|
3985
4070
|
outputs: ["ngModelChange"],
|
|
3986
4071
|
exportAs: ["ngModel"]
|
|
3987
4072
|
},
|
|
4073
|
+
{
|
|
4074
|
+
kind: "component",
|
|
4075
|
+
type: i2$1.FieldErrorDisplayComponent,
|
|
4076
|
+
selector: "pw-field-error-display",
|
|
4077
|
+
inputs: ["errorMsg", "displayError"]
|
|
4078
|
+
},
|
|
3988
4079
|
{
|
|
3989
4080
|
kind: "pipe",
|
|
3990
4081
|
type: i2$4.TranslocoPipe,
|
|
@@ -3998,16 +4089,34 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3998
4089
|
minVersion: "12.0.0",
|
|
3999
4090
|
version: "22.2.3",
|
|
4000
4091
|
ngImport: i0,
|
|
4001
|
-
type:
|
|
4092
|
+
type: FlowsJsonFieldComponent,
|
|
4002
4093
|
decorators: [{
|
|
4003
4094
|
type: Component,
|
|
4004
4095
|
args: [{
|
|
4005
|
-
selector: "pw-flows-
|
|
4096
|
+
selector: "pw-flows-json-field",
|
|
4097
|
+
template: `
|
|
4098
|
+
<textarea
|
|
4099
|
+
class="form-control pw-json-field"
|
|
4100
|
+
rows="5"
|
|
4101
|
+
spellcheck="false"
|
|
4102
|
+
[id]="inputId"
|
|
4103
|
+
[readOnly]="readOnly"
|
|
4104
|
+
[(ngModel)]="text"
|
|
4105
|
+
[ngModelOptions]="{ standalone: true }"
|
|
4106
|
+
(blur)="commit()"
|
|
4107
|
+
></textarea>
|
|
4108
|
+
@if (invalid) {
|
|
4109
|
+
<pw-field-error-display
|
|
4110
|
+
[displayError]="true"
|
|
4111
|
+
[errorMsg]="'Flows.Versions.Editor.InvalidJson' | transloco"
|
|
4112
|
+
>
|
|
4113
|
+
</pw-field-error-display>
|
|
4114
|
+
}
|
|
4115
|
+
`,
|
|
4006
4116
|
standalone: false,
|
|
4007
|
-
|
|
4117
|
+
styles: [".pw-json-field{white-space:pre;overflow-x:auto}\n"]
|
|
4008
4118
|
}]
|
|
4009
4119
|
}],
|
|
4010
|
-
ctorParameters: () => [{ type: i2$4.TranslocoService }],
|
|
4011
4120
|
propDecorators: {
|
|
4012
4121
|
value: [{ type: Input }],
|
|
4013
4122
|
inputId: [{ type: Input }],
|
|
@@ -4015,66 +4124,146 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4015
4124
|
valueChange: [{ type: Output }]
|
|
4016
4125
|
}
|
|
4017
4126
|
});
|
|
4018
|
-
const
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4127
|
+
const OPTION_KEYS = {
|
|
4128
|
+
operators: FLOW_CONDITION_OPERATORS.map((op) => [op, `Flows.Condition.Ops.${op}`]),
|
|
4129
|
+
types: [
|
|
4130
|
+
"text",
|
|
4131
|
+
"number",
|
|
4132
|
+
"boolean"
|
|
4133
|
+
].map((type) => [type, `Flows.Condition.Types.${type}`]),
|
|
4134
|
+
combinators: [["all", "Flows.Condition.All"], ["any", "Flows.Condition.Any"]],
|
|
4135
|
+
booleans: [["true", "Flows.Branch.true"], ["false", "Flows.Branch.false"]]
|
|
4136
|
+
};
|
|
4137
|
+
var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
4138
|
+
constructor(translation, cdr, destroyRef) {
|
|
4139
|
+
this.suggestions = [];
|
|
4024
4140
|
this.readOnly = false;
|
|
4025
4141
|
this.valueChange = new EventEmitter();
|
|
4026
|
-
this.
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
this
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4142
|
+
this.icons = FLOWS_ICONS;
|
|
4143
|
+
this.options = {};
|
|
4144
|
+
this.takesValue = takesValue;
|
|
4145
|
+
this.isNumericOperator = isNumericOperator;
|
|
4146
|
+
this.group = {
|
|
4147
|
+
combinator: "all",
|
|
4148
|
+
rules: []
|
|
4149
|
+
};
|
|
4150
|
+
this.mode = "rules";
|
|
4151
|
+
this.incomplete = false;
|
|
4152
|
+
translation.selectTranslation("flows").pipe(takeUntilDestroyed(destroyRef)).subscribe(() => {
|
|
4153
|
+
this.options = Object.fromEntries(Object.entries(OPTION_KEYS).map(([name, entries]) => [name, entries.map(([value, key]) => ({
|
|
4154
|
+
value,
|
|
4155
|
+
label: translation.translate(key)
|
|
4156
|
+
}))]));
|
|
4157
|
+
cdr.markForCheck();
|
|
4036
4158
|
});
|
|
4037
4159
|
}
|
|
4038
|
-
|
|
4039
|
-
this
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4160
|
+
ngOnChanges() {
|
|
4161
|
+
if (this.value !== void 0 && this.value === this.emitted) return;
|
|
4162
|
+
this.load(this.value);
|
|
4163
|
+
}
|
|
4164
|
+
get combinesRules() {
|
|
4165
|
+
return this.group.rules.length > 1;
|
|
4166
|
+
}
|
|
4167
|
+
get canUseRules() {
|
|
4168
|
+
return fromJsonLogic(this.value) !== null;
|
|
4169
|
+
}
|
|
4170
|
+
addRule() {
|
|
4171
|
+
this.group = {
|
|
4172
|
+
...this.group,
|
|
4173
|
+
rules: [...this.group.rules, emptyFlowConditionRule()]
|
|
4174
|
+
};
|
|
4175
|
+
this.incomplete = true;
|
|
4176
|
+
}
|
|
4177
|
+
removeRule(index) {
|
|
4178
|
+
this.group = {
|
|
4179
|
+
...this.group,
|
|
4180
|
+
rules: this.group.rules.filter((_, i) => i !== index)
|
|
4181
|
+
};
|
|
4182
|
+
this.commit();
|
|
4183
|
+
}
|
|
4184
|
+
useRules() {
|
|
4185
|
+
this.load(this.value);
|
|
4186
|
+
}
|
|
4187
|
+
useJson() {
|
|
4188
|
+
this.mode = "json";
|
|
4189
|
+
}
|
|
4190
|
+
commit() {
|
|
4191
|
+
if (this.readOnly) return;
|
|
4192
|
+
const logic = this.group.rules.length ? toJsonLogic(this.group) : void 0;
|
|
4193
|
+
this.incomplete = !!this.group.rules.length && logic === void 0;
|
|
4194
|
+
if (!this.incomplete) this.emit(logic);
|
|
4195
|
+
}
|
|
4196
|
+
emit(value) {
|
|
4197
|
+
this.emitted = value;
|
|
4198
|
+
this.valueChange.emit(value);
|
|
4199
|
+
}
|
|
4200
|
+
load(value) {
|
|
4201
|
+
const group = fromJsonLogic(value);
|
|
4202
|
+
this.mode = group ? "rules" : "json";
|
|
4203
|
+
this.group = group ?? {
|
|
4204
|
+
combinator: "all",
|
|
4205
|
+
rules: []
|
|
4206
|
+
};
|
|
4207
|
+
this.incomplete = false;
|
|
4208
|
+
}
|
|
4209
|
+
static {
|
|
4210
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4211
|
+
minVersion: "12.0.0",
|
|
4212
|
+
version: "22.2.3",
|
|
4213
|
+
ngImport: i0,
|
|
4214
|
+
type: FlowsConditionFieldComponent,
|
|
4215
|
+
deps: [
|
|
4216
|
+
{ token: i2$4.TranslocoService },
|
|
4217
|
+
{ token: i0.ChangeDetectorRef },
|
|
4218
|
+
{ token: i0.DestroyRef }
|
|
4219
|
+
],
|
|
4220
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
4221
|
+
});
|
|
4222
|
+
}
|
|
4223
|
+
static {
|
|
4224
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4225
|
+
minVersion: "17.0.0",
|
|
4226
|
+
version: "22.2.3",
|
|
4227
|
+
type: FlowsConditionFieldComponent,
|
|
4228
|
+
isStandalone: false,
|
|
4229
|
+
selector: "pw-flows-condition-field",
|
|
4230
|
+
inputs: {
|
|
4231
|
+
value: "value",
|
|
4232
|
+
inputId: "inputId",
|
|
4233
|
+
suggestions: "suggestions",
|
|
4234
|
+
readOnly: "readOnly"
|
|
4235
|
+
},
|
|
4236
|
+
outputs: { valueChange: "valueChange" },
|
|
4237
|
+
usesOnChanges: true,
|
|
4238
|
+
ngImport: i0,
|
|
4239
|
+
template: "<div class=\"pw-condition\"\n [id]=\"inputId\"\n data-testid=\"flow-condition\">\n @if (mode === 'rules') {\n @if (combinesRules) {\n <p-select [options]=\"options['combinators']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"pw-condition__combinator\"\n data-testid=\"flow-condition-combinator\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"group.combinator\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n }\n\n @for (rule of group.rules; track $index) {\n <div class=\"pw-condition__rule\"\n data-testid=\"flow-condition-rule\">\n <input type=\"text\"\n class=\"form-control\"\n [attr.list]=\"inputId + '-fields'\"\n [attr.aria-label]=\"'Flows.Condition.Field' | transloco\"\n [placeholder]=\"'Flows.Condition.Field' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"rule.field\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n <p-select [options]=\"options['operators']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [ariaLabel]=\"'Flows.Condition.Operator' | transloco\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"rule.operator\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n @if (takesValue(rule.operator)) {\n <div class=\"pw-condition__value\">\n @if (rule.valueType === 'boolean' && !isNumericOperator(rule.operator)) {\n <p-select [options]=\"options['booleans']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [ariaLabel]=\"'Flows.Condition.Value' | transloco\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"rule.value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n } @else {\n <input class=\"form-control\"\n [type]=\"isNumericOperator(rule.operator) || rule.valueType === 'number' ? 'number' : 'text'\"\n [attr.aria-label]=\"'Flows.Condition.Value' | transloco\"\n [placeholder]=\"'Flows.Condition.Value' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"rule.value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n }\n @if (!isNumericOperator(rule.operator)) {\n <p-select class=\"pw-condition__type\"\n [options]=\"options['types']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n [ariaLabel]=\"'Flows.Condition.Type' | transloco\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"rule.valueType\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n }\n </div>\n }\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-condition__remove\"\n [attr.aria-label]=\"'Flows.Condition.RemoveRule' | transloco\"\n [pTooltip]=\"'Flows.Condition.RemoveRule' | transloco\"\n appendTo=\"body\"\n (click)=\"removeRule($index)\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </div>\n }\n\n @if (incomplete) {\n <small class=\"pw-condition__hint is-warning\"\n data-testid=\"flow-condition-incomplete\">{{ 'Flows.Condition.Incomplete' | transloco }}</small>\n }\n\n <div class=\"pw-condition__actions\">\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-condition-add\"\n (click)=\"addRule()\">{{ 'Flows.Condition.AddRule' | transloco }}</button>\n }\n <button type=\"button\"\n class=\"btn btn-link btn-sm\"\n (click)=\"useJson()\">{{ 'Flows.Condition.AsJson' | transloco }}</button>\n </div>\n\n <datalist [id]=\"inputId + '-fields'\">\n @for (field of suggestions; track field) {\n <option [value]=\"field\"></option>\n }\n </datalist>\n } @else {\n <pw-flows-json-field [inputId]=\"inputId + '-json'\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"emit($event)\"></pw-flows-json-field>\n @if (canUseRules) {\n <button type=\"button\"\n class=\"btn btn-link btn-sm\"\n (click)=\"useRules()\">{{ 'Flows.Condition.AsRules' | transloco }}</button>\n } @else {\n <small class=\"pw-condition__hint\">{{ 'Flows.Condition.TooComplex' | transloco }}</small>\n }\n }\n</div>\n",
|
|
4240
|
+
styles: [".pw-condition{display:flex;flex-direction:column;gap:8px}.pw-condition__rule{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;padding:8px;border:1px solid #e2e5ea;border-radius:4px}.pw-condition__rule>:not(.pw-condition__remove){grid-column:1}.pw-condition__value{display:flex;gap:6px}.pw-condition__value>:first-child{flex:1;min-width:0}.pw-condition__type{flex:0 0 112px}.pw-condition__remove{grid-column:2;grid-row:1;align-self:start;color:#5a6473}.pw-condition__actions{display:flex;justify-content:space-between;align-items:center}.pw-condition__hint{color:#5a6473;font-size:12px}.pw-condition__hint.is-warning{color:#b7791f}\n"],
|
|
4241
|
+
dependencies: [
|
|
4242
|
+
{
|
|
4243
|
+
kind: "directive",
|
|
4244
|
+
type: i3$1.NgSelectOption,
|
|
4245
|
+
selector: "option",
|
|
4246
|
+
inputs: ["ngValue", "value"]
|
|
4247
|
+
},
|
|
4248
|
+
{
|
|
4249
|
+
kind: "directive",
|
|
4250
|
+
type: i3$1.ɵNgSelectMultipleOption,
|
|
4251
|
+
selector: "option",
|
|
4252
|
+
inputs: ["ngValue", "value"]
|
|
4253
|
+
},
|
|
4254
|
+
{
|
|
4255
|
+
kind: "directive",
|
|
4256
|
+
type: i3$1.DefaultValueAccessor,
|
|
4257
|
+
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]"
|
|
4258
|
+
},
|
|
4259
|
+
{
|
|
4260
|
+
kind: "directive",
|
|
4261
|
+
type: i3$1.NgControlStatus,
|
|
4262
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
4263
|
+
},
|
|
4264
|
+
{
|
|
4265
|
+
kind: "directive",
|
|
4266
|
+
type: i3$1.NgModel,
|
|
4078
4267
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
4079
4268
|
inputs: [
|
|
4080
4269
|
"name",
|
|
@@ -4085,6 +4274,34 @@ var FlowsTimezoneFieldComponent = class FlowsTimezoneFieldComponent {
|
|
|
4085
4274
|
outputs: ["ngModelChange"],
|
|
4086
4275
|
exportAs: ["ngModel"]
|
|
4087
4276
|
},
|
|
4277
|
+
{
|
|
4278
|
+
kind: "directive",
|
|
4279
|
+
type: i1$1.Tooltip,
|
|
4280
|
+
selector: "[pTooltip]",
|
|
4281
|
+
inputs: [
|
|
4282
|
+
"tooltipPosition",
|
|
4283
|
+
"tooltipEvent",
|
|
4284
|
+
"positionStyle",
|
|
4285
|
+
"tooltipStyleClass",
|
|
4286
|
+
"tooltipZIndex",
|
|
4287
|
+
"escape",
|
|
4288
|
+
"showDelay",
|
|
4289
|
+
"hideDelay",
|
|
4290
|
+
"life",
|
|
4291
|
+
"positionTop",
|
|
4292
|
+
"positionLeft",
|
|
4293
|
+
"autoHide",
|
|
4294
|
+
"fitContent",
|
|
4295
|
+
"hideOnEscape",
|
|
4296
|
+
"showOnEllipsis",
|
|
4297
|
+
"pTooltip",
|
|
4298
|
+
"tooltipDisabled",
|
|
4299
|
+
"tooltipOptions",
|
|
4300
|
+
"appendTo",
|
|
4301
|
+
"pTooltipPT",
|
|
4302
|
+
"pTooltipUnstyled"
|
|
4303
|
+
]
|
|
4304
|
+
},
|
|
4088
4305
|
{
|
|
4089
4306
|
kind: "component",
|
|
4090
4307
|
type: i4$1.Select,
|
|
@@ -4155,6 +4372,54 @@ var FlowsTimezoneFieldComponent = class FlowsTimezoneFieldComponent {
|
|
|
4155
4372
|
"onLazyLoad"
|
|
4156
4373
|
]
|
|
4157
4374
|
},
|
|
4375
|
+
{
|
|
4376
|
+
kind: "component",
|
|
4377
|
+
type: i2$3.FaIconComponent,
|
|
4378
|
+
selector: "fa-icon",
|
|
4379
|
+
inputs: [
|
|
4380
|
+
"icon",
|
|
4381
|
+
"title",
|
|
4382
|
+
"animation",
|
|
4383
|
+
"mask",
|
|
4384
|
+
"flip",
|
|
4385
|
+
"size",
|
|
4386
|
+
"pull",
|
|
4387
|
+
"border",
|
|
4388
|
+
"inverse",
|
|
4389
|
+
"symbol",
|
|
4390
|
+
"rotate",
|
|
4391
|
+
"fixedWidth",
|
|
4392
|
+
"transform",
|
|
4393
|
+
"a11yRole"
|
|
4394
|
+
],
|
|
4395
|
+
outputs: [
|
|
4396
|
+
"iconChange",
|
|
4397
|
+
"titleChange",
|
|
4398
|
+
"animationChange",
|
|
4399
|
+
"maskChange",
|
|
4400
|
+
"flipChange",
|
|
4401
|
+
"sizeChange",
|
|
4402
|
+
"pullChange",
|
|
4403
|
+
"borderChange",
|
|
4404
|
+
"inverseChange",
|
|
4405
|
+
"symbolChange",
|
|
4406
|
+
"rotateChange",
|
|
4407
|
+
"fixedWidthChange",
|
|
4408
|
+
"transformChange",
|
|
4409
|
+
"a11yRoleChange"
|
|
4410
|
+
]
|
|
4411
|
+
},
|
|
4412
|
+
{
|
|
4413
|
+
kind: "component",
|
|
4414
|
+
type: FlowsJsonFieldComponent,
|
|
4415
|
+
selector: "pw-flows-json-field",
|
|
4416
|
+
inputs: [
|
|
4417
|
+
"value",
|
|
4418
|
+
"inputId",
|
|
4419
|
+
"readOnly"
|
|
4420
|
+
],
|
|
4421
|
+
outputs: ["valueChange"]
|
|
4422
|
+
},
|
|
4158
4423
|
{
|
|
4159
4424
|
kind: "pipe",
|
|
4160
4425
|
type: i2$4.TranslocoPipe,
|
|
@@ -4168,80 +4433,209 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4168
4433
|
minVersion: "12.0.0",
|
|
4169
4434
|
version: "22.2.3",
|
|
4170
4435
|
ngImport: i0,
|
|
4171
|
-
type:
|
|
4436
|
+
type: FlowsConditionFieldComponent,
|
|
4172
4437
|
decorators: [{
|
|
4173
4438
|
type: Component,
|
|
4174
4439
|
args: [{
|
|
4175
|
-
selector: "pw-flows-
|
|
4176
|
-
|
|
4177
|
-
<p-select
|
|
4178
|
-
|
|
4179
|
-
[options]="zones"
|
|
4180
|
-
[filter]="true"
|
|
4181
|
-
[showClear]="true"
|
|
4182
|
-
[disabled]="readOnly"
|
|
4183
|
-
[placeholder]="'Flows.Schedule.ServerTime' | transloco"
|
|
4184
|
-
[ngModel]="value"
|
|
4185
|
-
[ngModelOptions]="{ standalone: true }"
|
|
4186
|
-
(ngModelChange)="valueChange.emit($event || null)"
|
|
4187
|
-
appendTo="body"
|
|
4188
|
-
styleClass="w-100"
|
|
4189
|
-
>
|
|
4190
|
-
</p-select>
|
|
4191
|
-
`,
|
|
4192
|
-
standalone: false
|
|
4440
|
+
selector: "pw-flows-condition-field",
|
|
4441
|
+
standalone: false,
|
|
4442
|
+
template: "<div class=\"pw-condition\"\n [id]=\"inputId\"\n data-testid=\"flow-condition\">\n @if (mode === 'rules') {\n @if (combinesRules) {\n <p-select [options]=\"options['combinators']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"pw-condition__combinator\"\n data-testid=\"flow-condition-combinator\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"group.combinator\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n }\n\n @for (rule of group.rules; track $index) {\n <div class=\"pw-condition__rule\"\n data-testid=\"flow-condition-rule\">\n <input type=\"text\"\n class=\"form-control\"\n [attr.list]=\"inputId + '-fields'\"\n [attr.aria-label]=\"'Flows.Condition.Field' | transloco\"\n [placeholder]=\"'Flows.Condition.Field' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"rule.field\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n <p-select [options]=\"options['operators']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [ariaLabel]=\"'Flows.Condition.Operator' | transloco\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"rule.operator\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n @if (takesValue(rule.operator)) {\n <div class=\"pw-condition__value\">\n @if (rule.valueType === 'boolean' && !isNumericOperator(rule.operator)) {\n <p-select [options]=\"options['booleans']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [ariaLabel]=\"'Flows.Condition.Value' | transloco\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"rule.value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n } @else {\n <input class=\"form-control\"\n [type]=\"isNumericOperator(rule.operator) || rule.valueType === 'number' ? 'number' : 'text'\"\n [attr.aria-label]=\"'Flows.Condition.Value' | transloco\"\n [placeholder]=\"'Flows.Condition.Value' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"rule.value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n }\n @if (!isNumericOperator(rule.operator)) {\n <p-select class=\"pw-condition__type\"\n [options]=\"options['types']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n [ariaLabel]=\"'Flows.Condition.Type' | transloco\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"rule.valueType\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n }\n </div>\n }\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-condition__remove\"\n [attr.aria-label]=\"'Flows.Condition.RemoveRule' | transloco\"\n [pTooltip]=\"'Flows.Condition.RemoveRule' | transloco\"\n appendTo=\"body\"\n (click)=\"removeRule($index)\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </div>\n }\n\n @if (incomplete) {\n <small class=\"pw-condition__hint is-warning\"\n data-testid=\"flow-condition-incomplete\">{{ 'Flows.Condition.Incomplete' | transloco }}</small>\n }\n\n <div class=\"pw-condition__actions\">\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-condition-add\"\n (click)=\"addRule()\">{{ 'Flows.Condition.AddRule' | transloco }}</button>\n }\n <button type=\"button\"\n class=\"btn btn-link btn-sm\"\n (click)=\"useJson()\">{{ 'Flows.Condition.AsJson' | transloco }}</button>\n </div>\n\n <datalist [id]=\"inputId + '-fields'\">\n @for (field of suggestions; track field) {\n <option [value]=\"field\"></option>\n }\n </datalist>\n } @else {\n <pw-flows-json-field [inputId]=\"inputId + '-json'\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"emit($event)\"></pw-flows-json-field>\n @if (canUseRules) {\n <button type=\"button\"\n class=\"btn btn-link btn-sm\"\n (click)=\"useRules()\">{{ 'Flows.Condition.AsRules' | transloco }}</button>\n } @else {\n <small class=\"pw-condition__hint\">{{ 'Flows.Condition.TooComplex' | transloco }}</small>\n }\n }\n</div>\n",
|
|
4443
|
+
styles: [".pw-condition{display:flex;flex-direction:column;gap:8px}.pw-condition__rule{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;padding:8px;border:1px solid #e2e5ea;border-radius:4px}.pw-condition__rule>:not(.pw-condition__remove){grid-column:1}.pw-condition__value{display:flex;gap:6px}.pw-condition__value>:first-child{flex:1;min-width:0}.pw-condition__type{flex:0 0 112px}.pw-condition__remove{grid-column:2;grid-row:1;align-self:start;color:#5a6473}.pw-condition__actions{display:flex;justify-content:space-between;align-items:center}.pw-condition__hint{color:#5a6473;font-size:12px}.pw-condition__hint.is-warning{color:#b7791f}\n"]
|
|
4193
4444
|
}]
|
|
4194
4445
|
}],
|
|
4446
|
+
ctorParameters: () => [
|
|
4447
|
+
{ type: i2$4.TranslocoService },
|
|
4448
|
+
{ type: i0.ChangeDetectorRef },
|
|
4449
|
+
{ type: i0.DestroyRef }
|
|
4450
|
+
],
|
|
4195
4451
|
propDecorators: {
|
|
4196
4452
|
value: [{ type: Input }],
|
|
4197
4453
|
inputId: [{ type: Input }],
|
|
4454
|
+
suggestions: [{ type: Input }],
|
|
4198
4455
|
readOnly: [{ type: Input }],
|
|
4199
4456
|
valueChange: [{ type: Output }]
|
|
4200
4457
|
}
|
|
4201
4458
|
});
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4459
|
+
const FLOW_CRON_MODES = [
|
|
4460
|
+
"minutes",
|
|
4461
|
+
"hourly",
|
|
4462
|
+
"daily",
|
|
4463
|
+
"weekly",
|
|
4464
|
+
"monthly",
|
|
4465
|
+
"custom"
|
|
4466
|
+
];
|
|
4467
|
+
const FLOW_CRON_EVERY_OPTIONS = [
|
|
4468
|
+
1,
|
|
4469
|
+
5,
|
|
4470
|
+
10,
|
|
4471
|
+
15,
|
|
4472
|
+
30
|
|
4473
|
+
];
|
|
4474
|
+
const DEFAULT_FLOW_CRON = {
|
|
4475
|
+
mode: "daily",
|
|
4476
|
+
every: 15,
|
|
4477
|
+
minute: 0,
|
|
4478
|
+
hour: 9,
|
|
4479
|
+
weekday: 1,
|
|
4480
|
+
monthday: 1,
|
|
4481
|
+
custom: ""
|
|
4482
|
+
};
|
|
4483
|
+
const NUMBER = String.raw`(\d{1,2})`;
|
|
4484
|
+
const PATTERNS = [
|
|
4485
|
+
["minutes", /^\*(?:\/(\d{1,2}))? \* \* \* \*$/],
|
|
4486
|
+
["hourly", new RegExp(String.raw`^${NUMBER} \* \* \* \*$`)],
|
|
4487
|
+
["daily", new RegExp(String.raw`^${NUMBER} ${NUMBER} \* \* \*$`)],
|
|
4488
|
+
["weekly", new RegExp(String.raw`^${NUMBER} ${NUMBER} \* \* ([0-6])$`)],
|
|
4489
|
+
["monthly", new RegExp(String.raw`^${NUMBER} ${NUMBER} ${NUMBER} \* \*$`)]
|
|
4490
|
+
];
|
|
4491
|
+
function toFlowCron(schedule) {
|
|
4492
|
+
const { minute, hour } = schedule;
|
|
4493
|
+
switch (schedule.mode) {
|
|
4494
|
+
case "minutes": return schedule.every === 1 ? "* * * * *" : `*/${schedule.every} * * * *`;
|
|
4495
|
+
case "hourly": return `${minute} * * * *`;
|
|
4496
|
+
case "daily": return `${minute} ${hour} * * *`;
|
|
4497
|
+
case "weekly": return `${minute} ${hour} * * ${schedule.weekday}`;
|
|
4498
|
+
case "monthly": return `${minute} ${hour} ${schedule.monthday} * *`;
|
|
4499
|
+
default: return schedule.custom.trim();
|
|
4500
|
+
}
|
|
4501
|
+
}
|
|
4502
|
+
function fromFlowCron(cron) {
|
|
4503
|
+
const text = typeof cron === "string" ? cron.trim().replace(/\s+/g, " ") : "";
|
|
4504
|
+
if (!text) return { ...DEFAULT_FLOW_CRON };
|
|
4505
|
+
for (const [mode, pattern] of PATTERNS) {
|
|
4506
|
+
const match = pattern.exec(text);
|
|
4507
|
+
if (match) return fromMatch(mode, match.slice(1).map((part) => part === void 0 ? void 0 : Number(part)));
|
|
4508
|
+
}
|
|
4509
|
+
return {
|
|
4510
|
+
...DEFAULT_FLOW_CRON,
|
|
4511
|
+
mode: "custom",
|
|
4512
|
+
custom: text
|
|
4513
|
+
};
|
|
4514
|
+
}
|
|
4515
|
+
function fromMatch(mode, [a, b, c]) {
|
|
4516
|
+
const base = {
|
|
4517
|
+
...DEFAULT_FLOW_CRON,
|
|
4518
|
+
mode
|
|
4519
|
+
};
|
|
4520
|
+
switch (mode) {
|
|
4521
|
+
case "minutes": {
|
|
4522
|
+
const every = a ?? 1;
|
|
4523
|
+
return FLOW_CRON_EVERY_OPTIONS.includes(every) ? {
|
|
4524
|
+
...base,
|
|
4525
|
+
every
|
|
4526
|
+
} : {
|
|
4527
|
+
...base,
|
|
4528
|
+
mode: "custom",
|
|
4529
|
+
custom: `*/${every} * * * *`
|
|
4530
|
+
};
|
|
4531
|
+
}
|
|
4532
|
+
case "hourly": return {
|
|
4533
|
+
...base,
|
|
4534
|
+
minute: a
|
|
4535
|
+
};
|
|
4536
|
+
case "daily": return {
|
|
4537
|
+
...base,
|
|
4538
|
+
minute: a,
|
|
4539
|
+
hour: b
|
|
4540
|
+
};
|
|
4541
|
+
case "weekly": return {
|
|
4542
|
+
...base,
|
|
4543
|
+
minute: a,
|
|
4544
|
+
hour: b,
|
|
4545
|
+
weekday: c
|
|
4546
|
+
};
|
|
4547
|
+
default: return c >= 1 && c <= 28 ? {
|
|
4548
|
+
...base,
|
|
4549
|
+
minute: a,
|
|
4550
|
+
hour: b,
|
|
4551
|
+
monthday: c
|
|
4552
|
+
} : {
|
|
4553
|
+
...base,
|
|
4554
|
+
mode: "custom",
|
|
4555
|
+
custom: `${a} ${b} ${c} * *`
|
|
4556
|
+
};
|
|
4557
|
+
}
|
|
4558
|
+
}
|
|
4559
|
+
function flowCronTime(schedule) {
|
|
4560
|
+
return `${String(schedule.hour).padStart(2, "0")}:${String(schedule.minute).padStart(2, "0")}`;
|
|
4561
|
+
}
|
|
4562
|
+
const A_SUNDAY = Date.UTC(2026, 9, 4);
|
|
4563
|
+
const DAY_MS = 864e5;
|
|
4564
|
+
var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
4565
|
+
constructor(translation) {
|
|
4566
|
+
this.translation = translation;
|
|
4567
|
+
this.readOnly = false;
|
|
4568
|
+
this.valueChange = new EventEmitter();
|
|
4569
|
+
this.modes = FLOW_CRON_MODES;
|
|
4570
|
+
this.everyOptions = FLOW_CRON_EVERY_OPTIONS;
|
|
4571
|
+
this.monthdays = Array.from({ length: 28 }, (_, i) => i + 1);
|
|
4572
|
+
this.schedule = fromFlowCron(void 0);
|
|
4573
|
+
this.weekdays = [];
|
|
4574
|
+
const format = new Intl.DateTimeFormat(this.translation.getActiveLang(), {
|
|
4575
|
+
weekday: "long",
|
|
4576
|
+
timeZone: "UTC"
|
|
4577
|
+
});
|
|
4578
|
+
this.weekdays = [
|
|
4579
|
+
0,
|
|
4580
|
+
1,
|
|
4581
|
+
2,
|
|
4582
|
+
3,
|
|
4583
|
+
4,
|
|
4584
|
+
5,
|
|
4585
|
+
6
|
|
4586
|
+
].map((value) => ({
|
|
4587
|
+
value,
|
|
4588
|
+
label: format.format(A_SUNDAY + value * DAY_MS)
|
|
4589
|
+
}));
|
|
4590
|
+
}
|
|
4591
|
+
ngOnChanges() {
|
|
4592
|
+
if (this.value !== void 0 && this.value === this.emitted) return;
|
|
4593
|
+
this.schedule = fromFlowCron(this.value);
|
|
4594
|
+
}
|
|
4595
|
+
get time() {
|
|
4596
|
+
return flowCronTime(this.schedule);
|
|
4597
|
+
}
|
|
4598
|
+
get weekdayLabel() {
|
|
4599
|
+
return this.weekdays[this.schedule.weekday]?.label ?? "";
|
|
4600
|
+
}
|
|
4601
|
+
setMode(mode) {
|
|
4602
|
+
this.update({
|
|
4603
|
+
mode,
|
|
4604
|
+
custom: mode === "custom" ? toFlowCron(this.schedule) : this.schedule.custom
|
|
4605
|
+
});
|
|
4606
|
+
}
|
|
4607
|
+
setTime(time) {
|
|
4608
|
+
const [hour, minute] = (time || "00:00").split(":").map(Number);
|
|
4609
|
+
this.update({
|
|
4610
|
+
hour,
|
|
4611
|
+
minute
|
|
4612
|
+
});
|
|
4613
|
+
}
|
|
4614
|
+
update(changes) {
|
|
4615
|
+
this.schedule = {
|
|
4616
|
+
...this.schedule,
|
|
4617
|
+
...changes
|
|
4618
|
+
};
|
|
4619
|
+
this.emitted = toFlowCron(this.schedule);
|
|
4620
|
+
this.valueChange.emit(this.emitted);
|
|
4621
|
+
}
|
|
4622
|
+
static {
|
|
4623
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4624
|
+
minVersion: "12.0.0",
|
|
4625
|
+
version: "22.2.3",
|
|
4626
|
+
ngImport: i0,
|
|
4627
|
+
type: FlowsCronFieldComponent,
|
|
4628
|
+
deps: [{ token: i2$4.TranslocoService }],
|
|
4629
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
4630
|
+
});
|
|
4631
|
+
}
|
|
4632
|
+
static {
|
|
4633
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4634
|
+
minVersion: "17.0.0",
|
|
4635
|
+
version: "22.2.3",
|
|
4636
|
+
type: FlowsCronFieldComponent,
|
|
4637
|
+
isStandalone: false,
|
|
4638
|
+
selector: "pw-flows-cron-field",
|
|
4245
4639
|
inputs: {
|
|
4246
4640
|
value: "value",
|
|
4247
4641
|
inputId: "inputId",
|
|
@@ -4250,38 +4644,53 @@ var FlowsJsonFieldComponent = class FlowsJsonFieldComponent {
|
|
|
4250
4644
|
outputs: { valueChange: "valueChange" },
|
|
4251
4645
|
usesOnChanges: true,
|
|
4252
4646
|
ngImport: i0,
|
|
4253
|
-
template:
|
|
4254
|
-
<textarea
|
|
4255
|
-
class="form-control pw-json-field"
|
|
4256
|
-
rows="5"
|
|
4257
|
-
spellcheck="false"
|
|
4258
|
-
[id]="inputId"
|
|
4259
|
-
[readOnly]="readOnly"
|
|
4260
|
-
[(ngModel)]="text"
|
|
4261
|
-
[ngModelOptions]="{ standalone: true }"
|
|
4262
|
-
(blur)="commit()"
|
|
4263
|
-
></textarea>
|
|
4264
|
-
@if (invalid) {
|
|
4265
|
-
<pw-field-error-display
|
|
4266
|
-
[displayError]="true"
|
|
4267
|
-
[errorMsg]="'Flows.Versions.Editor.InvalidJson' | transloco"
|
|
4268
|
-
>
|
|
4269
|
-
</pw-field-error-display>
|
|
4270
|
-
}
|
|
4271
|
-
`,
|
|
4272
|
-
isInline: true,
|
|
4273
|
-
styles: [".pw-json-field{white-space:pre;overflow-x:auto}\n"],
|
|
4647
|
+
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",
|
|
4274
4648
|
dependencies: [
|
|
4649
|
+
{
|
|
4650
|
+
kind: "directive",
|
|
4651
|
+
type: i3$1.NgSelectOption,
|
|
4652
|
+
selector: "option",
|
|
4653
|
+
inputs: ["ngValue", "value"]
|
|
4654
|
+
},
|
|
4655
|
+
{
|
|
4656
|
+
kind: "directive",
|
|
4657
|
+
type: i3$1.ɵNgSelectMultipleOption,
|
|
4658
|
+
selector: "option",
|
|
4659
|
+
inputs: ["ngValue", "value"]
|
|
4660
|
+
},
|
|
4275
4661
|
{
|
|
4276
4662
|
kind: "directive",
|
|
4277
4663
|
type: i3$1.DefaultValueAccessor,
|
|
4278
4664
|
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]"
|
|
4279
4665
|
},
|
|
4666
|
+
{
|
|
4667
|
+
kind: "directive",
|
|
4668
|
+
type: i3$1.NumberValueAccessor,
|
|
4669
|
+
selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
|
|
4670
|
+
},
|
|
4671
|
+
{
|
|
4672
|
+
kind: "directive",
|
|
4673
|
+
type: i3$1.SelectControlValueAccessor,
|
|
4674
|
+
selector: "select:not([multiple]):not([ngNoCva])[formControlName],select:not([multiple]):not([ngNoCva])[formControl],select:not([multiple]):not([ngNoCva])[ngModel]",
|
|
4675
|
+
inputs: ["compareWith"]
|
|
4676
|
+
},
|
|
4280
4677
|
{
|
|
4281
4678
|
kind: "directive",
|
|
4282
4679
|
type: i3$1.NgControlStatus,
|
|
4283
4680
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
4284
4681
|
},
|
|
4682
|
+
{
|
|
4683
|
+
kind: "directive",
|
|
4684
|
+
type: i3$1.MinValidator,
|
|
4685
|
+
selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
|
|
4686
|
+
inputs: ["min"]
|
|
4687
|
+
},
|
|
4688
|
+
{
|
|
4689
|
+
kind: "directive",
|
|
4690
|
+
type: i3$1.MaxValidator,
|
|
4691
|
+
selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]",
|
|
4692
|
+
inputs: ["max"]
|
|
4693
|
+
},
|
|
4285
4694
|
{
|
|
4286
4695
|
kind: "directive",
|
|
4287
4696
|
type: i3$1.NgModel,
|
|
@@ -4295,12 +4704,6 @@ var FlowsJsonFieldComponent = class FlowsJsonFieldComponent {
|
|
|
4295
4704
|
outputs: ["ngModelChange"],
|
|
4296
4705
|
exportAs: ["ngModel"]
|
|
4297
4706
|
},
|
|
4298
|
-
{
|
|
4299
|
-
kind: "component",
|
|
4300
|
-
type: i2$1.FieldErrorDisplayComponent,
|
|
4301
|
-
selector: "pw-field-error-display",
|
|
4302
|
-
inputs: ["errorMsg", "displayError"]
|
|
4303
|
-
},
|
|
4304
4707
|
{
|
|
4305
4708
|
kind: "pipe",
|
|
4306
4709
|
type: i2$4.TranslocoPipe,
|
|
@@ -4314,298 +4717,75 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4314
4717
|
minVersion: "12.0.0",
|
|
4315
4718
|
version: "22.2.3",
|
|
4316
4719
|
ngImport: i0,
|
|
4317
|
-
type:
|
|
4720
|
+
type: FlowsCronFieldComponent,
|
|
4318
4721
|
decorators: [{
|
|
4319
4722
|
type: Component,
|
|
4320
4723
|
args: [{
|
|
4321
|
-
selector: "pw-flows-
|
|
4322
|
-
template: `
|
|
4323
|
-
<textarea
|
|
4324
|
-
class="form-control pw-json-field"
|
|
4325
|
-
rows="5"
|
|
4326
|
-
spellcheck="false"
|
|
4327
|
-
[id]="inputId"
|
|
4328
|
-
[readOnly]="readOnly"
|
|
4329
|
-
[(ngModel)]="text"
|
|
4330
|
-
[ngModelOptions]="{ standalone: true }"
|
|
4331
|
-
(blur)="commit()"
|
|
4332
|
-
></textarea>
|
|
4333
|
-
@if (invalid) {
|
|
4334
|
-
<pw-field-error-display
|
|
4335
|
-
[displayError]="true"
|
|
4336
|
-
[errorMsg]="'Flows.Versions.Editor.InvalidJson' | transloco"
|
|
4337
|
-
>
|
|
4338
|
-
</pw-field-error-display>
|
|
4339
|
-
}
|
|
4340
|
-
`,
|
|
4724
|
+
selector: "pw-flows-cron-field",
|
|
4341
4725
|
standalone: false,
|
|
4342
|
-
|
|
4726
|
+
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"
|
|
4343
4727
|
}]
|
|
4344
4728
|
}],
|
|
4729
|
+
ctorParameters: () => [{ type: i2$4.TranslocoService }],
|
|
4345
4730
|
propDecorators: {
|
|
4346
4731
|
value: [{ type: Input }],
|
|
4347
4732
|
inputId: [{ type: Input }],
|
|
4348
4733
|
readOnly: [{ type: Input }],
|
|
4349
4734
|
valueChange: [{ type: Output }]
|
|
4350
4735
|
}
|
|
4351
|
-
});
|
|
4352
|
-
const
|
|
4353
|
-
"
|
|
4354
|
-
"
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
"not_empty"
|
|
4362
|
-
];
|
|
4363
|
-
const LOGIC_OPS = {
|
|
4364
|
-
"==": "eq",
|
|
4365
|
-
"!=": "neq",
|
|
4366
|
-
">": "gt",
|
|
4367
|
-
">=": "gte",
|
|
4368
|
-
"<": "lt",
|
|
4369
|
-
"<=": "lte"
|
|
4370
|
-
};
|
|
4371
|
-
const OP_LOGIC = Object.fromEntries(Object.entries(LOGIC_OPS).map(([logic, op]) => [op, logic]));
|
|
4372
|
-
function isNumericOperator(operator) {
|
|
4373
|
-
return [
|
|
4374
|
-
"gt",
|
|
4375
|
-
"gte",
|
|
4376
|
-
"lt",
|
|
4377
|
-
"lte"
|
|
4378
|
-
].includes(operator);
|
|
4379
|
-
}
|
|
4380
|
-
function takesValue(operator) {
|
|
4381
|
-
return operator !== "empty" && operator !== "not_empty";
|
|
4382
|
-
}
|
|
4383
|
-
function emptyFlowConditionRule() {
|
|
4384
|
-
return {
|
|
4385
|
-
field: "",
|
|
4386
|
-
operator: "eq",
|
|
4387
|
-
value: "",
|
|
4388
|
-
valueType: "text"
|
|
4389
|
-
};
|
|
4390
|
-
}
|
|
4391
|
-
function typedValue(rule) {
|
|
4392
|
-
if (rule.valueType === "boolean") return rule.value === "true";
|
|
4393
|
-
return isNumericOperator(rule.operator) || rule.valueType === "number" ? Number(rule.value) : rule.value;
|
|
4394
|
-
}
|
|
4395
|
-
function isCompleteRule(rule) {
|
|
4396
|
-
if (!rule.field.trim()) return false;
|
|
4397
|
-
if (!takesValue(rule.operator)) return true;
|
|
4398
|
-
return isNumericOperator(rule.operator) || rule.valueType === "number" ? rule.value.trim() !== "" && Number.isFinite(Number(rule.value)) : true;
|
|
4399
|
-
}
|
|
4400
|
-
function ruleToLogic(rule) {
|
|
4401
|
-
const field = { var: rule.field.trim() };
|
|
4402
|
-
switch (rule.operator) {
|
|
4403
|
-
case "contains": return { in: [typedValue(rule), field] };
|
|
4404
|
-
case "empty": return { "==": [field, null] };
|
|
4405
|
-
case "not_empty": return { "!=": [field, null] };
|
|
4406
|
-
default: return { [OP_LOGIC[rule.operator]]: [field, typedValue(rule)] };
|
|
4407
|
-
}
|
|
4408
|
-
}
|
|
4409
|
-
function toJsonLogic(group) {
|
|
4410
|
-
if (!group.rules.length || !group.rules.every(isCompleteRule)) return;
|
|
4411
|
-
const logic = group.rules.map(ruleToLogic);
|
|
4412
|
-
return logic.length === 1 ? logic[0] : { [group.combinator === "all" ? "and" : "or"]: logic };
|
|
4413
|
-
}
|
|
4414
|
-
function asRecord(value) {
|
|
4415
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
4416
|
-
}
|
|
4417
|
-
function fieldOf(value) {
|
|
4418
|
-
const record = asRecord(value);
|
|
4419
|
-
const keys = record ? Object.keys(record) : [];
|
|
4420
|
-
return keys.length === 1 && keys[0] === "var" && typeof record?.["var"] === "string" ? record["var"] : null;
|
|
4421
|
-
}
|
|
4422
|
-
function valueRule(field, operator, value) {
|
|
4423
|
-
if (typeof value === "number") return {
|
|
4424
|
-
field,
|
|
4425
|
-
operator,
|
|
4426
|
-
value: String(value),
|
|
4427
|
-
valueType: "number"
|
|
4428
|
-
};
|
|
4429
|
-
if (typeof value === "boolean") return {
|
|
4430
|
-
field,
|
|
4431
|
-
operator,
|
|
4432
|
-
value: String(value),
|
|
4433
|
-
valueType: "boolean"
|
|
4434
|
-
};
|
|
4435
|
-
return typeof value === "string" ? {
|
|
4436
|
-
field,
|
|
4437
|
-
operator,
|
|
4438
|
-
value,
|
|
4439
|
-
valueType: "text"
|
|
4440
|
-
} : null;
|
|
4441
|
-
}
|
|
4442
|
-
function logicToRule(logic) {
|
|
4443
|
-
const record = asRecord(logic);
|
|
4444
|
-
const [op] = record ? Object.keys(record) : [];
|
|
4445
|
-
const args = record && Object.keys(record).length === 1 ? record[op] : null;
|
|
4446
|
-
if (!Array.isArray(args) || args.length !== 2) return null;
|
|
4447
|
-
if (op === "in") {
|
|
4448
|
-
const field = fieldOf(args[1]);
|
|
4449
|
-
return field ? valueRule(field, "contains", args[0]) : null;
|
|
4450
|
-
}
|
|
4451
|
-
const field = fieldOf(args[0]);
|
|
4452
|
-
const operator = LOGIC_OPS[op];
|
|
4453
|
-
if (!field || !operator) return null;
|
|
4454
|
-
if (args[1] === null && (operator === "eq" || operator === "neq")) return {
|
|
4455
|
-
field,
|
|
4456
|
-
operator: operator === "eq" ? "empty" : "not_empty",
|
|
4457
|
-
value: "",
|
|
4458
|
-
valueType: "text"
|
|
4459
|
-
};
|
|
4460
|
-
return valueRule(field, operator, args[1]);
|
|
4461
|
-
}
|
|
4462
|
-
function fromJsonLogic(logic) {
|
|
4463
|
-
const record = asRecord(logic);
|
|
4464
|
-
if (!record) return logic === void 0 || logic === null ? {
|
|
4465
|
-
combinator: "all",
|
|
4466
|
-
rules: []
|
|
4467
|
-
} : null;
|
|
4468
|
-
const [key] = Object.keys(record);
|
|
4469
|
-
const nested = Object.keys(record).length === 1 && (key === "and" || key === "or") ? record[key] : null;
|
|
4470
|
-
const rules = (Array.isArray(nested) ? nested : [logic]).map(logicToRule);
|
|
4471
|
-
if (rules.includes(null)) return null;
|
|
4472
|
-
return {
|
|
4473
|
-
combinator: key === "or" ? "any" : "all",
|
|
4474
|
-
rules
|
|
4475
|
-
};
|
|
4476
|
-
}
|
|
4477
|
-
const OPTION_KEYS = {
|
|
4478
|
-
operators: FLOW_CONDITION_OPERATORS.map((op) => [op, `Flows.Condition.Ops.${op}`]),
|
|
4479
|
-
types: [
|
|
4480
|
-
"text",
|
|
4481
|
-
"number",
|
|
4482
|
-
"boolean"
|
|
4483
|
-
].map((type) => [type, `Flows.Condition.Types.${type}`]),
|
|
4484
|
-
combinators: [["all", "Flows.Condition.All"], ["any", "Flows.Condition.Any"]],
|
|
4485
|
-
booleans: [["true", "Flows.Branch.true"], ["false", "Flows.Branch.false"]]
|
|
4486
|
-
};
|
|
4487
|
-
var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
4488
|
-
constructor(translation, cdr, destroyRef) {
|
|
4489
|
-
this.suggestions = [];
|
|
4490
|
-
this.readOnly = false;
|
|
4491
|
-
this.valueChange = new EventEmitter();
|
|
4492
|
-
this.icons = FLOWS_ICONS;
|
|
4493
|
-
this.options = {};
|
|
4494
|
-
this.takesValue = takesValue;
|
|
4495
|
-
this.isNumericOperator = isNumericOperator;
|
|
4496
|
-
this.group = {
|
|
4497
|
-
combinator: "all",
|
|
4498
|
-
rules: []
|
|
4499
|
-
};
|
|
4500
|
-
this.mode = "rules";
|
|
4501
|
-
this.incomplete = false;
|
|
4502
|
-
translation.selectTranslation("flows").pipe(takeUntilDestroyed(destroyRef)).subscribe(() => {
|
|
4503
|
-
this.options = Object.fromEntries(Object.entries(OPTION_KEYS).map(([name, entries]) => [name, entries.map(([value, key]) => ({
|
|
4504
|
-
value,
|
|
4505
|
-
label: translation.translate(key)
|
|
4506
|
-
}))]));
|
|
4507
|
-
cdr.markForCheck();
|
|
4508
|
-
});
|
|
4509
|
-
}
|
|
4510
|
-
ngOnChanges() {
|
|
4511
|
-
if (this.value !== void 0 && this.value === this.emitted) return;
|
|
4512
|
-
this.load(this.value);
|
|
4513
|
-
}
|
|
4514
|
-
get combinesRules() {
|
|
4515
|
-
return this.group.rules.length > 1;
|
|
4516
|
-
}
|
|
4517
|
-
get canUseRules() {
|
|
4518
|
-
return fromJsonLogic(this.value) !== null;
|
|
4519
|
-
}
|
|
4520
|
-
addRule() {
|
|
4521
|
-
this.group = {
|
|
4522
|
-
...this.group,
|
|
4523
|
-
rules: [...this.group.rules, emptyFlowConditionRule()]
|
|
4524
|
-
};
|
|
4525
|
-
this.incomplete = true;
|
|
4526
|
-
}
|
|
4527
|
-
removeRule(index) {
|
|
4528
|
-
this.group = {
|
|
4529
|
-
...this.group,
|
|
4530
|
-
rules: this.group.rules.filter((_, i) => i !== index)
|
|
4531
|
-
};
|
|
4532
|
-
this.commit();
|
|
4533
|
-
}
|
|
4534
|
-
useRules() {
|
|
4535
|
-
this.load(this.value);
|
|
4536
|
-
}
|
|
4537
|
-
useJson() {
|
|
4538
|
-
this.mode = "json";
|
|
4539
|
-
}
|
|
4540
|
-
commit() {
|
|
4541
|
-
if (this.readOnly) return;
|
|
4542
|
-
const logic = this.group.rules.length ? toJsonLogic(this.group) : void 0;
|
|
4543
|
-
this.incomplete = !!this.group.rules.length && logic === void 0;
|
|
4544
|
-
if (!this.incomplete) this.emit(logic);
|
|
4545
|
-
}
|
|
4546
|
-
emit(value) {
|
|
4547
|
-
this.emitted = value;
|
|
4548
|
-
this.valueChange.emit(value);
|
|
4549
|
-
}
|
|
4550
|
-
load(value) {
|
|
4551
|
-
const group = fromJsonLogic(value);
|
|
4552
|
-
this.mode = group ? "rules" : "json";
|
|
4553
|
-
this.group = group ?? {
|
|
4554
|
-
combinator: "all",
|
|
4555
|
-
rules: []
|
|
4556
|
-
};
|
|
4557
|
-
this.incomplete = false;
|
|
4736
|
+
});
|
|
4737
|
+
const ZONES = (() => {
|
|
4738
|
+
const zones = Intl.supportedValuesOf("timeZone");
|
|
4739
|
+
return zones.includes("UTC") ? zones : ["UTC", ...zones];
|
|
4740
|
+
})();
|
|
4741
|
+
var FlowsTimezoneFieldComponent = class FlowsTimezoneFieldComponent {
|
|
4742
|
+
constructor() {
|
|
4743
|
+
this.readOnly = false;
|
|
4744
|
+
this.valueChange = new EventEmitter();
|
|
4745
|
+
this.zones = ZONES;
|
|
4558
4746
|
}
|
|
4559
4747
|
static {
|
|
4560
4748
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4561
4749
|
minVersion: "12.0.0",
|
|
4562
4750
|
version: "22.2.3",
|
|
4563
4751
|
ngImport: i0,
|
|
4564
|
-
type:
|
|
4565
|
-
deps: [
|
|
4566
|
-
{ token: i2$4.TranslocoService },
|
|
4567
|
-
{ token: i0.ChangeDetectorRef },
|
|
4568
|
-
{ token: i0.DestroyRef }
|
|
4569
|
-
],
|
|
4752
|
+
type: FlowsTimezoneFieldComponent,
|
|
4753
|
+
deps: [],
|
|
4570
4754
|
target: i0.ɵɵFactoryTarget.Component
|
|
4571
4755
|
});
|
|
4572
4756
|
}
|
|
4573
4757
|
static {
|
|
4574
4758
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4575
|
-
minVersion: "
|
|
4759
|
+
minVersion: "14.0.0",
|
|
4576
4760
|
version: "22.2.3",
|
|
4577
|
-
type:
|
|
4761
|
+
type: FlowsTimezoneFieldComponent,
|
|
4578
4762
|
isStandalone: false,
|
|
4579
|
-
selector: "pw-flows-
|
|
4763
|
+
selector: "pw-flows-timezone-field",
|
|
4580
4764
|
inputs: {
|
|
4581
4765
|
value: "value",
|
|
4582
4766
|
inputId: "inputId",
|
|
4583
|
-
suggestions: "suggestions",
|
|
4584
4767
|
readOnly: "readOnly"
|
|
4585
4768
|
},
|
|
4586
4769
|
outputs: { valueChange: "valueChange" },
|
|
4587
|
-
usesOnChanges: true,
|
|
4588
4770
|
ngImport: i0,
|
|
4589
|
-
template:
|
|
4590
|
-
|
|
4771
|
+
template: `
|
|
4772
|
+
<p-select
|
|
4773
|
+
[inputId]="inputId"
|
|
4774
|
+
[options]="zones"
|
|
4775
|
+
[filter]="true"
|
|
4776
|
+
[showClear]="true"
|
|
4777
|
+
[disabled]="readOnly"
|
|
4778
|
+
[placeholder]="'Flows.Schedule.ServerTime' | transloco"
|
|
4779
|
+
[ngModel]="value"
|
|
4780
|
+
[ngModelOptions]="{ standalone: true }"
|
|
4781
|
+
(ngModelChange)="valueChange.emit($event || null)"
|
|
4782
|
+
appendTo="body"
|
|
4783
|
+
styleClass="w-100"
|
|
4784
|
+
>
|
|
4785
|
+
</p-select>
|
|
4786
|
+
`,
|
|
4787
|
+
isInline: true,
|
|
4591
4788
|
dependencies: [
|
|
4592
|
-
{
|
|
4593
|
-
kind: "directive",
|
|
4594
|
-
type: i3$1.NgSelectOption,
|
|
4595
|
-
selector: "option",
|
|
4596
|
-
inputs: ["ngValue", "value"]
|
|
4597
|
-
},
|
|
4598
|
-
{
|
|
4599
|
-
kind: "directive",
|
|
4600
|
-
type: i3$1.ɵNgSelectMultipleOption,
|
|
4601
|
-
selector: "option",
|
|
4602
|
-
inputs: ["ngValue", "value"]
|
|
4603
|
-
},
|
|
4604
|
-
{
|
|
4605
|
-
kind: "directive",
|
|
4606
|
-
type: i3$1.DefaultValueAccessor,
|
|
4607
|
-
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]"
|
|
4608
|
-
},
|
|
4609
4789
|
{
|
|
4610
4790
|
kind: "directive",
|
|
4611
4791
|
type: i3$1.NgControlStatus,
|
|
@@ -4624,34 +4804,6 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
4624
4804
|
outputs: ["ngModelChange"],
|
|
4625
4805
|
exportAs: ["ngModel"]
|
|
4626
4806
|
},
|
|
4627
|
-
{
|
|
4628
|
-
kind: "directive",
|
|
4629
|
-
type: i1$1.Tooltip,
|
|
4630
|
-
selector: "[pTooltip]",
|
|
4631
|
-
inputs: [
|
|
4632
|
-
"tooltipPosition",
|
|
4633
|
-
"tooltipEvent",
|
|
4634
|
-
"positionStyle",
|
|
4635
|
-
"tooltipStyleClass",
|
|
4636
|
-
"tooltipZIndex",
|
|
4637
|
-
"escape",
|
|
4638
|
-
"showDelay",
|
|
4639
|
-
"hideDelay",
|
|
4640
|
-
"life",
|
|
4641
|
-
"positionTop",
|
|
4642
|
-
"positionLeft",
|
|
4643
|
-
"autoHide",
|
|
4644
|
-
"fitContent",
|
|
4645
|
-
"hideOnEscape",
|
|
4646
|
-
"showOnEllipsis",
|
|
4647
|
-
"pTooltip",
|
|
4648
|
-
"tooltipDisabled",
|
|
4649
|
-
"tooltipOptions",
|
|
4650
|
-
"appendTo",
|
|
4651
|
-
"pTooltipPT",
|
|
4652
|
-
"pTooltipUnstyled"
|
|
4653
|
-
]
|
|
4654
|
-
},
|
|
4655
4807
|
{
|
|
4656
4808
|
kind: "component",
|
|
4657
4809
|
type: i4$1.Select,
|
|
@@ -4708,18 +4860,177 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
4708
4860
|
"filterValue",
|
|
4709
4861
|
"options",
|
|
4710
4862
|
"appendTo",
|
|
4711
|
-
"motionOptions"
|
|
4712
|
-
],
|
|
4713
|
-
outputs: [
|
|
4714
|
-
"onChange",
|
|
4715
|
-
"onFilter",
|
|
4716
|
-
"onFocus",
|
|
4717
|
-
"onBlur",
|
|
4718
|
-
"onClick",
|
|
4719
|
-
"onShow",
|
|
4720
|
-
"onHide",
|
|
4721
|
-
"onClear",
|
|
4722
|
-
"onLazyLoad"
|
|
4863
|
+
"motionOptions"
|
|
4864
|
+
],
|
|
4865
|
+
outputs: [
|
|
4866
|
+
"onChange",
|
|
4867
|
+
"onFilter",
|
|
4868
|
+
"onFocus",
|
|
4869
|
+
"onBlur",
|
|
4870
|
+
"onClick",
|
|
4871
|
+
"onShow",
|
|
4872
|
+
"onHide",
|
|
4873
|
+
"onClear",
|
|
4874
|
+
"onLazyLoad"
|
|
4875
|
+
]
|
|
4876
|
+
},
|
|
4877
|
+
{
|
|
4878
|
+
kind: "pipe",
|
|
4879
|
+
type: i2$4.TranslocoPipe,
|
|
4880
|
+
name: "transloco"
|
|
4881
|
+
}
|
|
4882
|
+
]
|
|
4883
|
+
});
|
|
4884
|
+
}
|
|
4885
|
+
};
|
|
4886
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
4887
|
+
minVersion: "12.0.0",
|
|
4888
|
+
version: "22.2.3",
|
|
4889
|
+
ngImport: i0,
|
|
4890
|
+
type: FlowsTimezoneFieldComponent,
|
|
4891
|
+
decorators: [{
|
|
4892
|
+
type: Component,
|
|
4893
|
+
args: [{
|
|
4894
|
+
selector: "pw-flows-timezone-field",
|
|
4895
|
+
template: `
|
|
4896
|
+
<p-select
|
|
4897
|
+
[inputId]="inputId"
|
|
4898
|
+
[options]="zones"
|
|
4899
|
+
[filter]="true"
|
|
4900
|
+
[showClear]="true"
|
|
4901
|
+
[disabled]="readOnly"
|
|
4902
|
+
[placeholder]="'Flows.Schedule.ServerTime' | transloco"
|
|
4903
|
+
[ngModel]="value"
|
|
4904
|
+
[ngModelOptions]="{ standalone: true }"
|
|
4905
|
+
(ngModelChange)="valueChange.emit($event || null)"
|
|
4906
|
+
appendTo="body"
|
|
4907
|
+
styleClass="w-100"
|
|
4908
|
+
>
|
|
4909
|
+
</p-select>
|
|
4910
|
+
`,
|
|
4911
|
+
standalone: false
|
|
4912
|
+
}]
|
|
4913
|
+
}],
|
|
4914
|
+
propDecorators: {
|
|
4915
|
+
value: [{ type: Input }],
|
|
4916
|
+
inputId: [{ type: Input }],
|
|
4917
|
+
readOnly: [{ type: Input }],
|
|
4918
|
+
valueChange: [{ type: Output }]
|
|
4919
|
+
}
|
|
4920
|
+
});
|
|
4921
|
+
var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
4922
|
+
constructor() {
|
|
4923
|
+
this.readOnly = false;
|
|
4924
|
+
this.valueChange = new EventEmitter();
|
|
4925
|
+
this.icons = FLOWS_ICONS;
|
|
4926
|
+
this.pairs = [];
|
|
4927
|
+
}
|
|
4928
|
+
ngOnChanges() {
|
|
4929
|
+
if (this.value !== void 0 && this.value === this.emitted) return;
|
|
4930
|
+
const record = this.value && typeof this.value === "object" && !Array.isArray(this.value) ? this.value : {};
|
|
4931
|
+
this.pairs = Object.entries(record).map(([key, value]) => ({
|
|
4932
|
+
key,
|
|
4933
|
+
value: typeof value === "string" ? value : JSON.stringify(value),
|
|
4934
|
+
original: value
|
|
4935
|
+
}));
|
|
4936
|
+
}
|
|
4937
|
+
addPair() {
|
|
4938
|
+
this.pairs = [...this.pairs, {
|
|
4939
|
+
key: "",
|
|
4940
|
+
value: ""
|
|
4941
|
+
}];
|
|
4942
|
+
}
|
|
4943
|
+
removePair(index) {
|
|
4944
|
+
this.pairs = this.pairs.filter((_, i) => i !== index);
|
|
4945
|
+
this.commit();
|
|
4946
|
+
}
|
|
4947
|
+
editValue(pair, value) {
|
|
4948
|
+
pair.value = value;
|
|
4949
|
+
delete pair.original;
|
|
4950
|
+
}
|
|
4951
|
+
commit() {
|
|
4952
|
+
const record = {};
|
|
4953
|
+
this.pairs.filter((pair) => pair.key.trim()).forEach((pair) => record[pair.key.trim()] = "original" in pair ? pair.original : pair.value);
|
|
4954
|
+
this.emitted = record;
|
|
4955
|
+
this.valueChange.emit(record);
|
|
4956
|
+
}
|
|
4957
|
+
static {
|
|
4958
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4959
|
+
minVersion: "12.0.0",
|
|
4960
|
+
version: "22.2.3",
|
|
4961
|
+
ngImport: i0,
|
|
4962
|
+
type: FlowsPairsFieldComponent,
|
|
4963
|
+
deps: [],
|
|
4964
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
4965
|
+
});
|
|
4966
|
+
}
|
|
4967
|
+
static {
|
|
4968
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4969
|
+
minVersion: "17.0.0",
|
|
4970
|
+
version: "22.2.3",
|
|
4971
|
+
type: FlowsPairsFieldComponent,
|
|
4972
|
+
isStandalone: false,
|
|
4973
|
+
selector: "pw-flows-pairs-field",
|
|
4974
|
+
inputs: {
|
|
4975
|
+
value: "value",
|
|
4976
|
+
inputId: "inputId",
|
|
4977
|
+
readOnly: "readOnly"
|
|
4978
|
+
},
|
|
4979
|
+
outputs: { valueChange: "valueChange" },
|
|
4980
|
+
usesOnChanges: true,
|
|
4981
|
+
ngImport: i0,
|
|
4982
|
+
template: "<div class=\"pw-pairs-field\"\n [id]=\"inputId\">\n @for (pair of pairs; track $index) {\n <div class=\"pw-pairs-field__row\"\n data-testid=\"flow-pair\">\n <input type=\"text\"\n class=\"form-control\"\n [attr.aria-label]=\"'Flows.Inspector.FieldName' | transloco\"\n [placeholder]=\"'Flows.Inspector.FieldName' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"pair.key\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n <input type=\"text\"\n class=\"form-control\"\n [attr.aria-label]=\"'Flows.Inspector.FieldValue' | transloco\"\n [placeholder]=\"'Flows.Inspector.FieldValue' | transloco\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"pair.value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"editValue(pair, $event)\"\n (blur)=\"commit()\" />\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-pairs-field__remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveField' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveField' | transloco\"\n appendTo=\"body\"\n (click)=\"removePair($index)\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </div>\n }\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n (click)=\"addPair()\">\n {{ 'Flows.Inspector.AddField' | transloco }}\n </button>\n }\n</div>\n",
|
|
4983
|
+
styles: [".pw-pairs-field{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.pw-pairs-field__row{display:flex;align-items:center;gap:8px;width:100%}.pw-pairs-field__remove{flex:none;color:#5a6473}\n"],
|
|
4984
|
+
dependencies: [
|
|
4985
|
+
{
|
|
4986
|
+
kind: "directive",
|
|
4987
|
+
type: i3$1.DefaultValueAccessor,
|
|
4988
|
+
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]"
|
|
4989
|
+
},
|
|
4990
|
+
{
|
|
4991
|
+
kind: "directive",
|
|
4992
|
+
type: i3$1.NgControlStatus,
|
|
4993
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
4994
|
+
},
|
|
4995
|
+
{
|
|
4996
|
+
kind: "directive",
|
|
4997
|
+
type: i3$1.NgModel,
|
|
4998
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
4999
|
+
inputs: [
|
|
5000
|
+
"name",
|
|
5001
|
+
"disabled",
|
|
5002
|
+
"ngModel",
|
|
5003
|
+
"ngModelOptions"
|
|
5004
|
+
],
|
|
5005
|
+
outputs: ["ngModelChange"],
|
|
5006
|
+
exportAs: ["ngModel"]
|
|
5007
|
+
},
|
|
5008
|
+
{
|
|
5009
|
+
kind: "directive",
|
|
5010
|
+
type: i1$1.Tooltip,
|
|
5011
|
+
selector: "[pTooltip]",
|
|
5012
|
+
inputs: [
|
|
5013
|
+
"tooltipPosition",
|
|
5014
|
+
"tooltipEvent",
|
|
5015
|
+
"positionStyle",
|
|
5016
|
+
"tooltipStyleClass",
|
|
5017
|
+
"tooltipZIndex",
|
|
5018
|
+
"escape",
|
|
5019
|
+
"showDelay",
|
|
5020
|
+
"hideDelay",
|
|
5021
|
+
"life",
|
|
5022
|
+
"positionTop",
|
|
5023
|
+
"positionLeft",
|
|
5024
|
+
"autoHide",
|
|
5025
|
+
"fitContent",
|
|
5026
|
+
"hideOnEscape",
|
|
5027
|
+
"showOnEllipsis",
|
|
5028
|
+
"pTooltip",
|
|
5029
|
+
"tooltipDisabled",
|
|
5030
|
+
"tooltipOptions",
|
|
5031
|
+
"appendTo",
|
|
5032
|
+
"pTooltipPT",
|
|
5033
|
+
"pTooltipUnstyled"
|
|
4723
5034
|
]
|
|
4724
5035
|
},
|
|
4725
5036
|
{
|
|
@@ -4759,17 +5070,6 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
4759
5070
|
"a11yRoleChange"
|
|
4760
5071
|
]
|
|
4761
5072
|
},
|
|
4762
|
-
{
|
|
4763
|
-
kind: "component",
|
|
4764
|
-
type: FlowsJsonFieldComponent,
|
|
4765
|
-
selector: "pw-flows-json-field",
|
|
4766
|
-
inputs: [
|
|
4767
|
-
"value",
|
|
4768
|
-
"inputId",
|
|
4769
|
-
"readOnly"
|
|
4770
|
-
],
|
|
4771
|
-
outputs: ["valueChange"]
|
|
4772
|
-
},
|
|
4773
5073
|
{
|
|
4774
5074
|
kind: "pipe",
|
|
4775
5075
|
type: i2$4.TranslocoPipe,
|
|
@@ -4783,71 +5083,84 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4783
5083
|
minVersion: "12.0.0",
|
|
4784
5084
|
version: "22.2.3",
|
|
4785
5085
|
ngImport: i0,
|
|
4786
|
-
type:
|
|
5086
|
+
type: FlowsPairsFieldComponent,
|
|
4787
5087
|
decorators: [{
|
|
4788
5088
|
type: Component,
|
|
4789
5089
|
args: [{
|
|
4790
|
-
selector: "pw-flows-
|
|
5090
|
+
selector: "pw-flows-pairs-field",
|
|
4791
5091
|
standalone: false,
|
|
4792
|
-
template: "<div class=\"pw-
|
|
4793
|
-
styles: [".pw-
|
|
5092
|
+
template: "<div class=\"pw-pairs-field\"\n [id]=\"inputId\">\n @for (pair of pairs; track $index) {\n <div class=\"pw-pairs-field__row\"\n data-testid=\"flow-pair\">\n <input type=\"text\"\n class=\"form-control\"\n [attr.aria-label]=\"'Flows.Inspector.FieldName' | transloco\"\n [placeholder]=\"'Flows.Inspector.FieldName' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"pair.key\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n <input type=\"text\"\n class=\"form-control\"\n [attr.aria-label]=\"'Flows.Inspector.FieldValue' | transloco\"\n [placeholder]=\"'Flows.Inspector.FieldValue' | transloco\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"pair.value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"editValue(pair, $event)\"\n (blur)=\"commit()\" />\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-pairs-field__remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveField' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveField' | transloco\"\n appendTo=\"body\"\n (click)=\"removePair($index)\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </div>\n }\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n (click)=\"addPair()\">\n {{ 'Flows.Inspector.AddField' | transloco }}\n </button>\n }\n</div>\n",
|
|
5093
|
+
styles: [".pw-pairs-field{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.pw-pairs-field__row{display:flex;align-items:center;gap:8px;width:100%}.pw-pairs-field__remove{flex:none;color:#5a6473}\n"]
|
|
4794
5094
|
}]
|
|
4795
5095
|
}],
|
|
4796
|
-
ctorParameters: () => [
|
|
4797
|
-
{ type: i2$4.TranslocoService },
|
|
4798
|
-
{ type: i0.ChangeDetectorRef },
|
|
4799
|
-
{ type: i0.DestroyRef }
|
|
4800
|
-
],
|
|
4801
5096
|
propDecorators: {
|
|
4802
5097
|
value: [{ type: Input }],
|
|
4803
5098
|
inputId: [{ type: Input }],
|
|
4804
|
-
suggestions: [{ type: Input }],
|
|
4805
5099
|
readOnly: [{ type: Input }],
|
|
4806
5100
|
valueChange: [{ type: Output }]
|
|
4807
5101
|
}
|
|
4808
5102
|
});
|
|
4809
|
-
|
|
5103
|
+
function flowChoiceName(name) {
|
|
5104
|
+
return name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
5105
|
+
}
|
|
5106
|
+
const FLOW_RESERVED_CHOICES = [
|
|
5107
|
+
"next",
|
|
5108
|
+
"error",
|
|
5109
|
+
"unsure"
|
|
5110
|
+
];
|
|
5111
|
+
function flowChoiceProblem(names, index) {
|
|
5112
|
+
const name = names[index];
|
|
5113
|
+
if (!name) return null;
|
|
5114
|
+
if (FLOW_RESERVED_CHOICES.includes(name)) return "Flows.Inspector.ChoiceReserved";
|
|
5115
|
+
return names.indexOf(name) < index ? "Flows.Inspector.ChoiceDuplicate" : null;
|
|
5116
|
+
}
|
|
5117
|
+
var FlowsChoicesFieldComponent = class FlowsChoicesFieldComponent {
|
|
4810
5118
|
constructor() {
|
|
4811
5119
|
this.readOnly = false;
|
|
4812
5120
|
this.valueChange = new EventEmitter();
|
|
4813
5121
|
this.icons = FLOWS_ICONS;
|
|
4814
|
-
this.
|
|
5122
|
+
this.choices = [];
|
|
5123
|
+
this.problems = [];
|
|
4815
5124
|
}
|
|
4816
5125
|
ngOnChanges() {
|
|
4817
5126
|
if (this.value !== void 0 && this.value === this.emitted) return;
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
value: typeof value === "string" ? value : JSON.stringify(value),
|
|
4822
|
-
original: value
|
|
5127
|
+
this.choices = (Array.isArray(this.value) ? this.value : []).filter((choice) => choice && typeof choice === "object").map((choice) => ({
|
|
5128
|
+
name: `${choice.name ?? ""}`,
|
|
5129
|
+
description: `${choice.description ?? ""}`
|
|
4823
5130
|
}));
|
|
5131
|
+
this.checkNames();
|
|
4824
5132
|
}
|
|
4825
|
-
|
|
4826
|
-
this.
|
|
4827
|
-
|
|
4828
|
-
|
|
5133
|
+
addChoice() {
|
|
5134
|
+
this.choices = [...this.choices, {
|
|
5135
|
+
name: "",
|
|
5136
|
+
description: ""
|
|
4829
5137
|
}];
|
|
5138
|
+
this.checkNames();
|
|
4830
5139
|
}
|
|
4831
|
-
|
|
4832
|
-
this.
|
|
5140
|
+
removeChoice(index) {
|
|
5141
|
+
this.choices = this.choices.filter((_, i) => i !== index);
|
|
4833
5142
|
this.commit();
|
|
4834
5143
|
}
|
|
4835
|
-
editValue(pair, value) {
|
|
4836
|
-
pair.value = value;
|
|
4837
|
-
delete pair.original;
|
|
4838
|
-
}
|
|
4839
5144
|
commit() {
|
|
4840
|
-
|
|
4841
|
-
this.
|
|
4842
|
-
this.
|
|
4843
|
-
|
|
5145
|
+
this.choices.forEach((choice) => choice.name = flowChoiceName(choice.name));
|
|
5146
|
+
this.checkNames();
|
|
5147
|
+
const kept = this.choices.filter((choice) => choice.name).map((choice) => ({
|
|
5148
|
+
name: choice.name,
|
|
5149
|
+
description: choice.description.trim()
|
|
5150
|
+
}));
|
|
5151
|
+
this.emitted = kept;
|
|
5152
|
+
this.valueChange.emit(kept);
|
|
5153
|
+
}
|
|
5154
|
+
checkNames() {
|
|
5155
|
+
const names = this.choices.map((choice) => choice.name);
|
|
5156
|
+
this.problems = names.map((_, index) => flowChoiceProblem(names, index));
|
|
4844
5157
|
}
|
|
4845
5158
|
static {
|
|
4846
5159
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4847
5160
|
minVersion: "12.0.0",
|
|
4848
5161
|
version: "22.2.3",
|
|
4849
5162
|
ngImport: i0,
|
|
4850
|
-
type:
|
|
5163
|
+
type: FlowsChoicesFieldComponent,
|
|
4851
5164
|
deps: [],
|
|
4852
5165
|
target: i0.ɵɵFactoryTarget.Component
|
|
4853
5166
|
});
|
|
@@ -4856,9 +5169,9 @@ var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
|
4856
5169
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4857
5170
|
minVersion: "17.0.0",
|
|
4858
5171
|
version: "22.2.3",
|
|
4859
|
-
type:
|
|
5172
|
+
type: FlowsChoicesFieldComponent,
|
|
4860
5173
|
isStandalone: false,
|
|
4861
|
-
selector: "pw-flows-
|
|
5174
|
+
selector: "pw-flows-choices-field",
|
|
4862
5175
|
inputs: {
|
|
4863
5176
|
value: "value",
|
|
4864
5177
|
inputId: "inputId",
|
|
@@ -4867,8 +5180,8 @@ var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
|
4867
5180
|
outputs: { valueChange: "valueChange" },
|
|
4868
5181
|
usesOnChanges: true,
|
|
4869
5182
|
ngImport: i0,
|
|
4870
|
-
template: "<div class=\"pw-
|
|
4871
|
-
styles: [".pw-
|
|
5183
|
+
template: "<div class=\"pw-choices-field\"\n [id]=\"inputId\">\n @for (choice of choices; track $index) {\n <div class=\"pw-choices-field__row\"\n data-testid=\"flow-choice\">\n <input type=\"text\"\n class=\"form-control\"\n [attr.aria-label]=\"'Flows.Inspector.ChoiceName' | transloco\"\n [placeholder]=\"'Flows.Inspector.ChoiceName' | transloco\"\n [readOnly]=\"readOnly\"\n maxlength=\"40\"\n [(ngModel)]=\"choice.name\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-choices-field__remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveChoice' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveChoice' | transloco\"\n appendTo=\"body\"\n (click)=\"removeChoice($index)\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n <textarea class=\"form-control pw-choices-field__description\"\n rows=\"2\"\n maxlength=\"200\"\n [attr.aria-label]=\"'Flows.Inspector.ChoiceDescription' | transloco\"\n [placeholder]=\"'Flows.Inspector.ChoiceDescription' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"choice.description\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\"></textarea>\n @if (problems[$index]; as problem) {\n <p class=\"pw-choices-field__problem\"\n role=\"status\"\n data-testid=\"flow-choice-problem\">\n <fa-icon [icon]=\"icons.warning\"\n aria-hidden=\"true\"></fa-icon>\n {{ problem | transloco: { name: choice.name } }}\n </p>\n }\n </div>\n }\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-choice-add\"\n (click)=\"addChoice()\">\n {{ 'Flows.Inspector.AddChoice' | transloco }}\n </button>\n }\n</div>\n",
|
|
5184
|
+
styles: [".pw-choices-field{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.pw-choices-field__row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 8px;width:100%;padding-bottom:8px;border-bottom:1px solid #e2e5ea}.pw-choices-field__description{grid-column:1/-1}.pw-choices-field__remove{color:#5a6473}.pw-choices-field__problem{grid-column:1/-1;display:flex;align-items:baseline;gap:6px;margin:0;color:#8a5a00;font-size:12px}\n"],
|
|
4872
5185
|
dependencies: [
|
|
4873
5186
|
{
|
|
4874
5187
|
kind: "directive",
|
|
@@ -4880,6 +5193,12 @@ var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
|
4880
5193
|
type: i3$1.NgControlStatus,
|
|
4881
5194
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
4882
5195
|
},
|
|
5196
|
+
{
|
|
5197
|
+
kind: "directive",
|
|
5198
|
+
type: i3$1.MaxLengthValidator,
|
|
5199
|
+
selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",
|
|
5200
|
+
inputs: ["maxlength"]
|
|
5201
|
+
},
|
|
4883
5202
|
{
|
|
4884
5203
|
kind: "directive",
|
|
4885
5204
|
type: i3$1.NgModel,
|
|
@@ -4971,14 +5290,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4971
5290
|
minVersion: "12.0.0",
|
|
4972
5291
|
version: "22.2.3",
|
|
4973
5292
|
ngImport: i0,
|
|
4974
|
-
type:
|
|
5293
|
+
type: FlowsChoicesFieldComponent,
|
|
4975
5294
|
decorators: [{
|
|
4976
5295
|
type: Component,
|
|
4977
5296
|
args: [{
|
|
4978
|
-
selector: "pw-flows-
|
|
5297
|
+
selector: "pw-flows-choices-field",
|
|
4979
5298
|
standalone: false,
|
|
4980
|
-
template: "<div class=\"pw-
|
|
4981
|
-
styles: [".pw-
|
|
5299
|
+
template: "<div class=\"pw-choices-field\"\n [id]=\"inputId\">\n @for (choice of choices; track $index) {\n <div class=\"pw-choices-field__row\"\n data-testid=\"flow-choice\">\n <input type=\"text\"\n class=\"form-control\"\n [attr.aria-label]=\"'Flows.Inspector.ChoiceName' | transloco\"\n [placeholder]=\"'Flows.Inspector.ChoiceName' | transloco\"\n [readOnly]=\"readOnly\"\n maxlength=\"40\"\n [(ngModel)]=\"choice.name\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-choices-field__remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveChoice' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveChoice' | transloco\"\n appendTo=\"body\"\n (click)=\"removeChoice($index)\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n <textarea class=\"form-control pw-choices-field__description\"\n rows=\"2\"\n maxlength=\"200\"\n [attr.aria-label]=\"'Flows.Inspector.ChoiceDescription' | transloco\"\n [placeholder]=\"'Flows.Inspector.ChoiceDescription' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"choice.description\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\"></textarea>\n @if (problems[$index]; as problem) {\n <p class=\"pw-choices-field__problem\"\n role=\"status\"\n data-testid=\"flow-choice-problem\">\n <fa-icon [icon]=\"icons.warning\"\n aria-hidden=\"true\"></fa-icon>\n {{ problem | transloco: { name: choice.name } }}\n </p>\n }\n </div>\n }\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-choice-add\"\n (click)=\"addChoice()\">\n {{ 'Flows.Inspector.AddChoice' | transloco }}\n </button>\n }\n</div>\n",
|
|
5300
|
+
styles: [".pw-choices-field{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.pw-choices-field__row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 8px;width:100%;padding-bottom:8px;border-bottom:1px solid #e2e5ea}.pw-choices-field__description{grid-column:1/-1}.pw-choices-field__remove{color:#5a6473}.pw-choices-field__problem{grid-column:1/-1;display:flex;align-items:baseline;gap:6px;margin:0;color:#8a5a00;font-size:12px}\n"]
|
|
4982
5301
|
}]
|
|
4983
5302
|
}],
|
|
4984
5303
|
propDecorators: {
|
|
@@ -5201,20 +5520,268 @@ var FlowsMemberFieldComponent = class FlowsMemberFieldComponent {
|
|
|
5201
5520
|
"onAdd",
|
|
5202
5521
|
"onFocus",
|
|
5203
5522
|
"onBlur",
|
|
5204
|
-
"onDropdownClick",
|
|
5205
|
-
"onClear",
|
|
5206
|
-
"onInputKeydown",
|
|
5207
|
-
"onKeyUp",
|
|
5523
|
+
"onDropdownClick",
|
|
5524
|
+
"onClear",
|
|
5525
|
+
"onInputKeydown",
|
|
5526
|
+
"onKeyUp",
|
|
5527
|
+
"onShow",
|
|
5528
|
+
"onHide",
|
|
5529
|
+
"onLazyLoad"
|
|
5530
|
+
]
|
|
5531
|
+
},
|
|
5532
|
+
{
|
|
5533
|
+
kind: "component",
|
|
5534
|
+
type: i2$1.FieldErrorDisplayComponent,
|
|
5535
|
+
selector: "pw-field-error-display",
|
|
5536
|
+
inputs: ["errorMsg", "displayError"]
|
|
5537
|
+
},
|
|
5538
|
+
{
|
|
5539
|
+
kind: "pipe",
|
|
5540
|
+
type: i2$4.TranslocoPipe,
|
|
5541
|
+
name: "transloco"
|
|
5542
|
+
}
|
|
5543
|
+
]
|
|
5544
|
+
});
|
|
5545
|
+
}
|
|
5546
|
+
};
|
|
5547
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
5548
|
+
minVersion: "12.0.0",
|
|
5549
|
+
version: "22.2.3",
|
|
5550
|
+
ngImport: i0,
|
|
5551
|
+
type: FlowsMemberFieldComponent,
|
|
5552
|
+
decorators: [{
|
|
5553
|
+
type: Component,
|
|
5554
|
+
args: [{
|
|
5555
|
+
selector: "pw-flows-member-field",
|
|
5556
|
+
standalone: false,
|
|
5557
|
+
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"
|
|
5558
|
+
}]
|
|
5559
|
+
}],
|
|
5560
|
+
ctorParameters: () => [{ type: FlowsMemberService }, { type: i0.ChangeDetectorRef }],
|
|
5561
|
+
propDecorators: {
|
|
5562
|
+
value: [{ type: Input }],
|
|
5563
|
+
multiple: [{ type: Input }],
|
|
5564
|
+
subscriptionId: [{ type: Input }],
|
|
5565
|
+
inputId: [{ type: Input }],
|
|
5566
|
+
readOnly: [{ type: Input }],
|
|
5567
|
+
valueChange: [{ type: Output }]
|
|
5568
|
+
}
|
|
5569
|
+
});
|
|
5570
|
+
function toIds(value) {
|
|
5571
|
+
return (Array.isArray(value) ? value : [value]).map(Number).filter((id) => Number.isInteger(id) && id > 0);
|
|
5572
|
+
}
|
|
5573
|
+
var FlowsParamFieldComponent = class FlowsParamFieldComponent {
|
|
5574
|
+
constructor(translation, cdr, destroyRef) {
|
|
5575
|
+
this.readOnly = false;
|
|
5576
|
+
this.listSuggestions = [];
|
|
5577
|
+
this.valueChange = new EventEmitter();
|
|
5578
|
+
this.mergeModes = [];
|
|
5579
|
+
this.defaultMergeMode = FLOW_MERGE_MODES[0];
|
|
5580
|
+
this.numberValue = flowNumberValue;
|
|
5581
|
+
translation.selectTranslation("flows").pipe(takeUntilDestroyed(destroyRef)).subscribe(() => {
|
|
5582
|
+
this.mergeModes = FLOW_MERGE_MODES.map((mode) => ({
|
|
5583
|
+
value: mode,
|
|
5584
|
+
label: translation.translate(`Flows.MergeModes.${mode}`)
|
|
5585
|
+
}));
|
|
5586
|
+
cdr.markForCheck();
|
|
5587
|
+
});
|
|
5588
|
+
}
|
|
5589
|
+
get kind() {
|
|
5590
|
+
return this.field.kind === "list" && !this.listSuggestions.length ? "text" : this.field.kind;
|
|
5591
|
+
}
|
|
5592
|
+
static {
|
|
5593
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
5594
|
+
minVersion: "12.0.0",
|
|
5595
|
+
version: "22.2.3",
|
|
5596
|
+
ngImport: i0,
|
|
5597
|
+
type: FlowsParamFieldComponent,
|
|
5598
|
+
deps: [
|
|
5599
|
+
{ token: i2$4.TranslocoService },
|
|
5600
|
+
{ token: i0.ChangeDetectorRef },
|
|
5601
|
+
{ token: i0.DestroyRef }
|
|
5602
|
+
],
|
|
5603
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
5604
|
+
});
|
|
5605
|
+
}
|
|
5606
|
+
static {
|
|
5607
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
5608
|
+
minVersion: "17.0.0",
|
|
5609
|
+
version: "22.2.3",
|
|
5610
|
+
type: FlowsParamFieldComponent,
|
|
5611
|
+
isStandalone: false,
|
|
5612
|
+
selector: "pw-flows-param-field",
|
|
5613
|
+
inputs: {
|
|
5614
|
+
field: "field",
|
|
5615
|
+
value: "value",
|
|
5616
|
+
readOnly: "readOnly",
|
|
5617
|
+
subscriptionId: "subscriptionId",
|
|
5618
|
+
listSuggestions: "listSuggestions"
|
|
5619
|
+
},
|
|
5620
|
+
outputs: { valueChange: "valueChange" },
|
|
5621
|
+
ngImport: i0,
|
|
5622
|
+
template: "@switch (kind) {\n@case ('textarea') {\n<textarea class=\"form-control\" rows=\"4\"\n [id]=\"field.id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"valueChange.emit($event)\"></textarea>\n}\n@case ('cron') {\n<pw-flows-cron-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-cron-field>\n}\n@case ('timezone') {\n<pw-flows-timezone-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-timezone-field>\n}\n@case ('pairs') {\n<pw-flows-pairs-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-pairs-field>\n}\n@case ('choices') {\n<pw-flows-choices-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-choices-field>\n}\n@case ('json') {\n<pw-flows-json-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-json-field>\n}\n@case ('member') {\n<pw-flows-member-field [inputId]=\"field.id\"\n [value]=\"value\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-member-field>\n}\n@case ('members') {\n<pw-flows-member-field [inputId]=\"field.id\"\n [multiple]=\"true\"\n [value]=\"value\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-member-field>\n}\n@case ('mode') {\n<p-select [inputId]=\"field.id\"\n [options]=\"mergeModes\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"value ?? defaultMergeMode\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"valueChange.emit($event)\"></p-select>\n}\n@case ('list') {\n<p-select [inputId]=\"field.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]=\"value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"valueChange.emit($event ?? undefined)\"></p-select>\n}\n@case ('select') {\n<p-select [inputId]=\"field.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]=\"value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"valueChange.emit($event ?? undefined)\"></p-select>\n}\n@case ('number') {\n<input class=\"form-control\"\n type=\"text\"\n inputmode=\"decimal\"\n [id]=\"field.id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"valueChange.emit(numberValue($event))\" />\n}\n@default {\n<input class=\"form-control\" type=\"text\" autocomplete=\"off\"\n [attr.inputmode]=\"field.kind === 'email' ? 'email' : null\"\n [id]=\"field.id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"valueChange.emit($event)\" />\n}\n}\n",
|
|
5623
|
+
styles: [":host{display:block}\n"],
|
|
5624
|
+
dependencies: [
|
|
5625
|
+
{
|
|
5626
|
+
kind: "directive",
|
|
5627
|
+
type: i3$1.DefaultValueAccessor,
|
|
5628
|
+
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]"
|
|
5629
|
+
},
|
|
5630
|
+
{
|
|
5631
|
+
kind: "directive",
|
|
5632
|
+
type: i3$1.NgControlStatus,
|
|
5633
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
5634
|
+
},
|
|
5635
|
+
{
|
|
5636
|
+
kind: "directive",
|
|
5637
|
+
type: i3$1.NgModel,
|
|
5638
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
5639
|
+
inputs: [
|
|
5640
|
+
"name",
|
|
5641
|
+
"disabled",
|
|
5642
|
+
"ngModel",
|
|
5643
|
+
"ngModelOptions"
|
|
5644
|
+
],
|
|
5645
|
+
outputs: ["ngModelChange"],
|
|
5646
|
+
exportAs: ["ngModel"]
|
|
5647
|
+
},
|
|
5648
|
+
{
|
|
5649
|
+
kind: "component",
|
|
5650
|
+
type: i4$1.Select,
|
|
5651
|
+
selector: "p-select",
|
|
5652
|
+
inputs: [
|
|
5653
|
+
"id",
|
|
5654
|
+
"scrollHeight",
|
|
5655
|
+
"filter",
|
|
5656
|
+
"panelStyle",
|
|
5657
|
+
"panelStyleClass",
|
|
5658
|
+
"readonly",
|
|
5659
|
+
"editable",
|
|
5660
|
+
"tabindex",
|
|
5661
|
+
"placeholder",
|
|
5662
|
+
"loadingIcon",
|
|
5663
|
+
"filterPlaceholder",
|
|
5664
|
+
"filterLocale",
|
|
5665
|
+
"inputId",
|
|
5666
|
+
"dataKey",
|
|
5667
|
+
"filterBy",
|
|
5668
|
+
"filterFields",
|
|
5669
|
+
"autofocus",
|
|
5670
|
+
"resetFilterOnHide",
|
|
5671
|
+
"checkmark",
|
|
5672
|
+
"dropdownIcon",
|
|
5673
|
+
"loading",
|
|
5674
|
+
"optionLabel",
|
|
5675
|
+
"optionValue",
|
|
5676
|
+
"optionDisabled",
|
|
5677
|
+
"optionGroupLabel",
|
|
5678
|
+
"optionGroupChildren",
|
|
5679
|
+
"group",
|
|
5680
|
+
"showClear",
|
|
5681
|
+
"emptyFilterMessage",
|
|
5682
|
+
"emptyMessage",
|
|
5683
|
+
"lazy",
|
|
5684
|
+
"virtualScroll",
|
|
5685
|
+
"virtualScrollItemSize",
|
|
5686
|
+
"virtualScrollOptions",
|
|
5687
|
+
"overlayOptions",
|
|
5688
|
+
"ariaFilterLabel",
|
|
5689
|
+
"ariaLabel",
|
|
5690
|
+
"ariaLabelledBy",
|
|
5691
|
+
"filterMatchMode",
|
|
5692
|
+
"tooltip",
|
|
5693
|
+
"tooltipPosition",
|
|
5694
|
+
"tooltipPositionStyle",
|
|
5695
|
+
"tooltipStyleClass",
|
|
5696
|
+
"focusOnHover",
|
|
5697
|
+
"selectOnFocus",
|
|
5698
|
+
"multiple",
|
|
5699
|
+
"autoOptionFocus",
|
|
5700
|
+
"autofocusFilter",
|
|
5701
|
+
"filterValue",
|
|
5702
|
+
"options",
|
|
5703
|
+
"appendTo",
|
|
5704
|
+
"motionOptions"
|
|
5705
|
+
],
|
|
5706
|
+
outputs: [
|
|
5707
|
+
"onChange",
|
|
5708
|
+
"onFilter",
|
|
5709
|
+
"onFocus",
|
|
5710
|
+
"onBlur",
|
|
5711
|
+
"onClick",
|
|
5208
5712
|
"onShow",
|
|
5209
5713
|
"onHide",
|
|
5714
|
+
"onClear",
|
|
5210
5715
|
"onLazyLoad"
|
|
5211
5716
|
]
|
|
5212
5717
|
},
|
|
5213
5718
|
{
|
|
5214
5719
|
kind: "component",
|
|
5215
|
-
type:
|
|
5216
|
-
selector: "pw-
|
|
5217
|
-
inputs: [
|
|
5720
|
+
type: FlowsCronFieldComponent,
|
|
5721
|
+
selector: "pw-flows-cron-field",
|
|
5722
|
+
inputs: [
|
|
5723
|
+
"value",
|
|
5724
|
+
"inputId",
|
|
5725
|
+
"readOnly"
|
|
5726
|
+
],
|
|
5727
|
+
outputs: ["valueChange"]
|
|
5728
|
+
},
|
|
5729
|
+
{
|
|
5730
|
+
kind: "component",
|
|
5731
|
+
type: FlowsTimezoneFieldComponent,
|
|
5732
|
+
selector: "pw-flows-timezone-field",
|
|
5733
|
+
inputs: [
|
|
5734
|
+
"value",
|
|
5735
|
+
"inputId",
|
|
5736
|
+
"readOnly"
|
|
5737
|
+
],
|
|
5738
|
+
outputs: ["valueChange"]
|
|
5739
|
+
},
|
|
5740
|
+
{
|
|
5741
|
+
kind: "component",
|
|
5742
|
+
type: FlowsJsonFieldComponent,
|
|
5743
|
+
selector: "pw-flows-json-field",
|
|
5744
|
+
inputs: [
|
|
5745
|
+
"value",
|
|
5746
|
+
"inputId",
|
|
5747
|
+
"readOnly"
|
|
5748
|
+
],
|
|
5749
|
+
outputs: ["valueChange"]
|
|
5750
|
+
},
|
|
5751
|
+
{
|
|
5752
|
+
kind: "component",
|
|
5753
|
+
type: FlowsPairsFieldComponent,
|
|
5754
|
+
selector: "pw-flows-pairs-field",
|
|
5755
|
+
inputs: [
|
|
5756
|
+
"value",
|
|
5757
|
+
"inputId",
|
|
5758
|
+
"readOnly"
|
|
5759
|
+
],
|
|
5760
|
+
outputs: ["valueChange"]
|
|
5761
|
+
},
|
|
5762
|
+
{
|
|
5763
|
+
kind: "component",
|
|
5764
|
+
type: FlowsChoicesFieldComponent,
|
|
5765
|
+
selector: "pw-flows-choices-field",
|
|
5766
|
+
inputs: [
|
|
5767
|
+
"value",
|
|
5768
|
+
"inputId",
|
|
5769
|
+
"readOnly"
|
|
5770
|
+
],
|
|
5771
|
+
outputs: ["valueChange"]
|
|
5772
|
+
},
|
|
5773
|
+
{
|
|
5774
|
+
kind: "component",
|
|
5775
|
+
type: FlowsMemberFieldComponent,
|
|
5776
|
+
selector: "pw-flows-member-field",
|
|
5777
|
+
inputs: [
|
|
5778
|
+
"value",
|
|
5779
|
+
"multiple",
|
|
5780
|
+
"subscriptionId",
|
|
5781
|
+
"inputId",
|
|
5782
|
+
"readOnly"
|
|
5783
|
+
],
|
|
5784
|
+
outputs: ["valueChange"]
|
|
5218
5785
|
},
|
|
5219
5786
|
{
|
|
5220
5787
|
kind: "pipe",
|
|
@@ -5229,28 +5796,30 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5229
5796
|
minVersion: "12.0.0",
|
|
5230
5797
|
version: "22.2.3",
|
|
5231
5798
|
ngImport: i0,
|
|
5232
|
-
type:
|
|
5799
|
+
type: FlowsParamFieldComponent,
|
|
5233
5800
|
decorators: [{
|
|
5234
5801
|
type: Component,
|
|
5235
5802
|
args: [{
|
|
5236
|
-
selector: "pw-flows-
|
|
5803
|
+
selector: "pw-flows-param-field",
|
|
5237
5804
|
standalone: false,
|
|
5238
|
-
template: "<
|
|
5805
|
+
template: "@switch (kind) {\n@case ('textarea') {\n<textarea class=\"form-control\" rows=\"4\"\n [id]=\"field.id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"valueChange.emit($event)\"></textarea>\n}\n@case ('cron') {\n<pw-flows-cron-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-cron-field>\n}\n@case ('timezone') {\n<pw-flows-timezone-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-timezone-field>\n}\n@case ('pairs') {\n<pw-flows-pairs-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-pairs-field>\n}\n@case ('choices') {\n<pw-flows-choices-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-choices-field>\n}\n@case ('json') {\n<pw-flows-json-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-json-field>\n}\n@case ('member') {\n<pw-flows-member-field [inputId]=\"field.id\"\n [value]=\"value\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-member-field>\n}\n@case ('members') {\n<pw-flows-member-field [inputId]=\"field.id\"\n [multiple]=\"true\"\n [value]=\"value\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-member-field>\n}\n@case ('mode') {\n<p-select [inputId]=\"field.id\"\n [options]=\"mergeModes\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"value ?? defaultMergeMode\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"valueChange.emit($event)\"></p-select>\n}\n@case ('list') {\n<p-select [inputId]=\"field.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]=\"value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"valueChange.emit($event ?? undefined)\"></p-select>\n}\n@case ('select') {\n<p-select [inputId]=\"field.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]=\"value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"valueChange.emit($event ?? undefined)\"></p-select>\n}\n@case ('number') {\n<input class=\"form-control\"\n type=\"text\"\n inputmode=\"decimal\"\n [id]=\"field.id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"valueChange.emit(numberValue($event))\" />\n}\n@default {\n<input class=\"form-control\" type=\"text\" autocomplete=\"off\"\n [attr.inputmode]=\"field.kind === 'email' ? 'email' : null\"\n [id]=\"field.id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"valueChange.emit($event)\" />\n}\n}\n",
|
|
5806
|
+
styles: [":host{display:block}\n"]
|
|
5239
5807
|
}]
|
|
5240
5808
|
}],
|
|
5241
|
-
ctorParameters: () => [
|
|
5809
|
+
ctorParameters: () => [
|
|
5810
|
+
{ type: i2$4.TranslocoService },
|
|
5811
|
+
{ type: i0.ChangeDetectorRef },
|
|
5812
|
+
{ type: i0.DestroyRef }
|
|
5813
|
+
],
|
|
5242
5814
|
propDecorators: {
|
|
5815
|
+
field: [{ type: Input }],
|
|
5243
5816
|
value: [{ type: Input }],
|
|
5244
|
-
multiple: [{ type: Input }],
|
|
5245
|
-
subscriptionId: [{ type: Input }],
|
|
5246
|
-
inputId: [{ type: Input }],
|
|
5247
5817
|
readOnly: [{ type: Input }],
|
|
5818
|
+
subscriptionId: [{ type: Input }],
|
|
5819
|
+
listSuggestions: [{ type: Input }],
|
|
5248
5820
|
valueChange: [{ type: Output }]
|
|
5249
5821
|
}
|
|
5250
5822
|
});
|
|
5251
|
-
function toIds(value) {
|
|
5252
|
-
return (Array.isArray(value) ? value : [value]).map(Number).filter((id) => Number.isInteger(id) && id > 0);
|
|
5253
|
-
}
|
|
5254
5823
|
var FlowsRetryFieldComponent = class FlowsRetryFieldComponent {
|
|
5255
5824
|
constructor() {
|
|
5256
5825
|
this.readOnly = false;
|
|
@@ -5718,7 +6287,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5718
6287
|
}
|
|
5719
6288
|
});
|
|
5720
6289
|
var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
5721
|
-
constructor(
|
|
6290
|
+
constructor(host) {
|
|
5722
6291
|
this.host = host;
|
|
5723
6292
|
this.definition = null;
|
|
5724
6293
|
this.readOnly = false;
|
|
@@ -5729,21 +6298,11 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5729
6298
|
this.nodeChange = new EventEmitter();
|
|
5730
6299
|
this.remove = new EventEmitter();
|
|
5731
6300
|
this.icons = FLOWS_ICONS;
|
|
5732
|
-
this.mergeModes = [];
|
|
5733
|
-
this.defaultMergeMode = FLOW_MERGE_MODES[0];
|
|
5734
6301
|
this.labelKey = flowNodeLabelKey;
|
|
5735
6302
|
this.paramLabelKey = flowParamLabelKey;
|
|
5736
6303
|
this.paramHelpKey = flowParamHelpKey;
|
|
5737
|
-
this.numberValue = flowNumberValue;
|
|
5738
6304
|
this.fields = [];
|
|
5739
6305
|
this.conditionNotAnObject = false;
|
|
5740
|
-
translation.selectTranslation("flows").pipe(takeUntilDestroyed(destroyRef)).subscribe(() => {
|
|
5741
|
-
this.mergeModes = FLOW_MERGE_MODES.map((mode) => ({
|
|
5742
|
-
value: mode,
|
|
5743
|
-
label: translation.translate(`Flows.MergeModes.${mode}`)
|
|
5744
|
-
}));
|
|
5745
|
-
cdr.markForCheck();
|
|
5746
|
-
});
|
|
5747
6306
|
}
|
|
5748
6307
|
ngOnChanges(changes) {
|
|
5749
6308
|
this.fields = (this.definition ? flowNodeFields(this.definition) : []).map((field) => ({
|
|
@@ -5764,9 +6323,6 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5764
6323
|
ngAfterViewChecked() {
|
|
5765
6324
|
this.leaving = void 0;
|
|
5766
6325
|
}
|
|
5767
|
-
kindOf(field) {
|
|
5768
|
-
return field.kind === "list" && !this.listSuggestions.length ? "text" : field.kind;
|
|
5769
|
-
}
|
|
5770
6326
|
fieldId(key) {
|
|
5771
6327
|
return `flow-node-${this.node.id}-${key}`;
|
|
5772
6328
|
}
|
|
@@ -5808,12 +6364,7 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5808
6364
|
version: "22.2.3",
|
|
5809
6365
|
ngImport: i0,
|
|
5810
6366
|
type: FlowsNodeInspectorComponent,
|
|
5811
|
-
deps: [
|
|
5812
|
-
{ token: i2$4.TranslocoService },
|
|
5813
|
-
{ token: i0.ChangeDetectorRef },
|
|
5814
|
-
{ token: i0.DestroyRef },
|
|
5815
|
-
{ token: i0.ElementRef }
|
|
5816
|
-
],
|
|
6367
|
+
deps: [{ token: i0.ElementRef }],
|
|
5817
6368
|
target: i0.ɵɵFactoryTarget.Component
|
|
5818
6369
|
});
|
|
5819
6370
|
}
|
|
@@ -5840,32 +6391,9 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5840
6391
|
},
|
|
5841
6392
|
usesOnChanges: true,
|
|
5842
6393
|
ngImport: i0,
|
|
5843
|
-
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
|
|
6394
|
+
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 <pw-flows-param-field [field]=\"field\"\n [value]=\"param(field.key)\"\n [readOnly]=\"readOnly\"\n [subscriptionId]=\"subscriptionId\"\n [listSuggestions]=\"listSuggestions\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-param-field>\n <pw-flows-unknown-fields [value]=\"param(field.key)\" [known]=\"fieldSuggestions\"></pw-flows-unknown-fields>\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",
|
|
5844
6395
|
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"],
|
|
5845
6396
|
dependencies: [
|
|
5846
|
-
{
|
|
5847
|
-
kind: "directive",
|
|
5848
|
-
type: i3$1.DefaultValueAccessor,
|
|
5849
|
-
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]"
|
|
5850
|
-
},
|
|
5851
|
-
{
|
|
5852
|
-
kind: "directive",
|
|
5853
|
-
type: i3$1.NgControlStatus,
|
|
5854
|
-
selector: "[formControlName],[ngModel],[formControl]"
|
|
5855
|
-
},
|
|
5856
|
-
{
|
|
5857
|
-
kind: "directive",
|
|
5858
|
-
type: i3$1.NgModel,
|
|
5859
|
-
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
5860
|
-
inputs: [
|
|
5861
|
-
"name",
|
|
5862
|
-
"disabled",
|
|
5863
|
-
"ngModel",
|
|
5864
|
-
"ngModelOptions"
|
|
5865
|
-
],
|
|
5866
|
-
outputs: ["ngModelChange"],
|
|
5867
|
-
exportAs: ["ngModel"]
|
|
5868
|
-
},
|
|
5869
6397
|
{
|
|
5870
6398
|
kind: "directive",
|
|
5871
6399
|
type: i1$1.Tooltip,
|
|
@@ -5894,76 +6422,6 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5894
6422
|
"pTooltipUnstyled"
|
|
5895
6423
|
]
|
|
5896
6424
|
},
|
|
5897
|
-
{
|
|
5898
|
-
kind: "component",
|
|
5899
|
-
type: i4$1.Select,
|
|
5900
|
-
selector: "p-select",
|
|
5901
|
-
inputs: [
|
|
5902
|
-
"id",
|
|
5903
|
-
"scrollHeight",
|
|
5904
|
-
"filter",
|
|
5905
|
-
"panelStyle",
|
|
5906
|
-
"panelStyleClass",
|
|
5907
|
-
"readonly",
|
|
5908
|
-
"editable",
|
|
5909
|
-
"tabindex",
|
|
5910
|
-
"placeholder",
|
|
5911
|
-
"loadingIcon",
|
|
5912
|
-
"filterPlaceholder",
|
|
5913
|
-
"filterLocale",
|
|
5914
|
-
"inputId",
|
|
5915
|
-
"dataKey",
|
|
5916
|
-
"filterBy",
|
|
5917
|
-
"filterFields",
|
|
5918
|
-
"autofocus",
|
|
5919
|
-
"resetFilterOnHide",
|
|
5920
|
-
"checkmark",
|
|
5921
|
-
"dropdownIcon",
|
|
5922
|
-
"loading",
|
|
5923
|
-
"optionLabel",
|
|
5924
|
-
"optionValue",
|
|
5925
|
-
"optionDisabled",
|
|
5926
|
-
"optionGroupLabel",
|
|
5927
|
-
"optionGroupChildren",
|
|
5928
|
-
"group",
|
|
5929
|
-
"showClear",
|
|
5930
|
-
"emptyFilterMessage",
|
|
5931
|
-
"emptyMessage",
|
|
5932
|
-
"lazy",
|
|
5933
|
-
"virtualScroll",
|
|
5934
|
-
"virtualScrollItemSize",
|
|
5935
|
-
"virtualScrollOptions",
|
|
5936
|
-
"overlayOptions",
|
|
5937
|
-
"ariaFilterLabel",
|
|
5938
|
-
"ariaLabel",
|
|
5939
|
-
"ariaLabelledBy",
|
|
5940
|
-
"filterMatchMode",
|
|
5941
|
-
"tooltip",
|
|
5942
|
-
"tooltipPosition",
|
|
5943
|
-
"tooltipPositionStyle",
|
|
5944
|
-
"tooltipStyleClass",
|
|
5945
|
-
"focusOnHover",
|
|
5946
|
-
"selectOnFocus",
|
|
5947
|
-
"multiple",
|
|
5948
|
-
"autoOptionFocus",
|
|
5949
|
-
"autofocusFilter",
|
|
5950
|
-
"filterValue",
|
|
5951
|
-
"options",
|
|
5952
|
-
"appendTo",
|
|
5953
|
-
"motionOptions"
|
|
5954
|
-
],
|
|
5955
|
-
outputs: [
|
|
5956
|
-
"onChange",
|
|
5957
|
-
"onFilter",
|
|
5958
|
-
"onFocus",
|
|
5959
|
-
"onBlur",
|
|
5960
|
-
"onClick",
|
|
5961
|
-
"onShow",
|
|
5962
|
-
"onHide",
|
|
5963
|
-
"onClear",
|
|
5964
|
-
"onLazyLoad"
|
|
5965
|
-
]
|
|
5966
|
-
},
|
|
5967
6425
|
{
|
|
5968
6426
|
kind: "component",
|
|
5969
6427
|
type: i2$1.FieldErrorDisplayComponent,
|
|
@@ -6030,39 +6488,6 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
6030
6488
|
"a11yRoleChange"
|
|
6031
6489
|
]
|
|
6032
6490
|
},
|
|
6033
|
-
{
|
|
6034
|
-
kind: "component",
|
|
6035
|
-
type: FlowsCronFieldComponent,
|
|
6036
|
-
selector: "pw-flows-cron-field",
|
|
6037
|
-
inputs: [
|
|
6038
|
-
"value",
|
|
6039
|
-
"inputId",
|
|
6040
|
-
"readOnly"
|
|
6041
|
-
],
|
|
6042
|
-
outputs: ["valueChange"]
|
|
6043
|
-
},
|
|
6044
|
-
{
|
|
6045
|
-
kind: "component",
|
|
6046
|
-
type: FlowsTimezoneFieldComponent,
|
|
6047
|
-
selector: "pw-flows-timezone-field",
|
|
6048
|
-
inputs: [
|
|
6049
|
-
"value",
|
|
6050
|
-
"inputId",
|
|
6051
|
-
"readOnly"
|
|
6052
|
-
],
|
|
6053
|
-
outputs: ["valueChange"]
|
|
6054
|
-
},
|
|
6055
|
-
{
|
|
6056
|
-
kind: "component",
|
|
6057
|
-
type: FlowsJsonFieldComponent,
|
|
6058
|
-
selector: "pw-flows-json-field",
|
|
6059
|
-
inputs: [
|
|
6060
|
-
"value",
|
|
6061
|
-
"inputId",
|
|
6062
|
-
"readOnly"
|
|
6063
|
-
],
|
|
6064
|
-
outputs: ["valueChange"]
|
|
6065
|
-
},
|
|
6066
6491
|
{
|
|
6067
6492
|
kind: "component",
|
|
6068
6493
|
type: FlowsConditionFieldComponent,
|
|
@@ -6077,25 +6502,14 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
6077
6502
|
},
|
|
6078
6503
|
{
|
|
6079
6504
|
kind: "component",
|
|
6080
|
-
type:
|
|
6081
|
-
selector: "pw-flows-
|
|
6082
|
-
inputs: [
|
|
6083
|
-
"value",
|
|
6084
|
-
"inputId",
|
|
6085
|
-
"readOnly"
|
|
6086
|
-
],
|
|
6087
|
-
outputs: ["valueChange"]
|
|
6088
|
-
},
|
|
6089
|
-
{
|
|
6090
|
-
kind: "component",
|
|
6091
|
-
type: FlowsMemberFieldComponent,
|
|
6092
|
-
selector: "pw-flows-member-field",
|
|
6505
|
+
type: FlowsParamFieldComponent,
|
|
6506
|
+
selector: "pw-flows-param-field",
|
|
6093
6507
|
inputs: [
|
|
6508
|
+
"field",
|
|
6094
6509
|
"value",
|
|
6095
|
-
"
|
|
6510
|
+
"readOnly",
|
|
6096
6511
|
"subscriptionId",
|
|
6097
|
-
"
|
|
6098
|
-
"readOnly"
|
|
6512
|
+
"listSuggestions"
|
|
6099
6513
|
],
|
|
6100
6514
|
outputs: ["valueChange"]
|
|
6101
6515
|
},
|
|
@@ -6147,16 +6561,11 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
6147
6561
|
args: [{
|
|
6148
6562
|
selector: "pw-flows-node-inspector",
|
|
6149
6563
|
standalone: false,
|
|
6150
|
-
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
|
|
6564
|
+
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 <pw-flows-param-field [field]=\"field\"\n [value]=\"param(field.key)\"\n [readOnly]=\"readOnly\"\n [subscriptionId]=\"subscriptionId\"\n [listSuggestions]=\"listSuggestions\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-param-field>\n <pw-flows-unknown-fields [value]=\"param(field.key)\" [known]=\"fieldSuggestions\"></pw-flows-unknown-fields>\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",
|
|
6151
6565
|
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"]
|
|
6152
6566
|
}]
|
|
6153
6567
|
}],
|
|
6154
|
-
ctorParameters: () => [
|
|
6155
|
-
{ type: i2$4.TranslocoService },
|
|
6156
|
-
{ type: i0.ChangeDetectorRef },
|
|
6157
|
-
{ type: i0.DestroyRef },
|
|
6158
|
-
{ type: i0.ElementRef }
|
|
6159
|
-
],
|
|
6568
|
+
ctorParameters: () => [{ type: i0.ElementRef }],
|
|
6160
6569
|
propDecorators: {
|
|
6161
6570
|
node: [{ type: Input }],
|
|
6162
6571
|
definition: [{ type: Input }],
|
|
@@ -7539,12 +7948,15 @@ var FlowsPrivateModule = class FlowsPrivateModule {
|
|
|
7539
7948
|
FlowsJsonFieldComponent,
|
|
7540
7949
|
FlowsConditionFieldComponent,
|
|
7541
7950
|
FlowsPairsFieldComponent,
|
|
7951
|
+
FlowsChoicesFieldComponent,
|
|
7952
|
+
FlowsParamFieldComponent,
|
|
7542
7953
|
FlowsMemberFieldComponent,
|
|
7543
7954
|
FlowsRetryFieldComponent,
|
|
7544
7955
|
FlowsAvailableFieldsComponent,
|
|
7545
7956
|
FlowsUnknownFieldsComponent,
|
|
7546
7957
|
FlowsWorkflowStatusComponent,
|
|
7547
|
-
FlowWorkflowBadgePipe
|
|
7958
|
+
FlowWorkflowBadgePipe,
|
|
7959
|
+
FlowJsonLinesPipe
|
|
7548
7960
|
],
|
|
7549
7961
|
imports: [
|
|
7550
7962
|
PwStickyActionsComponent,
|
|
@@ -7659,12 +8071,15 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
7659
8071
|
FlowsJsonFieldComponent,
|
|
7660
8072
|
FlowsConditionFieldComponent,
|
|
7661
8073
|
FlowsPairsFieldComponent,
|
|
8074
|
+
FlowsChoicesFieldComponent,
|
|
8075
|
+
FlowsParamFieldComponent,
|
|
7662
8076
|
FlowsMemberFieldComponent,
|
|
7663
8077
|
FlowsRetryFieldComponent,
|
|
7664
8078
|
FlowsAvailableFieldsComponent,
|
|
7665
8079
|
FlowsUnknownFieldsComponent,
|
|
7666
8080
|
FlowsWorkflowStatusComponent,
|
|
7667
|
-
FlowWorkflowBadgePipe
|
|
8081
|
+
FlowWorkflowBadgePipe,
|
|
8082
|
+
FlowJsonLinesPipe
|
|
7668
8083
|
]
|
|
7669
8084
|
}]
|
|
7670
8085
|
}]
|