@posiwise/flows 0.0.9 → 0.0.11
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 +1361 -902
- package/fesm2022/posiwise-flows.mjs.map +1 -1
- package/package.json +1 -1
- package/types/posiwise-flows.d.ts +176 -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: () => [
|
|
@@ -1649,7 +1724,7 @@ var FlowsRunsComponent = class FlowsRunsComponent extends AppBaseComponent {
|
|
|
1649
1724
|
selector: "pw-flows-runs",
|
|
1650
1725
|
usesInheritance: true,
|
|
1651
1726
|
ngImport: i0,
|
|
1652
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Runs.Title' | transloco }}</h2>\n </div>\n</div>\n\n@if (loading) {\n<pw-skeleton-table [rows]=\"8\" [columns]=\"7\" [showCaption]=\"true\" />\n}\n\n@if (!loading) {\n@if (totalRecordsUnFilter > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table #dt\n [value]=\"runs\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\">\n <ng-template #caption>\n <pw-flows-runs-filters [subscriptionId]=\"subscriptionId\"\n (queryChange)=\"onQuery($event)\" />\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Run' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Workflow' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Version' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Started' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Duration' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-two\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-run>\n <tr>\n <td data-head=\"Run\">#{{ run.id }}</td>\n <td data-head=\"Workflow\">\n <a [routerLink]=\"versionsLink(run)\">{{ run.flow_workflow_name || '#' + run.flow_workflow_id }}</a>\n </td>\n <td data-head=\"Version\">\n <a [routerLink]=\"versionsLink(run)\"\n [queryParams]=\"{ version: run.flow_version_id }\">{{ 'Flows.Runs.VersionLabel' | transloco: { number: run.flow_version_number } }}</a>\n </td>\n <td data-head=\"Status\">\n <span [class]=\"badgeClass(run.status)\">\n {{ 'Flows.Status.' + run.status | transloco }}\n </span>\n </td>\n <td data-head=\"Started\">{{ run.started_at ? (run.started_at | dateFormat) : '—' }}</td>\n <td data-head=\"Duration\">\n @if (duration(run) !== null) {\n {{ duration(run) / 1000 | number: '1.0-1' }}{{ 'Flows.Runs.SecondsSuffix' | transloco }}\n } @else {\n —\n }\n </td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"'Flows.Runs.Inspect' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.inspect\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Runs.Inspect' | transloco\"\n (click)=\"inspect(run)\"\n (keydown.enter)=\"inspect(run)\"></fa-icon>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"runs.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Runs.Empty' | transloco\" [description]=\"'Flows.Runs.EmptyDescription' | transloco\"></pw-no-data>\n}\n}\n",
|
|
1727
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Runs.Title' | transloco }}</h2>\n </div>\n</div>\n\n@if (loading) {\n<div class=\"mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"7\" [showCaption]=\"true\" />\n</div>\n}\n\n@if (!loading) {\n@if (totalRecordsUnFilter > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table #dt\n [value]=\"runs\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\">\n <ng-template #caption>\n <pw-flows-runs-filters [subscriptionId]=\"subscriptionId\"\n (queryChange)=\"onQuery($event)\" />\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Run' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Workflow' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Version' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Started' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Duration' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-two\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-run>\n <tr>\n <td data-head=\"Run\">#{{ run.id }}</td>\n <td data-head=\"Workflow\">\n <a [routerLink]=\"versionsLink(run)\">{{ run.flow_workflow_name || '#' + run.flow_workflow_id }}</a>\n </td>\n <td data-head=\"Version\">\n <a [routerLink]=\"versionsLink(run)\"\n [queryParams]=\"{ version: run.flow_version_id }\">{{ 'Flows.Runs.VersionLabel' | transloco: { number: run.flow_version_number } }}</a>\n </td>\n <td data-head=\"Status\">\n <span [class]=\"badgeClass(run.status)\">\n {{ 'Flows.Status.' + run.status | transloco }}\n </span>\n </td>\n <td data-head=\"Started\">{{ run.started_at ? (run.started_at | dateFormat) : '—' }}</td>\n <td data-head=\"Duration\">\n @if (duration(run) !== null) {\n {{ duration(run) / 1000 | number: '1.0-1' }}{{ 'Flows.Runs.SecondsSuffix' | transloco }}\n } @else {\n —\n }\n </td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"'Flows.Runs.Inspect' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.inspect\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Runs.Inspect' | transloco\"\n (click)=\"inspect(run)\"\n (keydown.enter)=\"inspect(run)\"></fa-icon>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"runs.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Runs.Empty' | transloco\" [description]=\"'Flows.Runs.EmptyDescription' | transloco\"></pw-no-data>\n}\n}\n",
|
|
1653
1728
|
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}\n"],
|
|
1654
1729
|
dependencies: [
|
|
1655
1730
|
{
|
|
@@ -1914,7 +1989,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1914
1989
|
args: [{
|
|
1915
1990
|
selector: "pw-flows-runs",
|
|
1916
1991
|
standalone: false,
|
|
1917
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Runs.Title' | transloco }}</h2>\n </div>\n</div>\n\n@if (loading) {\n<pw-skeleton-table [rows]=\"8\" [columns]=\"7\" [showCaption]=\"true\" />\n}\n\n@if (!loading) {\n@if (totalRecordsUnFilter > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table #dt\n [value]=\"runs\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\">\n <ng-template #caption>\n <pw-flows-runs-filters [subscriptionId]=\"subscriptionId\"\n (queryChange)=\"onQuery($event)\" />\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Run' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Workflow' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Version' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Started' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Duration' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-two\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-run>\n <tr>\n <td data-head=\"Run\">#{{ run.id }}</td>\n <td data-head=\"Workflow\">\n <a [routerLink]=\"versionsLink(run)\">{{ run.flow_workflow_name || '#' + run.flow_workflow_id }}</a>\n </td>\n <td data-head=\"Version\">\n <a [routerLink]=\"versionsLink(run)\"\n [queryParams]=\"{ version: run.flow_version_id }\">{{ 'Flows.Runs.VersionLabel' | transloco: { number: run.flow_version_number } }}</a>\n </td>\n <td data-head=\"Status\">\n <span [class]=\"badgeClass(run.status)\">\n {{ 'Flows.Status.' + run.status | transloco }}\n </span>\n </td>\n <td data-head=\"Started\">{{ run.started_at ? (run.started_at | dateFormat) : '—' }}</td>\n <td data-head=\"Duration\">\n @if (duration(run) !== null) {\n {{ duration(run) / 1000 | number: '1.0-1' }}{{ 'Flows.Runs.SecondsSuffix' | transloco }}\n } @else {\n —\n }\n </td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"'Flows.Runs.Inspect' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.inspect\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Runs.Inspect' | transloco\"\n (click)=\"inspect(run)\"\n (keydown.enter)=\"inspect(run)\"></fa-icon>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"runs.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Runs.Empty' | transloco\" [description]=\"'Flows.Runs.EmptyDescription' | transloco\"></pw-no-data>\n}\n}\n",
|
|
1992
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Runs.Title' | transloco }}</h2>\n </div>\n</div>\n\n@if (loading) {\n<div class=\"mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"7\" [showCaption]=\"true\" />\n</div>\n}\n\n@if (!loading) {\n@if (totalRecordsUnFilter > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table #dt\n [value]=\"runs\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\">\n <ng-template #caption>\n <pw-flows-runs-filters [subscriptionId]=\"subscriptionId\"\n (queryChange)=\"onQuery($event)\" />\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Run' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Workflow' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Version' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Started' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Runs.Column.Duration' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-two\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-run>\n <tr>\n <td data-head=\"Run\">#{{ run.id }}</td>\n <td data-head=\"Workflow\">\n <a [routerLink]=\"versionsLink(run)\">{{ run.flow_workflow_name || '#' + run.flow_workflow_id }}</a>\n </td>\n <td data-head=\"Version\">\n <a [routerLink]=\"versionsLink(run)\"\n [queryParams]=\"{ version: run.flow_version_id }\">{{ 'Flows.Runs.VersionLabel' | transloco: { number: run.flow_version_number } }}</a>\n </td>\n <td data-head=\"Status\">\n <span [class]=\"badgeClass(run.status)\">\n {{ 'Flows.Status.' + run.status | transloco }}\n </span>\n </td>\n <td data-head=\"Started\">{{ run.started_at ? (run.started_at | dateFormat) : '—' }}</td>\n <td data-head=\"Duration\">\n @if (duration(run) !== null) {\n {{ duration(run) / 1000 | number: '1.0-1' }}{{ 'Flows.Runs.SecondsSuffix' | transloco }}\n } @else {\n —\n }\n </td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"'Flows.Runs.Inspect' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.inspect\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Runs.Inspect' | transloco\"\n (click)=\"inspect(run)\"\n (keydown.enter)=\"inspect(run)\"></fa-icon>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"runs.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Runs.Empty' | transloco\" [description]=\"'Flows.Runs.EmptyDescription' | transloco\"></pw-no-data>\n}\n}\n",
|
|
1918
1993
|
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}\n"]
|
|
1919
1994
|
}]
|
|
1920
1995
|
}],
|
|
@@ -1928,12 +2003,12 @@ var FlowsTabsComponent = class FlowsTabsComponent {
|
|
|
1928
2003
|
constructor() {
|
|
1929
2004
|
this.items = [{
|
|
1930
2005
|
id: "workflows",
|
|
1931
|
-
|
|
2006
|
+
labelKey: "Flows.Workflows.Title",
|
|
1932
2007
|
icon: "fa fa-fw fa-sitemap",
|
|
1933
2008
|
routerLink: ["/flows/workflows"]
|
|
1934
2009
|
}, {
|
|
1935
2010
|
id: "runs",
|
|
1936
|
-
|
|
2011
|
+
labelKey: "Flows.Runs.Title",
|
|
1937
2012
|
icon: "fa fa-fw fa-history",
|
|
1938
2013
|
routerLink: ["/flows/runs"]
|
|
1939
2014
|
}];
|
|
@@ -2755,6 +2830,37 @@ function flowFieldSources(graph, nodeId, definitions, learned = {}) {
|
|
|
2755
2830
|
};
|
|
2756
2831
|
});
|
|
2757
2832
|
}
|
|
2833
|
+
const CONFLICT = Symbol("conflict");
|
|
2834
|
+
function ownSettings(node) {
|
|
2835
|
+
return Object.fromEntries(Object.entries(node?.params ?? {}).filter((entry) => typeof entry[1] === "string" && entry[1].trim() !== "" && !entry[1].includes("{{")));
|
|
2836
|
+
}
|
|
2837
|
+
function combine(all) {
|
|
2838
|
+
const merged = {};
|
|
2839
|
+
all.forEach((settings) => Object.entries(settings).forEach(([name, value]) => {
|
|
2840
|
+
merged[name] = name in merged && merged[name] !== value ? CONFLICT : value;
|
|
2841
|
+
}));
|
|
2842
|
+
return Object.fromEntries(Object.entries(merged).filter((entry) => entry[1] !== CONFLICT));
|
|
2843
|
+
}
|
|
2844
|
+
function flowSettingValues(graph, nodeId) {
|
|
2845
|
+
const byId = new Map(graph.nodes.map((node) => [node.id, node]));
|
|
2846
|
+
const into = flowIncoming(graph, {
|
|
2847
|
+
outOf: (id) => ({
|
|
2848
|
+
...into(id),
|
|
2849
|
+
...ownSettings(byId.get(id))
|
|
2850
|
+
}),
|
|
2851
|
+
failed: (id) => ({
|
|
2852
|
+
...into(id),
|
|
2853
|
+
...ownSettings(byId.get(id))
|
|
2854
|
+
}),
|
|
2855
|
+
combine,
|
|
2856
|
+
none: () => ({})
|
|
2857
|
+
});
|
|
2858
|
+
return into(nodeId);
|
|
2859
|
+
}
|
|
2860
|
+
function flowSettingFor(value, settings) {
|
|
2861
|
+
const name = typeof value === "string" ? /^\{\{\s*([\w.]+)\s*\}\}$/.exec(value)?.[1] : void 0;
|
|
2862
|
+
return name && settings?.[name] || null;
|
|
2863
|
+
}
|
|
2758
2864
|
function flowNodeSelection(graph, node, definition, definitions, workflowFields) {
|
|
2759
2865
|
const learned = workflowFields?.byNode ?? {};
|
|
2760
2866
|
const incoming = flowFieldsInto(graph, node.id, definitions, learned);
|
|
@@ -2763,9 +2869,19 @@ function flowNodeSelection(graph, node, definition, definitions, workflowFields)
|
|
|
2763
2869
|
definition,
|
|
2764
2870
|
fieldSuggestions: [.../* @__PURE__ */ new Set([...conditionFieldSuggestions(graph, node.id), ...incoming.names])],
|
|
2765
2871
|
listSuggestions: Object.keys(incoming.lists),
|
|
2766
|
-
fieldSources: flowFieldsPossible(graph, node.id) ? flowFieldSources(graph, node.id, definitions, learned) : null
|
|
2872
|
+
fieldSources: flowFieldsPossible(graph, node.id) ? flowFieldSources(graph, node.id, definitions, learned) : null,
|
|
2873
|
+
settingValues: flowSettingValues(graph, node.id)
|
|
2767
2874
|
};
|
|
2768
2875
|
}
|
|
2876
|
+
function flowAiChoices(node) {
|
|
2877
|
+
const choices = node.params?.["choices"];
|
|
2878
|
+
return Array.isArray(choices) ? choices.filter((choice) => !!choice && typeof choice === "object") : [];
|
|
2879
|
+
}
|
|
2880
|
+
function flowNodeOutputs(node, definition) {
|
|
2881
|
+
if (node.type !== "logic.ai_decide") return definition.outputs;
|
|
2882
|
+
const names = flowAiChoices(node).map((choice) => choice.name).filter((name) => typeof name === "string" && name.trim() !== "");
|
|
2883
|
+
return [.../* @__PURE__ */ new Set([...definition.outputs, ...names])];
|
|
2884
|
+
}
|
|
2769
2885
|
const FLOW_SOCKET = new ClassicPreset.Socket("flow");
|
|
2770
2886
|
var FlowCanvasNode = class extends ClassicPreset.Node {
|
|
2771
2887
|
constructor(flowNode, definition, label, hasInput, outputs) {
|
|
@@ -2776,8 +2892,22 @@ var FlowCanvasNode = class extends ClassicPreset.Node {
|
|
|
2776
2892
|
this.height = 0;
|
|
2777
2893
|
this.id = flowNode.id;
|
|
2778
2894
|
if (hasInput) this.addInput("in", new ClassicPreset.Input(FLOW_SOCKET, "", true));
|
|
2779
|
-
outputs.forEach((branch) => this.
|
|
2780
|
-
this.
|
|
2895
|
+
outputs.forEach((branch) => this.addBranch(branch));
|
|
2896
|
+
this.fitHeight();
|
|
2897
|
+
}
|
|
2898
|
+
syncOutputs(outputs) {
|
|
2899
|
+
const removed = Object.keys(this.outputs).filter((branch) => !outputs.includes(branch));
|
|
2900
|
+
removed.forEach((branch) => this.removeOutput(branch));
|
|
2901
|
+
outputs.filter((branch) => !this.hasOutput(branch)).forEach((branch) => this.addBranch(branch));
|
|
2902
|
+
this.fitHeight();
|
|
2903
|
+
return removed;
|
|
2904
|
+
}
|
|
2905
|
+
addBranch(branch) {
|
|
2906
|
+
this.addOutput(branch, new ClassicPreset.Output(FLOW_SOCKET, branch === "next" ? "" : branch));
|
|
2907
|
+
}
|
|
2908
|
+
fitHeight() {
|
|
2909
|
+
const outputs = Object.keys(this.outputs).length;
|
|
2910
|
+
this.height = 56 + Math.max(outputs, this.hasInput("in") ? 1 : 0) * 36;
|
|
2781
2911
|
}
|
|
2782
2912
|
};
|
|
2783
2913
|
var FlowCanvasConnection = class extends ClassicPreset.Connection {};
|
|
@@ -2785,7 +2915,7 @@ function branchOf(edge) {
|
|
|
2785
2915
|
return edge.branch ?? "next";
|
|
2786
2916
|
}
|
|
2787
2917
|
function outputsFor(node, definition, edges) {
|
|
2788
|
-
if (definition) return definition
|
|
2918
|
+
if (definition) return flowNodeOutputs(node, definition);
|
|
2789
2919
|
const used = edges.filter((edge) => edge.from === node.id).map(branchOf);
|
|
2790
2920
|
return [.../* @__PURE__ */ new Set([DEFAULT_FLOW_BRANCH, ...used])];
|
|
2791
2921
|
}
|
|
@@ -3244,10 +3374,19 @@ var FlowCanvasEditor = class {
|
|
|
3244
3374
|
const node = this.rete.editor.getNode(nodeId);
|
|
3245
3375
|
if (node) {
|
|
3246
3376
|
node.flowNode = flowNode;
|
|
3377
|
+
if (node.definition) {
|
|
3378
|
+
const outputs = flowNodeOutputs(flowNode, node.definition);
|
|
3379
|
+
await this.removeBranches(node, Object.keys(node.outputs).filter((branch) => !outputs.includes(branch)));
|
|
3380
|
+
node.syncOutputs(outputs);
|
|
3381
|
+
}
|
|
3247
3382
|
await this.rete.area.update("node", nodeId);
|
|
3248
3383
|
this.listener.changed();
|
|
3249
3384
|
}
|
|
3250
3385
|
}
|
|
3386
|
+
async removeBranches(node, branches) {
|
|
3387
|
+
const gone = this.rete.editor.getConnections().filter((c) => c.source === node.id && branches.includes(c.sourceOutput));
|
|
3388
|
+
for (const connection of gone) await this.rete.editor.removeConnection(connection.id);
|
|
3389
|
+
}
|
|
3251
3390
|
node(nodeId) {
|
|
3252
3391
|
return this.rete.editor.getNode(nodeId);
|
|
3253
3392
|
}
|
|
@@ -3461,6 +3600,11 @@ const FIELD_KINDS = {
|
|
|
3461
3600
|
"data.set_fields": { fields: "pairs" },
|
|
3462
3601
|
"data.merge": { mode: "mode" },
|
|
3463
3602
|
"data.split_out": { field: "list" },
|
|
3603
|
+
"logic.ai_decide": {
|
|
3604
|
+
instructions: "textarea",
|
|
3605
|
+
choices: "choices",
|
|
3606
|
+
min_confidence: "number"
|
|
3607
|
+
},
|
|
3464
3608
|
"action.email": {
|
|
3465
3609
|
to: "email",
|
|
3466
3610
|
subject: "text",
|
|
@@ -3737,176 +3881,164 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3737
3881
|
add: [{ type: Output }]
|
|
3738
3882
|
}
|
|
3739
3883
|
});
|
|
3740
|
-
const
|
|
3741
|
-
"
|
|
3742
|
-
"
|
|
3743
|
-
"
|
|
3744
|
-
"
|
|
3745
|
-
"
|
|
3746
|
-
"
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
5,
|
|
3751
|
-
10,
|
|
3752
|
-
15,
|
|
3753
|
-
30
|
|
3884
|
+
const FLOW_CONDITION_OPERATORS = [
|
|
3885
|
+
"eq",
|
|
3886
|
+
"neq",
|
|
3887
|
+
"gt",
|
|
3888
|
+
"gte",
|
|
3889
|
+
"lt",
|
|
3890
|
+
"lte",
|
|
3891
|
+
"contains",
|
|
3892
|
+
"empty",
|
|
3893
|
+
"not_empty"
|
|
3754
3894
|
];
|
|
3755
|
-
const
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
custom: ""
|
|
3895
|
+
const LOGIC_OPS = {
|
|
3896
|
+
"==": "eq",
|
|
3897
|
+
"!=": "neq",
|
|
3898
|
+
">": "gt",
|
|
3899
|
+
">=": "gte",
|
|
3900
|
+
"<": "lt",
|
|
3901
|
+
"<=": "lte"
|
|
3763
3902
|
};
|
|
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
|
-
}
|
|
3903
|
+
const OP_LOGIC = Object.fromEntries(Object.entries(LOGIC_OPS).map(([logic, op]) => [op, logic]));
|
|
3904
|
+
function isNumericOperator(operator) {
|
|
3905
|
+
return [
|
|
3906
|
+
"gt",
|
|
3907
|
+
"gte",
|
|
3908
|
+
"lt",
|
|
3909
|
+
"lte"
|
|
3910
|
+
].includes(operator);
|
|
3782
3911
|
}
|
|
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
|
-
}
|
|
3912
|
+
function takesValue(operator) {
|
|
3913
|
+
return operator !== "empty" && operator !== "not_empty";
|
|
3914
|
+
}
|
|
3915
|
+
function emptyFlowConditionRule() {
|
|
3790
3916
|
return {
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3917
|
+
field: "",
|
|
3918
|
+
operator: "eq",
|
|
3919
|
+
value: "",
|
|
3920
|
+
valueType: "text"
|
|
3794
3921
|
};
|
|
3795
3922
|
}
|
|
3796
|
-
function
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
mode
|
|
3800
|
-
};
|
|
3801
|
-
switch (mode) {
|
|
3802
|
-
case "minutes": {
|
|
3803
|
-
const every = a ?? 1;
|
|
3804
|
-
return FLOW_CRON_EVERY_OPTIONS.includes(every) ? {
|
|
3805
|
-
...base,
|
|
3806
|
-
every
|
|
3807
|
-
} : {
|
|
3808
|
-
...base,
|
|
3809
|
-
mode: "custom",
|
|
3810
|
-
custom: `*/${every} * * * *`
|
|
3811
|
-
};
|
|
3812
|
-
}
|
|
3813
|
-
case "hourly": return {
|
|
3814
|
-
...base,
|
|
3815
|
-
minute: a
|
|
3816
|
-
};
|
|
3817
|
-
case "daily": return {
|
|
3818
|
-
...base,
|
|
3819
|
-
minute: a,
|
|
3820
|
-
hour: b
|
|
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
|
-
};
|
|
3838
|
-
}
|
|
3923
|
+
function typedValue(rule) {
|
|
3924
|
+
if (rule.valueType === "boolean") return rule.value === "true";
|
|
3925
|
+
return isNumericOperator(rule.operator) || rule.valueType === "number" ? Number(rule.value) : rule.value;
|
|
3839
3926
|
}
|
|
3840
|
-
function
|
|
3841
|
-
|
|
3927
|
+
function isCompleteRule(rule) {
|
|
3928
|
+
if (!rule.field.trim()) return false;
|
|
3929
|
+
if (!takesValue(rule.operator)) return true;
|
|
3930
|
+
return isNumericOperator(rule.operator) || rule.valueType === "number" ? rule.value.trim() !== "" && Number.isFinite(Number(rule.value)) : true;
|
|
3842
3931
|
}
|
|
3843
|
-
|
|
3844
|
-
const
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
}
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3932
|
+
function ruleToLogic(rule) {
|
|
3933
|
+
const field = { var: rule.field.trim() };
|
|
3934
|
+
switch (rule.operator) {
|
|
3935
|
+
case "contains": return { in: [typedValue(rule), field] };
|
|
3936
|
+
case "empty": return { "==": [field, null] };
|
|
3937
|
+
case "not_empty": return { "!=": [field, null] };
|
|
3938
|
+
default: return { [OP_LOGIC[rule.operator]]: [field, typedValue(rule)] };
|
|
3939
|
+
}
|
|
3940
|
+
}
|
|
3941
|
+
function toJsonLogic(group) {
|
|
3942
|
+
if (!group.rules.length || !group.rules.every(isCompleteRule)) return;
|
|
3943
|
+
const logic = group.rules.map(ruleToLogic);
|
|
3944
|
+
return logic.length === 1 ? logic[0] : { [group.combinator === "all" ? "and" : "or"]: logic };
|
|
3945
|
+
}
|
|
3946
|
+
function asRecord(value) {
|
|
3947
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
3948
|
+
}
|
|
3949
|
+
function fieldOf(value) {
|
|
3950
|
+
const record = asRecord(value);
|
|
3951
|
+
const keys = record ? Object.keys(record) : [];
|
|
3952
|
+
return keys.length === 1 && keys[0] === "var" && typeof record?.["var"] === "string" ? record["var"] : null;
|
|
3953
|
+
}
|
|
3954
|
+
function valueRule(field, operator, value) {
|
|
3955
|
+
if (typeof value === "number") return {
|
|
3956
|
+
field,
|
|
3957
|
+
operator,
|
|
3958
|
+
value: String(value),
|
|
3959
|
+
valueType: "number"
|
|
3960
|
+
};
|
|
3961
|
+
if (typeof value === "boolean") return {
|
|
3962
|
+
field,
|
|
3963
|
+
operator,
|
|
3964
|
+
value: String(value),
|
|
3965
|
+
valueType: "boolean"
|
|
3966
|
+
};
|
|
3967
|
+
return typeof value === "string" ? {
|
|
3968
|
+
field,
|
|
3969
|
+
operator,
|
|
3970
|
+
value,
|
|
3971
|
+
valueType: "text"
|
|
3972
|
+
} : null;
|
|
3973
|
+
}
|
|
3974
|
+
function logicToRule(logic) {
|
|
3975
|
+
const record = asRecord(logic);
|
|
3976
|
+
const [op] = record ? Object.keys(record) : [];
|
|
3977
|
+
const args = record && Object.keys(record).length === 1 ? record[op] : null;
|
|
3978
|
+
if (!Array.isArray(args) || args.length !== 2) return null;
|
|
3979
|
+
if (op === "in") {
|
|
3980
|
+
const field = fieldOf(args[1]);
|
|
3981
|
+
return field ? valueRule(field, "contains", args[0]) : null;
|
|
3982
|
+
}
|
|
3983
|
+
const field = fieldOf(args[0]);
|
|
3984
|
+
const operator = LOGIC_OPS[op];
|
|
3985
|
+
if (!field || !operator) return null;
|
|
3986
|
+
if (args[1] === null && (operator === "eq" || operator === "neq")) return {
|
|
3987
|
+
field,
|
|
3988
|
+
operator: operator === "eq" ? "empty" : "not_empty",
|
|
3989
|
+
value: "",
|
|
3990
|
+
valueType: "text"
|
|
3991
|
+
};
|
|
3992
|
+
return valueRule(field, operator, args[1]);
|
|
3993
|
+
}
|
|
3994
|
+
function fromJsonLogic(logic) {
|
|
3995
|
+
const record = asRecord(logic);
|
|
3996
|
+
if (!record) return logic === void 0 || logic === null ? {
|
|
3997
|
+
combinator: "all",
|
|
3998
|
+
rules: []
|
|
3999
|
+
} : null;
|
|
4000
|
+
const [key] = Object.keys(record);
|
|
4001
|
+
const nested = Object.keys(record).length === 1 && (key === "and" || key === "or") ? record[key] : null;
|
|
4002
|
+
const rules = (Array.isArray(nested) ? nested : [logic]).map(logicToRule);
|
|
4003
|
+
if (rules.includes(null)) return null;
|
|
4004
|
+
return {
|
|
4005
|
+
combinator: key === "or" ? "any" : "all",
|
|
4006
|
+
rules
|
|
4007
|
+
};
|
|
4008
|
+
}
|
|
4009
|
+
var FlowsJsonFieldComponent = class FlowsJsonFieldComponent {
|
|
4010
|
+
constructor() {
|
|
4011
|
+
this.readOnly = false;
|
|
4012
|
+
this.valueChange = new EventEmitter();
|
|
4013
|
+
this.text = "";
|
|
4014
|
+
this.invalid = false;
|
|
4015
|
+
}
|
|
4016
|
+
ngOnChanges() {
|
|
4017
|
+
this.text = this.value === void 0 ? "" : JSON.stringify(this.value, null, 2);
|
|
4018
|
+
this.invalid = false;
|
|
4019
|
+
}
|
|
4020
|
+
commit() {
|
|
4021
|
+
if (this.readOnly) return;
|
|
4022
|
+
if (!this.text.trim()) {
|
|
4023
|
+
this.invalid = false;
|
|
4024
|
+
this.valueChange.emit(void 0);
|
|
4025
|
+
return;
|
|
4026
|
+
}
|
|
4027
|
+
try {
|
|
4028
|
+
const parsed = JSON.parse(this.text);
|
|
4029
|
+
this.invalid = false;
|
|
4030
|
+
this.valueChange.emit(parsed);
|
|
4031
|
+
} catch {
|
|
4032
|
+
this.invalid = true;
|
|
4033
|
+
}
|
|
3902
4034
|
}
|
|
3903
4035
|
static {
|
|
3904
4036
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
3905
4037
|
minVersion: "12.0.0",
|
|
3906
4038
|
version: "22.2.3",
|
|
3907
4039
|
ngImport: i0,
|
|
3908
|
-
type:
|
|
3909
|
-
deps: [
|
|
4040
|
+
type: FlowsJsonFieldComponent,
|
|
4041
|
+
deps: [],
|
|
3910
4042
|
target: i0.ɵɵFactoryTarget.Component
|
|
3911
4043
|
});
|
|
3912
4044
|
}
|
|
@@ -3914,9 +4046,9 @@ var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
|
3914
4046
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3915
4047
|
minVersion: "17.0.0",
|
|
3916
4048
|
version: "22.2.3",
|
|
3917
|
-
type:
|
|
4049
|
+
type: FlowsJsonFieldComponent,
|
|
3918
4050
|
isStandalone: false,
|
|
3919
|
-
selector: "pw-flows-
|
|
4051
|
+
selector: "pw-flows-json-field",
|
|
3920
4052
|
inputs: {
|
|
3921
4053
|
value: "value",
|
|
3922
4054
|
inputId: "inputId",
|
|
@@ -3925,53 +4057,38 @@ var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
|
3925
4057
|
outputs: { valueChange: "valueChange" },
|
|
3926
4058
|
usesOnChanges: true,
|
|
3927
4059
|
ngImport: i0,
|
|
3928
|
-
template:
|
|
4060
|
+
template: `
|
|
4061
|
+
<textarea
|
|
4062
|
+
class="form-control pw-json-field"
|
|
4063
|
+
rows="5"
|
|
4064
|
+
spellcheck="false"
|
|
4065
|
+
[id]="inputId"
|
|
4066
|
+
[readOnly]="readOnly"
|
|
4067
|
+
[(ngModel)]="text"
|
|
4068
|
+
[ngModelOptions]="{ standalone: true }"
|
|
4069
|
+
(blur)="commit()"
|
|
4070
|
+
></textarea>
|
|
4071
|
+
@if (invalid) {
|
|
4072
|
+
<pw-field-error-display
|
|
4073
|
+
[displayError]="true"
|
|
4074
|
+
[errorMsg]="'Flows.Versions.Editor.InvalidJson' | transloco"
|
|
4075
|
+
>
|
|
4076
|
+
</pw-field-error-display>
|
|
4077
|
+
}
|
|
4078
|
+
`,
|
|
4079
|
+
isInline: true,
|
|
4080
|
+
styles: [".pw-json-field{white-space:pre;overflow-x:auto}\n"],
|
|
3929
4081
|
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
4082
|
{
|
|
3943
4083
|
kind: "directive",
|
|
3944
4084
|
type: i3$1.DefaultValueAccessor,
|
|
3945
4085
|
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
4086
|
},
|
|
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
4087
|
{
|
|
3959
4088
|
kind: "directive",
|
|
3960
4089
|
type: i3$1.NgControlStatus,
|
|
3961
4090
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
3962
4091
|
},
|
|
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
4092
|
{
|
|
3976
4093
|
kind: "directive",
|
|
3977
4094
|
type: i3$1.NgModel,
|
|
@@ -3985,6 +4102,12 @@ var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
|
3985
4102
|
outputs: ["ngModelChange"],
|
|
3986
4103
|
exportAs: ["ngModel"]
|
|
3987
4104
|
},
|
|
4105
|
+
{
|
|
4106
|
+
kind: "component",
|
|
4107
|
+
type: i2$1.FieldErrorDisplayComponent,
|
|
4108
|
+
selector: "pw-field-error-display",
|
|
4109
|
+
inputs: ["errorMsg", "displayError"]
|
|
4110
|
+
},
|
|
3988
4111
|
{
|
|
3989
4112
|
kind: "pipe",
|
|
3990
4113
|
type: i2$4.TranslocoPipe,
|
|
@@ -3998,16 +4121,34 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3998
4121
|
minVersion: "12.0.0",
|
|
3999
4122
|
version: "22.2.3",
|
|
4000
4123
|
ngImport: i0,
|
|
4001
|
-
type:
|
|
4124
|
+
type: FlowsJsonFieldComponent,
|
|
4002
4125
|
decorators: [{
|
|
4003
4126
|
type: Component,
|
|
4004
4127
|
args: [{
|
|
4005
|
-
selector: "pw-flows-
|
|
4128
|
+
selector: "pw-flows-json-field",
|
|
4129
|
+
template: `
|
|
4130
|
+
<textarea
|
|
4131
|
+
class="form-control pw-json-field"
|
|
4132
|
+
rows="5"
|
|
4133
|
+
spellcheck="false"
|
|
4134
|
+
[id]="inputId"
|
|
4135
|
+
[readOnly]="readOnly"
|
|
4136
|
+
[(ngModel)]="text"
|
|
4137
|
+
[ngModelOptions]="{ standalone: true }"
|
|
4138
|
+
(blur)="commit()"
|
|
4139
|
+
></textarea>
|
|
4140
|
+
@if (invalid) {
|
|
4141
|
+
<pw-field-error-display
|
|
4142
|
+
[displayError]="true"
|
|
4143
|
+
[errorMsg]="'Flows.Versions.Editor.InvalidJson' | transloco"
|
|
4144
|
+
>
|
|
4145
|
+
</pw-field-error-display>
|
|
4146
|
+
}
|
|
4147
|
+
`,
|
|
4006
4148
|
standalone: false,
|
|
4007
|
-
|
|
4149
|
+
styles: [".pw-json-field{white-space:pre;overflow-x:auto}\n"]
|
|
4008
4150
|
}]
|
|
4009
4151
|
}],
|
|
4010
|
-
ctorParameters: () => [{ type: i2$4.TranslocoService }],
|
|
4011
4152
|
propDecorators: {
|
|
4012
4153
|
value: [{ type: Input }],
|
|
4013
4154
|
inputId: [{ type: Input }],
|
|
@@ -4015,58 +4156,138 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4015
4156
|
valueChange: [{ type: Output }]
|
|
4016
4157
|
}
|
|
4017
4158
|
});
|
|
4018
|
-
const
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4159
|
+
const OPTION_KEYS = {
|
|
4160
|
+
operators: FLOW_CONDITION_OPERATORS.map((op) => [op, `Flows.Condition.Ops.${op}`]),
|
|
4161
|
+
types: [
|
|
4162
|
+
"text",
|
|
4163
|
+
"number",
|
|
4164
|
+
"boolean"
|
|
4165
|
+
].map((type) => [type, `Flows.Condition.Types.${type}`]),
|
|
4166
|
+
combinators: [["all", "Flows.Condition.All"], ["any", "Flows.Condition.Any"]],
|
|
4167
|
+
booleans: [["true", "Flows.Branch.true"], ["false", "Flows.Branch.false"]]
|
|
4168
|
+
};
|
|
4169
|
+
var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
4170
|
+
constructor(translation, cdr, destroyRef) {
|
|
4171
|
+
this.suggestions = [];
|
|
4024
4172
|
this.readOnly = false;
|
|
4025
4173
|
this.valueChange = new EventEmitter();
|
|
4026
|
-
this.
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
this
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4174
|
+
this.icons = FLOWS_ICONS;
|
|
4175
|
+
this.options = {};
|
|
4176
|
+
this.takesValue = takesValue;
|
|
4177
|
+
this.isNumericOperator = isNumericOperator;
|
|
4178
|
+
this.group = {
|
|
4179
|
+
combinator: "all",
|
|
4180
|
+
rules: []
|
|
4181
|
+
};
|
|
4182
|
+
this.mode = "rules";
|
|
4183
|
+
this.incomplete = false;
|
|
4184
|
+
translation.selectTranslation("flows").pipe(takeUntilDestroyed(destroyRef)).subscribe(() => {
|
|
4185
|
+
this.options = Object.fromEntries(Object.entries(OPTION_KEYS).map(([name, entries]) => [name, entries.map(([value, key]) => ({
|
|
4186
|
+
value,
|
|
4187
|
+
label: translation.translate(key)
|
|
4188
|
+
}))]));
|
|
4189
|
+
cdr.markForCheck();
|
|
4036
4190
|
});
|
|
4037
4191
|
}
|
|
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
|
-
|
|
4192
|
+
ngOnChanges() {
|
|
4193
|
+
if (this.value !== void 0 && this.value === this.emitted) return;
|
|
4194
|
+
this.load(this.value);
|
|
4195
|
+
}
|
|
4196
|
+
get combinesRules() {
|
|
4197
|
+
return this.group.rules.length > 1;
|
|
4198
|
+
}
|
|
4199
|
+
get canUseRules() {
|
|
4200
|
+
return fromJsonLogic(this.value) !== null;
|
|
4201
|
+
}
|
|
4202
|
+
addRule() {
|
|
4203
|
+
this.group = {
|
|
4204
|
+
...this.group,
|
|
4205
|
+
rules: [...this.group.rules, emptyFlowConditionRule()]
|
|
4206
|
+
};
|
|
4207
|
+
this.incomplete = true;
|
|
4208
|
+
}
|
|
4209
|
+
removeRule(index) {
|
|
4210
|
+
this.group = {
|
|
4211
|
+
...this.group,
|
|
4212
|
+
rules: this.group.rules.filter((_, i) => i !== index)
|
|
4213
|
+
};
|
|
4214
|
+
this.commit();
|
|
4215
|
+
}
|
|
4216
|
+
useRules() {
|
|
4217
|
+
this.load(this.value);
|
|
4218
|
+
}
|
|
4219
|
+
useJson() {
|
|
4220
|
+
this.mode = "json";
|
|
4221
|
+
}
|
|
4222
|
+
commit() {
|
|
4223
|
+
if (this.readOnly) return;
|
|
4224
|
+
const logic = this.group.rules.length ? toJsonLogic(this.group) : void 0;
|
|
4225
|
+
this.incomplete = !!this.group.rules.length && logic === void 0;
|
|
4226
|
+
if (!this.incomplete) this.emit(logic);
|
|
4227
|
+
}
|
|
4228
|
+
emit(value) {
|
|
4229
|
+
this.emitted = value;
|
|
4230
|
+
this.valueChange.emit(value);
|
|
4231
|
+
}
|
|
4232
|
+
load(value) {
|
|
4233
|
+
const group = fromJsonLogic(value);
|
|
4234
|
+
this.mode = group ? "rules" : "json";
|
|
4235
|
+
this.group = group ?? {
|
|
4236
|
+
combinator: "all",
|
|
4237
|
+
rules: []
|
|
4238
|
+
};
|
|
4239
|
+
this.incomplete = false;
|
|
4240
|
+
}
|
|
4241
|
+
static {
|
|
4242
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4243
|
+
minVersion: "12.0.0",
|
|
4244
|
+
version: "22.2.3",
|
|
4245
|
+
ngImport: i0,
|
|
4246
|
+
type: FlowsConditionFieldComponent,
|
|
4247
|
+
deps: [
|
|
4248
|
+
{ token: i2$4.TranslocoService },
|
|
4249
|
+
{ token: i0.ChangeDetectorRef },
|
|
4250
|
+
{ token: i0.DestroyRef }
|
|
4251
|
+
],
|
|
4252
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
4253
|
+
});
|
|
4254
|
+
}
|
|
4255
|
+
static {
|
|
4256
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4257
|
+
minVersion: "17.0.0",
|
|
4258
|
+
version: "22.2.3",
|
|
4259
|
+
type: FlowsConditionFieldComponent,
|
|
4260
|
+
isStandalone: false,
|
|
4261
|
+
selector: "pw-flows-condition-field",
|
|
4262
|
+
inputs: {
|
|
4263
|
+
value: "value",
|
|
4264
|
+
inputId: "inputId",
|
|
4265
|
+
suggestions: "suggestions",
|
|
4266
|
+
readOnly: "readOnly"
|
|
4267
|
+
},
|
|
4268
|
+
outputs: { valueChange: "valueChange" },
|
|
4269
|
+
usesOnChanges: true,
|
|
4270
|
+
ngImport: i0,
|
|
4271
|
+
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",
|
|
4272
|
+
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"],
|
|
4069
4273
|
dependencies: [
|
|
4274
|
+
{
|
|
4275
|
+
kind: "directive",
|
|
4276
|
+
type: i3$1.NgSelectOption,
|
|
4277
|
+
selector: "option",
|
|
4278
|
+
inputs: ["ngValue", "value"]
|
|
4279
|
+
},
|
|
4280
|
+
{
|
|
4281
|
+
kind: "directive",
|
|
4282
|
+
type: i3$1.ɵNgSelectMultipleOption,
|
|
4283
|
+
selector: "option",
|
|
4284
|
+
inputs: ["ngValue", "value"]
|
|
4285
|
+
},
|
|
4286
|
+
{
|
|
4287
|
+
kind: "directive",
|
|
4288
|
+
type: i3$1.DefaultValueAccessor,
|
|
4289
|
+
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]"
|
|
4290
|
+
},
|
|
4070
4291
|
{
|
|
4071
4292
|
kind: "directive",
|
|
4072
4293
|
type: i3$1.NgControlStatus,
|
|
@@ -4085,6 +4306,34 @@ var FlowsTimezoneFieldComponent = class FlowsTimezoneFieldComponent {
|
|
|
4085
4306
|
outputs: ["ngModelChange"],
|
|
4086
4307
|
exportAs: ["ngModel"]
|
|
4087
4308
|
},
|
|
4309
|
+
{
|
|
4310
|
+
kind: "directive",
|
|
4311
|
+
type: i1$1.Tooltip,
|
|
4312
|
+
selector: "[pTooltip]",
|
|
4313
|
+
inputs: [
|
|
4314
|
+
"tooltipPosition",
|
|
4315
|
+
"tooltipEvent",
|
|
4316
|
+
"positionStyle",
|
|
4317
|
+
"tooltipStyleClass",
|
|
4318
|
+
"tooltipZIndex",
|
|
4319
|
+
"escape",
|
|
4320
|
+
"showDelay",
|
|
4321
|
+
"hideDelay",
|
|
4322
|
+
"life",
|
|
4323
|
+
"positionTop",
|
|
4324
|
+
"positionLeft",
|
|
4325
|
+
"autoHide",
|
|
4326
|
+
"fitContent",
|
|
4327
|
+
"hideOnEscape",
|
|
4328
|
+
"showOnEllipsis",
|
|
4329
|
+
"pTooltip",
|
|
4330
|
+
"tooltipDisabled",
|
|
4331
|
+
"tooltipOptions",
|
|
4332
|
+
"appendTo",
|
|
4333
|
+
"pTooltipPT",
|
|
4334
|
+
"pTooltipUnstyled"
|
|
4335
|
+
]
|
|
4336
|
+
},
|
|
4088
4337
|
{
|
|
4089
4338
|
kind: "component",
|
|
4090
4339
|
type: i4$1.Select,
|
|
@@ -4155,6 +4404,54 @@ var FlowsTimezoneFieldComponent = class FlowsTimezoneFieldComponent {
|
|
|
4155
4404
|
"onLazyLoad"
|
|
4156
4405
|
]
|
|
4157
4406
|
},
|
|
4407
|
+
{
|
|
4408
|
+
kind: "component",
|
|
4409
|
+
type: i2$3.FaIconComponent,
|
|
4410
|
+
selector: "fa-icon",
|
|
4411
|
+
inputs: [
|
|
4412
|
+
"icon",
|
|
4413
|
+
"title",
|
|
4414
|
+
"animation",
|
|
4415
|
+
"mask",
|
|
4416
|
+
"flip",
|
|
4417
|
+
"size",
|
|
4418
|
+
"pull",
|
|
4419
|
+
"border",
|
|
4420
|
+
"inverse",
|
|
4421
|
+
"symbol",
|
|
4422
|
+
"rotate",
|
|
4423
|
+
"fixedWidth",
|
|
4424
|
+
"transform",
|
|
4425
|
+
"a11yRole"
|
|
4426
|
+
],
|
|
4427
|
+
outputs: [
|
|
4428
|
+
"iconChange",
|
|
4429
|
+
"titleChange",
|
|
4430
|
+
"animationChange",
|
|
4431
|
+
"maskChange",
|
|
4432
|
+
"flipChange",
|
|
4433
|
+
"sizeChange",
|
|
4434
|
+
"pullChange",
|
|
4435
|
+
"borderChange",
|
|
4436
|
+
"inverseChange",
|
|
4437
|
+
"symbolChange",
|
|
4438
|
+
"rotateChange",
|
|
4439
|
+
"fixedWidthChange",
|
|
4440
|
+
"transformChange",
|
|
4441
|
+
"a11yRoleChange"
|
|
4442
|
+
]
|
|
4443
|
+
},
|
|
4444
|
+
{
|
|
4445
|
+
kind: "component",
|
|
4446
|
+
type: FlowsJsonFieldComponent,
|
|
4447
|
+
selector: "pw-flows-json-field",
|
|
4448
|
+
inputs: [
|
|
4449
|
+
"value",
|
|
4450
|
+
"inputId",
|
|
4451
|
+
"readOnly"
|
|
4452
|
+
],
|
|
4453
|
+
outputs: ["valueChange"]
|
|
4454
|
+
},
|
|
4158
4455
|
{
|
|
4159
4456
|
kind: "pipe",
|
|
4160
4457
|
type: i2$4.TranslocoPipe,
|
|
@@ -4168,80 +4465,209 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4168
4465
|
minVersion: "12.0.0",
|
|
4169
4466
|
version: "22.2.3",
|
|
4170
4467
|
ngImport: i0,
|
|
4171
|
-
type:
|
|
4468
|
+
type: FlowsConditionFieldComponent,
|
|
4172
4469
|
decorators: [{
|
|
4173
4470
|
type: Component,
|
|
4174
4471
|
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
|
|
4472
|
+
selector: "pw-flows-condition-field",
|
|
4473
|
+
standalone: false,
|
|
4474
|
+
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",
|
|
4475
|
+
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
4476
|
}]
|
|
4194
4477
|
}],
|
|
4478
|
+
ctorParameters: () => [
|
|
4479
|
+
{ type: i2$4.TranslocoService },
|
|
4480
|
+
{ type: i0.ChangeDetectorRef },
|
|
4481
|
+
{ type: i0.DestroyRef }
|
|
4482
|
+
],
|
|
4195
4483
|
propDecorators: {
|
|
4196
4484
|
value: [{ type: Input }],
|
|
4197
4485
|
inputId: [{ type: Input }],
|
|
4486
|
+
suggestions: [{ type: Input }],
|
|
4198
4487
|
readOnly: [{ type: Input }],
|
|
4199
4488
|
valueChange: [{ type: Output }]
|
|
4200
4489
|
}
|
|
4201
4490
|
});
|
|
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
|
-
|
|
4491
|
+
const FLOW_CRON_MODES = [
|
|
4492
|
+
"minutes",
|
|
4493
|
+
"hourly",
|
|
4494
|
+
"daily",
|
|
4495
|
+
"weekly",
|
|
4496
|
+
"monthly",
|
|
4497
|
+
"custom"
|
|
4498
|
+
];
|
|
4499
|
+
const FLOW_CRON_EVERY_OPTIONS = [
|
|
4500
|
+
1,
|
|
4501
|
+
5,
|
|
4502
|
+
10,
|
|
4503
|
+
15,
|
|
4504
|
+
30
|
|
4505
|
+
];
|
|
4506
|
+
const DEFAULT_FLOW_CRON = {
|
|
4507
|
+
mode: "daily",
|
|
4508
|
+
every: 15,
|
|
4509
|
+
minute: 0,
|
|
4510
|
+
hour: 9,
|
|
4511
|
+
weekday: 1,
|
|
4512
|
+
monthday: 1,
|
|
4513
|
+
custom: ""
|
|
4514
|
+
};
|
|
4515
|
+
const NUMBER = String.raw`(\d{1,2})`;
|
|
4516
|
+
const PATTERNS = [
|
|
4517
|
+
["minutes", /^\*(?:\/(\d{1,2}))? \* \* \* \*$/],
|
|
4518
|
+
["hourly", new RegExp(String.raw`^${NUMBER} \* \* \* \*$`)],
|
|
4519
|
+
["daily", new RegExp(String.raw`^${NUMBER} ${NUMBER} \* \* \*$`)],
|
|
4520
|
+
["weekly", new RegExp(String.raw`^${NUMBER} ${NUMBER} \* \* ([0-6])$`)],
|
|
4521
|
+
["monthly", new RegExp(String.raw`^${NUMBER} ${NUMBER} ${NUMBER} \* \*$`)]
|
|
4522
|
+
];
|
|
4523
|
+
function toFlowCron(schedule) {
|
|
4524
|
+
const { minute, hour } = schedule;
|
|
4525
|
+
switch (schedule.mode) {
|
|
4526
|
+
case "minutes": return schedule.every === 1 ? "* * * * *" : `*/${schedule.every} * * * *`;
|
|
4527
|
+
case "hourly": return `${minute} * * * *`;
|
|
4528
|
+
case "daily": return `${minute} ${hour} * * *`;
|
|
4529
|
+
case "weekly": return `${minute} ${hour} * * ${schedule.weekday}`;
|
|
4530
|
+
case "monthly": return `${minute} ${hour} ${schedule.monthday} * *`;
|
|
4531
|
+
default: return schedule.custom.trim();
|
|
4532
|
+
}
|
|
4533
|
+
}
|
|
4534
|
+
function fromFlowCron(cron) {
|
|
4535
|
+
const text = typeof cron === "string" ? cron.trim().replace(/\s+/g, " ") : "";
|
|
4536
|
+
if (!text) return { ...DEFAULT_FLOW_CRON };
|
|
4537
|
+
for (const [mode, pattern] of PATTERNS) {
|
|
4538
|
+
const match = pattern.exec(text);
|
|
4539
|
+
if (match) return fromMatch(mode, match.slice(1).map((part) => part === void 0 ? void 0 : Number(part)));
|
|
4540
|
+
}
|
|
4541
|
+
return {
|
|
4542
|
+
...DEFAULT_FLOW_CRON,
|
|
4543
|
+
mode: "custom",
|
|
4544
|
+
custom: text
|
|
4545
|
+
};
|
|
4546
|
+
}
|
|
4547
|
+
function fromMatch(mode, [a, b, c]) {
|
|
4548
|
+
const base = {
|
|
4549
|
+
...DEFAULT_FLOW_CRON,
|
|
4550
|
+
mode
|
|
4551
|
+
};
|
|
4552
|
+
switch (mode) {
|
|
4553
|
+
case "minutes": {
|
|
4554
|
+
const every = a ?? 1;
|
|
4555
|
+
return FLOW_CRON_EVERY_OPTIONS.includes(every) ? {
|
|
4556
|
+
...base,
|
|
4557
|
+
every
|
|
4558
|
+
} : {
|
|
4559
|
+
...base,
|
|
4560
|
+
mode: "custom",
|
|
4561
|
+
custom: `*/${every} * * * *`
|
|
4562
|
+
};
|
|
4563
|
+
}
|
|
4564
|
+
case "hourly": return {
|
|
4565
|
+
...base,
|
|
4566
|
+
minute: a
|
|
4567
|
+
};
|
|
4568
|
+
case "daily": return {
|
|
4569
|
+
...base,
|
|
4570
|
+
minute: a,
|
|
4571
|
+
hour: b
|
|
4572
|
+
};
|
|
4573
|
+
case "weekly": return {
|
|
4574
|
+
...base,
|
|
4575
|
+
minute: a,
|
|
4576
|
+
hour: b,
|
|
4577
|
+
weekday: c
|
|
4578
|
+
};
|
|
4579
|
+
default: return c >= 1 && c <= 28 ? {
|
|
4580
|
+
...base,
|
|
4581
|
+
minute: a,
|
|
4582
|
+
hour: b,
|
|
4583
|
+
monthday: c
|
|
4584
|
+
} : {
|
|
4585
|
+
...base,
|
|
4586
|
+
mode: "custom",
|
|
4587
|
+
custom: `${a} ${b} ${c} * *`
|
|
4588
|
+
};
|
|
4589
|
+
}
|
|
4590
|
+
}
|
|
4591
|
+
function flowCronTime(schedule) {
|
|
4592
|
+
return `${String(schedule.hour).padStart(2, "0")}:${String(schedule.minute).padStart(2, "0")}`;
|
|
4593
|
+
}
|
|
4594
|
+
const A_SUNDAY = Date.UTC(2026, 9, 4);
|
|
4595
|
+
const DAY_MS = 864e5;
|
|
4596
|
+
var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
4597
|
+
constructor(translation) {
|
|
4598
|
+
this.translation = translation;
|
|
4599
|
+
this.readOnly = false;
|
|
4600
|
+
this.valueChange = new EventEmitter();
|
|
4601
|
+
this.modes = FLOW_CRON_MODES;
|
|
4602
|
+
this.everyOptions = FLOW_CRON_EVERY_OPTIONS;
|
|
4603
|
+
this.monthdays = Array.from({ length: 28 }, (_, i) => i + 1);
|
|
4604
|
+
this.schedule = fromFlowCron(void 0);
|
|
4605
|
+
this.weekdays = [];
|
|
4606
|
+
const format = new Intl.DateTimeFormat(this.translation.getActiveLang(), {
|
|
4607
|
+
weekday: "long",
|
|
4608
|
+
timeZone: "UTC"
|
|
4609
|
+
});
|
|
4610
|
+
this.weekdays = [
|
|
4611
|
+
0,
|
|
4612
|
+
1,
|
|
4613
|
+
2,
|
|
4614
|
+
3,
|
|
4615
|
+
4,
|
|
4616
|
+
5,
|
|
4617
|
+
6
|
|
4618
|
+
].map((value) => ({
|
|
4619
|
+
value,
|
|
4620
|
+
label: format.format(A_SUNDAY + value * DAY_MS)
|
|
4621
|
+
}));
|
|
4622
|
+
}
|
|
4623
|
+
ngOnChanges() {
|
|
4624
|
+
if (this.value !== void 0 && this.value === this.emitted) return;
|
|
4625
|
+
this.schedule = fromFlowCron(this.value);
|
|
4626
|
+
}
|
|
4627
|
+
get time() {
|
|
4628
|
+
return flowCronTime(this.schedule);
|
|
4629
|
+
}
|
|
4630
|
+
get weekdayLabel() {
|
|
4631
|
+
return this.weekdays[this.schedule.weekday]?.label ?? "";
|
|
4632
|
+
}
|
|
4633
|
+
setMode(mode) {
|
|
4634
|
+
this.update({
|
|
4635
|
+
mode,
|
|
4636
|
+
custom: mode === "custom" ? toFlowCron(this.schedule) : this.schedule.custom
|
|
4637
|
+
});
|
|
4638
|
+
}
|
|
4639
|
+
setTime(time) {
|
|
4640
|
+
const [hour, minute] = (time || "00:00").split(":").map(Number);
|
|
4641
|
+
this.update({
|
|
4642
|
+
hour,
|
|
4643
|
+
minute
|
|
4644
|
+
});
|
|
4645
|
+
}
|
|
4646
|
+
update(changes) {
|
|
4647
|
+
this.schedule = {
|
|
4648
|
+
...this.schedule,
|
|
4649
|
+
...changes
|
|
4650
|
+
};
|
|
4651
|
+
this.emitted = toFlowCron(this.schedule);
|
|
4652
|
+
this.valueChange.emit(this.emitted);
|
|
4653
|
+
}
|
|
4654
|
+
static {
|
|
4655
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4656
|
+
minVersion: "12.0.0",
|
|
4657
|
+
version: "22.2.3",
|
|
4658
|
+
ngImport: i0,
|
|
4659
|
+
type: FlowsCronFieldComponent,
|
|
4660
|
+
deps: [{ token: i2$4.TranslocoService }],
|
|
4661
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
4662
|
+
});
|
|
4663
|
+
}
|
|
4664
|
+
static {
|
|
4665
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4666
|
+
minVersion: "17.0.0",
|
|
4667
|
+
version: "22.2.3",
|
|
4668
|
+
type: FlowsCronFieldComponent,
|
|
4243
4669
|
isStandalone: false,
|
|
4244
|
-
selector: "pw-flows-
|
|
4670
|
+
selector: "pw-flows-cron-field",
|
|
4245
4671
|
inputs: {
|
|
4246
4672
|
value: "value",
|
|
4247
4673
|
inputId: "inputId",
|
|
@@ -4250,38 +4676,53 @@ var FlowsJsonFieldComponent = class FlowsJsonFieldComponent {
|
|
|
4250
4676
|
outputs: { valueChange: "valueChange" },
|
|
4251
4677
|
usesOnChanges: true,
|
|
4252
4678
|
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"],
|
|
4679
|
+
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
4680
|
dependencies: [
|
|
4681
|
+
{
|
|
4682
|
+
kind: "directive",
|
|
4683
|
+
type: i3$1.NgSelectOption,
|
|
4684
|
+
selector: "option",
|
|
4685
|
+
inputs: ["ngValue", "value"]
|
|
4686
|
+
},
|
|
4687
|
+
{
|
|
4688
|
+
kind: "directive",
|
|
4689
|
+
type: i3$1.ɵNgSelectMultipleOption,
|
|
4690
|
+
selector: "option",
|
|
4691
|
+
inputs: ["ngValue", "value"]
|
|
4692
|
+
},
|
|
4275
4693
|
{
|
|
4276
4694
|
kind: "directive",
|
|
4277
4695
|
type: i3$1.DefaultValueAccessor,
|
|
4278
4696
|
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
4697
|
},
|
|
4698
|
+
{
|
|
4699
|
+
kind: "directive",
|
|
4700
|
+
type: i3$1.NumberValueAccessor,
|
|
4701
|
+
selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
|
|
4702
|
+
},
|
|
4703
|
+
{
|
|
4704
|
+
kind: "directive",
|
|
4705
|
+
type: i3$1.SelectControlValueAccessor,
|
|
4706
|
+
selector: "select:not([multiple]):not([ngNoCva])[formControlName],select:not([multiple]):not([ngNoCva])[formControl],select:not([multiple]):not([ngNoCva])[ngModel]",
|
|
4707
|
+
inputs: ["compareWith"]
|
|
4708
|
+
},
|
|
4280
4709
|
{
|
|
4281
4710
|
kind: "directive",
|
|
4282
4711
|
type: i3$1.NgControlStatus,
|
|
4283
4712
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
4284
4713
|
},
|
|
4714
|
+
{
|
|
4715
|
+
kind: "directive",
|
|
4716
|
+
type: i3$1.MinValidator,
|
|
4717
|
+
selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
|
|
4718
|
+
inputs: ["min"]
|
|
4719
|
+
},
|
|
4720
|
+
{
|
|
4721
|
+
kind: "directive",
|
|
4722
|
+
type: i3$1.MaxValidator,
|
|
4723
|
+
selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]",
|
|
4724
|
+
inputs: ["max"]
|
|
4725
|
+
},
|
|
4285
4726
|
{
|
|
4286
4727
|
kind: "directive",
|
|
4287
4728
|
type: i3$1.NgModel,
|
|
@@ -4295,12 +4736,6 @@ var FlowsJsonFieldComponent = class FlowsJsonFieldComponent {
|
|
|
4295
4736
|
outputs: ["ngModelChange"],
|
|
4296
4737
|
exportAs: ["ngModel"]
|
|
4297
4738
|
},
|
|
4298
|
-
{
|
|
4299
|
-
kind: "component",
|
|
4300
|
-
type: i2$1.FieldErrorDisplayComponent,
|
|
4301
|
-
selector: "pw-field-error-display",
|
|
4302
|
-
inputs: ["errorMsg", "displayError"]
|
|
4303
|
-
},
|
|
4304
4739
|
{
|
|
4305
4740
|
kind: "pipe",
|
|
4306
4741
|
type: i2$4.TranslocoPipe,
|
|
@@ -4314,34 +4749,16 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4314
4749
|
minVersion: "12.0.0",
|
|
4315
4750
|
version: "22.2.3",
|
|
4316
4751
|
ngImport: i0,
|
|
4317
|
-
type:
|
|
4752
|
+
type: FlowsCronFieldComponent,
|
|
4318
4753
|
decorators: [{
|
|
4319
4754
|
type: Component,
|
|
4320
4755
|
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
|
-
`,
|
|
4756
|
+
selector: "pw-flows-cron-field",
|
|
4341
4757
|
standalone: false,
|
|
4342
|
-
|
|
4758
|
+
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
4759
|
}]
|
|
4344
4760
|
}],
|
|
4761
|
+
ctorParameters: () => [{ type: i2$4.TranslocoService }],
|
|
4345
4762
|
propDecorators: {
|
|
4346
4763
|
value: [{ type: Input }],
|
|
4347
4764
|
inputId: [{ type: Input }],
|
|
@@ -4349,263 +4766,58 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4349
4766
|
valueChange: [{ type: Output }]
|
|
4350
4767
|
}
|
|
4351
4768
|
});
|
|
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;
|
|
4769
|
+
const ZONES = (() => {
|
|
4770
|
+
const zones = Intl.supportedValuesOf("timeZone");
|
|
4771
|
+
return zones.includes("UTC") ? zones : ["UTC", ...zones];
|
|
4772
|
+
})();
|
|
4773
|
+
var FlowsTimezoneFieldComponent = class FlowsTimezoneFieldComponent {
|
|
4774
|
+
constructor() {
|
|
4775
|
+
this.readOnly = false;
|
|
4776
|
+
this.valueChange = new EventEmitter();
|
|
4777
|
+
this.zones = ZONES;
|
|
4558
4778
|
}
|
|
4559
4779
|
static {
|
|
4560
4780
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4561
4781
|
minVersion: "12.0.0",
|
|
4562
4782
|
version: "22.2.3",
|
|
4563
4783
|
ngImport: i0,
|
|
4564
|
-
type:
|
|
4565
|
-
deps: [
|
|
4566
|
-
{ token: i2$4.TranslocoService },
|
|
4567
|
-
{ token: i0.ChangeDetectorRef },
|
|
4568
|
-
{ token: i0.DestroyRef }
|
|
4569
|
-
],
|
|
4784
|
+
type: FlowsTimezoneFieldComponent,
|
|
4785
|
+
deps: [],
|
|
4570
4786
|
target: i0.ɵɵFactoryTarget.Component
|
|
4571
4787
|
});
|
|
4572
4788
|
}
|
|
4573
4789
|
static {
|
|
4574
4790
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4575
|
-
minVersion: "
|
|
4791
|
+
minVersion: "14.0.0",
|
|
4576
4792
|
version: "22.2.3",
|
|
4577
|
-
type:
|
|
4793
|
+
type: FlowsTimezoneFieldComponent,
|
|
4578
4794
|
isStandalone: false,
|
|
4579
|
-
selector: "pw-flows-
|
|
4795
|
+
selector: "pw-flows-timezone-field",
|
|
4580
4796
|
inputs: {
|
|
4581
4797
|
value: "value",
|
|
4582
4798
|
inputId: "inputId",
|
|
4583
|
-
suggestions: "suggestions",
|
|
4584
4799
|
readOnly: "readOnly"
|
|
4585
4800
|
},
|
|
4586
4801
|
outputs: { valueChange: "valueChange" },
|
|
4587
|
-
usesOnChanges: true,
|
|
4588
4802
|
ngImport: i0,
|
|
4589
|
-
template:
|
|
4590
|
-
|
|
4803
|
+
template: `
|
|
4804
|
+
<p-select
|
|
4805
|
+
[inputId]="inputId"
|
|
4806
|
+
[options]="zones"
|
|
4807
|
+
[filter]="true"
|
|
4808
|
+
[showClear]="true"
|
|
4809
|
+
[disabled]="readOnly"
|
|
4810
|
+
[placeholder]="'Flows.Schedule.ServerTime' | transloco"
|
|
4811
|
+
[ngModel]="value"
|
|
4812
|
+
[ngModelOptions]="{ standalone: true }"
|
|
4813
|
+
(ngModelChange)="valueChange.emit($event || null)"
|
|
4814
|
+
appendTo="body"
|
|
4815
|
+
styleClass="w-100"
|
|
4816
|
+
>
|
|
4817
|
+
</p-select>
|
|
4818
|
+
`,
|
|
4819
|
+
isInline: true,
|
|
4591
4820
|
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
4821
|
{
|
|
4610
4822
|
kind: "directive",
|
|
4611
4823
|
type: i3$1.NgControlStatus,
|
|
@@ -4624,34 +4836,6 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
4624
4836
|
outputs: ["ngModelChange"],
|
|
4625
4837
|
exportAs: ["ngModel"]
|
|
4626
4838
|
},
|
|
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
4839
|
{
|
|
4656
4840
|
kind: "component",
|
|
4657
4841
|
type: i4$1.Select,
|
|
@@ -4708,18 +4892,177 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
4708
4892
|
"filterValue",
|
|
4709
4893
|
"options",
|
|
4710
4894
|
"appendTo",
|
|
4711
|
-
"motionOptions"
|
|
4712
|
-
],
|
|
4713
|
-
outputs: [
|
|
4714
|
-
"onChange",
|
|
4715
|
-
"onFilter",
|
|
4716
|
-
"onFocus",
|
|
4717
|
-
"onBlur",
|
|
4718
|
-
"onClick",
|
|
4719
|
-
"onShow",
|
|
4720
|
-
"onHide",
|
|
4721
|
-
"onClear",
|
|
4722
|
-
"onLazyLoad"
|
|
4895
|
+
"motionOptions"
|
|
4896
|
+
],
|
|
4897
|
+
outputs: [
|
|
4898
|
+
"onChange",
|
|
4899
|
+
"onFilter",
|
|
4900
|
+
"onFocus",
|
|
4901
|
+
"onBlur",
|
|
4902
|
+
"onClick",
|
|
4903
|
+
"onShow",
|
|
4904
|
+
"onHide",
|
|
4905
|
+
"onClear",
|
|
4906
|
+
"onLazyLoad"
|
|
4907
|
+
]
|
|
4908
|
+
},
|
|
4909
|
+
{
|
|
4910
|
+
kind: "pipe",
|
|
4911
|
+
type: i2$4.TranslocoPipe,
|
|
4912
|
+
name: "transloco"
|
|
4913
|
+
}
|
|
4914
|
+
]
|
|
4915
|
+
});
|
|
4916
|
+
}
|
|
4917
|
+
};
|
|
4918
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
4919
|
+
minVersion: "12.0.0",
|
|
4920
|
+
version: "22.2.3",
|
|
4921
|
+
ngImport: i0,
|
|
4922
|
+
type: FlowsTimezoneFieldComponent,
|
|
4923
|
+
decorators: [{
|
|
4924
|
+
type: Component,
|
|
4925
|
+
args: [{
|
|
4926
|
+
selector: "pw-flows-timezone-field",
|
|
4927
|
+
template: `
|
|
4928
|
+
<p-select
|
|
4929
|
+
[inputId]="inputId"
|
|
4930
|
+
[options]="zones"
|
|
4931
|
+
[filter]="true"
|
|
4932
|
+
[showClear]="true"
|
|
4933
|
+
[disabled]="readOnly"
|
|
4934
|
+
[placeholder]="'Flows.Schedule.ServerTime' | transloco"
|
|
4935
|
+
[ngModel]="value"
|
|
4936
|
+
[ngModelOptions]="{ standalone: true }"
|
|
4937
|
+
(ngModelChange)="valueChange.emit($event || null)"
|
|
4938
|
+
appendTo="body"
|
|
4939
|
+
styleClass="w-100"
|
|
4940
|
+
>
|
|
4941
|
+
</p-select>
|
|
4942
|
+
`,
|
|
4943
|
+
standalone: false
|
|
4944
|
+
}]
|
|
4945
|
+
}],
|
|
4946
|
+
propDecorators: {
|
|
4947
|
+
value: [{ type: Input }],
|
|
4948
|
+
inputId: [{ type: Input }],
|
|
4949
|
+
readOnly: [{ type: Input }],
|
|
4950
|
+
valueChange: [{ type: Output }]
|
|
4951
|
+
}
|
|
4952
|
+
});
|
|
4953
|
+
var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
4954
|
+
constructor() {
|
|
4955
|
+
this.readOnly = false;
|
|
4956
|
+
this.valueChange = new EventEmitter();
|
|
4957
|
+
this.icons = FLOWS_ICONS;
|
|
4958
|
+
this.pairs = [];
|
|
4959
|
+
}
|
|
4960
|
+
ngOnChanges() {
|
|
4961
|
+
if (this.value !== void 0 && this.value === this.emitted) return;
|
|
4962
|
+
const record = this.value && typeof this.value === "object" && !Array.isArray(this.value) ? this.value : {};
|
|
4963
|
+
this.pairs = Object.entries(record).map(([key, value]) => ({
|
|
4964
|
+
key,
|
|
4965
|
+
value: typeof value === "string" ? value : JSON.stringify(value),
|
|
4966
|
+
original: value
|
|
4967
|
+
}));
|
|
4968
|
+
}
|
|
4969
|
+
addPair() {
|
|
4970
|
+
this.pairs = [...this.pairs, {
|
|
4971
|
+
key: "",
|
|
4972
|
+
value: ""
|
|
4973
|
+
}];
|
|
4974
|
+
}
|
|
4975
|
+
removePair(index) {
|
|
4976
|
+
this.pairs = this.pairs.filter((_, i) => i !== index);
|
|
4977
|
+
this.commit();
|
|
4978
|
+
}
|
|
4979
|
+
editValue(pair, value) {
|
|
4980
|
+
pair.value = value;
|
|
4981
|
+
delete pair.original;
|
|
4982
|
+
}
|
|
4983
|
+
commit() {
|
|
4984
|
+
const record = {};
|
|
4985
|
+
this.pairs.filter((pair) => pair.key.trim()).forEach((pair) => record[pair.key.trim()] = "original" in pair ? pair.original : pair.value);
|
|
4986
|
+
this.emitted = record;
|
|
4987
|
+
this.valueChange.emit(record);
|
|
4988
|
+
}
|
|
4989
|
+
static {
|
|
4990
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4991
|
+
minVersion: "12.0.0",
|
|
4992
|
+
version: "22.2.3",
|
|
4993
|
+
ngImport: i0,
|
|
4994
|
+
type: FlowsPairsFieldComponent,
|
|
4995
|
+
deps: [],
|
|
4996
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
4997
|
+
});
|
|
4998
|
+
}
|
|
4999
|
+
static {
|
|
5000
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
5001
|
+
minVersion: "17.0.0",
|
|
5002
|
+
version: "22.2.3",
|
|
5003
|
+
type: FlowsPairsFieldComponent,
|
|
5004
|
+
isStandalone: false,
|
|
5005
|
+
selector: "pw-flows-pairs-field",
|
|
5006
|
+
inputs: {
|
|
5007
|
+
value: "value",
|
|
5008
|
+
inputId: "inputId",
|
|
5009
|
+
readOnly: "readOnly"
|
|
5010
|
+
},
|
|
5011
|
+
outputs: { valueChange: "valueChange" },
|
|
5012
|
+
usesOnChanges: true,
|
|
5013
|
+
ngImport: i0,
|
|
5014
|
+
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",
|
|
5015
|
+
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"],
|
|
5016
|
+
dependencies: [
|
|
5017
|
+
{
|
|
5018
|
+
kind: "directive",
|
|
5019
|
+
type: i3$1.DefaultValueAccessor,
|
|
5020
|
+
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]"
|
|
5021
|
+
},
|
|
5022
|
+
{
|
|
5023
|
+
kind: "directive",
|
|
5024
|
+
type: i3$1.NgControlStatus,
|
|
5025
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
5026
|
+
},
|
|
5027
|
+
{
|
|
5028
|
+
kind: "directive",
|
|
5029
|
+
type: i3$1.NgModel,
|
|
5030
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
5031
|
+
inputs: [
|
|
5032
|
+
"name",
|
|
5033
|
+
"disabled",
|
|
5034
|
+
"ngModel",
|
|
5035
|
+
"ngModelOptions"
|
|
5036
|
+
],
|
|
5037
|
+
outputs: ["ngModelChange"],
|
|
5038
|
+
exportAs: ["ngModel"]
|
|
5039
|
+
},
|
|
5040
|
+
{
|
|
5041
|
+
kind: "directive",
|
|
5042
|
+
type: i1$1.Tooltip,
|
|
5043
|
+
selector: "[pTooltip]",
|
|
5044
|
+
inputs: [
|
|
5045
|
+
"tooltipPosition",
|
|
5046
|
+
"tooltipEvent",
|
|
5047
|
+
"positionStyle",
|
|
5048
|
+
"tooltipStyleClass",
|
|
5049
|
+
"tooltipZIndex",
|
|
5050
|
+
"escape",
|
|
5051
|
+
"showDelay",
|
|
5052
|
+
"hideDelay",
|
|
5053
|
+
"life",
|
|
5054
|
+
"positionTop",
|
|
5055
|
+
"positionLeft",
|
|
5056
|
+
"autoHide",
|
|
5057
|
+
"fitContent",
|
|
5058
|
+
"hideOnEscape",
|
|
5059
|
+
"showOnEllipsis",
|
|
5060
|
+
"pTooltip",
|
|
5061
|
+
"tooltipDisabled",
|
|
5062
|
+
"tooltipOptions",
|
|
5063
|
+
"appendTo",
|
|
5064
|
+
"pTooltipPT",
|
|
5065
|
+
"pTooltipUnstyled"
|
|
4723
5066
|
]
|
|
4724
5067
|
},
|
|
4725
5068
|
{
|
|
@@ -4759,17 +5102,6 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
4759
5102
|
"a11yRoleChange"
|
|
4760
5103
|
]
|
|
4761
5104
|
},
|
|
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
5105
|
{
|
|
4774
5106
|
kind: "pipe",
|
|
4775
5107
|
type: i2$4.TranslocoPipe,
|
|
@@ -4783,71 +5115,84 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4783
5115
|
minVersion: "12.0.0",
|
|
4784
5116
|
version: "22.2.3",
|
|
4785
5117
|
ngImport: i0,
|
|
4786
|
-
type:
|
|
5118
|
+
type: FlowsPairsFieldComponent,
|
|
4787
5119
|
decorators: [{
|
|
4788
5120
|
type: Component,
|
|
4789
5121
|
args: [{
|
|
4790
|
-
selector: "pw-flows-
|
|
5122
|
+
selector: "pw-flows-pairs-field",
|
|
4791
5123
|
standalone: false,
|
|
4792
|
-
template: "<div class=\"pw-
|
|
4793
|
-
styles: [".pw-
|
|
5124
|
+
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",
|
|
5125
|
+
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
5126
|
}]
|
|
4795
5127
|
}],
|
|
4796
|
-
ctorParameters: () => [
|
|
4797
|
-
{ type: i2$4.TranslocoService },
|
|
4798
|
-
{ type: i0.ChangeDetectorRef },
|
|
4799
|
-
{ type: i0.DestroyRef }
|
|
4800
|
-
],
|
|
4801
5128
|
propDecorators: {
|
|
4802
5129
|
value: [{ type: Input }],
|
|
4803
5130
|
inputId: [{ type: Input }],
|
|
4804
|
-
suggestions: [{ type: Input }],
|
|
4805
5131
|
readOnly: [{ type: Input }],
|
|
4806
5132
|
valueChange: [{ type: Output }]
|
|
4807
5133
|
}
|
|
4808
5134
|
});
|
|
4809
|
-
|
|
5135
|
+
function flowChoiceName(name) {
|
|
5136
|
+
return name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
5137
|
+
}
|
|
5138
|
+
const FLOW_RESERVED_CHOICES = [
|
|
5139
|
+
"next",
|
|
5140
|
+
"error",
|
|
5141
|
+
"unsure"
|
|
5142
|
+
];
|
|
5143
|
+
function flowChoiceProblem(names, index) {
|
|
5144
|
+
const name = names[index];
|
|
5145
|
+
if (!name) return null;
|
|
5146
|
+
if (FLOW_RESERVED_CHOICES.includes(name)) return "Flows.Inspector.ChoiceReserved";
|
|
5147
|
+
return names.indexOf(name) < index ? "Flows.Inspector.ChoiceDuplicate" : null;
|
|
5148
|
+
}
|
|
5149
|
+
var FlowsChoicesFieldComponent = class FlowsChoicesFieldComponent {
|
|
4810
5150
|
constructor() {
|
|
4811
5151
|
this.readOnly = false;
|
|
4812
5152
|
this.valueChange = new EventEmitter();
|
|
4813
5153
|
this.icons = FLOWS_ICONS;
|
|
4814
|
-
this.
|
|
5154
|
+
this.choices = [];
|
|
5155
|
+
this.problems = [];
|
|
4815
5156
|
}
|
|
4816
5157
|
ngOnChanges() {
|
|
4817
5158
|
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
|
|
5159
|
+
this.choices = (Array.isArray(this.value) ? this.value : []).filter((choice) => choice && typeof choice === "object").map((choice) => ({
|
|
5160
|
+
name: `${choice.name ?? ""}`,
|
|
5161
|
+
description: `${choice.description ?? ""}`
|
|
4823
5162
|
}));
|
|
5163
|
+
this.checkNames();
|
|
4824
5164
|
}
|
|
4825
|
-
|
|
4826
|
-
this.
|
|
4827
|
-
|
|
4828
|
-
|
|
5165
|
+
addChoice() {
|
|
5166
|
+
this.choices = [...this.choices, {
|
|
5167
|
+
name: "",
|
|
5168
|
+
description: ""
|
|
4829
5169
|
}];
|
|
5170
|
+
this.checkNames();
|
|
4830
5171
|
}
|
|
4831
|
-
|
|
4832
|
-
this.
|
|
5172
|
+
removeChoice(index) {
|
|
5173
|
+
this.choices = this.choices.filter((_, i) => i !== index);
|
|
4833
5174
|
this.commit();
|
|
4834
5175
|
}
|
|
4835
|
-
editValue(pair, value) {
|
|
4836
|
-
pair.value = value;
|
|
4837
|
-
delete pair.original;
|
|
4838
|
-
}
|
|
4839
5176
|
commit() {
|
|
4840
|
-
|
|
4841
|
-
this.
|
|
4842
|
-
this.
|
|
4843
|
-
|
|
5177
|
+
this.choices.forEach((choice) => choice.name = flowChoiceName(choice.name));
|
|
5178
|
+
this.checkNames();
|
|
5179
|
+
const kept = this.choices.filter((choice) => choice.name).map((choice) => ({
|
|
5180
|
+
name: choice.name,
|
|
5181
|
+
description: choice.description.trim()
|
|
5182
|
+
}));
|
|
5183
|
+
this.emitted = kept;
|
|
5184
|
+
this.valueChange.emit(kept);
|
|
5185
|
+
}
|
|
5186
|
+
checkNames() {
|
|
5187
|
+
const names = this.choices.map((choice) => choice.name);
|
|
5188
|
+
this.problems = names.map((_, index) => flowChoiceProblem(names, index));
|
|
4844
5189
|
}
|
|
4845
5190
|
static {
|
|
4846
5191
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4847
5192
|
minVersion: "12.0.0",
|
|
4848
5193
|
version: "22.2.3",
|
|
4849
5194
|
ngImport: i0,
|
|
4850
|
-
type:
|
|
5195
|
+
type: FlowsChoicesFieldComponent,
|
|
4851
5196
|
deps: [],
|
|
4852
5197
|
target: i0.ɵɵFactoryTarget.Component
|
|
4853
5198
|
});
|
|
@@ -4856,9 +5201,9 @@ var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
|
4856
5201
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4857
5202
|
minVersion: "17.0.0",
|
|
4858
5203
|
version: "22.2.3",
|
|
4859
|
-
type:
|
|
5204
|
+
type: FlowsChoicesFieldComponent,
|
|
4860
5205
|
isStandalone: false,
|
|
4861
|
-
selector: "pw-flows-
|
|
5206
|
+
selector: "pw-flows-choices-field",
|
|
4862
5207
|
inputs: {
|
|
4863
5208
|
value: "value",
|
|
4864
5209
|
inputId: "inputId",
|
|
@@ -4867,8 +5212,8 @@ var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
|
4867
5212
|
outputs: { valueChange: "valueChange" },
|
|
4868
5213
|
usesOnChanges: true,
|
|
4869
5214
|
ngImport: i0,
|
|
4870
|
-
template: "<div class=\"pw-
|
|
4871
|
-
styles: [".pw-
|
|
5215
|
+
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",
|
|
5216
|
+
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
5217
|
dependencies: [
|
|
4873
5218
|
{
|
|
4874
5219
|
kind: "directive",
|
|
@@ -4880,6 +5225,12 @@ var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
|
4880
5225
|
type: i3$1.NgControlStatus,
|
|
4881
5226
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
4882
5227
|
},
|
|
5228
|
+
{
|
|
5229
|
+
kind: "directive",
|
|
5230
|
+
type: i3$1.MaxLengthValidator,
|
|
5231
|
+
selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",
|
|
5232
|
+
inputs: ["maxlength"]
|
|
5233
|
+
},
|
|
4883
5234
|
{
|
|
4884
5235
|
kind: "directive",
|
|
4885
5236
|
type: i3$1.NgModel,
|
|
@@ -4971,14 +5322,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4971
5322
|
minVersion: "12.0.0",
|
|
4972
5323
|
version: "22.2.3",
|
|
4973
5324
|
ngImport: i0,
|
|
4974
|
-
type:
|
|
5325
|
+
type: FlowsChoicesFieldComponent,
|
|
4975
5326
|
decorators: [{
|
|
4976
5327
|
type: Component,
|
|
4977
5328
|
args: [{
|
|
4978
|
-
selector: "pw-flows-
|
|
5329
|
+
selector: "pw-flows-choices-field",
|
|
4979
5330
|
standalone: false,
|
|
4980
|
-
template: "<div class=\"pw-
|
|
4981
|
-
styles: [".pw-
|
|
5331
|
+
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",
|
|
5332
|
+
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
5333
|
}]
|
|
4983
5334
|
}],
|
|
4984
5335
|
propDecorators: {
|
|
@@ -5201,20 +5552,273 @@ var FlowsMemberFieldComponent = class FlowsMemberFieldComponent {
|
|
|
5201
5552
|
"onAdd",
|
|
5202
5553
|
"onFocus",
|
|
5203
5554
|
"onBlur",
|
|
5204
|
-
"onDropdownClick",
|
|
5205
|
-
"onClear",
|
|
5206
|
-
"onInputKeydown",
|
|
5207
|
-
"onKeyUp",
|
|
5555
|
+
"onDropdownClick",
|
|
5556
|
+
"onClear",
|
|
5557
|
+
"onInputKeydown",
|
|
5558
|
+
"onKeyUp",
|
|
5559
|
+
"onShow",
|
|
5560
|
+
"onHide",
|
|
5561
|
+
"onLazyLoad"
|
|
5562
|
+
]
|
|
5563
|
+
},
|
|
5564
|
+
{
|
|
5565
|
+
kind: "component",
|
|
5566
|
+
type: i2$1.FieldErrorDisplayComponent,
|
|
5567
|
+
selector: "pw-field-error-display",
|
|
5568
|
+
inputs: ["errorMsg", "displayError"]
|
|
5569
|
+
},
|
|
5570
|
+
{
|
|
5571
|
+
kind: "pipe",
|
|
5572
|
+
type: i2$4.TranslocoPipe,
|
|
5573
|
+
name: "transloco"
|
|
5574
|
+
}
|
|
5575
|
+
]
|
|
5576
|
+
});
|
|
5577
|
+
}
|
|
5578
|
+
};
|
|
5579
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
5580
|
+
minVersion: "12.0.0",
|
|
5581
|
+
version: "22.2.3",
|
|
5582
|
+
ngImport: i0,
|
|
5583
|
+
type: FlowsMemberFieldComponent,
|
|
5584
|
+
decorators: [{
|
|
5585
|
+
type: Component,
|
|
5586
|
+
args: [{
|
|
5587
|
+
selector: "pw-flows-member-field",
|
|
5588
|
+
standalone: false,
|
|
5589
|
+
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"
|
|
5590
|
+
}]
|
|
5591
|
+
}],
|
|
5592
|
+
ctorParameters: () => [{ type: FlowsMemberService }, { type: i0.ChangeDetectorRef }],
|
|
5593
|
+
propDecorators: {
|
|
5594
|
+
value: [{ type: Input }],
|
|
5595
|
+
multiple: [{ type: Input }],
|
|
5596
|
+
subscriptionId: [{ type: Input }],
|
|
5597
|
+
inputId: [{ type: Input }],
|
|
5598
|
+
readOnly: [{ type: Input }],
|
|
5599
|
+
valueChange: [{ type: Output }]
|
|
5600
|
+
}
|
|
5601
|
+
});
|
|
5602
|
+
function toIds(value) {
|
|
5603
|
+
return (Array.isArray(value) ? value : [value]).map(Number).filter((id) => Number.isInteger(id) && id > 0);
|
|
5604
|
+
}
|
|
5605
|
+
var FlowsParamFieldComponent = class FlowsParamFieldComponent {
|
|
5606
|
+
constructor(translation, cdr, destroyRef) {
|
|
5607
|
+
this.readOnly = false;
|
|
5608
|
+
this.listSuggestions = [];
|
|
5609
|
+
this.settingValues = {};
|
|
5610
|
+
this.valueChange = new EventEmitter();
|
|
5611
|
+
this.mergeModes = [];
|
|
5612
|
+
this.defaultMergeMode = FLOW_MERGE_MODES[0];
|
|
5613
|
+
this.numberValue = flowNumberValue;
|
|
5614
|
+
translation.selectTranslation("flows").pipe(takeUntilDestroyed(destroyRef)).subscribe(() => {
|
|
5615
|
+
this.mergeModes = FLOW_MERGE_MODES.map((mode) => ({
|
|
5616
|
+
value: mode,
|
|
5617
|
+
label: translation.translate(`Flows.MergeModes.${mode}`)
|
|
5618
|
+
}));
|
|
5619
|
+
cdr.markForCheck();
|
|
5620
|
+
});
|
|
5621
|
+
}
|
|
5622
|
+
get shownValue() {
|
|
5623
|
+
return this.field.editable && flowSettingFor(this.value, this.settingValues) || this.value;
|
|
5624
|
+
}
|
|
5625
|
+
get kind() {
|
|
5626
|
+
return this.field.kind === "list" && !this.listSuggestions.length ? "text" : this.field.kind;
|
|
5627
|
+
}
|
|
5628
|
+
static {
|
|
5629
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
5630
|
+
minVersion: "12.0.0",
|
|
5631
|
+
version: "22.2.3",
|
|
5632
|
+
ngImport: i0,
|
|
5633
|
+
type: FlowsParamFieldComponent,
|
|
5634
|
+
deps: [
|
|
5635
|
+
{ token: i2$4.TranslocoService },
|
|
5636
|
+
{ token: i0.ChangeDetectorRef },
|
|
5637
|
+
{ token: i0.DestroyRef }
|
|
5638
|
+
],
|
|
5639
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
5640
|
+
});
|
|
5641
|
+
}
|
|
5642
|
+
static {
|
|
5643
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
5644
|
+
minVersion: "17.0.0",
|
|
5645
|
+
version: "22.2.3",
|
|
5646
|
+
type: FlowsParamFieldComponent,
|
|
5647
|
+
isStandalone: false,
|
|
5648
|
+
selector: "pw-flows-param-field",
|
|
5649
|
+
inputs: {
|
|
5650
|
+
field: "field",
|
|
5651
|
+
value: "value",
|
|
5652
|
+
readOnly: "readOnly",
|
|
5653
|
+
subscriptionId: "subscriptionId",
|
|
5654
|
+
listSuggestions: "listSuggestions",
|
|
5655
|
+
settingValues: "settingValues"
|
|
5656
|
+
},
|
|
5657
|
+
outputs: { valueChange: "valueChange" },
|
|
5658
|
+
ngImport: i0,
|
|
5659
|
+
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 [editable]=\"field.editable === true\"\n [placeholder]=\"field.placeholder ?? ''\"\n [showClear]=\"!field.required\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"shownValue\"\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",
|
|
5660
|
+
styles: [":host{display:block}\n"],
|
|
5661
|
+
dependencies: [
|
|
5662
|
+
{
|
|
5663
|
+
kind: "directive",
|
|
5664
|
+
type: i3$1.DefaultValueAccessor,
|
|
5665
|
+
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]"
|
|
5666
|
+
},
|
|
5667
|
+
{
|
|
5668
|
+
kind: "directive",
|
|
5669
|
+
type: i3$1.NgControlStatus,
|
|
5670
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
5671
|
+
},
|
|
5672
|
+
{
|
|
5673
|
+
kind: "directive",
|
|
5674
|
+
type: i3$1.NgModel,
|
|
5675
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
5676
|
+
inputs: [
|
|
5677
|
+
"name",
|
|
5678
|
+
"disabled",
|
|
5679
|
+
"ngModel",
|
|
5680
|
+
"ngModelOptions"
|
|
5681
|
+
],
|
|
5682
|
+
outputs: ["ngModelChange"],
|
|
5683
|
+
exportAs: ["ngModel"]
|
|
5684
|
+
},
|
|
5685
|
+
{
|
|
5686
|
+
kind: "component",
|
|
5687
|
+
type: i4$1.Select,
|
|
5688
|
+
selector: "p-select",
|
|
5689
|
+
inputs: [
|
|
5690
|
+
"id",
|
|
5691
|
+
"scrollHeight",
|
|
5692
|
+
"filter",
|
|
5693
|
+
"panelStyle",
|
|
5694
|
+
"panelStyleClass",
|
|
5695
|
+
"readonly",
|
|
5696
|
+
"editable",
|
|
5697
|
+
"tabindex",
|
|
5698
|
+
"placeholder",
|
|
5699
|
+
"loadingIcon",
|
|
5700
|
+
"filterPlaceholder",
|
|
5701
|
+
"filterLocale",
|
|
5702
|
+
"inputId",
|
|
5703
|
+
"dataKey",
|
|
5704
|
+
"filterBy",
|
|
5705
|
+
"filterFields",
|
|
5706
|
+
"autofocus",
|
|
5707
|
+
"resetFilterOnHide",
|
|
5708
|
+
"checkmark",
|
|
5709
|
+
"dropdownIcon",
|
|
5710
|
+
"loading",
|
|
5711
|
+
"optionLabel",
|
|
5712
|
+
"optionValue",
|
|
5713
|
+
"optionDisabled",
|
|
5714
|
+
"optionGroupLabel",
|
|
5715
|
+
"optionGroupChildren",
|
|
5716
|
+
"group",
|
|
5717
|
+
"showClear",
|
|
5718
|
+
"emptyFilterMessage",
|
|
5719
|
+
"emptyMessage",
|
|
5720
|
+
"lazy",
|
|
5721
|
+
"virtualScroll",
|
|
5722
|
+
"virtualScrollItemSize",
|
|
5723
|
+
"virtualScrollOptions",
|
|
5724
|
+
"overlayOptions",
|
|
5725
|
+
"ariaFilterLabel",
|
|
5726
|
+
"ariaLabel",
|
|
5727
|
+
"ariaLabelledBy",
|
|
5728
|
+
"filterMatchMode",
|
|
5729
|
+
"tooltip",
|
|
5730
|
+
"tooltipPosition",
|
|
5731
|
+
"tooltipPositionStyle",
|
|
5732
|
+
"tooltipStyleClass",
|
|
5733
|
+
"focusOnHover",
|
|
5734
|
+
"selectOnFocus",
|
|
5735
|
+
"multiple",
|
|
5736
|
+
"autoOptionFocus",
|
|
5737
|
+
"autofocusFilter",
|
|
5738
|
+
"filterValue",
|
|
5739
|
+
"options",
|
|
5740
|
+
"appendTo",
|
|
5741
|
+
"motionOptions"
|
|
5742
|
+
],
|
|
5743
|
+
outputs: [
|
|
5744
|
+
"onChange",
|
|
5745
|
+
"onFilter",
|
|
5746
|
+
"onFocus",
|
|
5747
|
+
"onBlur",
|
|
5748
|
+
"onClick",
|
|
5208
5749
|
"onShow",
|
|
5209
5750
|
"onHide",
|
|
5751
|
+
"onClear",
|
|
5210
5752
|
"onLazyLoad"
|
|
5211
5753
|
]
|
|
5212
5754
|
},
|
|
5213
5755
|
{
|
|
5214
5756
|
kind: "component",
|
|
5215
|
-
type:
|
|
5216
|
-
selector: "pw-
|
|
5217
|
-
inputs: [
|
|
5757
|
+
type: FlowsCronFieldComponent,
|
|
5758
|
+
selector: "pw-flows-cron-field",
|
|
5759
|
+
inputs: [
|
|
5760
|
+
"value",
|
|
5761
|
+
"inputId",
|
|
5762
|
+
"readOnly"
|
|
5763
|
+
],
|
|
5764
|
+
outputs: ["valueChange"]
|
|
5765
|
+
},
|
|
5766
|
+
{
|
|
5767
|
+
kind: "component",
|
|
5768
|
+
type: FlowsTimezoneFieldComponent,
|
|
5769
|
+
selector: "pw-flows-timezone-field",
|
|
5770
|
+
inputs: [
|
|
5771
|
+
"value",
|
|
5772
|
+
"inputId",
|
|
5773
|
+
"readOnly"
|
|
5774
|
+
],
|
|
5775
|
+
outputs: ["valueChange"]
|
|
5776
|
+
},
|
|
5777
|
+
{
|
|
5778
|
+
kind: "component",
|
|
5779
|
+
type: FlowsJsonFieldComponent,
|
|
5780
|
+
selector: "pw-flows-json-field",
|
|
5781
|
+
inputs: [
|
|
5782
|
+
"value",
|
|
5783
|
+
"inputId",
|
|
5784
|
+
"readOnly"
|
|
5785
|
+
],
|
|
5786
|
+
outputs: ["valueChange"]
|
|
5787
|
+
},
|
|
5788
|
+
{
|
|
5789
|
+
kind: "component",
|
|
5790
|
+
type: FlowsPairsFieldComponent,
|
|
5791
|
+
selector: "pw-flows-pairs-field",
|
|
5792
|
+
inputs: [
|
|
5793
|
+
"value",
|
|
5794
|
+
"inputId",
|
|
5795
|
+
"readOnly"
|
|
5796
|
+
],
|
|
5797
|
+
outputs: ["valueChange"]
|
|
5798
|
+
},
|
|
5799
|
+
{
|
|
5800
|
+
kind: "component",
|
|
5801
|
+
type: FlowsChoicesFieldComponent,
|
|
5802
|
+
selector: "pw-flows-choices-field",
|
|
5803
|
+
inputs: [
|
|
5804
|
+
"value",
|
|
5805
|
+
"inputId",
|
|
5806
|
+
"readOnly"
|
|
5807
|
+
],
|
|
5808
|
+
outputs: ["valueChange"]
|
|
5809
|
+
},
|
|
5810
|
+
{
|
|
5811
|
+
kind: "component",
|
|
5812
|
+
type: FlowsMemberFieldComponent,
|
|
5813
|
+
selector: "pw-flows-member-field",
|
|
5814
|
+
inputs: [
|
|
5815
|
+
"value",
|
|
5816
|
+
"multiple",
|
|
5817
|
+
"subscriptionId",
|
|
5818
|
+
"inputId",
|
|
5819
|
+
"readOnly"
|
|
5820
|
+
],
|
|
5821
|
+
outputs: ["valueChange"]
|
|
5218
5822
|
},
|
|
5219
5823
|
{
|
|
5220
5824
|
kind: "pipe",
|
|
@@ -5229,28 +5833,31 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5229
5833
|
minVersion: "12.0.0",
|
|
5230
5834
|
version: "22.2.3",
|
|
5231
5835
|
ngImport: i0,
|
|
5232
|
-
type:
|
|
5836
|
+
type: FlowsParamFieldComponent,
|
|
5233
5837
|
decorators: [{
|
|
5234
5838
|
type: Component,
|
|
5235
5839
|
args: [{
|
|
5236
|
-
selector: "pw-flows-
|
|
5840
|
+
selector: "pw-flows-param-field",
|
|
5237
5841
|
standalone: false,
|
|
5238
|
-
template: "<
|
|
5842
|
+
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 [editable]=\"field.editable === true\"\n [placeholder]=\"field.placeholder ?? ''\"\n [showClear]=\"!field.required\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"shownValue\"\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",
|
|
5843
|
+
styles: [":host{display:block}\n"]
|
|
5239
5844
|
}]
|
|
5240
5845
|
}],
|
|
5241
|
-
ctorParameters: () => [
|
|
5846
|
+
ctorParameters: () => [
|
|
5847
|
+
{ type: i2$4.TranslocoService },
|
|
5848
|
+
{ type: i0.ChangeDetectorRef },
|
|
5849
|
+
{ type: i0.DestroyRef }
|
|
5850
|
+
],
|
|
5242
5851
|
propDecorators: {
|
|
5852
|
+
field: [{ type: Input }],
|
|
5243
5853
|
value: [{ type: Input }],
|
|
5244
|
-
multiple: [{ type: Input }],
|
|
5245
|
-
subscriptionId: [{ type: Input }],
|
|
5246
|
-
inputId: [{ type: Input }],
|
|
5247
5854
|
readOnly: [{ type: Input }],
|
|
5855
|
+
subscriptionId: [{ type: Input }],
|
|
5856
|
+
listSuggestions: [{ type: Input }],
|
|
5857
|
+
settingValues: [{ type: Input }],
|
|
5248
5858
|
valueChange: [{ type: Output }]
|
|
5249
5859
|
}
|
|
5250
5860
|
});
|
|
5251
|
-
function toIds(value) {
|
|
5252
|
-
return (Array.isArray(value) ? value : [value]).map(Number).filter((id) => Number.isInteger(id) && id > 0);
|
|
5253
|
-
}
|
|
5254
5861
|
var FlowsRetryFieldComponent = class FlowsRetryFieldComponent {
|
|
5255
5862
|
constructor() {
|
|
5256
5863
|
this.readOnly = false;
|
|
@@ -5477,6 +6084,7 @@ var FlowsAvailableFieldsComponent = class FlowsAvailableFieldsComponent {
|
|
|
5477
6084
|
if (this.readOnly || !box?.isConnected || box.readOnly) return;
|
|
5478
6085
|
box.focus();
|
|
5479
6086
|
if (names) box.value = field;
|
|
6087
|
+
else if (box.closest("p-select")) box.value = this.placeholder(field, names);
|
|
5480
6088
|
else box.setRangeText(this.placeholder(field, names), box.selectionStart ?? box.value.length, box.selectionEnd ?? box.value.length, "end");
|
|
5481
6089
|
box.dispatchEvent(new Event("input", { bubbles: true }));
|
|
5482
6090
|
}
|
|
@@ -5718,32 +6326,23 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5718
6326
|
}
|
|
5719
6327
|
});
|
|
5720
6328
|
var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
5721
|
-
constructor(
|
|
6329
|
+
constructor(host) {
|
|
5722
6330
|
this.host = host;
|
|
5723
6331
|
this.definition = null;
|
|
5724
6332
|
this.readOnly = false;
|
|
5725
6333
|
this.fieldSuggestions = [];
|
|
5726
6334
|
this.listSuggestions = [];
|
|
6335
|
+
this.settingValues = {};
|
|
5727
6336
|
this.fieldSources = [];
|
|
5728
6337
|
this.firstRun = false;
|
|
5729
6338
|
this.nodeChange = new EventEmitter();
|
|
5730
6339
|
this.remove = new EventEmitter();
|
|
5731
6340
|
this.icons = FLOWS_ICONS;
|
|
5732
|
-
this.mergeModes = [];
|
|
5733
|
-
this.defaultMergeMode = FLOW_MERGE_MODES[0];
|
|
5734
6341
|
this.labelKey = flowNodeLabelKey;
|
|
5735
6342
|
this.paramLabelKey = flowParamLabelKey;
|
|
5736
6343
|
this.paramHelpKey = flowParamHelpKey;
|
|
5737
|
-
this.numberValue = flowNumberValue;
|
|
5738
6344
|
this.fields = [];
|
|
5739
6345
|
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
6346
|
}
|
|
5748
6347
|
ngOnChanges(changes) {
|
|
5749
6348
|
this.fields = (this.definition ? flowNodeFields(this.definition) : []).map((field) => ({
|
|
@@ -5764,9 +6363,6 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5764
6363
|
ngAfterViewChecked() {
|
|
5765
6364
|
this.leaving = void 0;
|
|
5766
6365
|
}
|
|
5767
|
-
kindOf(field) {
|
|
5768
|
-
return field.kind === "list" && !this.listSuggestions.length ? "text" : field.kind;
|
|
5769
|
-
}
|
|
5770
6366
|
fieldId(key) {
|
|
5771
6367
|
return `flow-node-${this.node.id}-${key}`;
|
|
5772
6368
|
}
|
|
@@ -5808,12 +6404,7 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5808
6404
|
version: "22.2.3",
|
|
5809
6405
|
ngImport: i0,
|
|
5810
6406
|
type: FlowsNodeInspectorComponent,
|
|
5811
|
-
deps: [
|
|
5812
|
-
{ token: i2$4.TranslocoService },
|
|
5813
|
-
{ token: i0.ChangeDetectorRef },
|
|
5814
|
-
{ token: i0.DestroyRef },
|
|
5815
|
-
{ token: i0.ElementRef }
|
|
5816
|
-
],
|
|
6407
|
+
deps: [{ token: i0.ElementRef }],
|
|
5817
6408
|
target: i0.ɵɵFactoryTarget.Component
|
|
5818
6409
|
});
|
|
5819
6410
|
}
|
|
@@ -5831,6 +6422,7 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5831
6422
|
readOnly: "readOnly",
|
|
5832
6423
|
fieldSuggestions: "fieldSuggestions",
|
|
5833
6424
|
listSuggestions: "listSuggestions",
|
|
6425
|
+
settingValues: "settingValues",
|
|
5834
6426
|
fieldSources: "fieldSources",
|
|
5835
6427
|
firstRun: "firstRun"
|
|
5836
6428
|
},
|
|
@@ -5840,32 +6432,9 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5840
6432
|
},
|
|
5841
6433
|
usesOnChanges: true,
|
|
5842
6434
|
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
|
|
6435
|
+
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 [settingValues]=\"settingValues\"\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
6436
|
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
6437
|
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
6438
|
{
|
|
5870
6439
|
kind: "directive",
|
|
5871
6440
|
type: i1$1.Tooltip,
|
|
@@ -5894,76 +6463,6 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5894
6463
|
"pTooltipUnstyled"
|
|
5895
6464
|
]
|
|
5896
6465
|
},
|
|
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
6466
|
{
|
|
5968
6467
|
kind: "component",
|
|
5969
6468
|
type: i2$1.FieldErrorDisplayComponent,
|
|
@@ -6030,39 +6529,6 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
6030
6529
|
"a11yRoleChange"
|
|
6031
6530
|
]
|
|
6032
6531
|
},
|
|
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
6532
|
{
|
|
6067
6533
|
kind: "component",
|
|
6068
6534
|
type: FlowsConditionFieldComponent,
|
|
@@ -6077,25 +6543,15 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
6077
6543
|
},
|
|
6078
6544
|
{
|
|
6079
6545
|
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",
|
|
6546
|
+
type: FlowsParamFieldComponent,
|
|
6547
|
+
selector: "pw-flows-param-field",
|
|
6093
6548
|
inputs: [
|
|
6549
|
+
"field",
|
|
6094
6550
|
"value",
|
|
6095
|
-
"
|
|
6551
|
+
"readOnly",
|
|
6096
6552
|
"subscriptionId",
|
|
6097
|
-
"
|
|
6098
|
-
"
|
|
6553
|
+
"listSuggestions",
|
|
6554
|
+
"settingValues"
|
|
6099
6555
|
],
|
|
6100
6556
|
outputs: ["valueChange"]
|
|
6101
6557
|
},
|
|
@@ -6147,16 +6603,11 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
6147
6603
|
args: [{
|
|
6148
6604
|
selector: "pw-flows-node-inspector",
|
|
6149
6605
|
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
|
|
6606
|
+
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 [settingValues]=\"settingValues\"\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
6607
|
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
6608
|
}]
|
|
6153
6609
|
}],
|
|
6154
|
-
ctorParameters: () => [
|
|
6155
|
-
{ type: i2$4.TranslocoService },
|
|
6156
|
-
{ type: i0.ChangeDetectorRef },
|
|
6157
|
-
{ type: i0.DestroyRef },
|
|
6158
|
-
{ type: i0.ElementRef }
|
|
6159
|
-
],
|
|
6610
|
+
ctorParameters: () => [{ type: i0.ElementRef }],
|
|
6160
6611
|
propDecorators: {
|
|
6161
6612
|
node: [{ type: Input }],
|
|
6162
6613
|
definition: [{ type: Input }],
|
|
@@ -6164,6 +6615,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
6164
6615
|
readOnly: [{ type: Input }],
|
|
6165
6616
|
fieldSuggestions: [{ type: Input }],
|
|
6166
6617
|
listSuggestions: [{ type: Input }],
|
|
6618
|
+
settingValues: [{ type: Input }],
|
|
6167
6619
|
fieldSources: [{ type: Input }],
|
|
6168
6620
|
firstRun: [{ type: Input }],
|
|
6169
6621
|
nodeChange: [{ type: Output }],
|
|
@@ -6295,7 +6747,7 @@ var FlowsVersionEditorComponent = class FlowsVersionEditorComponent {
|
|
|
6295
6747
|
}],
|
|
6296
6748
|
usesOnChanges: true,
|
|
6297
6749
|
ngImport: i0,
|
|
6298
|
-
template: "<div class=\"pw-version-editor mt-3\">\n <h3>{{ headingKey | transloco: { number: duplicateOf?.version } }}</h3>\n\n <pw-loader [isVisible]=\"loading\"></pw-loader>\n\n @if (!loading) {\n @if (loadFailed) {\n <pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Canvas.LoadFailed' | transloco\">\n </pw-field-error-display>\n } @else {\n <div class=\"pw-version-editor__toolbar\">\n <!-- The raw graph is for support work; members build on the diagram. -->\n <div class=\"btn-group me-auto\"\n *rbacAllow=\"'SuperAdmin'\"\n role=\"tablist\">\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-canvas\"\n [class.active]=\"view === 'canvas'\"\n [attr.aria-selected]=\"view === 'canvas'\"\n (click)=\"show('canvas')\">\n <fa-icon [icon]=\"icons.diagram\"></fa-icon>\n {{ 'Flows.Canvas.Diagram' | transloco }}\n </button>\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-json\"\n [class.active]=\"view === 'json'\"\n [attr.aria-selected]=\"view === 'json'\"\n (click)=\"show('json')\">\n <fa-icon [icon]=\"icons.json\"></fa-icon>\n {{ 'Flows.Canvas.Json' | transloco }}\n </button>\n </div>\n @if (view === 'canvas') {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm ms-auto\"\n data-testid=\"flow-fit\"\n (click)=\"canvas.zoomToFit()\">\n <fa-icon [icon]=\"icons.fit\"></fa-icon>\n {{ 'Flows.Canvas.Fit' | transloco }}\n </button>\n }\n </div>\n\n @if (check && !readOnly) {\n <pw-flows-graph-check [canvas]=\"canvas\"\n [definitions]=\"definitions\"\n [graph]=\"graph\"\n [result]=\"check\"></pw-flows-graph-check>\n }\n\n @if (dropped.length) {\n <p class=\"pw-version-editor__warning\"\n role=\"alert\"\n data-testid=\"flow-dropped-edges\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Canvas.Dropped' | transloco: { count: dropped.length } }}\n </p>\n }\n\n @let fields = workflowFields$ | async;\n <div class=\"pw-version-editor__workspace\"\n [class.is-read-only]=\"readOnly\"\n [hidden]=\"view !== 'canvas'\">\n @if (!readOnly) {\n <pw-flows-node-palette class=\"pw-version-editor__palette\"\n [definitions]=\"definitions\"\n (add)=\"canvas.addNode($event)\"></pw-flows-node-palette>\n }\n <pw-flows-graph-canvas #canvas\n class=\"pw-version-editor__canvas\"\n [graph]=\"graph\"\n [definitions]=\"definitions\"\n [workflowFields]=\"fields\"\n [readOnly]=\"readOnly\"\n (selectionChange)=\"select($event)\"\n (dropped)=\"dropped = $event\"></pw-flows-graph-canvas>\n <div class=\"pw-version-editor__side\">\n @if (selection) {\n <pw-flows-node-inspector [node]=\"selection.node\"\n [definition]=\"selection.definition\"\n [fieldSuggestions]=\"selection.fieldSuggestions\"\n [fieldSources]=\"selection.fieldSources\"\n [listSuggestions]=\"selection.listSuggestions\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n [firstRun]=\"!!fields && !fields.ran\"\n (nodeChange)=\"updateSelected($event)\"\n (remove)=\"removeSelected()\"></pw-flows-node-inspector>\n } @else {\n <p class=\"pw-version-editor__hint\">{{ (readOnly ? 'Flows.Canvas.SelectToView' : 'Flows.Canvas.SelectToEdit') | transloco }}</p>\n }\n </div>\n </div>\n\n @if (view === 'json') {\n <pre class=\"pw-version-editor__json\"\n data-testid=\"flow-json\">{{ json }}</pre>\n }\n }\n }\n\n <div class=\"mb-3 col-12 text-end mt-3\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"cancel()\">\n {{ (readOnly ? 'Flows.Versions.Editor.Close' : 'Button.Cancel') | transloco }}\n </button>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"saving || loading || loadFailed\"\n (click)=\"save()\">\n {{ 'Button.Submit' | transloco }}\n </button>\n }\n </div>\n</div>\n",
|
|
6750
|
+
template: "<div class=\"pw-version-editor mt-3\">\n <h3>{{ headingKey | transloco: { number: duplicateOf?.version } }}</h3>\n\n <pw-loader [isVisible]=\"loading\"></pw-loader>\n\n @if (!loading) {\n @if (loadFailed) {\n <pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Canvas.LoadFailed' | transloco\">\n </pw-field-error-display>\n } @else {\n <div class=\"pw-version-editor__toolbar\">\n <!-- The raw graph is for support work; members build on the diagram. -->\n <div class=\"btn-group me-auto\"\n *rbacAllow=\"'SuperAdmin'\"\n role=\"tablist\">\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-canvas\"\n [class.active]=\"view === 'canvas'\"\n [attr.aria-selected]=\"view === 'canvas'\"\n (click)=\"show('canvas')\">\n <fa-icon [icon]=\"icons.diagram\"></fa-icon>\n {{ 'Flows.Canvas.Diagram' | transloco }}\n </button>\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-json\"\n [class.active]=\"view === 'json'\"\n [attr.aria-selected]=\"view === 'json'\"\n (click)=\"show('json')\">\n <fa-icon [icon]=\"icons.json\"></fa-icon>\n {{ 'Flows.Canvas.Json' | transloco }}\n </button>\n </div>\n @if (view === 'canvas') {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm ms-auto\"\n data-testid=\"flow-fit\"\n (click)=\"canvas.zoomToFit()\">\n <fa-icon [icon]=\"icons.fit\"></fa-icon>\n {{ 'Flows.Canvas.Fit' | transloco }}\n </button>\n }\n </div>\n\n @if (check && !readOnly) {\n <pw-flows-graph-check [canvas]=\"canvas\"\n [definitions]=\"definitions\"\n [graph]=\"graph\"\n [result]=\"check\"></pw-flows-graph-check>\n }\n\n @if (dropped.length) {\n <p class=\"pw-version-editor__warning\"\n role=\"alert\"\n data-testid=\"flow-dropped-edges\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Canvas.Dropped' | transloco: { count: dropped.length } }}\n </p>\n }\n\n @let fields = workflowFields$ | async;\n <div class=\"pw-version-editor__workspace\"\n [class.is-read-only]=\"readOnly\"\n [hidden]=\"view !== 'canvas'\">\n @if (!readOnly) {\n <pw-flows-node-palette class=\"pw-version-editor__palette\"\n [definitions]=\"definitions\"\n (add)=\"canvas.addNode($event)\"></pw-flows-node-palette>\n }\n <pw-flows-graph-canvas #canvas\n class=\"pw-version-editor__canvas\"\n [graph]=\"graph\"\n [definitions]=\"definitions\"\n [workflowFields]=\"fields\"\n [readOnly]=\"readOnly\"\n (selectionChange)=\"select($event)\"\n (dropped)=\"dropped = $event\"></pw-flows-graph-canvas>\n <div class=\"pw-version-editor__side\">\n @if (selection) {\n <pw-flows-node-inspector [node]=\"selection.node\"\n [definition]=\"selection.definition\"\n [fieldSuggestions]=\"selection.fieldSuggestions\"\n [fieldSources]=\"selection.fieldSources\"\n [listSuggestions]=\"selection.listSuggestions\"\n [settingValues]=\"selection.settingValues\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n [firstRun]=\"!!fields && !fields.ran\"\n (nodeChange)=\"updateSelected($event)\"\n (remove)=\"removeSelected()\"></pw-flows-node-inspector>\n } @else {\n <p class=\"pw-version-editor__hint\">{{ (readOnly ? 'Flows.Canvas.SelectToView' : 'Flows.Canvas.SelectToEdit') | transloco }}</p>\n }\n </div>\n </div>\n\n @if (view === 'json') {\n <pre class=\"pw-version-editor__json\"\n data-testid=\"flow-json\">{{ json }}</pre>\n }\n }\n }\n\n <div class=\"mb-3 col-12 text-end mt-3\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"cancel()\">\n {{ (readOnly ? 'Flows.Versions.Editor.Close' : 'Button.Cancel') | transloco }}\n </button>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"saving || loading || loadFailed\"\n (click)=\"save()\">\n {{ 'Button.Submit' | transloco }}\n </button>\n }\n </div>\n</div>\n",
|
|
6299
6751
|
styles: [":host .pw-version-editor>h3{display:block;border-top:1px solid #e2e5ea;margin-top:2rem;padding-top:1.25rem}.pw-version-editor__toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:8px}.pw-version-editor__warning{display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid #b7791f;border-radius:4px;color:#b7791f}.pw-version-editor__workspace{display:grid;grid-template-columns:200px minmax(0,1fr) 300px;height:560px;border:1px solid #e2e5ea;border-radius:8px;overflow:hidden}.pw-version-editor__workspace.is-read-only{grid-template-columns:minmax(0,1fr) 300px}.pw-version-editor__palette,.pw-version-editor__side{overflow-y:auto;background:#fff}.pw-version-editor__palette{border-right:1px solid #e2e5ea}.pw-version-editor__side{border-left:1px solid #e2e5ea}.pw-version-editor__hint{margin:0;padding:16px;color:#7c8696}.pw-version-editor__json{max-height:560px;margin:0;padding:12px;overflow:auto;border:1px solid #e2e5ea;border-radius:8px;background:#f7f8fa}@media(max-width:991px){.pw-version-editor__workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:auto 420px auto;height:auto}.pw-version-editor__workspace.is-read-only{grid-template-columns:minmax(0,1fr);grid-template-rows:420px auto}.pw-version-editor__palette{max-height:200px;border-right:0;border-bottom:1px solid #e2e5ea}.pw-version-editor__side{border-left:0;border-top:1px solid #e2e5ea}}\n"],
|
|
6300
6752
|
dependencies: [
|
|
6301
6753
|
{
|
|
@@ -6402,6 +6854,7 @@ var FlowsVersionEditorComponent = class FlowsVersionEditorComponent {
|
|
|
6402
6854
|
"readOnly",
|
|
6403
6855
|
"fieldSuggestions",
|
|
6404
6856
|
"listSuggestions",
|
|
6857
|
+
"settingValues",
|
|
6405
6858
|
"fieldSources",
|
|
6406
6859
|
"firstRun"
|
|
6407
6860
|
],
|
|
@@ -6431,7 +6884,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
6431
6884
|
args: [{
|
|
6432
6885
|
selector: "pw-flows-version-editor",
|
|
6433
6886
|
standalone: false,
|
|
6434
|
-
template: "<div class=\"pw-version-editor mt-3\">\n <h3>{{ headingKey | transloco: { number: duplicateOf?.version } }}</h3>\n\n <pw-loader [isVisible]=\"loading\"></pw-loader>\n\n @if (!loading) {\n @if (loadFailed) {\n <pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Canvas.LoadFailed' | transloco\">\n </pw-field-error-display>\n } @else {\n <div class=\"pw-version-editor__toolbar\">\n <!-- The raw graph is for support work; members build on the diagram. -->\n <div class=\"btn-group me-auto\"\n *rbacAllow=\"'SuperAdmin'\"\n role=\"tablist\">\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-canvas\"\n [class.active]=\"view === 'canvas'\"\n [attr.aria-selected]=\"view === 'canvas'\"\n (click)=\"show('canvas')\">\n <fa-icon [icon]=\"icons.diagram\"></fa-icon>\n {{ 'Flows.Canvas.Diagram' | transloco }}\n </button>\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-json\"\n [class.active]=\"view === 'json'\"\n [attr.aria-selected]=\"view === 'json'\"\n (click)=\"show('json')\">\n <fa-icon [icon]=\"icons.json\"></fa-icon>\n {{ 'Flows.Canvas.Json' | transloco }}\n </button>\n </div>\n @if (view === 'canvas') {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm ms-auto\"\n data-testid=\"flow-fit\"\n (click)=\"canvas.zoomToFit()\">\n <fa-icon [icon]=\"icons.fit\"></fa-icon>\n {{ 'Flows.Canvas.Fit' | transloco }}\n </button>\n }\n </div>\n\n @if (check && !readOnly) {\n <pw-flows-graph-check [canvas]=\"canvas\"\n [definitions]=\"definitions\"\n [graph]=\"graph\"\n [result]=\"check\"></pw-flows-graph-check>\n }\n\n @if (dropped.length) {\n <p class=\"pw-version-editor__warning\"\n role=\"alert\"\n data-testid=\"flow-dropped-edges\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Canvas.Dropped' | transloco: { count: dropped.length } }}\n </p>\n }\n\n @let fields = workflowFields$ | async;\n <div class=\"pw-version-editor__workspace\"\n [class.is-read-only]=\"readOnly\"\n [hidden]=\"view !== 'canvas'\">\n @if (!readOnly) {\n <pw-flows-node-palette class=\"pw-version-editor__palette\"\n [definitions]=\"definitions\"\n (add)=\"canvas.addNode($event)\"></pw-flows-node-palette>\n }\n <pw-flows-graph-canvas #canvas\n class=\"pw-version-editor__canvas\"\n [graph]=\"graph\"\n [definitions]=\"definitions\"\n [workflowFields]=\"fields\"\n [readOnly]=\"readOnly\"\n (selectionChange)=\"select($event)\"\n (dropped)=\"dropped = $event\"></pw-flows-graph-canvas>\n <div class=\"pw-version-editor__side\">\n @if (selection) {\n <pw-flows-node-inspector [node]=\"selection.node\"\n [definition]=\"selection.definition\"\n [fieldSuggestions]=\"selection.fieldSuggestions\"\n [fieldSources]=\"selection.fieldSources\"\n [listSuggestions]=\"selection.listSuggestions\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n [firstRun]=\"!!fields && !fields.ran\"\n (nodeChange)=\"updateSelected($event)\"\n (remove)=\"removeSelected()\"></pw-flows-node-inspector>\n } @else {\n <p class=\"pw-version-editor__hint\">{{ (readOnly ? 'Flows.Canvas.SelectToView' : 'Flows.Canvas.SelectToEdit') | transloco }}</p>\n }\n </div>\n </div>\n\n @if (view === 'json') {\n <pre class=\"pw-version-editor__json\"\n data-testid=\"flow-json\">{{ json }}</pre>\n }\n }\n }\n\n <div class=\"mb-3 col-12 text-end mt-3\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"cancel()\">\n {{ (readOnly ? 'Flows.Versions.Editor.Close' : 'Button.Cancel') | transloco }}\n </button>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"saving || loading || loadFailed\"\n (click)=\"save()\">\n {{ 'Button.Submit' | transloco }}\n </button>\n }\n </div>\n</div>\n",
|
|
6887
|
+
template: "<div class=\"pw-version-editor mt-3\">\n <h3>{{ headingKey | transloco: { number: duplicateOf?.version } }}</h3>\n\n <pw-loader [isVisible]=\"loading\"></pw-loader>\n\n @if (!loading) {\n @if (loadFailed) {\n <pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Canvas.LoadFailed' | transloco\">\n </pw-field-error-display>\n } @else {\n <div class=\"pw-version-editor__toolbar\">\n <!-- The raw graph is for support work; members build on the diagram. -->\n <div class=\"btn-group me-auto\"\n *rbacAllow=\"'SuperAdmin'\"\n role=\"tablist\">\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-canvas\"\n [class.active]=\"view === 'canvas'\"\n [attr.aria-selected]=\"view === 'canvas'\"\n (click)=\"show('canvas')\">\n <fa-icon [icon]=\"icons.diagram\"></fa-icon>\n {{ 'Flows.Canvas.Diagram' | transloco }}\n </button>\n <button type=\"button\"\n role=\"tab\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-view-json\"\n [class.active]=\"view === 'json'\"\n [attr.aria-selected]=\"view === 'json'\"\n (click)=\"show('json')\">\n <fa-icon [icon]=\"icons.json\"></fa-icon>\n {{ 'Flows.Canvas.Json' | transloco }}\n </button>\n </div>\n @if (view === 'canvas') {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm ms-auto\"\n data-testid=\"flow-fit\"\n (click)=\"canvas.zoomToFit()\">\n <fa-icon [icon]=\"icons.fit\"></fa-icon>\n {{ 'Flows.Canvas.Fit' | transloco }}\n </button>\n }\n </div>\n\n @if (check && !readOnly) {\n <pw-flows-graph-check [canvas]=\"canvas\"\n [definitions]=\"definitions\"\n [graph]=\"graph\"\n [result]=\"check\"></pw-flows-graph-check>\n }\n\n @if (dropped.length) {\n <p class=\"pw-version-editor__warning\"\n role=\"alert\"\n data-testid=\"flow-dropped-edges\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Canvas.Dropped' | transloco: { count: dropped.length } }}\n </p>\n }\n\n @let fields = workflowFields$ | async;\n <div class=\"pw-version-editor__workspace\"\n [class.is-read-only]=\"readOnly\"\n [hidden]=\"view !== 'canvas'\">\n @if (!readOnly) {\n <pw-flows-node-palette class=\"pw-version-editor__palette\"\n [definitions]=\"definitions\"\n (add)=\"canvas.addNode($event)\"></pw-flows-node-palette>\n }\n <pw-flows-graph-canvas #canvas\n class=\"pw-version-editor__canvas\"\n [graph]=\"graph\"\n [definitions]=\"definitions\"\n [workflowFields]=\"fields\"\n [readOnly]=\"readOnly\"\n (selectionChange)=\"select($event)\"\n (dropped)=\"dropped = $event\"></pw-flows-graph-canvas>\n <div class=\"pw-version-editor__side\">\n @if (selection) {\n <pw-flows-node-inspector [node]=\"selection.node\"\n [definition]=\"selection.definition\"\n [fieldSuggestions]=\"selection.fieldSuggestions\"\n [fieldSources]=\"selection.fieldSources\"\n [listSuggestions]=\"selection.listSuggestions\"\n [settingValues]=\"selection.settingValues\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n [firstRun]=\"!!fields && !fields.ran\"\n (nodeChange)=\"updateSelected($event)\"\n (remove)=\"removeSelected()\"></pw-flows-node-inspector>\n } @else {\n <p class=\"pw-version-editor__hint\">{{ (readOnly ? 'Flows.Canvas.SelectToView' : 'Flows.Canvas.SelectToEdit') | transloco }}</p>\n }\n </div>\n </div>\n\n @if (view === 'json') {\n <pre class=\"pw-version-editor__json\"\n data-testid=\"flow-json\">{{ json }}</pre>\n }\n }\n }\n\n <div class=\"mb-3 col-12 text-end mt-3\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"cancel()\">\n {{ (readOnly ? 'Flows.Versions.Editor.Close' : 'Button.Cancel') | transloco }}\n </button>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-primary\"\n [disabled]=\"saving || loading || loadFailed\"\n (click)=\"save()\">\n {{ 'Button.Submit' | transloco }}\n </button>\n }\n </div>\n</div>\n",
|
|
6435
6888
|
styles: [":host .pw-version-editor>h3{display:block;border-top:1px solid #e2e5ea;margin-top:2rem;padding-top:1.25rem}.pw-version-editor__toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:8px}.pw-version-editor__warning{display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid #b7791f;border-radius:4px;color:#b7791f}.pw-version-editor__workspace{display:grid;grid-template-columns:200px minmax(0,1fr) 300px;height:560px;border:1px solid #e2e5ea;border-radius:8px;overflow:hidden}.pw-version-editor__workspace.is-read-only{grid-template-columns:minmax(0,1fr) 300px}.pw-version-editor__palette,.pw-version-editor__side{overflow-y:auto;background:#fff}.pw-version-editor__palette{border-right:1px solid #e2e5ea}.pw-version-editor__side{border-left:1px solid #e2e5ea}.pw-version-editor__hint{margin:0;padding:16px;color:#7c8696}.pw-version-editor__json{max-height:560px;margin:0;padding:12px;overflow:auto;border:1px solid #e2e5ea;border-radius:8px;background:#f7f8fa}@media(max-width:991px){.pw-version-editor__workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:auto 420px auto;height:auto}.pw-version-editor__workspace.is-read-only{grid-template-columns:minmax(0,1fr);grid-template-rows:420px auto}.pw-version-editor__palette{max-height:200px;border-right:0;border-bottom:1px solid #e2e5ea}.pw-version-editor__side{border-left:0;border-top:1px solid #e2e5ea}}\n"]
|
|
6436
6889
|
}]
|
|
6437
6890
|
}],
|
|
@@ -6627,7 +7080,7 @@ var FlowsWorkflowVersionsComponent = class FlowsWorkflowVersionsComponent extend
|
|
|
6627
7080
|
}],
|
|
6628
7081
|
usesInheritance: true,
|
|
6629
7082
|
ngImport: i0,
|
|
6630
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex flex-wrap justify-content-between align-items-center gap-2\">\n <div class=\"d-flex flex-wrap align-items-center gap-3\">\n <h2 class=\"card-title p-0 mb-0\">\n {{ 'Flows.Versions.Title' | transloco }}\n @if (workflow) {\n <span class=\"pw-versions-subject\">{{ workflow.name }}</span>\n }\n </h2>\n @if (workflow) {\n <span [class]=\"workflow.status | flowWorkflowBadge\"\n data-testid=\"flow-workflow-status\">\n {{ 'Flows.WorkflowStatus.' + workflow.status | transloco }}\n </span>\n }\n </div>\n <div class=\"d-flex flex-wrap align-items-center gap-2\"\n data-testid=\"flow-versions-actions\">\n @if (workflow) {\n <pw-flows-workflow-status [workflow]=\"workflow\"\n [subscriptionId]=\"subscriptionId\"\n [hasPublished]=\"versions.some(isPublished)\"\n (workflowChange)=\"workflow = $event\"></pw-flows-workflow-status>\n }\n <!-- A published version is read-only, so leaving it loses nothing. -->\n @let draftOpen = editor.open && !(editor.version && isPublished(editor.version));\n <span [pTooltip]=\"draftOpen ? ('Flows.Versions.CloseFirst' | transloco) : ''\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n data-testid=\"flow-version-create\"\n [disabled]=\"draftOpen\"\n (click)=\"openEditor()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Versions.Create' | transloco }}\n </button>\n </span>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-secondary\"\n (click)=\"back()\">\n <fa-icon [icon]=\"icons.back\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Back' | transloco }}\n </button>\n </div>\n </div>\n</div>\n\n@if (loading) {\n<pw-skeleton-table [rows]=\"8\" [columns]=\"5\" [showCaption]=\"false\" />\n}\n\n@if (!loading) {\n@if (notFound) {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Versions.NotFound' | transloco\"></pw-no-data>\n} @else {\n@if (versions.length > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table [value]=\"versions\">\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Version' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.State' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Published' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Created' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-version>\n <tr>\n <td data-head=\"Version\">{{ version.version }}</td>\n <td data-head=\"State\">\n <span [class]=\"badgeClass(version)\">\n {{ (isPublished(version) ? 'Flows.Versions.State.Published' : 'Flows.Versions.State.Draft') | transloco }}\n </span>\n </td>\n <td data-head=\"Published\">\n {{ version.published_at ? (version.published_at | dateFormat) : '—' }}\n </td>\n <td data-head=\"Created\">{{ version.created_at | dateFormat }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"(isPublished(version) ? 'Flows.Versions.Action.View' : 'Flows.Versions.Action.Edit') | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon [class]=\"isPublished(version) ? 'cta1-icon' : 'edit-icon'\"\n [icon]=\"isPublished(version) ? icons.inspect : icons.edit\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"(isPublished(version) ? 'Flows.Versions.Action.View' : 'Flows.Versions.Action.Edit') | transloco\"\n (click)=\"openEditor(version)\"\n (keydown.enter)=\"openEditor(version)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Versions.Action.Duplicate' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.duplicate\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Versions.Action.Duplicate' | transloco\"\n (click)=\"duplicate(version)\"\n (keydown.enter)=\"duplicate(version)\"></fa-icon>\n </li>\n <!-- Hiding this is courtesy; protect_endpoint! is the control. -->\n @if (!isPublished(version) && canPublish) {\n <li [pTooltip]=\"'Flows.Versions.Action.Publish' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.publish\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Versions.Action.Publish' | transloco\"\n (click)=\"publish(version)\"\n (keydown.enter)=\"publish(version)\"></fa-icon>\n </li>\n }\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"versions.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Versions.Empty' | transloco\" [description]=\"'Flows.Versions.EmptyDescription' | transloco\"></pw-no-data>\n}\n\n@if (editor.open) {\n<pw-flows-version-editor [version]=\"editor.version\"\n [duplicateOf]=\"editor.duplicateOf\"\n [workflowId]=\"workflowId\"\n [subscriptionId]=\"subscriptionId\"\n [check]=\"editor.check\"\n (saved)=\"onVersionSaved()\"\n (cancelled)=\"editor.close()\">\n</pw-flows-version-editor>\n}\n}\n}\n",
|
|
7083
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex flex-wrap justify-content-between align-items-center gap-2\">\n <div class=\"d-flex flex-wrap align-items-center gap-3\">\n <h2 class=\"card-title p-0 mb-0\">\n {{ 'Flows.Versions.Title' | transloco }}\n @if (workflow) {\n <span class=\"pw-versions-subject\">{{ workflow.name }}</span>\n }\n </h2>\n @if (workflow) {\n <span [class]=\"workflow.status | flowWorkflowBadge\"\n data-testid=\"flow-workflow-status\">\n {{ 'Flows.WorkflowStatus.' + workflow.status | transloco }}\n </span>\n }\n </div>\n <div class=\"d-flex flex-wrap align-items-center gap-2\"\n data-testid=\"flow-versions-actions\">\n @if (workflow) {\n <pw-flows-workflow-status [workflow]=\"workflow\"\n [subscriptionId]=\"subscriptionId\"\n [hasPublished]=\"versions.some(isPublished)\"\n (workflowChange)=\"workflow = $event\"></pw-flows-workflow-status>\n }\n <!-- A published version is read-only, so leaving it loses nothing. -->\n @let draftOpen = editor.open && !(editor.version && isPublished(editor.version));\n <span [pTooltip]=\"draftOpen ? ('Flows.Versions.CloseFirst' | transloco) : ''\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n data-testid=\"flow-version-create\"\n [disabled]=\"draftOpen\"\n (click)=\"openEditor()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Versions.Create' | transloco }}\n </button>\n </span>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-secondary\"\n (click)=\"back()\">\n <fa-icon [icon]=\"icons.back\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Back' | transloco }}\n </button>\n </div>\n </div>\n</div>\n\n@if (loading) {\n<div class=\"mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"5\" [showCaption]=\"false\" />\n</div>\n}\n\n@if (!loading) {\n@if (notFound) {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Versions.NotFound' | transloco\"></pw-no-data>\n} @else {\n@if (versions.length > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table [value]=\"versions\">\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Version' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.State' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Published' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Created' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-version>\n <tr>\n <td data-head=\"Version\">{{ version.version }}</td>\n <td data-head=\"State\">\n <span [class]=\"badgeClass(version)\">\n {{ (isPublished(version) ? 'Flows.Versions.State.Published' : 'Flows.Versions.State.Draft') | transloco }}\n </span>\n </td>\n <td data-head=\"Published\">\n {{ version.published_at ? (version.published_at | dateFormat) : '—' }}\n </td>\n <td data-head=\"Created\">{{ version.created_at | dateFormat }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"(isPublished(version) ? 'Flows.Versions.Action.View' : 'Flows.Versions.Action.Edit') | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon [class]=\"isPublished(version) ? 'cta1-icon' : 'edit-icon'\"\n [icon]=\"isPublished(version) ? icons.inspect : icons.edit\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"(isPublished(version) ? 'Flows.Versions.Action.View' : 'Flows.Versions.Action.Edit') | transloco\"\n (click)=\"openEditor(version)\"\n (keydown.enter)=\"openEditor(version)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Versions.Action.Duplicate' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.duplicate\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Versions.Action.Duplicate' | transloco\"\n (click)=\"duplicate(version)\"\n (keydown.enter)=\"duplicate(version)\"></fa-icon>\n </li>\n <!-- Hiding this is courtesy; protect_endpoint! is the control. -->\n @if (!isPublished(version) && canPublish) {\n <li [pTooltip]=\"'Flows.Versions.Action.Publish' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.publish\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Versions.Action.Publish' | transloco\"\n (click)=\"publish(version)\"\n (keydown.enter)=\"publish(version)\"></fa-icon>\n </li>\n }\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"versions.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Versions.Empty' | transloco\" [description]=\"'Flows.Versions.EmptyDescription' | transloco\"></pw-no-data>\n}\n\n@if (editor.open) {\n<pw-flows-version-editor [version]=\"editor.version\"\n [duplicateOf]=\"editor.duplicateOf\"\n [workflowId]=\"workflowId\"\n [subscriptionId]=\"subscriptionId\"\n [check]=\"editor.check\"\n (saved)=\"onVersionSaved()\"\n (cancelled)=\"editor.close()\">\n</pw-flows-version-editor>\n}\n}\n}\n",
|
|
6631
7084
|
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.pw-versions-subject{margin-left:.5rem;color:#5a6473;font-weight:400}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}\n"],
|
|
6632
7085
|
dependencies: [
|
|
6633
7086
|
{
|
|
@@ -6890,7 +7343,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
6890
7343
|
args: [{
|
|
6891
7344
|
selector: "pw-flows-workflow-versions",
|
|
6892
7345
|
standalone: false,
|
|
6893
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex flex-wrap justify-content-between align-items-center gap-2\">\n <div class=\"d-flex flex-wrap align-items-center gap-3\">\n <h2 class=\"card-title p-0 mb-0\">\n {{ 'Flows.Versions.Title' | transloco }}\n @if (workflow) {\n <span class=\"pw-versions-subject\">{{ workflow.name }}</span>\n }\n </h2>\n @if (workflow) {\n <span [class]=\"workflow.status | flowWorkflowBadge\"\n data-testid=\"flow-workflow-status\">\n {{ 'Flows.WorkflowStatus.' + workflow.status | transloco }}\n </span>\n }\n </div>\n <div class=\"d-flex flex-wrap align-items-center gap-2\"\n data-testid=\"flow-versions-actions\">\n @if (workflow) {\n <pw-flows-workflow-status [workflow]=\"workflow\"\n [subscriptionId]=\"subscriptionId\"\n [hasPublished]=\"versions.some(isPublished)\"\n (workflowChange)=\"workflow = $event\"></pw-flows-workflow-status>\n }\n <!-- A published version is read-only, so leaving it loses nothing. -->\n @let draftOpen = editor.open && !(editor.version && isPublished(editor.version));\n <span [pTooltip]=\"draftOpen ? ('Flows.Versions.CloseFirst' | transloco) : ''\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n data-testid=\"flow-version-create\"\n [disabled]=\"draftOpen\"\n (click)=\"openEditor()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Versions.Create' | transloco }}\n </button>\n </span>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-secondary\"\n (click)=\"back()\">\n <fa-icon [icon]=\"icons.back\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Back' | transloco }}\n </button>\n </div>\n </div>\n</div>\n\n@if (loading) {\n<pw-skeleton-table [rows]=\"8\" [columns]=\"5\" [showCaption]=\"false\" />\n}\n\n@if (!loading) {\n@if (notFound) {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Versions.NotFound' | transloco\"></pw-no-data>\n} @else {\n@if (versions.length > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table [value]=\"versions\">\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Version' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.State' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Published' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Created' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-version>\n <tr>\n <td data-head=\"Version\">{{ version.version }}</td>\n <td data-head=\"State\">\n <span [class]=\"badgeClass(version)\">\n {{ (isPublished(version) ? 'Flows.Versions.State.Published' : 'Flows.Versions.State.Draft') | transloco }}\n </span>\n </td>\n <td data-head=\"Published\">\n {{ version.published_at ? (version.published_at | dateFormat) : '—' }}\n </td>\n <td data-head=\"Created\">{{ version.created_at | dateFormat }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"(isPublished(version) ? 'Flows.Versions.Action.View' : 'Flows.Versions.Action.Edit') | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon [class]=\"isPublished(version) ? 'cta1-icon' : 'edit-icon'\"\n [icon]=\"isPublished(version) ? icons.inspect : icons.edit\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"(isPublished(version) ? 'Flows.Versions.Action.View' : 'Flows.Versions.Action.Edit') | transloco\"\n (click)=\"openEditor(version)\"\n (keydown.enter)=\"openEditor(version)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Versions.Action.Duplicate' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.duplicate\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Versions.Action.Duplicate' | transloco\"\n (click)=\"duplicate(version)\"\n (keydown.enter)=\"duplicate(version)\"></fa-icon>\n </li>\n <!-- Hiding this is courtesy; protect_endpoint! is the control. -->\n @if (!isPublished(version) && canPublish) {\n <li [pTooltip]=\"'Flows.Versions.Action.Publish' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.publish\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Versions.Action.Publish' | transloco\"\n (click)=\"publish(version)\"\n (keydown.enter)=\"publish(version)\"></fa-icon>\n </li>\n }\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"versions.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Versions.Empty' | transloco\" [description]=\"'Flows.Versions.EmptyDescription' | transloco\"></pw-no-data>\n}\n\n@if (editor.open) {\n<pw-flows-version-editor [version]=\"editor.version\"\n [duplicateOf]=\"editor.duplicateOf\"\n [workflowId]=\"workflowId\"\n [subscriptionId]=\"subscriptionId\"\n [check]=\"editor.check\"\n (saved)=\"onVersionSaved()\"\n (cancelled)=\"editor.close()\">\n</pw-flows-version-editor>\n}\n}\n}\n",
|
|
7346
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex flex-wrap justify-content-between align-items-center gap-2\">\n <div class=\"d-flex flex-wrap align-items-center gap-3\">\n <h2 class=\"card-title p-0 mb-0\">\n {{ 'Flows.Versions.Title' | transloco }}\n @if (workflow) {\n <span class=\"pw-versions-subject\">{{ workflow.name }}</span>\n }\n </h2>\n @if (workflow) {\n <span [class]=\"workflow.status | flowWorkflowBadge\"\n data-testid=\"flow-workflow-status\">\n {{ 'Flows.WorkflowStatus.' + workflow.status | transloco }}\n </span>\n }\n </div>\n <div class=\"d-flex flex-wrap align-items-center gap-2\"\n data-testid=\"flow-versions-actions\">\n @if (workflow) {\n <pw-flows-workflow-status [workflow]=\"workflow\"\n [subscriptionId]=\"subscriptionId\"\n [hasPublished]=\"versions.some(isPublished)\"\n (workflowChange)=\"workflow = $event\"></pw-flows-workflow-status>\n }\n <!-- A published version is read-only, so leaving it loses nothing. -->\n @let draftOpen = editor.open && !(editor.version && isPublished(editor.version));\n <span [pTooltip]=\"draftOpen ? ('Flows.Versions.CloseFirst' | transloco) : ''\"\n tooltipPosition=\"bottom\"\n appendTo=\"body\">\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n data-testid=\"flow-version-create\"\n [disabled]=\"draftOpen\"\n (click)=\"openEditor()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Versions.Create' | transloco }}\n </button>\n </span>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-secondary\"\n (click)=\"back()\">\n <fa-icon [icon]=\"icons.back\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Back' | transloco }}\n </button>\n </div>\n </div>\n</div>\n\n@if (loading) {\n<div class=\"mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"5\" [showCaption]=\"false\" />\n</div>\n}\n\n@if (!loading) {\n@if (notFound) {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Versions.NotFound' | transloco\"></pw-no-data>\n} @else {\n@if (versions.length > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table [value]=\"versions\">\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Version' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.State' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Published' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Versions.Column.Created' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-version>\n <tr>\n <td data-head=\"Version\">{{ version.version }}</td>\n <td data-head=\"State\">\n <span [class]=\"badgeClass(version)\">\n {{ (isPublished(version) ? 'Flows.Versions.State.Published' : 'Flows.Versions.State.Draft') | transloco }}\n </span>\n </td>\n <td data-head=\"Published\">\n {{ version.published_at ? (version.published_at | dateFormat) : '—' }}\n </td>\n <td data-head=\"Created\">{{ version.created_at | dateFormat }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"(isPublished(version) ? 'Flows.Versions.Action.View' : 'Flows.Versions.Action.Edit') | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon [class]=\"isPublished(version) ? 'cta1-icon' : 'edit-icon'\"\n [icon]=\"isPublished(version) ? icons.inspect : icons.edit\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"(isPublished(version) ? 'Flows.Versions.Action.View' : 'Flows.Versions.Action.Edit') | transloco\"\n (click)=\"openEditor(version)\"\n (keydown.enter)=\"openEditor(version)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Versions.Action.Duplicate' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.duplicate\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Versions.Action.Duplicate' | transloco\"\n (click)=\"duplicate(version)\"\n (keydown.enter)=\"duplicate(version)\"></fa-icon>\n </li>\n <!-- Hiding this is courtesy; protect_endpoint! is the control. -->\n @if (!isPublished(version) && canPublish) {\n <li [pTooltip]=\"'Flows.Versions.Action.Publish' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.publish\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Versions.Action.Publish' | transloco\"\n (click)=\"publish(version)\"\n (keydown.enter)=\"publish(version)\"></fa-icon>\n </li>\n }\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"versions.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Versions.Empty' | transloco\" [description]=\"'Flows.Versions.EmptyDescription' | transloco\"></pw-no-data>\n}\n\n@if (editor.open) {\n<pw-flows-version-editor [version]=\"editor.version\"\n [duplicateOf]=\"editor.duplicateOf\"\n [workflowId]=\"workflowId\"\n [subscriptionId]=\"subscriptionId\"\n [check]=\"editor.check\"\n (saved)=\"onVersionSaved()\"\n (cancelled)=\"editor.close()\">\n</pw-flows-version-editor>\n}\n}\n}\n",
|
|
6894
7347
|
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.pw-versions-subject{margin-left:.5rem;color:#5a6473;font-weight:400}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}\n"]
|
|
6895
7348
|
}]
|
|
6896
7349
|
}],
|
|
@@ -7035,7 +7488,7 @@ var FlowsWorkflowsComponent = class FlowsWorkflowsComponent extends AppBaseCompo
|
|
|
7035
7488
|
selector: "pw-flows-workflows",
|
|
7036
7489
|
usesInheritance: true,
|
|
7037
7490
|
ngImport: i0,
|
|
7038
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Workflows.Title' | transloco }}</h2>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"createWorkflow()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Create' | transloco }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n<pw-skeleton-table [rows]=\"8\" [columns]=\"5\" [showCaption]=\"true\" />\n}\n\n@if (!loading) {\n@if (totalRecordsUnFilter > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table #dt\n [value]=\"workflows\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n filterDelay=\"1000\">\n <ng-template #caption>\n <div class=\"search-filter\">\n <div class=\"col-12 col-sm-4\">\n <p-select inputId=\"flows-workflows-status\"\n [options]=\"statusOptions\"\n optionValue=\"value\"\n [placeholder]=\"'Flows.Workflows.Filter.Status' | transloco\"\n [showClear]=\"true\"\n [(ngModel)]=\"status\"\n (onChange)=\"filterByStatus($event.value)\"\n appendTo=\"body\">\n </p-select>\n </div>\n <!-- No ngModel — onLazyLoad is the single writer of searchText. -->\n <div class=\"text-end\">\n <label for=\"flows-workflows-search\"\n class=\"visually-hidden\">{{ 'Flows.Workflows.Filter.SearchLabel' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><fa-icon [icon]=\"icons.search\"\n aria-hidden=\"true\"></fa-icon></p-inputicon>\n <input #searchInput\n type=\"text\"\n id=\"flows-workflows-search\"\n name=\"flows-workflows-search\"\n pInputText\n [placeholder]=\"'Flows.Workflows.Filter.Search' | transloco\"\n (input)=\"dt.filterGlobal(searchInput.value, 'contains')\" />\n </p-iconfield>\n </div>\n </div>\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Name' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Description' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Created' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-workflow>\n <tr>\n <td data-head=\"Name\">\n <a [routerLink]=\"[workflow.id, 'versions']\">{{ workflow.name }}</a>\n </td>\n <td data-head=\"Description\">{{ workflow.description || '—' }}</td>\n <td data-head=\"Status\">\n <span [class]=\"badgeClass(workflow.status)\">\n {{ 'Flows.WorkflowStatus.' + workflow.status | transloco }}\n </span>\n </td>\n <td data-head=\"Created\">{{ workflow.created_at | dateFormat }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"'Flows.Workflows.Action.Versions' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.versions\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Versions' | transloco\"\n (click)=\"openVersions(workflow)\"\n (keydown.enter)=\"openVersions(workflow)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Workflows.Action.Edit' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"edit-icon\"\n [icon]=\"icons.edit\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Edit' | transloco\"\n (click)=\"editWorkflow(workflow)\"\n (keydown.enter)=\"editWorkflow(workflow)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Workflows.Action.Delete' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"delete-icon\"\n [icon]=\"icons.delete\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Delete' | transloco\"\n (click)=\"deleteWorkflow(workflow)\"\n (keydown.enter)=\"deleteWorkflow(workflow)\"></fa-icon>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"workflows.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Workflows.Empty' | transloco\" [description]=\"'Flows.Workflows.EmptyDescription' | transloco\"></pw-no-data>\n}\n}\n",
|
|
7491
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Workflows.Title' | transloco }}</h2>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"createWorkflow()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Create' | transloco }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n<div class=\"mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"5\" [showCaption]=\"true\" />\n</div>\n}\n\n@if (!loading) {\n@if (totalRecordsUnFilter > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table #dt\n [value]=\"workflows\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n filterDelay=\"1000\">\n <ng-template #caption>\n <div class=\"search-filter\">\n <div class=\"col-12 col-sm-4\">\n <p-select inputId=\"flows-workflows-status\"\n [options]=\"statusOptions\"\n optionValue=\"value\"\n [placeholder]=\"'Flows.Workflows.Filter.Status' | transloco\"\n [showClear]=\"true\"\n [(ngModel)]=\"status\"\n (onChange)=\"filterByStatus($event.value)\"\n appendTo=\"body\">\n </p-select>\n </div>\n <!-- No ngModel — onLazyLoad is the single writer of searchText. -->\n <div class=\"text-end\">\n <label for=\"flows-workflows-search\"\n class=\"visually-hidden\">{{ 'Flows.Workflows.Filter.SearchLabel' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><fa-icon [icon]=\"icons.search\"\n aria-hidden=\"true\"></fa-icon></p-inputicon>\n <input #searchInput\n type=\"text\"\n id=\"flows-workflows-search\"\n name=\"flows-workflows-search\"\n pInputText\n [placeholder]=\"'Flows.Workflows.Filter.Search' | transloco\"\n (input)=\"dt.filterGlobal(searchInput.value, 'contains')\" />\n </p-iconfield>\n </div>\n </div>\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Name' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Description' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Created' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-workflow>\n <tr>\n <td data-head=\"Name\">\n <a [routerLink]=\"[workflow.id, 'versions']\">{{ workflow.name }}</a>\n </td>\n <td data-head=\"Description\">{{ workflow.description || '—' }}</td>\n <td data-head=\"Status\">\n <span [class]=\"badgeClass(workflow.status)\">\n {{ 'Flows.WorkflowStatus.' + workflow.status | transloco }}\n </span>\n </td>\n <td data-head=\"Created\">{{ workflow.created_at | dateFormat }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"'Flows.Workflows.Action.Versions' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.versions\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Versions' | transloco\"\n (click)=\"openVersions(workflow)\"\n (keydown.enter)=\"openVersions(workflow)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Workflows.Action.Edit' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"edit-icon\"\n [icon]=\"icons.edit\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Edit' | transloco\"\n (click)=\"editWorkflow(workflow)\"\n (keydown.enter)=\"editWorkflow(workflow)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Workflows.Action.Delete' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"delete-icon\"\n [icon]=\"icons.delete\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Delete' | transloco\"\n (click)=\"deleteWorkflow(workflow)\"\n (keydown.enter)=\"deleteWorkflow(workflow)\"></fa-icon>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"workflows.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Workflows.Empty' | transloco\" [description]=\"'Flows.Workflows.EmptyDescription' | transloco\"></pw-no-data>\n}\n}\n",
|
|
7039
7492
|
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}.primeng-datatable-container td[data-head=Name]{min-width:200px;font-weight:600;color:#1a1d21}.primeng-datatable-container td[data-head=Description]{min-width:220px;color:#5a6473}\n"],
|
|
7040
7493
|
dependencies: [
|
|
7041
7494
|
{
|
|
@@ -7402,7 +7855,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
7402
7855
|
args: [{
|
|
7403
7856
|
selector: "pw-flows-workflows",
|
|
7404
7857
|
standalone: false,
|
|
7405
|
-
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Workflows.Title' | transloco }}</h2>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"createWorkflow()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Create' | transloco }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n<pw-skeleton-table [rows]=\"8\" [columns]=\"5\" [showCaption]=\"true\" />\n}\n\n@if (!loading) {\n@if (totalRecordsUnFilter > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table #dt\n [value]=\"workflows\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n filterDelay=\"1000\">\n <ng-template #caption>\n <div class=\"search-filter\">\n <div class=\"col-12 col-sm-4\">\n <p-select inputId=\"flows-workflows-status\"\n [options]=\"statusOptions\"\n optionValue=\"value\"\n [placeholder]=\"'Flows.Workflows.Filter.Status' | transloco\"\n [showClear]=\"true\"\n [(ngModel)]=\"status\"\n (onChange)=\"filterByStatus($event.value)\"\n appendTo=\"body\">\n </p-select>\n </div>\n <!-- No ngModel — onLazyLoad is the single writer of searchText. -->\n <div class=\"text-end\">\n <label for=\"flows-workflows-search\"\n class=\"visually-hidden\">{{ 'Flows.Workflows.Filter.SearchLabel' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><fa-icon [icon]=\"icons.search\"\n aria-hidden=\"true\"></fa-icon></p-inputicon>\n <input #searchInput\n type=\"text\"\n id=\"flows-workflows-search\"\n name=\"flows-workflows-search\"\n pInputText\n [placeholder]=\"'Flows.Workflows.Filter.Search' | transloco\"\n (input)=\"dt.filterGlobal(searchInput.value, 'contains')\" />\n </p-iconfield>\n </div>\n </div>\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Name' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Description' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Created' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-workflow>\n <tr>\n <td data-head=\"Name\">\n <a [routerLink]=\"[workflow.id, 'versions']\">{{ workflow.name }}</a>\n </td>\n <td data-head=\"Description\">{{ workflow.description || '—' }}</td>\n <td data-head=\"Status\">\n <span [class]=\"badgeClass(workflow.status)\">\n {{ 'Flows.WorkflowStatus.' + workflow.status | transloco }}\n </span>\n </td>\n <td data-head=\"Created\">{{ workflow.created_at | dateFormat }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"'Flows.Workflows.Action.Versions' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.versions\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Versions' | transloco\"\n (click)=\"openVersions(workflow)\"\n (keydown.enter)=\"openVersions(workflow)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Workflows.Action.Edit' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"edit-icon\"\n [icon]=\"icons.edit\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Edit' | transloco\"\n (click)=\"editWorkflow(workflow)\"\n (keydown.enter)=\"editWorkflow(workflow)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Workflows.Action.Delete' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"delete-icon\"\n [icon]=\"icons.delete\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Delete' | transloco\"\n (click)=\"deleteWorkflow(workflow)\"\n (keydown.enter)=\"deleteWorkflow(workflow)\"></fa-icon>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"workflows.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Workflows.Empty' | transloco\" [description]=\"'Flows.Workflows.EmptyDescription' | transloco\"></pw-no-data>\n}\n}\n",
|
|
7858
|
+
template: "<div class=\"row\">\n <div class=\"col-12 d-flex justify-content-between align-items-center\">\n <h2 class=\"card-title p-0\">{{ 'Flows.Workflows.Title' | transloco }}</h2>\n <button type=\"button\"\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"createWorkflow()\">\n <fa-icon [icon]=\"icons.create\"\n aria-hidden=\"true\"></fa-icon>\n {{ 'Flows.Workflows.Create' | transloco }}\n </button>\n </div>\n</div>\n\n@if (loading) {\n<div class=\"mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"5\" [showCaption]=\"true\" />\n</div>\n}\n\n@if (!loading) {\n@if (totalRecordsUnFilter > 0) {\n<div class=\"primeng-datatable-container table-responsive mt-3\">\n <p-table #dt\n [value]=\"workflows\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n [lazy]=\"true\"\n [totalRecords]=\"totalRecords\"\n (onLazyLoad)=\"onLazyLoad($event)\"\n filterDelay=\"1000\">\n <ng-template #caption>\n <div class=\"search-filter\">\n <div class=\"col-12 col-sm-4\">\n <p-select inputId=\"flows-workflows-status\"\n [options]=\"statusOptions\"\n optionValue=\"value\"\n [placeholder]=\"'Flows.Workflows.Filter.Status' | transloco\"\n [showClear]=\"true\"\n [(ngModel)]=\"status\"\n (onChange)=\"filterByStatus($event.value)\"\n appendTo=\"body\">\n </p-select>\n </div>\n <!-- No ngModel — onLazyLoad is the single writer of searchText. -->\n <div class=\"text-end\">\n <label for=\"flows-workflows-search\"\n class=\"visually-hidden\">{{ 'Flows.Workflows.Filter.SearchLabel' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><fa-icon [icon]=\"icons.search\"\n aria-hidden=\"true\"></fa-icon></p-inputicon>\n <input #searchInput\n type=\"text\"\n id=\"flows-workflows-search\"\n name=\"flows-workflows-search\"\n pInputText\n [placeholder]=\"'Flows.Workflows.Filter.Search' | transloco\"\n (input)=\"dt.filterGlobal(searchInput.value, 'contains')\" />\n </p-iconfield>\n </div>\n </div>\n </ng-template>\n\n <ng-template #header>\n <tr>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Name' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Description' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Status' | transloco }}</th>\n <th scope=\"col\">{{ 'Flows.Workflows.Column.Created' | transloco }}</th>\n <th scope=\"col\"\n class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n\n <ng-template #body\n let-workflow>\n <tr>\n <td data-head=\"Name\">\n <a [routerLink]=\"[workflow.id, 'versions']\">{{ workflow.name }}</a>\n </td>\n <td data-head=\"Description\">{{ workflow.description || '—' }}</td>\n <td data-head=\"Status\">\n <span [class]=\"badgeClass(workflow.status)\">\n {{ 'Flows.WorkflowStatus.' + workflow.status | transloco }}\n </span>\n </td>\n <td data-head=\"Created\">{{ workflow.created_at | dateFormat }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline\">\n <li [pTooltip]=\"'Flows.Workflows.Action.Versions' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"cta1-icon\"\n [icon]=\"icons.versions\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Versions' | transloco\"\n (click)=\"openVersions(workflow)\"\n (keydown.enter)=\"openVersions(workflow)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Workflows.Action.Edit' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"edit-icon\"\n [icon]=\"icons.edit\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Edit' | transloco\"\n (click)=\"editWorkflow(workflow)\"\n (keydown.enter)=\"editWorkflow(workflow)\"></fa-icon>\n </li>\n <li [pTooltip]=\"'Flows.Workflows.Action.Delete' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon class=\"delete-icon\"\n [icon]=\"icons.delete\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"'Flows.Workflows.Action.Delete' | transloco\"\n (click)=\"deleteWorkflow(workflow)\"\n (keydown.enter)=\"deleteWorkflow(workflow)\"></fa-icon>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n\n <pw-records-summary [showing]=\"workflows.length\"\n [total]=\"totalRecords\" />\n</div>\n} @else {\n<pw-no-data [withImage]=\"true\" [message]=\"'Flows.Workflows.Empty' | transloco\" [description]=\"'Flows.Workflows.EmptyDescription' | transloco\"></pw-no-data>\n}\n}\n",
|
|
7406
7859
|
styles: [".pw-flow-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.01em;white-space:nowrap}.pw-flow-badge:before{content:\"\";width:6px;height:6px;border-radius:50%;background-color:currentColor;flex:0 0 auto}.pw-flow-badge--success{background-color:#e6f4ec;color:#0f6b3a}.pw-flow-badge--danger{background-color:#fbeae8;color:#c0392b}.pw-flow-badge--warning{background-color:#fbf1e3;color:#8a5a00}.pw-flow-badge--info{background-color:#e6f3f6;color:#1f6378}.pw-flow-badge--muted{background-color:#eef0f3;color:#5a6473}td[data-head=Run],td[data-head=Workflow],td[data-head=Version],td[data-head=Attempts],td[data-head=Duration]{color:#5a6473;font-variant-numeric:tabular-nums;white-space:nowrap}td[data-head=Node]{min-width:180px;font-weight:600;color:#1a1d21;overflow-wrap:anywhere}.primeng-datatable-container table tbody tr:hover{background-color:#f5f7fa}.primeng-datatable-container td[data-head=Name]{min-width:200px;font-weight:600;color:#1a1d21}.primeng-datatable-container td[data-head=Description]{min-width:220px;color:#5a6473}\n"]
|
|
7407
7860
|
}]
|
|
7408
7861
|
}],
|
|
@@ -7539,12 +7992,15 @@ var FlowsPrivateModule = class FlowsPrivateModule {
|
|
|
7539
7992
|
FlowsJsonFieldComponent,
|
|
7540
7993
|
FlowsConditionFieldComponent,
|
|
7541
7994
|
FlowsPairsFieldComponent,
|
|
7995
|
+
FlowsChoicesFieldComponent,
|
|
7996
|
+
FlowsParamFieldComponent,
|
|
7542
7997
|
FlowsMemberFieldComponent,
|
|
7543
7998
|
FlowsRetryFieldComponent,
|
|
7544
7999
|
FlowsAvailableFieldsComponent,
|
|
7545
8000
|
FlowsUnknownFieldsComponent,
|
|
7546
8001
|
FlowsWorkflowStatusComponent,
|
|
7547
|
-
FlowWorkflowBadgePipe
|
|
8002
|
+
FlowWorkflowBadgePipe,
|
|
8003
|
+
FlowJsonLinesPipe
|
|
7548
8004
|
],
|
|
7549
8005
|
imports: [
|
|
7550
8006
|
PwStickyActionsComponent,
|
|
@@ -7659,12 +8115,15 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
7659
8115
|
FlowsJsonFieldComponent,
|
|
7660
8116
|
FlowsConditionFieldComponent,
|
|
7661
8117
|
FlowsPairsFieldComponent,
|
|
8118
|
+
FlowsChoicesFieldComponent,
|
|
8119
|
+
FlowsParamFieldComponent,
|
|
7662
8120
|
FlowsMemberFieldComponent,
|
|
7663
8121
|
FlowsRetryFieldComponent,
|
|
7664
8122
|
FlowsAvailableFieldsComponent,
|
|
7665
8123
|
FlowsUnknownFieldsComponent,
|
|
7666
8124
|
FlowsWorkflowStatusComponent,
|
|
7667
|
-
FlowWorkflowBadgePipe
|
|
8125
|
+
FlowWorkflowBadgePipe,
|
|
8126
|
+
FlowJsonLinesPipe
|
|
7668
8127
|
]
|
|
7669
8128
|
}]
|
|
7670
8129
|
}]
|