@posiwise/flows 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/posiwise-flows.mjs +1539 -877
- package/fesm2022/posiwise-flows.mjs.map +1 -1
- package/package.json +1 -1
- package/types/posiwise-flows.d.ts +226 -35
|
@@ -23,7 +23,7 @@ import { CommonModule } from "@angular/common";
|
|
|
23
23
|
import * as i2$4 from "@jsverse/transloco";
|
|
24
24
|
import { TRANSLOCO_SCOPE } from "@jsverse/transloco";
|
|
25
25
|
import * as i1$1 from "primeng/tooltip";
|
|
26
|
-
import * as
|
|
26
|
+
import * as i14 from "@posiwise/pipes";
|
|
27
27
|
import { PipesModule } from "@posiwise/pipes";
|
|
28
28
|
import * as i3$1 from "@angular/forms";
|
|
29
29
|
import { FormsModule, ReactiveFormsModule, UntypedFormBuilder, Validators } from "@angular/forms";
|
|
@@ -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));
|
|
@@ -535,30 +559,105 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
535
559
|
nodeIds: [{ type: Input }]
|
|
536
560
|
}
|
|
537
561
|
});
|
|
562
|
+
const FLOWS_SERVICE = "products-api";
|
|
563
|
+
const PREFIX$1 = "Flows.Run.Source.";
|
|
564
|
+
const FLOWS_SYSTEMS = ["smtp_mailer"];
|
|
565
|
+
function flowErrorSourceText(source, product) {
|
|
566
|
+
if (!source?.service) return null;
|
|
567
|
+
if (source.service === "products-api") {
|
|
568
|
+
if (source.system && FLOWS_SYSTEMS.includes(source.system)) return {
|
|
569
|
+
key: PREFIX$1 + "ViaFlows." + source.system,
|
|
570
|
+
params: {}
|
|
571
|
+
};
|
|
572
|
+
return source.system ? {
|
|
573
|
+
key: PREFIX$1 + "SystemViaFlows",
|
|
574
|
+
params: { system: source.system }
|
|
575
|
+
} : {
|
|
576
|
+
key: PREFIX$1 + "Flows",
|
|
577
|
+
params: {}
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
if (source.system) return product ? {
|
|
581
|
+
key: PREFIX$1 + "SystemVia",
|
|
582
|
+
params: {
|
|
583
|
+
system: source.system,
|
|
584
|
+
product
|
|
585
|
+
}
|
|
586
|
+
} : {
|
|
587
|
+
key: PREFIX$1 + "System",
|
|
588
|
+
params: { system: source.system }
|
|
589
|
+
};
|
|
590
|
+
return product ? {
|
|
591
|
+
key: PREFIX$1 + "Product",
|
|
592
|
+
params: { product }
|
|
593
|
+
} : {
|
|
594
|
+
key: PREFIX$1 + "OtherService",
|
|
595
|
+
params: {}
|
|
596
|
+
};
|
|
597
|
+
}
|
|
538
598
|
const PREFIX = "Flows.Run.Errors.";
|
|
539
599
|
const BY_CODE = {
|
|
540
600
|
awaiting_timeout: "Timeout",
|
|
541
601
|
no_credentials: "NoCredentials",
|
|
542
602
|
no_crm: "NoCrm",
|
|
603
|
+
crm_sync_failed: "CrmSyncFailed",
|
|
543
604
|
output_too_large: "OutputTooLarge",
|
|
605
|
+
interrupted: "Interrupted",
|
|
544
606
|
unsupported_action: "CannotRunHere",
|
|
545
607
|
unsupported_connector: "CannotRunHere",
|
|
546
608
|
unsupported_request: "CannotRunHere",
|
|
547
609
|
unsupported_shard: "CannotRunHere",
|
|
548
610
|
task_request_failed: "NotSent",
|
|
549
611
|
task_received_no_items: "NoItems",
|
|
612
|
+
task_failed: "TaskFailed",
|
|
613
|
+
ai_not_configured: "AiNotConfigured",
|
|
614
|
+
ai_decide_failed: "AiFailed",
|
|
615
|
+
ai_decide_received_no_items: "NoItems",
|
|
550
616
|
email_recipients_invalid: "EmailRecipients",
|
|
551
617
|
no_shard_for_email: "EmailNotSent",
|
|
552
|
-
delivery_failed: "
|
|
618
|
+
delivery_failed: "NotDelivered",
|
|
553
619
|
user_not_in_subscription: "UserNotInSubscription",
|
|
620
|
+
no_context_for_user_resolution: "NoContext",
|
|
554
621
|
split_out_requires_a_field: "FieldNotSet",
|
|
555
622
|
aggregate_requires_a_field: "FieldNotSet",
|
|
556
623
|
split_out_field_missing: "FieldMissing",
|
|
557
624
|
split_out_field_not_a_list: "FieldNotAList",
|
|
625
|
+
split_out_element_not_an_object: "FieldNotRecords",
|
|
558
626
|
template_path_missing: "PlaceholderMissing",
|
|
627
|
+
template_too_many_placeholders: "TooManyPlaceholders",
|
|
559
628
|
set_fields_requires_an_object: "SetFieldsInvalid",
|
|
560
629
|
set_fields_received_a_non_object_item: "SetFieldsInvalid",
|
|
561
|
-
evaluation_failed: "ConditionFailed"
|
|
630
|
+
evaluation_failed: "ConditionFailed",
|
|
631
|
+
unreachable_nodes: "UnreachableNodes",
|
|
632
|
+
unsupported_node_type: "NodeUnavailable",
|
|
633
|
+
unsupported_merge_mode: "MergeModeUnsupported"
|
|
634
|
+
};
|
|
635
|
+
const ITEM_LIMITS = {
|
|
636
|
+
task_too_many_items: "50",
|
|
637
|
+
ai_decide_too_many_items: "20",
|
|
638
|
+
email_too_many_items: "50",
|
|
639
|
+
split_out_too_many_items: "500",
|
|
640
|
+
aggregate_too_many_items: "500"
|
|
641
|
+
};
|
|
642
|
+
const SMTP_FIELDS = [
|
|
643
|
+
"address",
|
|
644
|
+
"user_name",
|
|
645
|
+
"password",
|
|
646
|
+
"port",
|
|
647
|
+
"from_email",
|
|
648
|
+
"no_reply_email"
|
|
649
|
+
];
|
|
650
|
+
const NAMED = {
|
|
651
|
+
SignInRefused: "system",
|
|
652
|
+
NotFound: "system",
|
|
653
|
+
RateLimited: "system",
|
|
654
|
+
ServiceError: "system",
|
|
655
|
+
CallFailed: "system",
|
|
656
|
+
OutputTooLarge: "system",
|
|
657
|
+
Timeout: "product",
|
|
658
|
+
NotSent: "product",
|
|
659
|
+
CannotRunHere: "product",
|
|
660
|
+
NoCredentials: "product"
|
|
562
661
|
};
|
|
563
662
|
function callFailure(detail) {
|
|
564
663
|
const status = Number(/\b([45]\d\d)\b/.exec(detail)?.[1]);
|
|
@@ -567,33 +666,78 @@ function callFailure(detail) {
|
|
|
567
666
|
if (status === 429) return "RateLimited";
|
|
568
667
|
return status >= 500 ? "ServiceError" : "CallFailed";
|
|
569
668
|
}
|
|
570
|
-
function
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
669
|
+
function smtpNotConfigured(detail) {
|
|
670
|
+
const missing = detail.split(",").map((field) => field.trim());
|
|
671
|
+
return {
|
|
672
|
+
key: PREFIX + "SmtpNotConfigured",
|
|
673
|
+
params: {},
|
|
674
|
+
list: SMTP_FIELDS.filter((field) => missing.includes(field)).map((field) => PREFIX + "SmtpField." + field)
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
function byCode(code, detail, error) {
|
|
575
678
|
if (code === "integration_call_failed") return {
|
|
576
679
|
key: PREFIX + callFailure(detail),
|
|
577
680
|
params: {}
|
|
578
681
|
};
|
|
682
|
+
if (code === "smtp_not_configured") return smtpNotConfigured(detail);
|
|
683
|
+
if (code === "email_delivery_failed") {
|
|
684
|
+
const refused = /authentication/i.test(detail);
|
|
685
|
+
return {
|
|
686
|
+
key: PREFIX + (refused ? "SmtpSignInRefused" : "SmtpFailed"),
|
|
687
|
+
params: {}
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
if (ITEM_LIMITS[code]) return {
|
|
691
|
+
key: PREFIX + "TooManyItems",
|
|
692
|
+
params: { limit: ITEM_LIMITS[code] }
|
|
693
|
+
};
|
|
579
694
|
const known = BY_CODE[code];
|
|
580
|
-
|
|
695
|
+
if (known) return {
|
|
581
696
|
key: PREFIX + known,
|
|
582
697
|
params: { detail }
|
|
698
|
+
};
|
|
699
|
+
return /^[a-z]+(_[a-z]+)+$/.test(code) ? {
|
|
700
|
+
key: PREFIX + "UnknownCode",
|
|
701
|
+
params: { detail: error }
|
|
583
702
|
} : {
|
|
584
703
|
key: PREFIX + "Unknown",
|
|
585
704
|
params: { detail: error }
|
|
586
705
|
};
|
|
587
706
|
}
|
|
707
|
+
function named(text, context) {
|
|
708
|
+
const name = text.key.slice(17);
|
|
709
|
+
const needs = NAMED[name];
|
|
710
|
+
const value = needs ? context?.[needs] : null;
|
|
711
|
+
return value ? {
|
|
712
|
+
...text,
|
|
713
|
+
key: text.key + "Named",
|
|
714
|
+
params: {
|
|
715
|
+
...text.params,
|
|
716
|
+
[needs]: value
|
|
717
|
+
}
|
|
718
|
+
} : text;
|
|
719
|
+
}
|
|
720
|
+
function flowStepErrorText(error, context) {
|
|
721
|
+
if (!error) return null;
|
|
722
|
+
const colon = error.indexOf(":");
|
|
723
|
+
return named(byCode((colon === -1 ? error : error.slice(0, colon)).trim(), colon === -1 ? "" : error.slice(colon + 1).trim(), error), context);
|
|
724
|
+
}
|
|
588
725
|
var FlowsStepErrorComponent = class FlowsStepErrorComponent {
|
|
589
726
|
constructor() {
|
|
590
727
|
this.error = null;
|
|
591
728
|
this.retrying = false;
|
|
729
|
+
this.source = null;
|
|
730
|
+
this.product = null;
|
|
592
731
|
this.icons = FLOWS_ICONS;
|
|
593
732
|
this.text = null;
|
|
733
|
+
this.sourceText = null;
|
|
594
734
|
}
|
|
595
735
|
ngOnChanges() {
|
|
596
|
-
this.text = flowStepErrorText(this.error
|
|
736
|
+
this.text = flowStepErrorText(this.error, {
|
|
737
|
+
system: this.source?.system,
|
|
738
|
+
product: this.product
|
|
739
|
+
});
|
|
740
|
+
this.sourceText = this.text ? flowErrorSourceText(this.source, this.product) : null;
|
|
597
741
|
}
|
|
598
742
|
static {
|
|
599
743
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
@@ -614,12 +758,14 @@ var FlowsStepErrorComponent = class FlowsStepErrorComponent {
|
|
|
614
758
|
selector: "pw-flows-step-error",
|
|
615
759
|
inputs: {
|
|
616
760
|
error: "error",
|
|
617
|
-
retrying: "retrying"
|
|
761
|
+
retrying: "retrying",
|
|
762
|
+
source: "source",
|
|
763
|
+
product: "product"
|
|
618
764
|
},
|
|
619
765
|
usesOnChanges: true,
|
|
620
766
|
ngImport: i0,
|
|
621
|
-
template: "@if (text) {\n@let reason = text.key | transloco: text.params;\n<span class=\"pw-step-error\"\n [class.is-retrying]=\"retrying\"\n [pTooltip]=\"error\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon [icon]=\"retrying ? icons.warning : icons.error\"\n aria-hidden=\"true\"></fa-icon>\n</span>\n<small class=\"pw-step-error__text\"\n [class.is-retrying]=\"retrying\"\n data-testid=\"flow-step-error-text\">\n {{ retrying ? ('Flows.Run.Errors.LastTry' | transloco: { reason }) : reason }}\n</small>\n}\n",
|
|
622
|
-
styles: [":host{display:contents}.pw-step-error{margin-left:6px;color:#c0392b;cursor:help}.pw-step-
|
|
767
|
+
template: "@if (text) {\n@let reason = text.key | transloco: text.params;\n<span class=\"pw-step-error\"\n [class.is-retrying]=\"retrying\"\n [pTooltip]=\"error\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon [icon]=\"retrying ? icons.warning : icons.error\"\n aria-hidden=\"true\"></fa-icon>\n</span>\n<span class=\"pw-step-error__body\">\n<small class=\"pw-step-error__text\"\n [class.is-retrying]=\"retrying\"\n data-testid=\"flow-step-error-text\">\n {{ retrying ? ('Flows.Run.Errors.LastTry' | transloco: { reason }) : reason }}\n</small>\n@if (text.list?.length) {\n<small class=\"pw-step-error__text\"\n data-testid=\"flow-step-error-missing\">\n {{ 'Flows.Run.Errors.Missing' | transloco }}\n @for (item of text.list; track item; let last = $last) { {{ item | transloco }}{{ last ? '' : ', ' }} }\n</small>\n}\n@if (sourceText) {\n<small class=\"pw-step-error__source\"\n data-testid=\"flow-step-error-source\">\n {{ sourceText.key | transloco: sourceText.params }}\n</small>\n}\n</span>\n}\n",
|
|
768
|
+
styles: [":host{display:contents}.pw-step-error{margin-left:6px;color:#c0392b;cursor:help}.pw-step-error__body{display:block;max-width:280px}.pw-step-error__text{display:block;margin-top:4px;color:#c0392b;white-space:normal;overflow-wrap:break-word}.pw-step-error__source{display:block;margin-top:2px;color:#6c757d;white-space:normal;overflow-wrap:break-word}.pw-step-error.is-retrying,.pw-step-error__text.is-retrying{color:#8a6d00}\n"],
|
|
623
769
|
dependencies: [
|
|
624
770
|
{
|
|
625
771
|
kind: "directive",
|
|
@@ -705,14 +851,174 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
705
851
|
args: [{
|
|
706
852
|
selector: "pw-flows-step-error",
|
|
707
853
|
standalone: false,
|
|
708
|
-
template: "@if (text) {\n@let reason = text.key | transloco: text.params;\n<span class=\"pw-step-error\"\n [class.is-retrying]=\"retrying\"\n [pTooltip]=\"error\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon [icon]=\"retrying ? icons.warning : icons.error\"\n aria-hidden=\"true\"></fa-icon>\n</span>\n<small class=\"pw-step-error__text\"\n [class.is-retrying]=\"retrying\"\n data-testid=\"flow-step-error-text\">\n {{ retrying ? ('Flows.Run.Errors.LastTry' | transloco: { reason }) : reason }}\n</small>\n}\n",
|
|
709
|
-
styles: [":host{display:contents}.pw-step-error{margin-left:6px;color:#c0392b;cursor:help}.pw-step-
|
|
854
|
+
template: "@if (text) {\n@let reason = text.key | transloco: text.params;\n<span class=\"pw-step-error\"\n [class.is-retrying]=\"retrying\"\n [pTooltip]=\"error\"\n tooltipPosition=\"top\"\n appendTo=\"body\">\n <fa-icon [icon]=\"retrying ? icons.warning : icons.error\"\n aria-hidden=\"true\"></fa-icon>\n</span>\n<span class=\"pw-step-error__body\">\n<small class=\"pw-step-error__text\"\n [class.is-retrying]=\"retrying\"\n data-testid=\"flow-step-error-text\">\n {{ retrying ? ('Flows.Run.Errors.LastTry' | transloco: { reason }) : reason }}\n</small>\n@if (text.list?.length) {\n<small class=\"pw-step-error__text\"\n data-testid=\"flow-step-error-missing\">\n {{ 'Flows.Run.Errors.Missing' | transloco }}\n @for (item of text.list; track item; let last = $last) { {{ item | transloco }}{{ last ? '' : ', ' }} }\n</small>\n}\n@if (sourceText) {\n<small class=\"pw-step-error__source\"\n data-testid=\"flow-step-error-source\">\n {{ sourceText.key | transloco: sourceText.params }}\n</small>\n}\n</span>\n}\n",
|
|
855
|
+
styles: [":host{display:contents}.pw-step-error{margin-left:6px;color:#c0392b;cursor:help}.pw-step-error__body{display:block;max-width:280px}.pw-step-error__text{display:block;margin-top:4px;color:#c0392b;white-space:normal;overflow-wrap:break-word}.pw-step-error__source{display:block;margin-top:2px;color:#6c757d;white-space:normal;overflow-wrap:break-word}.pw-step-error.is-retrying,.pw-step-error__text.is-retrying{color:#8a6d00}\n"]
|
|
856
|
+
}]
|
|
857
|
+
}],
|
|
858
|
+
propDecorators: {
|
|
859
|
+
error: [{ type: Input }],
|
|
860
|
+
retrying: [{ type: Input }],
|
|
861
|
+
source: [{ type: Input }],
|
|
862
|
+
product: [{ type: Input }]
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
var FlowsRunErrorComponent = class FlowsRunErrorComponent {
|
|
866
|
+
constructor() {
|
|
867
|
+
this.error = null;
|
|
868
|
+
this.steps = [];
|
|
869
|
+
this.nodeTypes = {};
|
|
870
|
+
this.definitions = {};
|
|
871
|
+
this.labelKey = flowNodeLabelKey;
|
|
872
|
+
this.text = null;
|
|
873
|
+
this.sourceText = null;
|
|
874
|
+
}
|
|
875
|
+
ngOnChanges() {
|
|
876
|
+
this.step = this.steps.find((step) => step.status === "failed" && step.error === this.error);
|
|
877
|
+
this.type = this.step ? this.nodeTypes[this.step.node_id] : void 0;
|
|
878
|
+
const source = this.source();
|
|
879
|
+
this.text = flowStepErrorText(this.error, {
|
|
880
|
+
system: source?.system,
|
|
881
|
+
product: this.product()
|
|
882
|
+
});
|
|
883
|
+
this.sourceText = this.text ? flowErrorSourceText(source, this.product()) : null;
|
|
884
|
+
}
|
|
885
|
+
source() {
|
|
886
|
+
return this.step ? this.step.error_source : { service: FLOWS_SERVICE };
|
|
887
|
+
}
|
|
888
|
+
product() {
|
|
889
|
+
return this.type ? this.definitions[this.type]?.product_key : null;
|
|
890
|
+
}
|
|
891
|
+
static {
|
|
892
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
893
|
+
minVersion: "12.0.0",
|
|
894
|
+
version: "22.2.3",
|
|
895
|
+
ngImport: i0,
|
|
896
|
+
type: FlowsRunErrorComponent,
|
|
897
|
+
deps: [],
|
|
898
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
static {
|
|
902
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
903
|
+
minVersion: "17.0.0",
|
|
904
|
+
version: "22.2.3",
|
|
905
|
+
type: FlowsRunErrorComponent,
|
|
906
|
+
isStandalone: false,
|
|
907
|
+
selector: "pw-flows-run-error",
|
|
908
|
+
inputs: {
|
|
909
|
+
error: "error",
|
|
910
|
+
steps: "steps",
|
|
911
|
+
nodeTypes: "nodeTypes",
|
|
912
|
+
definitions: "definitions"
|
|
913
|
+
},
|
|
914
|
+
usesOnChanges: true,
|
|
915
|
+
ngImport: i0,
|
|
916
|
+
template: "@if (text) {\n<div class=\"pw-run-error\"\n role=\"alert\"\n data-testid=\"flow-run-error\">\n <span class=\"pw-run-error__label\">{{ 'Flows.Run.Meta.Error' | transloco }}</span>\n <span class=\"pw-run-error__message\"\n [pTooltip]=\"error\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n data-testid=\"flow-run-error-text\">{{ text.key | transloco: text.params }}</span>\n @if (text.list?.length) {\n <small class=\"pw-run-error__detail\"\n data-testid=\"flow-run-error-missing\">{{ 'Flows.Run.Errors.Missing' | transloco }}\n @for (item of text.list; track item; let last = $last) { {{ item | transloco }}{{ last ? '' : ', ' }} }</small>\n }\n @if (step) {\n @let key = type ? labelKey(type) : '';\n @let translated = key ? (key | transloco) : '';\n @let name = type ? (translated === key ? (definitions[type]?.label ?? type) : translated) : step.node_id;\n <small class=\"pw-run-error__detail\"\n data-testid=\"flow-run-error-step\">{{ 'Flows.Run.Meta.FailedStep' | transloco: { step: name } }}</small>\n }\n @if (sourceText) {\n <small class=\"pw-run-error__detail\"\n data-testid=\"flow-run-error-source\">{{ sourceText.key | transloco: sourceText.params }}</small>\n }\n</div>\n}\n",
|
|
917
|
+
styles: [".pw-run-error{display:flex;flex-direction:column;gap:2px;background-color:#fbeae8;border:1px solid #f3d3cf;border-radius:6px;padding:10px 12px;margin-bottom:12px}.pw-run-error__label{font-size:11px;font-weight:600;letter-spacing:.01em;color:#c0392b}.pw-run-error__message{color:#1a1d21;overflow-wrap:anywhere;cursor:help}.pw-run-error__detail{color:#6c757d;overflow-wrap:anywhere}\n"],
|
|
918
|
+
dependencies: [{
|
|
919
|
+
kind: "directive",
|
|
920
|
+
type: i1$1.Tooltip,
|
|
921
|
+
selector: "[pTooltip]",
|
|
922
|
+
inputs: [
|
|
923
|
+
"tooltipPosition",
|
|
924
|
+
"tooltipEvent",
|
|
925
|
+
"positionStyle",
|
|
926
|
+
"tooltipStyleClass",
|
|
927
|
+
"tooltipZIndex",
|
|
928
|
+
"escape",
|
|
929
|
+
"showDelay",
|
|
930
|
+
"hideDelay",
|
|
931
|
+
"life",
|
|
932
|
+
"positionTop",
|
|
933
|
+
"positionLeft",
|
|
934
|
+
"autoHide",
|
|
935
|
+
"fitContent",
|
|
936
|
+
"hideOnEscape",
|
|
937
|
+
"showOnEllipsis",
|
|
938
|
+
"pTooltip",
|
|
939
|
+
"tooltipDisabled",
|
|
940
|
+
"tooltipOptions",
|
|
941
|
+
"appendTo",
|
|
942
|
+
"pTooltipPT",
|
|
943
|
+
"pTooltipUnstyled"
|
|
944
|
+
]
|
|
945
|
+
}, {
|
|
946
|
+
kind: "pipe",
|
|
947
|
+
type: i2$4.TranslocoPipe,
|
|
948
|
+
name: "transloco"
|
|
949
|
+
}]
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
};
|
|
953
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
954
|
+
minVersion: "12.0.0",
|
|
955
|
+
version: "22.2.3",
|
|
956
|
+
ngImport: i0,
|
|
957
|
+
type: FlowsRunErrorComponent,
|
|
958
|
+
decorators: [{
|
|
959
|
+
type: Component,
|
|
960
|
+
args: [{
|
|
961
|
+
selector: "pw-flows-run-error",
|
|
962
|
+
standalone: false,
|
|
963
|
+
template: "@if (text) {\n<div class=\"pw-run-error\"\n role=\"alert\"\n data-testid=\"flow-run-error\">\n <span class=\"pw-run-error__label\">{{ 'Flows.Run.Meta.Error' | transloco }}</span>\n <span class=\"pw-run-error__message\"\n [pTooltip]=\"error\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n data-testid=\"flow-run-error-text\">{{ text.key | transloco: text.params }}</span>\n @if (text.list?.length) {\n <small class=\"pw-run-error__detail\"\n data-testid=\"flow-run-error-missing\">{{ 'Flows.Run.Errors.Missing' | transloco }}\n @for (item of text.list; track item; let last = $last) { {{ item | transloco }}{{ last ? '' : ', ' }} }</small>\n }\n @if (step) {\n @let key = type ? labelKey(type) : '';\n @let translated = key ? (key | transloco) : '';\n @let name = type ? (translated === key ? (definitions[type]?.label ?? type) : translated) : step.node_id;\n <small class=\"pw-run-error__detail\"\n data-testid=\"flow-run-error-step\">{{ 'Flows.Run.Meta.FailedStep' | transloco: { step: name } }}</small>\n }\n @if (sourceText) {\n <small class=\"pw-run-error__detail\"\n data-testid=\"flow-run-error-source\">{{ sourceText.key | transloco: sourceText.params }}</small>\n }\n</div>\n}\n",
|
|
964
|
+
styles: [".pw-run-error{display:flex;flex-direction:column;gap:2px;background-color:#fbeae8;border:1px solid #f3d3cf;border-radius:6px;padding:10px 12px;margin-bottom:12px}.pw-run-error__label{font-size:11px;font-weight:600;letter-spacing:.01em;color:#c0392b}.pw-run-error__message{color:#1a1d21;overflow-wrap:anywhere;cursor:help}.pw-run-error__detail{color:#6c757d;overflow-wrap:anywhere}\n"]
|
|
710
965
|
}]
|
|
711
966
|
}],
|
|
712
967
|
propDecorators: {
|
|
713
968
|
error: [{ type: Input }],
|
|
714
|
-
|
|
969
|
+
steps: [{ type: Input }],
|
|
970
|
+
nodeTypes: [{ type: Input }],
|
|
971
|
+
definitions: [{ type: Input }]
|
|
972
|
+
}
|
|
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
|
+
});
|
|
715
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
|
+
}]
|
|
716
1022
|
});
|
|
717
1023
|
var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBaseComponent {
|
|
718
1024
|
constructor(injector, flowsRunService, workflowService, nodeService, cdr) {
|
|
@@ -765,10 +1071,6 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
765
1071
|
toggleItems(stepId) {
|
|
766
1072
|
if (!this.openSteps.delete(stepId)) this.openSteps.add(stepId);
|
|
767
1073
|
}
|
|
768
|
-
asJson(value) {
|
|
769
|
-
if (value === null || value === void 0) return "—";
|
|
770
|
-
return JSON.stringify(value, null, 2);
|
|
771
|
-
}
|
|
772
1074
|
watch(subscriptionId) {
|
|
773
1075
|
this.watch$?.unsubscribe();
|
|
774
1076
|
this.watch$ = this.flowsRunService.watchRun(this.runId, subscriptionId).pipe(takeUntil(this.destroy$)).subscribe({
|
|
@@ -786,14 +1088,11 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
786
1088
|
const versionId = this.run?.flow_version_id;
|
|
787
1089
|
if (!versionId || versionId === this.namedVersionId) return;
|
|
788
1090
|
this.namedVersionId = versionId;
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
this.nodeTypes = Object.fromEntries(toFlowGraph(version.graph).nodes.map((node) => [node.id, node.type]));
|
|
795
|
-
this.nodeIds = Object.keys(this.nodeTypes);
|
|
796
|
-
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;
|
|
797
1096
|
this.cdr.markForCheck();
|
|
798
1097
|
},
|
|
799
1098
|
error: () => void 0
|
|
@@ -834,8 +1133,8 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
834
1133
|
selector: "pw-flows-run-inspector",
|
|
835
1134
|
usesInheritance: true,
|
|
836
1135
|
ngImport: i0,
|
|
837
|
-
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 <
|
|
838
|
-
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-
|
|
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"],
|
|
839
1138
|
dependencies: [
|
|
840
1139
|
{
|
|
841
1140
|
kind: "component",
|
|
@@ -1040,7 +1339,23 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
1040
1339
|
kind: "component",
|
|
1041
1340
|
type: FlowsStepErrorComponent,
|
|
1042
1341
|
selector: "pw-flows-step-error",
|
|
1043
|
-
inputs: [
|
|
1342
|
+
inputs: [
|
|
1343
|
+
"error",
|
|
1344
|
+
"retrying",
|
|
1345
|
+
"source",
|
|
1346
|
+
"product"
|
|
1347
|
+
]
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
kind: "component",
|
|
1351
|
+
type: FlowsRunErrorComponent,
|
|
1352
|
+
selector: "pw-flows-run-error",
|
|
1353
|
+
inputs: [
|
|
1354
|
+
"error",
|
|
1355
|
+
"steps",
|
|
1356
|
+
"nodeTypes",
|
|
1357
|
+
"definitions"
|
|
1358
|
+
]
|
|
1044
1359
|
},
|
|
1045
1360
|
{
|
|
1046
1361
|
kind: "pipe",
|
|
@@ -1054,8 +1369,13 @@ var FlowsRunInspectorComponent = class FlowsRunInspectorComponent extends AppBas
|
|
|
1054
1369
|
},
|
|
1055
1370
|
{
|
|
1056
1371
|
kind: "pipe",
|
|
1057
|
-
type:
|
|
1372
|
+
type: i14.DateFormatPipe,
|
|
1058
1373
|
name: "dateFormat"
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
kind: "pipe",
|
|
1377
|
+
type: FlowJsonLinesPipe,
|
|
1378
|
+
name: "flowJsonLines"
|
|
1059
1379
|
}
|
|
1060
1380
|
]
|
|
1061
1381
|
});
|
|
@@ -1071,8 +1391,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1071
1391
|
args: [{
|
|
1072
1392
|
selector: "pw-flows-run-inspector",
|
|
1073
1393
|
standalone: false,
|
|
1074
|
-
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 <
|
|
1075
|
-
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-
|
|
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"]
|
|
1076
1396
|
}]
|
|
1077
1397
|
}],
|
|
1078
1398
|
ctorParameters: () => [
|
|
@@ -1652,7 +1972,7 @@ var FlowsRunsComponent = class FlowsRunsComponent extends AppBaseComponent {
|
|
|
1652
1972
|
},
|
|
1653
1973
|
{
|
|
1654
1974
|
kind: "pipe",
|
|
1655
|
-
type:
|
|
1975
|
+
type: i14.DateFormatPipe,
|
|
1656
1976
|
name: "dateFormat"
|
|
1657
1977
|
}
|
|
1658
1978
|
]
|
|
@@ -2521,6 +2841,15 @@ function flowNodeSelection(graph, node, definition, definitions, workflowFields)
|
|
|
2521
2841
|
fieldSources: flowFieldsPossible(graph, node.id) ? flowFieldSources(graph, node.id, definitions, learned) : null
|
|
2522
2842
|
};
|
|
2523
2843
|
}
|
|
2844
|
+
function flowAiChoices(node) {
|
|
2845
|
+
const choices = node.params?.["choices"];
|
|
2846
|
+
return Array.isArray(choices) ? choices.filter((choice) => !!choice && typeof choice === "object") : [];
|
|
2847
|
+
}
|
|
2848
|
+
function flowNodeOutputs(node, definition) {
|
|
2849
|
+
if (node.type !== "logic.ai_decide") return definition.outputs;
|
|
2850
|
+
const names = flowAiChoices(node).map((choice) => choice.name).filter((name) => typeof name === "string" && name.trim() !== "");
|
|
2851
|
+
return [.../* @__PURE__ */ new Set([...definition.outputs, ...names])];
|
|
2852
|
+
}
|
|
2524
2853
|
const FLOW_SOCKET = new ClassicPreset.Socket("flow");
|
|
2525
2854
|
var FlowCanvasNode = class extends ClassicPreset.Node {
|
|
2526
2855
|
constructor(flowNode, definition, label, hasInput, outputs) {
|
|
@@ -2531,8 +2860,22 @@ var FlowCanvasNode = class extends ClassicPreset.Node {
|
|
|
2531
2860
|
this.height = 0;
|
|
2532
2861
|
this.id = flowNode.id;
|
|
2533
2862
|
if (hasInput) this.addInput("in", new ClassicPreset.Input(FLOW_SOCKET, "", true));
|
|
2534
|
-
outputs.forEach((branch) => this.
|
|
2535
|
-
this.
|
|
2863
|
+
outputs.forEach((branch) => this.addBranch(branch));
|
|
2864
|
+
this.fitHeight();
|
|
2865
|
+
}
|
|
2866
|
+
syncOutputs(outputs) {
|
|
2867
|
+
const removed = Object.keys(this.outputs).filter((branch) => !outputs.includes(branch));
|
|
2868
|
+
removed.forEach((branch) => this.removeOutput(branch));
|
|
2869
|
+
outputs.filter((branch) => !this.hasOutput(branch)).forEach((branch) => this.addBranch(branch));
|
|
2870
|
+
this.fitHeight();
|
|
2871
|
+
return removed;
|
|
2872
|
+
}
|
|
2873
|
+
addBranch(branch) {
|
|
2874
|
+
this.addOutput(branch, new ClassicPreset.Output(FLOW_SOCKET, branch === "next" ? "" : branch));
|
|
2875
|
+
}
|
|
2876
|
+
fitHeight() {
|
|
2877
|
+
const outputs = Object.keys(this.outputs).length;
|
|
2878
|
+
this.height = 56 + Math.max(outputs, this.hasInput("in") ? 1 : 0) * 36;
|
|
2536
2879
|
}
|
|
2537
2880
|
};
|
|
2538
2881
|
var FlowCanvasConnection = class extends ClassicPreset.Connection {};
|
|
@@ -2540,7 +2883,7 @@ function branchOf(edge) {
|
|
|
2540
2883
|
return edge.branch ?? "next";
|
|
2541
2884
|
}
|
|
2542
2885
|
function outputsFor(node, definition, edges) {
|
|
2543
|
-
if (definition) return definition
|
|
2886
|
+
if (definition) return flowNodeOutputs(node, definition);
|
|
2544
2887
|
const used = edges.filter((edge) => edge.from === node.id).map(branchOf);
|
|
2545
2888
|
return [.../* @__PURE__ */ new Set([DEFAULT_FLOW_BRANCH, ...used])];
|
|
2546
2889
|
}
|
|
@@ -2999,10 +3342,19 @@ var FlowCanvasEditor = class {
|
|
|
2999
3342
|
const node = this.rete.editor.getNode(nodeId);
|
|
3000
3343
|
if (node) {
|
|
3001
3344
|
node.flowNode = flowNode;
|
|
3345
|
+
if (node.definition) {
|
|
3346
|
+
const outputs = flowNodeOutputs(flowNode, node.definition);
|
|
3347
|
+
await this.removeBranches(node, Object.keys(node.outputs).filter((branch) => !outputs.includes(branch)));
|
|
3348
|
+
node.syncOutputs(outputs);
|
|
3349
|
+
}
|
|
3002
3350
|
await this.rete.area.update("node", nodeId);
|
|
3003
3351
|
this.listener.changed();
|
|
3004
3352
|
}
|
|
3005
3353
|
}
|
|
3354
|
+
async removeBranches(node, branches) {
|
|
3355
|
+
const gone = this.rete.editor.getConnections().filter((c) => c.source === node.id && branches.includes(c.sourceOutput));
|
|
3356
|
+
for (const connection of gone) await this.rete.editor.removeConnection(connection.id);
|
|
3357
|
+
}
|
|
3006
3358
|
node(nodeId) {
|
|
3007
3359
|
return this.rete.editor.getNode(nodeId);
|
|
3008
3360
|
}
|
|
@@ -3216,6 +3568,11 @@ const FIELD_KINDS = {
|
|
|
3216
3568
|
"data.set_fields": { fields: "pairs" },
|
|
3217
3569
|
"data.merge": { mode: "mode" },
|
|
3218
3570
|
"data.split_out": { field: "list" },
|
|
3571
|
+
"logic.ai_decide": {
|
|
3572
|
+
instructions: "textarea",
|
|
3573
|
+
choices: "choices",
|
|
3574
|
+
min_confidence: "number"
|
|
3575
|
+
},
|
|
3219
3576
|
"action.email": {
|
|
3220
3577
|
to: "email",
|
|
3221
3578
|
subject: "text",
|
|
@@ -3492,176 +3849,164 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3492
3849
|
add: [{ type: Output }]
|
|
3493
3850
|
}
|
|
3494
3851
|
});
|
|
3495
|
-
const
|
|
3496
|
-
"
|
|
3497
|
-
"
|
|
3498
|
-
"
|
|
3499
|
-
"
|
|
3500
|
-
"
|
|
3501
|
-
"
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
5,
|
|
3506
|
-
10,
|
|
3507
|
-
15,
|
|
3508
|
-
30
|
|
3852
|
+
const FLOW_CONDITION_OPERATORS = [
|
|
3853
|
+
"eq",
|
|
3854
|
+
"neq",
|
|
3855
|
+
"gt",
|
|
3856
|
+
"gte",
|
|
3857
|
+
"lt",
|
|
3858
|
+
"lte",
|
|
3859
|
+
"contains",
|
|
3860
|
+
"empty",
|
|
3861
|
+
"not_empty"
|
|
3509
3862
|
];
|
|
3510
|
-
const
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
custom: ""
|
|
3863
|
+
const LOGIC_OPS = {
|
|
3864
|
+
"==": "eq",
|
|
3865
|
+
"!=": "neq",
|
|
3866
|
+
">": "gt",
|
|
3867
|
+
">=": "gte",
|
|
3868
|
+
"<": "lt",
|
|
3869
|
+
"<=": "lte"
|
|
3518
3870
|
};
|
|
3519
|
-
const
|
|
3520
|
-
|
|
3521
|
-
[
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
];
|
|
3527
|
-
function toFlowCron(schedule) {
|
|
3528
|
-
const { minute, hour } = schedule;
|
|
3529
|
-
switch (schedule.mode) {
|
|
3530
|
-
case "minutes": return schedule.every === 1 ? "* * * * *" : `*/${schedule.every} * * * *`;
|
|
3531
|
-
case "hourly": return `${minute} * * * *`;
|
|
3532
|
-
case "daily": return `${minute} ${hour} * * *`;
|
|
3533
|
-
case "weekly": return `${minute} ${hour} * * ${schedule.weekday}`;
|
|
3534
|
-
case "monthly": return `${minute} ${hour} ${schedule.monthday} * *`;
|
|
3535
|
-
default: return schedule.custom.trim();
|
|
3536
|
-
}
|
|
3871
|
+
const OP_LOGIC = Object.fromEntries(Object.entries(LOGIC_OPS).map(([logic, op]) => [op, logic]));
|
|
3872
|
+
function isNumericOperator(operator) {
|
|
3873
|
+
return [
|
|
3874
|
+
"gt",
|
|
3875
|
+
"gte",
|
|
3876
|
+
"lt",
|
|
3877
|
+
"lte"
|
|
3878
|
+
].includes(operator);
|
|
3537
3879
|
}
|
|
3538
|
-
function
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
const match = pattern.exec(text);
|
|
3543
|
-
if (match) return fromMatch(mode, match.slice(1).map((part) => part === void 0 ? void 0 : Number(part)));
|
|
3544
|
-
}
|
|
3880
|
+
function takesValue(operator) {
|
|
3881
|
+
return operator !== "empty" && operator !== "not_empty";
|
|
3882
|
+
}
|
|
3883
|
+
function emptyFlowConditionRule() {
|
|
3545
3884
|
return {
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3885
|
+
field: "",
|
|
3886
|
+
operator: "eq",
|
|
3887
|
+
value: "",
|
|
3888
|
+
valueType: "text"
|
|
3549
3889
|
};
|
|
3550
3890
|
}
|
|
3551
|
-
function
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
}
|
|
3568
|
-
case "hourly": return {
|
|
3569
|
-
...base,
|
|
3570
|
-
minute: a
|
|
3571
|
-
};
|
|
3572
|
-
case "daily": return {
|
|
3573
|
-
...base,
|
|
3574
|
-
minute: a,
|
|
3575
|
-
hour: b
|
|
3576
|
-
};
|
|
3577
|
-
case "weekly": return {
|
|
3578
|
-
...base,
|
|
3579
|
-
minute: a,
|
|
3580
|
-
hour: b,
|
|
3581
|
-
weekday: c
|
|
3582
|
-
};
|
|
3583
|
-
default: return c >= 1 && c <= 28 ? {
|
|
3584
|
-
...base,
|
|
3585
|
-
minute: a,
|
|
3586
|
-
hour: b,
|
|
3587
|
-
monthday: c
|
|
3588
|
-
} : {
|
|
3589
|
-
...base,
|
|
3590
|
-
mode: "custom",
|
|
3591
|
-
custom: `${a} ${b} ${c} * *`
|
|
3592
|
-
};
|
|
3891
|
+
function typedValue(rule) {
|
|
3892
|
+
if (rule.valueType === "boolean") return rule.value === "true";
|
|
3893
|
+
return isNumericOperator(rule.operator) || rule.valueType === "number" ? Number(rule.value) : rule.value;
|
|
3894
|
+
}
|
|
3895
|
+
function isCompleteRule(rule) {
|
|
3896
|
+
if (!rule.field.trim()) return false;
|
|
3897
|
+
if (!takesValue(rule.operator)) return true;
|
|
3898
|
+
return isNumericOperator(rule.operator) || rule.valueType === "number" ? rule.value.trim() !== "" && Number.isFinite(Number(rule.value)) : true;
|
|
3899
|
+
}
|
|
3900
|
+
function ruleToLogic(rule) {
|
|
3901
|
+
const field = { var: rule.field.trim() };
|
|
3902
|
+
switch (rule.operator) {
|
|
3903
|
+
case "contains": return { in: [typedValue(rule), field] };
|
|
3904
|
+
case "empty": return { "==": [field, null] };
|
|
3905
|
+
case "not_empty": return { "!=": [field, null] };
|
|
3906
|
+
default: return { [OP_LOGIC[rule.operator]]: [field, typedValue(rule)] };
|
|
3593
3907
|
}
|
|
3594
3908
|
}
|
|
3595
|
-
function
|
|
3596
|
-
|
|
3909
|
+
function toJsonLogic(group) {
|
|
3910
|
+
if (!group.rules.length || !group.rules.every(isCompleteRule)) return;
|
|
3911
|
+
const logic = group.rules.map(ruleToLogic);
|
|
3912
|
+
return logic.length === 1 ? logic[0] : { [group.combinator === "all" ? "and" : "or"]: logic };
|
|
3597
3913
|
}
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3914
|
+
function asRecord(value) {
|
|
3915
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
3916
|
+
}
|
|
3917
|
+
function fieldOf(value) {
|
|
3918
|
+
const record = asRecord(value);
|
|
3919
|
+
const keys = record ? Object.keys(record) : [];
|
|
3920
|
+
return keys.length === 1 && keys[0] === "var" && typeof record?.["var"] === "string" ? record["var"] : null;
|
|
3921
|
+
}
|
|
3922
|
+
function valueRule(field, operator, value) {
|
|
3923
|
+
if (typeof value === "number") return {
|
|
3924
|
+
field,
|
|
3925
|
+
operator,
|
|
3926
|
+
value: String(value),
|
|
3927
|
+
valueType: "number"
|
|
3928
|
+
};
|
|
3929
|
+
if (typeof value === "boolean") return {
|
|
3930
|
+
field,
|
|
3931
|
+
operator,
|
|
3932
|
+
value: String(value),
|
|
3933
|
+
valueType: "boolean"
|
|
3934
|
+
};
|
|
3935
|
+
return typeof value === "string" ? {
|
|
3936
|
+
field,
|
|
3937
|
+
operator,
|
|
3938
|
+
value,
|
|
3939
|
+
valueType: "text"
|
|
3940
|
+
} : null;
|
|
3941
|
+
}
|
|
3942
|
+
function logicToRule(logic) {
|
|
3943
|
+
const record = asRecord(logic);
|
|
3944
|
+
const [op] = record ? Object.keys(record) : [];
|
|
3945
|
+
const args = record && Object.keys(record).length === 1 ? record[op] : null;
|
|
3946
|
+
if (!Array.isArray(args) || args.length !== 2) return null;
|
|
3947
|
+
if (op === "in") {
|
|
3948
|
+
const field = fieldOf(args[1]);
|
|
3949
|
+
return field ? valueRule(field, "contains", args[0]) : null;
|
|
3950
|
+
}
|
|
3951
|
+
const field = fieldOf(args[0]);
|
|
3952
|
+
const operator = LOGIC_OPS[op];
|
|
3953
|
+
if (!field || !operator) return null;
|
|
3954
|
+
if (args[1] === null && (operator === "eq" || operator === "neq")) return {
|
|
3955
|
+
field,
|
|
3956
|
+
operator: operator === "eq" ? "empty" : "not_empty",
|
|
3957
|
+
value: "",
|
|
3958
|
+
valueType: "text"
|
|
3959
|
+
};
|
|
3960
|
+
return valueRule(field, operator, args[1]);
|
|
3961
|
+
}
|
|
3962
|
+
function fromJsonLogic(logic) {
|
|
3963
|
+
const record = asRecord(logic);
|
|
3964
|
+
if (!record) return logic === void 0 || logic === null ? {
|
|
3965
|
+
combinator: "all",
|
|
3966
|
+
rules: []
|
|
3967
|
+
} : null;
|
|
3968
|
+
const [key] = Object.keys(record);
|
|
3969
|
+
const nested = Object.keys(record).length === 1 && (key === "and" || key === "or") ? record[key] : null;
|
|
3970
|
+
const rules = (Array.isArray(nested) ? nested : [logic]).map(logicToRule);
|
|
3971
|
+
if (rules.includes(null)) return null;
|
|
3972
|
+
return {
|
|
3973
|
+
combinator: key === "or" ? "any" : "all",
|
|
3974
|
+
rules
|
|
3975
|
+
};
|
|
3976
|
+
}
|
|
3977
|
+
var FlowsJsonFieldComponent = class FlowsJsonFieldComponent {
|
|
3978
|
+
constructor() {
|
|
3603
3979
|
this.readOnly = false;
|
|
3604
3980
|
this.valueChange = new EventEmitter();
|
|
3605
|
-
this.
|
|
3606
|
-
this.
|
|
3607
|
-
this.monthdays = Array.from({ length: 28 }, (_, i) => i + 1);
|
|
3608
|
-
this.schedule = fromFlowCron(void 0);
|
|
3609
|
-
this.weekdays = [];
|
|
3610
|
-
const format = new Intl.DateTimeFormat(this.translation.getActiveLang(), {
|
|
3611
|
-
weekday: "long",
|
|
3612
|
-
timeZone: "UTC"
|
|
3613
|
-
});
|
|
3614
|
-
this.weekdays = [
|
|
3615
|
-
0,
|
|
3616
|
-
1,
|
|
3617
|
-
2,
|
|
3618
|
-
3,
|
|
3619
|
-
4,
|
|
3620
|
-
5,
|
|
3621
|
-
6
|
|
3622
|
-
].map((value) => ({
|
|
3623
|
-
value,
|
|
3624
|
-
label: format.format(A_SUNDAY + value * DAY_MS)
|
|
3625
|
-
}));
|
|
3981
|
+
this.text = "";
|
|
3982
|
+
this.invalid = false;
|
|
3626
3983
|
}
|
|
3627
3984
|
ngOnChanges() {
|
|
3628
|
-
|
|
3629
|
-
this.
|
|
3630
|
-
}
|
|
3631
|
-
get time() {
|
|
3632
|
-
return flowCronTime(this.schedule);
|
|
3633
|
-
}
|
|
3634
|
-
get weekdayLabel() {
|
|
3635
|
-
return this.weekdays[this.schedule.weekday]?.label ?? "";
|
|
3636
|
-
}
|
|
3637
|
-
setMode(mode) {
|
|
3638
|
-
this.update({
|
|
3639
|
-
mode,
|
|
3640
|
-
custom: mode === "custom" ? toFlowCron(this.schedule) : this.schedule.custom
|
|
3641
|
-
});
|
|
3642
|
-
}
|
|
3643
|
-
setTime(time) {
|
|
3644
|
-
const [hour, minute] = (time || "00:00").split(":").map(Number);
|
|
3645
|
-
this.update({
|
|
3646
|
-
hour,
|
|
3647
|
-
minute
|
|
3648
|
-
});
|
|
3985
|
+
this.text = this.value === void 0 ? "" : JSON.stringify(this.value, null, 2);
|
|
3986
|
+
this.invalid = false;
|
|
3649
3987
|
}
|
|
3650
|
-
|
|
3651
|
-
this.
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3988
|
+
commit() {
|
|
3989
|
+
if (this.readOnly) return;
|
|
3990
|
+
if (!this.text.trim()) {
|
|
3991
|
+
this.invalid = false;
|
|
3992
|
+
this.valueChange.emit(void 0);
|
|
3993
|
+
return;
|
|
3994
|
+
}
|
|
3995
|
+
try {
|
|
3996
|
+
const parsed = JSON.parse(this.text);
|
|
3997
|
+
this.invalid = false;
|
|
3998
|
+
this.valueChange.emit(parsed);
|
|
3999
|
+
} catch {
|
|
4000
|
+
this.invalid = true;
|
|
4001
|
+
}
|
|
3657
4002
|
}
|
|
3658
4003
|
static {
|
|
3659
4004
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
3660
4005
|
minVersion: "12.0.0",
|
|
3661
4006
|
version: "22.2.3",
|
|
3662
4007
|
ngImport: i0,
|
|
3663
|
-
type:
|
|
3664
|
-
deps: [
|
|
4008
|
+
type: FlowsJsonFieldComponent,
|
|
4009
|
+
deps: [],
|
|
3665
4010
|
target: i0.ɵɵFactoryTarget.Component
|
|
3666
4011
|
});
|
|
3667
4012
|
}
|
|
@@ -3669,9 +4014,9 @@ var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
|
3669
4014
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3670
4015
|
minVersion: "17.0.0",
|
|
3671
4016
|
version: "22.2.3",
|
|
3672
|
-
type:
|
|
4017
|
+
type: FlowsJsonFieldComponent,
|
|
3673
4018
|
isStandalone: false,
|
|
3674
|
-
selector: "pw-flows-
|
|
4019
|
+
selector: "pw-flows-json-field",
|
|
3675
4020
|
inputs: {
|
|
3676
4021
|
value: "value",
|
|
3677
4022
|
inputId: "inputId",
|
|
@@ -3680,53 +4025,38 @@ var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
|
3680
4025
|
outputs: { valueChange: "valueChange" },
|
|
3681
4026
|
usesOnChanges: true,
|
|
3682
4027
|
ngImport: i0,
|
|
3683
|
-
template:
|
|
4028
|
+
template: `
|
|
4029
|
+
<textarea
|
|
4030
|
+
class="form-control pw-json-field"
|
|
4031
|
+
rows="5"
|
|
4032
|
+
spellcheck="false"
|
|
4033
|
+
[id]="inputId"
|
|
4034
|
+
[readOnly]="readOnly"
|
|
4035
|
+
[(ngModel)]="text"
|
|
4036
|
+
[ngModelOptions]="{ standalone: true }"
|
|
4037
|
+
(blur)="commit()"
|
|
4038
|
+
></textarea>
|
|
4039
|
+
@if (invalid) {
|
|
4040
|
+
<pw-field-error-display
|
|
4041
|
+
[displayError]="true"
|
|
4042
|
+
[errorMsg]="'Flows.Versions.Editor.InvalidJson' | transloco"
|
|
4043
|
+
>
|
|
4044
|
+
</pw-field-error-display>
|
|
4045
|
+
}
|
|
4046
|
+
`,
|
|
4047
|
+
isInline: true,
|
|
4048
|
+
styles: [".pw-json-field{white-space:pre;overflow-x:auto}\n"],
|
|
3684
4049
|
dependencies: [
|
|
3685
|
-
{
|
|
3686
|
-
kind: "directive",
|
|
3687
|
-
type: i3$1.NgSelectOption,
|
|
3688
|
-
selector: "option",
|
|
3689
|
-
inputs: ["ngValue", "value"]
|
|
3690
|
-
},
|
|
3691
|
-
{
|
|
3692
|
-
kind: "directive",
|
|
3693
|
-
type: i3$1.ɵNgSelectMultipleOption,
|
|
3694
|
-
selector: "option",
|
|
3695
|
-
inputs: ["ngValue", "value"]
|
|
3696
|
-
},
|
|
3697
4050
|
{
|
|
3698
4051
|
kind: "directive",
|
|
3699
4052
|
type: i3$1.DefaultValueAccessor,
|
|
3700
4053
|
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
3701
4054
|
},
|
|
3702
|
-
{
|
|
3703
|
-
kind: "directive",
|
|
3704
|
-
type: i3$1.NumberValueAccessor,
|
|
3705
|
-
selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
|
|
3706
|
-
},
|
|
3707
|
-
{
|
|
3708
|
-
kind: "directive",
|
|
3709
|
-
type: i3$1.SelectControlValueAccessor,
|
|
3710
|
-
selector: "select:not([multiple]):not([ngNoCva])[formControlName],select:not([multiple]):not([ngNoCva])[formControl],select:not([multiple]):not([ngNoCva])[ngModel]",
|
|
3711
|
-
inputs: ["compareWith"]
|
|
3712
|
-
},
|
|
3713
4055
|
{
|
|
3714
4056
|
kind: "directive",
|
|
3715
4057
|
type: i3$1.NgControlStatus,
|
|
3716
4058
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
3717
4059
|
},
|
|
3718
|
-
{
|
|
3719
|
-
kind: "directive",
|
|
3720
|
-
type: i3$1.MinValidator,
|
|
3721
|
-
selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
|
|
3722
|
-
inputs: ["min"]
|
|
3723
|
-
},
|
|
3724
|
-
{
|
|
3725
|
-
kind: "directive",
|
|
3726
|
-
type: i3$1.MaxValidator,
|
|
3727
|
-
selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]",
|
|
3728
|
-
inputs: ["max"]
|
|
3729
|
-
},
|
|
3730
4060
|
{
|
|
3731
4061
|
kind: "directive",
|
|
3732
4062
|
type: i3$1.NgModel,
|
|
@@ -3740,6 +4070,12 @@ var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
|
3740
4070
|
outputs: ["ngModelChange"],
|
|
3741
4071
|
exportAs: ["ngModel"]
|
|
3742
4072
|
},
|
|
4073
|
+
{
|
|
4074
|
+
kind: "component",
|
|
4075
|
+
type: i2$1.FieldErrorDisplayComponent,
|
|
4076
|
+
selector: "pw-field-error-display",
|
|
4077
|
+
inputs: ["errorMsg", "displayError"]
|
|
4078
|
+
},
|
|
3743
4079
|
{
|
|
3744
4080
|
kind: "pipe",
|
|
3745
4081
|
type: i2$4.TranslocoPipe,
|
|
@@ -3753,75 +4089,173 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3753
4089
|
minVersion: "12.0.0",
|
|
3754
4090
|
version: "22.2.3",
|
|
3755
4091
|
ngImport: i0,
|
|
3756
|
-
type:
|
|
4092
|
+
type: FlowsJsonFieldComponent,
|
|
3757
4093
|
decorators: [{
|
|
3758
4094
|
type: Component,
|
|
3759
4095
|
args: [{
|
|
3760
|
-
selector: "pw-flows-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
4096
|
+
selector: "pw-flows-json-field",
|
|
4097
|
+
template: `
|
|
4098
|
+
<textarea
|
|
4099
|
+
class="form-control pw-json-field"
|
|
4100
|
+
rows="5"
|
|
4101
|
+
spellcheck="false"
|
|
4102
|
+
[id]="inputId"
|
|
4103
|
+
[readOnly]="readOnly"
|
|
4104
|
+
[(ngModel)]="text"
|
|
4105
|
+
[ngModelOptions]="{ standalone: true }"
|
|
4106
|
+
(blur)="commit()"
|
|
4107
|
+
></textarea>
|
|
4108
|
+
@if (invalid) {
|
|
4109
|
+
<pw-field-error-display
|
|
4110
|
+
[displayError]="true"
|
|
4111
|
+
[errorMsg]="'Flows.Versions.Editor.InvalidJson' | transloco"
|
|
4112
|
+
>
|
|
4113
|
+
</pw-field-error-display>
|
|
4114
|
+
}
|
|
4115
|
+
`,
|
|
4116
|
+
standalone: false,
|
|
4117
|
+
styles: [".pw-json-field{white-space:pre;overflow-x:auto}\n"]
|
|
4118
|
+
}]
|
|
4119
|
+
}],
|
|
4120
|
+
propDecorators: {
|
|
4121
|
+
value: [{ type: Input }],
|
|
4122
|
+
inputId: [{ type: Input }],
|
|
3769
4123
|
readOnly: [{ type: Input }],
|
|
3770
4124
|
valueChange: [{ type: Output }]
|
|
3771
4125
|
}
|
|
3772
4126
|
});
|
|
3773
|
-
const
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
4127
|
+
const OPTION_KEYS = {
|
|
4128
|
+
operators: FLOW_CONDITION_OPERATORS.map((op) => [op, `Flows.Condition.Ops.${op}`]),
|
|
4129
|
+
types: [
|
|
4130
|
+
"text",
|
|
4131
|
+
"number",
|
|
4132
|
+
"boolean"
|
|
4133
|
+
].map((type) => [type, `Flows.Condition.Types.${type}`]),
|
|
4134
|
+
combinators: [["all", "Flows.Condition.All"], ["any", "Flows.Condition.Any"]],
|
|
4135
|
+
booleans: [["true", "Flows.Branch.true"], ["false", "Flows.Branch.false"]]
|
|
4136
|
+
};
|
|
4137
|
+
var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
4138
|
+
constructor(translation, cdr, destroyRef) {
|
|
4139
|
+
this.suggestions = [];
|
|
3779
4140
|
this.readOnly = false;
|
|
3780
4141
|
this.valueChange = new EventEmitter();
|
|
3781
|
-
this.
|
|
4142
|
+
this.icons = FLOWS_ICONS;
|
|
4143
|
+
this.options = {};
|
|
4144
|
+
this.takesValue = takesValue;
|
|
4145
|
+
this.isNumericOperator = isNumericOperator;
|
|
4146
|
+
this.group = {
|
|
4147
|
+
combinator: "all",
|
|
4148
|
+
rules: []
|
|
4149
|
+
};
|
|
4150
|
+
this.mode = "rules";
|
|
4151
|
+
this.incomplete = false;
|
|
4152
|
+
translation.selectTranslation("flows").pipe(takeUntilDestroyed(destroyRef)).subscribe(() => {
|
|
4153
|
+
this.options = Object.fromEntries(Object.entries(OPTION_KEYS).map(([name, entries]) => [name, entries.map(([value, key]) => ({
|
|
4154
|
+
value,
|
|
4155
|
+
label: translation.translate(key)
|
|
4156
|
+
}))]));
|
|
4157
|
+
cdr.markForCheck();
|
|
4158
|
+
});
|
|
4159
|
+
}
|
|
4160
|
+
ngOnChanges() {
|
|
4161
|
+
if (this.value !== void 0 && this.value === this.emitted) return;
|
|
4162
|
+
this.load(this.value);
|
|
4163
|
+
}
|
|
4164
|
+
get combinesRules() {
|
|
4165
|
+
return this.group.rules.length > 1;
|
|
4166
|
+
}
|
|
4167
|
+
get canUseRules() {
|
|
4168
|
+
return fromJsonLogic(this.value) !== null;
|
|
4169
|
+
}
|
|
4170
|
+
addRule() {
|
|
4171
|
+
this.group = {
|
|
4172
|
+
...this.group,
|
|
4173
|
+
rules: [...this.group.rules, emptyFlowConditionRule()]
|
|
4174
|
+
};
|
|
4175
|
+
this.incomplete = true;
|
|
4176
|
+
}
|
|
4177
|
+
removeRule(index) {
|
|
4178
|
+
this.group = {
|
|
4179
|
+
...this.group,
|
|
4180
|
+
rules: this.group.rules.filter((_, i) => i !== index)
|
|
4181
|
+
};
|
|
4182
|
+
this.commit();
|
|
4183
|
+
}
|
|
4184
|
+
useRules() {
|
|
4185
|
+
this.load(this.value);
|
|
4186
|
+
}
|
|
4187
|
+
useJson() {
|
|
4188
|
+
this.mode = "json";
|
|
4189
|
+
}
|
|
4190
|
+
commit() {
|
|
4191
|
+
if (this.readOnly) return;
|
|
4192
|
+
const logic = this.group.rules.length ? toJsonLogic(this.group) : void 0;
|
|
4193
|
+
this.incomplete = !!this.group.rules.length && logic === void 0;
|
|
4194
|
+
if (!this.incomplete) this.emit(logic);
|
|
4195
|
+
}
|
|
4196
|
+
emit(value) {
|
|
4197
|
+
this.emitted = value;
|
|
4198
|
+
this.valueChange.emit(value);
|
|
4199
|
+
}
|
|
4200
|
+
load(value) {
|
|
4201
|
+
const group = fromJsonLogic(value);
|
|
4202
|
+
this.mode = group ? "rules" : "json";
|
|
4203
|
+
this.group = group ?? {
|
|
4204
|
+
combinator: "all",
|
|
4205
|
+
rules: []
|
|
4206
|
+
};
|
|
4207
|
+
this.incomplete = false;
|
|
3782
4208
|
}
|
|
3783
4209
|
static {
|
|
3784
4210
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
3785
4211
|
minVersion: "12.0.0",
|
|
3786
4212
|
version: "22.2.3",
|
|
3787
4213
|
ngImport: i0,
|
|
3788
|
-
type:
|
|
3789
|
-
deps: [
|
|
4214
|
+
type: FlowsConditionFieldComponent,
|
|
4215
|
+
deps: [
|
|
4216
|
+
{ token: i2$4.TranslocoService },
|
|
4217
|
+
{ token: i0.ChangeDetectorRef },
|
|
4218
|
+
{ token: i0.DestroyRef }
|
|
4219
|
+
],
|
|
3790
4220
|
target: i0.ɵɵFactoryTarget.Component
|
|
3791
4221
|
});
|
|
3792
4222
|
}
|
|
3793
4223
|
static {
|
|
3794
4224
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3795
|
-
minVersion: "
|
|
4225
|
+
minVersion: "17.0.0",
|
|
3796
4226
|
version: "22.2.3",
|
|
3797
|
-
type:
|
|
4227
|
+
type: FlowsConditionFieldComponent,
|
|
3798
4228
|
isStandalone: false,
|
|
3799
|
-
selector: "pw-flows-
|
|
4229
|
+
selector: "pw-flows-condition-field",
|
|
3800
4230
|
inputs: {
|
|
3801
4231
|
value: "value",
|
|
3802
4232
|
inputId: "inputId",
|
|
4233
|
+
suggestions: "suggestions",
|
|
3803
4234
|
readOnly: "readOnly"
|
|
3804
4235
|
},
|
|
3805
4236
|
outputs: { valueChange: "valueChange" },
|
|
4237
|
+
usesOnChanges: true,
|
|
3806
4238
|
ngImport: i0,
|
|
3807
|
-
template:
|
|
3808
|
-
|
|
3809
|
-
[inputId]="inputId"
|
|
3810
|
-
[options]="zones"
|
|
3811
|
-
[filter]="true"
|
|
3812
|
-
[showClear]="true"
|
|
3813
|
-
[disabled]="readOnly"
|
|
3814
|
-
[placeholder]="'Flows.Schedule.ServerTime' | transloco"
|
|
3815
|
-
[ngModel]="value"
|
|
3816
|
-
[ngModelOptions]="{ standalone: true }"
|
|
3817
|
-
(ngModelChange)="valueChange.emit($event || null)"
|
|
3818
|
-
appendTo="body"
|
|
3819
|
-
styleClass="w-100"
|
|
3820
|
-
>
|
|
3821
|
-
</p-select>
|
|
3822
|
-
`,
|
|
3823
|
-
isInline: true,
|
|
4239
|
+
template: "<div class=\"pw-condition\"\n [id]=\"inputId\"\n data-testid=\"flow-condition\">\n @if (mode === 'rules') {\n @if (combinesRules) {\n <p-select [options]=\"options['combinators']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"pw-condition__combinator\"\n data-testid=\"flow-condition-combinator\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"group.combinator\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n }\n\n @for (rule of group.rules; track $index) {\n <div class=\"pw-condition__rule\"\n data-testid=\"flow-condition-rule\">\n <input type=\"text\"\n class=\"form-control\"\n [attr.list]=\"inputId + '-fields'\"\n [attr.aria-label]=\"'Flows.Condition.Field' | transloco\"\n [placeholder]=\"'Flows.Condition.Field' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"rule.field\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n <p-select [options]=\"options['operators']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [ariaLabel]=\"'Flows.Condition.Operator' | transloco\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"rule.operator\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n @if (takesValue(rule.operator)) {\n <div class=\"pw-condition__value\">\n @if (rule.valueType === 'boolean' && !isNumericOperator(rule.operator)) {\n <p-select [options]=\"options['booleans']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [ariaLabel]=\"'Flows.Condition.Value' | transloco\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"rule.value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n } @else {\n <input class=\"form-control\"\n [type]=\"isNumericOperator(rule.operator) || rule.valueType === 'number' ? 'number' : 'text'\"\n [attr.aria-label]=\"'Flows.Condition.Value' | transloco\"\n [placeholder]=\"'Flows.Condition.Value' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"rule.value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n }\n @if (!isNumericOperator(rule.operator)) {\n <p-select class=\"pw-condition__type\"\n [options]=\"options['types']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n [ariaLabel]=\"'Flows.Condition.Type' | transloco\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"rule.valueType\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n }\n </div>\n }\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-condition__remove\"\n [attr.aria-label]=\"'Flows.Condition.RemoveRule' | transloco\"\n [pTooltip]=\"'Flows.Condition.RemoveRule' | transloco\"\n appendTo=\"body\"\n (click)=\"removeRule($index)\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </div>\n }\n\n @if (incomplete) {\n <small class=\"pw-condition__hint is-warning\"\n data-testid=\"flow-condition-incomplete\">{{ 'Flows.Condition.Incomplete' | transloco }}</small>\n }\n\n <div class=\"pw-condition__actions\">\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-condition-add\"\n (click)=\"addRule()\">{{ 'Flows.Condition.AddRule' | transloco }}</button>\n }\n <button type=\"button\"\n class=\"btn btn-link btn-sm\"\n (click)=\"useJson()\">{{ 'Flows.Condition.AsJson' | transloco }}</button>\n </div>\n\n <datalist [id]=\"inputId + '-fields'\">\n @for (field of suggestions; track field) {\n <option [value]=\"field\"></option>\n }\n </datalist>\n } @else {\n <pw-flows-json-field [inputId]=\"inputId + '-json'\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"emit($event)\"></pw-flows-json-field>\n @if (canUseRules) {\n <button type=\"button\"\n class=\"btn btn-link btn-sm\"\n (click)=\"useRules()\">{{ 'Flows.Condition.AsRules' | transloco }}</button>\n } @else {\n <small class=\"pw-condition__hint\">{{ 'Flows.Condition.TooComplex' | transloco }}</small>\n }\n }\n</div>\n",
|
|
4240
|
+
styles: [".pw-condition{display:flex;flex-direction:column;gap:8px}.pw-condition__rule{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;padding:8px;border:1px solid #e2e5ea;border-radius:4px}.pw-condition__rule>:not(.pw-condition__remove){grid-column:1}.pw-condition__value{display:flex;gap:6px}.pw-condition__value>:first-child{flex:1;min-width:0}.pw-condition__type{flex:0 0 112px}.pw-condition__remove{grid-column:2;grid-row:1;align-self:start;color:#5a6473}.pw-condition__actions{display:flex;justify-content:space-between;align-items:center}.pw-condition__hint{color:#5a6473;font-size:12px}.pw-condition__hint.is-warning{color:#b7791f}\n"],
|
|
3824
4241
|
dependencies: [
|
|
4242
|
+
{
|
|
4243
|
+
kind: "directive",
|
|
4244
|
+
type: i3$1.NgSelectOption,
|
|
4245
|
+
selector: "option",
|
|
4246
|
+
inputs: ["ngValue", "value"]
|
|
4247
|
+
},
|
|
4248
|
+
{
|
|
4249
|
+
kind: "directive",
|
|
4250
|
+
type: i3$1.ɵNgSelectMultipleOption,
|
|
4251
|
+
selector: "option",
|
|
4252
|
+
inputs: ["ngValue", "value"]
|
|
4253
|
+
},
|
|
4254
|
+
{
|
|
4255
|
+
kind: "directive",
|
|
4256
|
+
type: i3$1.DefaultValueAccessor,
|
|
4257
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
4258
|
+
},
|
|
3825
4259
|
{
|
|
3826
4260
|
kind: "directive",
|
|
3827
4261
|
type: i3$1.NgControlStatus,
|
|
@@ -3840,6 +4274,34 @@ var FlowsTimezoneFieldComponent = class FlowsTimezoneFieldComponent {
|
|
|
3840
4274
|
outputs: ["ngModelChange"],
|
|
3841
4275
|
exportAs: ["ngModel"]
|
|
3842
4276
|
},
|
|
4277
|
+
{
|
|
4278
|
+
kind: "directive",
|
|
4279
|
+
type: i1$1.Tooltip,
|
|
4280
|
+
selector: "[pTooltip]",
|
|
4281
|
+
inputs: [
|
|
4282
|
+
"tooltipPosition",
|
|
4283
|
+
"tooltipEvent",
|
|
4284
|
+
"positionStyle",
|
|
4285
|
+
"tooltipStyleClass",
|
|
4286
|
+
"tooltipZIndex",
|
|
4287
|
+
"escape",
|
|
4288
|
+
"showDelay",
|
|
4289
|
+
"hideDelay",
|
|
4290
|
+
"life",
|
|
4291
|
+
"positionTop",
|
|
4292
|
+
"positionLeft",
|
|
4293
|
+
"autoHide",
|
|
4294
|
+
"fitContent",
|
|
4295
|
+
"hideOnEscape",
|
|
4296
|
+
"showOnEllipsis",
|
|
4297
|
+
"pTooltip",
|
|
4298
|
+
"tooltipDisabled",
|
|
4299
|
+
"tooltipOptions",
|
|
4300
|
+
"appendTo",
|
|
4301
|
+
"pTooltipPT",
|
|
4302
|
+
"pTooltipUnstyled"
|
|
4303
|
+
]
|
|
4304
|
+
},
|
|
3843
4305
|
{
|
|
3844
4306
|
kind: "component",
|
|
3845
4307
|
type: i4$1.Select,
|
|
@@ -3910,6 +4372,54 @@ var FlowsTimezoneFieldComponent = class FlowsTimezoneFieldComponent {
|
|
|
3910
4372
|
"onLazyLoad"
|
|
3911
4373
|
]
|
|
3912
4374
|
},
|
|
4375
|
+
{
|
|
4376
|
+
kind: "component",
|
|
4377
|
+
type: i2$3.FaIconComponent,
|
|
4378
|
+
selector: "fa-icon",
|
|
4379
|
+
inputs: [
|
|
4380
|
+
"icon",
|
|
4381
|
+
"title",
|
|
4382
|
+
"animation",
|
|
4383
|
+
"mask",
|
|
4384
|
+
"flip",
|
|
4385
|
+
"size",
|
|
4386
|
+
"pull",
|
|
4387
|
+
"border",
|
|
4388
|
+
"inverse",
|
|
4389
|
+
"symbol",
|
|
4390
|
+
"rotate",
|
|
4391
|
+
"fixedWidth",
|
|
4392
|
+
"transform",
|
|
4393
|
+
"a11yRole"
|
|
4394
|
+
],
|
|
4395
|
+
outputs: [
|
|
4396
|
+
"iconChange",
|
|
4397
|
+
"titleChange",
|
|
4398
|
+
"animationChange",
|
|
4399
|
+
"maskChange",
|
|
4400
|
+
"flipChange",
|
|
4401
|
+
"sizeChange",
|
|
4402
|
+
"pullChange",
|
|
4403
|
+
"borderChange",
|
|
4404
|
+
"inverseChange",
|
|
4405
|
+
"symbolChange",
|
|
4406
|
+
"rotateChange",
|
|
4407
|
+
"fixedWidthChange",
|
|
4408
|
+
"transformChange",
|
|
4409
|
+
"a11yRoleChange"
|
|
4410
|
+
]
|
|
4411
|
+
},
|
|
4412
|
+
{
|
|
4413
|
+
kind: "component",
|
|
4414
|
+
type: FlowsJsonFieldComponent,
|
|
4415
|
+
selector: "pw-flows-json-field",
|
|
4416
|
+
inputs: [
|
|
4417
|
+
"value",
|
|
4418
|
+
"inputId",
|
|
4419
|
+
"readOnly"
|
|
4420
|
+
],
|
|
4421
|
+
outputs: ["valueChange"]
|
|
4422
|
+
},
|
|
3913
4423
|
{
|
|
3914
4424
|
kind: "pipe",
|
|
3915
4425
|
type: i2$4.TranslocoPipe,
|
|
@@ -3923,70 +4433,199 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3923
4433
|
minVersion: "12.0.0",
|
|
3924
4434
|
version: "22.2.3",
|
|
3925
4435
|
ngImport: i0,
|
|
3926
|
-
type:
|
|
4436
|
+
type: FlowsConditionFieldComponent,
|
|
3927
4437
|
decorators: [{
|
|
3928
4438
|
type: Component,
|
|
3929
4439
|
args: [{
|
|
3930
|
-
selector: "pw-flows-
|
|
3931
|
-
|
|
3932
|
-
<p-select
|
|
3933
|
-
|
|
3934
|
-
[options]="zones"
|
|
3935
|
-
[filter]="true"
|
|
3936
|
-
[showClear]="true"
|
|
3937
|
-
[disabled]="readOnly"
|
|
3938
|
-
[placeholder]="'Flows.Schedule.ServerTime' | transloco"
|
|
3939
|
-
[ngModel]="value"
|
|
3940
|
-
[ngModelOptions]="{ standalone: true }"
|
|
3941
|
-
(ngModelChange)="valueChange.emit($event || null)"
|
|
3942
|
-
appendTo="body"
|
|
3943
|
-
styleClass="w-100"
|
|
3944
|
-
>
|
|
3945
|
-
</p-select>
|
|
3946
|
-
`,
|
|
3947
|
-
standalone: false
|
|
4440
|
+
selector: "pw-flows-condition-field",
|
|
4441
|
+
standalone: false,
|
|
4442
|
+
template: "<div class=\"pw-condition\"\n [id]=\"inputId\"\n data-testid=\"flow-condition\">\n @if (mode === 'rules') {\n @if (combinesRules) {\n <p-select [options]=\"options['combinators']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"pw-condition__combinator\"\n data-testid=\"flow-condition-combinator\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"group.combinator\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n }\n\n @for (rule of group.rules; track $index) {\n <div class=\"pw-condition__rule\"\n data-testid=\"flow-condition-rule\">\n <input type=\"text\"\n class=\"form-control\"\n [attr.list]=\"inputId + '-fields'\"\n [attr.aria-label]=\"'Flows.Condition.Field' | transloco\"\n [placeholder]=\"'Flows.Condition.Field' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"rule.field\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n <p-select [options]=\"options['operators']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [ariaLabel]=\"'Flows.Condition.Operator' | transloco\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"rule.operator\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n @if (takesValue(rule.operator)) {\n <div class=\"pw-condition__value\">\n @if (rule.valueType === 'boolean' && !isNumericOperator(rule.operator)) {\n <p-select [options]=\"options['booleans']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [ariaLabel]=\"'Flows.Condition.Value' | transloco\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"rule.value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n } @else {\n <input class=\"form-control\"\n [type]=\"isNumericOperator(rule.operator) || rule.valueType === 'number' ? 'number' : 'text'\"\n [attr.aria-label]=\"'Flows.Condition.Value' | transloco\"\n [placeholder]=\"'Flows.Condition.Value' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"rule.value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n }\n @if (!isNumericOperator(rule.operator)) {\n <p-select class=\"pw-condition__type\"\n [options]=\"options['types']\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n [ariaLabel]=\"'Flows.Condition.Type' | transloco\"\n [disabled]=\"readOnly\"\n [(ngModel)]=\"rule.valueType\"\n [ngModelOptions]=\"{ standalone: true }\"\n (onChange)=\"commit()\">\n </p-select>\n }\n </div>\n }\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-condition__remove\"\n [attr.aria-label]=\"'Flows.Condition.RemoveRule' | transloco\"\n [pTooltip]=\"'Flows.Condition.RemoveRule' | transloco\"\n appendTo=\"body\"\n (click)=\"removeRule($index)\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </div>\n }\n\n @if (incomplete) {\n <small class=\"pw-condition__hint is-warning\"\n data-testid=\"flow-condition-incomplete\">{{ 'Flows.Condition.Incomplete' | transloco }}</small>\n }\n\n <div class=\"pw-condition__actions\">\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-condition-add\"\n (click)=\"addRule()\">{{ 'Flows.Condition.AddRule' | transloco }}</button>\n }\n <button type=\"button\"\n class=\"btn btn-link btn-sm\"\n (click)=\"useJson()\">{{ 'Flows.Condition.AsJson' | transloco }}</button>\n </div>\n\n <datalist [id]=\"inputId + '-fields'\">\n @for (field of suggestions; track field) {\n <option [value]=\"field\"></option>\n }\n </datalist>\n } @else {\n <pw-flows-json-field [inputId]=\"inputId + '-json'\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"emit($event)\"></pw-flows-json-field>\n @if (canUseRules) {\n <button type=\"button\"\n class=\"btn btn-link btn-sm\"\n (click)=\"useRules()\">{{ 'Flows.Condition.AsRules' | transloco }}</button>\n } @else {\n <small class=\"pw-condition__hint\">{{ 'Flows.Condition.TooComplex' | transloco }}</small>\n }\n }\n</div>\n",
|
|
4443
|
+
styles: [".pw-condition{display:flex;flex-direction:column;gap:8px}.pw-condition__rule{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;padding:8px;border:1px solid #e2e5ea;border-radius:4px}.pw-condition__rule>:not(.pw-condition__remove){grid-column:1}.pw-condition__value{display:flex;gap:6px}.pw-condition__value>:first-child{flex:1;min-width:0}.pw-condition__type{flex:0 0 112px}.pw-condition__remove{grid-column:2;grid-row:1;align-self:start;color:#5a6473}.pw-condition__actions{display:flex;justify-content:space-between;align-items:center}.pw-condition__hint{color:#5a6473;font-size:12px}.pw-condition__hint.is-warning{color:#b7791f}\n"]
|
|
3948
4444
|
}]
|
|
3949
4445
|
}],
|
|
4446
|
+
ctorParameters: () => [
|
|
4447
|
+
{ type: i2$4.TranslocoService },
|
|
4448
|
+
{ type: i0.ChangeDetectorRef },
|
|
4449
|
+
{ type: i0.DestroyRef }
|
|
4450
|
+
],
|
|
3950
4451
|
propDecorators: {
|
|
3951
4452
|
value: [{ type: Input }],
|
|
3952
4453
|
inputId: [{ type: Input }],
|
|
4454
|
+
suggestions: [{ type: Input }],
|
|
3953
4455
|
readOnly: [{ type: Input }],
|
|
3954
4456
|
valueChange: [{ type: Output }]
|
|
3955
4457
|
}
|
|
3956
4458
|
});
|
|
3957
|
-
|
|
3958
|
-
|
|
4459
|
+
const FLOW_CRON_MODES = [
|
|
4460
|
+
"minutes",
|
|
4461
|
+
"hourly",
|
|
4462
|
+
"daily",
|
|
4463
|
+
"weekly",
|
|
4464
|
+
"monthly",
|
|
4465
|
+
"custom"
|
|
4466
|
+
];
|
|
4467
|
+
const FLOW_CRON_EVERY_OPTIONS = [
|
|
4468
|
+
1,
|
|
4469
|
+
5,
|
|
4470
|
+
10,
|
|
4471
|
+
15,
|
|
4472
|
+
30
|
|
4473
|
+
];
|
|
4474
|
+
const DEFAULT_FLOW_CRON = {
|
|
4475
|
+
mode: "daily",
|
|
4476
|
+
every: 15,
|
|
4477
|
+
minute: 0,
|
|
4478
|
+
hour: 9,
|
|
4479
|
+
weekday: 1,
|
|
4480
|
+
monthday: 1,
|
|
4481
|
+
custom: ""
|
|
4482
|
+
};
|
|
4483
|
+
const NUMBER = String.raw`(\d{1,2})`;
|
|
4484
|
+
const PATTERNS = [
|
|
4485
|
+
["minutes", /^\*(?:\/(\d{1,2}))? \* \* \* \*$/],
|
|
4486
|
+
["hourly", new RegExp(String.raw`^${NUMBER} \* \* \* \*$`)],
|
|
4487
|
+
["daily", new RegExp(String.raw`^${NUMBER} ${NUMBER} \* \* \*$`)],
|
|
4488
|
+
["weekly", new RegExp(String.raw`^${NUMBER} ${NUMBER} \* \* ([0-6])$`)],
|
|
4489
|
+
["monthly", new RegExp(String.raw`^${NUMBER} ${NUMBER} ${NUMBER} \* \*$`)]
|
|
4490
|
+
];
|
|
4491
|
+
function toFlowCron(schedule) {
|
|
4492
|
+
const { minute, hour } = schedule;
|
|
4493
|
+
switch (schedule.mode) {
|
|
4494
|
+
case "minutes": return schedule.every === 1 ? "* * * * *" : `*/${schedule.every} * * * *`;
|
|
4495
|
+
case "hourly": return `${minute} * * * *`;
|
|
4496
|
+
case "daily": return `${minute} ${hour} * * *`;
|
|
4497
|
+
case "weekly": return `${minute} ${hour} * * ${schedule.weekday}`;
|
|
4498
|
+
case "monthly": return `${minute} ${hour} ${schedule.monthday} * *`;
|
|
4499
|
+
default: return schedule.custom.trim();
|
|
4500
|
+
}
|
|
4501
|
+
}
|
|
4502
|
+
function fromFlowCron(cron) {
|
|
4503
|
+
const text = typeof cron === "string" ? cron.trim().replace(/\s+/g, " ") : "";
|
|
4504
|
+
if (!text) return { ...DEFAULT_FLOW_CRON };
|
|
4505
|
+
for (const [mode, pattern] of PATTERNS) {
|
|
4506
|
+
const match = pattern.exec(text);
|
|
4507
|
+
if (match) return fromMatch(mode, match.slice(1).map((part) => part === void 0 ? void 0 : Number(part)));
|
|
4508
|
+
}
|
|
4509
|
+
return {
|
|
4510
|
+
...DEFAULT_FLOW_CRON,
|
|
4511
|
+
mode: "custom",
|
|
4512
|
+
custom: text
|
|
4513
|
+
};
|
|
4514
|
+
}
|
|
4515
|
+
function fromMatch(mode, [a, b, c]) {
|
|
4516
|
+
const base = {
|
|
4517
|
+
...DEFAULT_FLOW_CRON,
|
|
4518
|
+
mode
|
|
4519
|
+
};
|
|
4520
|
+
switch (mode) {
|
|
4521
|
+
case "minutes": {
|
|
4522
|
+
const every = a ?? 1;
|
|
4523
|
+
return FLOW_CRON_EVERY_OPTIONS.includes(every) ? {
|
|
4524
|
+
...base,
|
|
4525
|
+
every
|
|
4526
|
+
} : {
|
|
4527
|
+
...base,
|
|
4528
|
+
mode: "custom",
|
|
4529
|
+
custom: `*/${every} * * * *`
|
|
4530
|
+
};
|
|
4531
|
+
}
|
|
4532
|
+
case "hourly": return {
|
|
4533
|
+
...base,
|
|
4534
|
+
minute: a
|
|
4535
|
+
};
|
|
4536
|
+
case "daily": return {
|
|
4537
|
+
...base,
|
|
4538
|
+
minute: a,
|
|
4539
|
+
hour: b
|
|
4540
|
+
};
|
|
4541
|
+
case "weekly": return {
|
|
4542
|
+
...base,
|
|
4543
|
+
minute: a,
|
|
4544
|
+
hour: b,
|
|
4545
|
+
weekday: c
|
|
4546
|
+
};
|
|
4547
|
+
default: return c >= 1 && c <= 28 ? {
|
|
4548
|
+
...base,
|
|
4549
|
+
minute: a,
|
|
4550
|
+
hour: b,
|
|
4551
|
+
monthday: c
|
|
4552
|
+
} : {
|
|
4553
|
+
...base,
|
|
4554
|
+
mode: "custom",
|
|
4555
|
+
custom: `${a} ${b} ${c} * *`
|
|
4556
|
+
};
|
|
4557
|
+
}
|
|
4558
|
+
}
|
|
4559
|
+
function flowCronTime(schedule) {
|
|
4560
|
+
return `${String(schedule.hour).padStart(2, "0")}:${String(schedule.minute).padStart(2, "0")}`;
|
|
4561
|
+
}
|
|
4562
|
+
const A_SUNDAY = Date.UTC(2026, 9, 4);
|
|
4563
|
+
const DAY_MS = 864e5;
|
|
4564
|
+
var FlowsCronFieldComponent = class FlowsCronFieldComponent {
|
|
4565
|
+
constructor(translation) {
|
|
4566
|
+
this.translation = translation;
|
|
3959
4567
|
this.readOnly = false;
|
|
3960
4568
|
this.valueChange = new EventEmitter();
|
|
3961
|
-
this.
|
|
3962
|
-
this.
|
|
4569
|
+
this.modes = FLOW_CRON_MODES;
|
|
4570
|
+
this.everyOptions = FLOW_CRON_EVERY_OPTIONS;
|
|
4571
|
+
this.monthdays = Array.from({ length: 28 }, (_, i) => i + 1);
|
|
4572
|
+
this.schedule = fromFlowCron(void 0);
|
|
4573
|
+
this.weekdays = [];
|
|
4574
|
+
const format = new Intl.DateTimeFormat(this.translation.getActiveLang(), {
|
|
4575
|
+
weekday: "long",
|
|
4576
|
+
timeZone: "UTC"
|
|
4577
|
+
});
|
|
4578
|
+
this.weekdays = [
|
|
4579
|
+
0,
|
|
4580
|
+
1,
|
|
4581
|
+
2,
|
|
4582
|
+
3,
|
|
4583
|
+
4,
|
|
4584
|
+
5,
|
|
4585
|
+
6
|
|
4586
|
+
].map((value) => ({
|
|
4587
|
+
value,
|
|
4588
|
+
label: format.format(A_SUNDAY + value * DAY_MS)
|
|
4589
|
+
}));
|
|
3963
4590
|
}
|
|
3964
4591
|
ngOnChanges() {
|
|
3965
|
-
|
|
3966
|
-
this.
|
|
4592
|
+
if (this.value !== void 0 && this.value === this.emitted) return;
|
|
4593
|
+
this.schedule = fromFlowCron(this.value);
|
|
3967
4594
|
}
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
this.
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
4595
|
+
get time() {
|
|
4596
|
+
return flowCronTime(this.schedule);
|
|
4597
|
+
}
|
|
4598
|
+
get weekdayLabel() {
|
|
4599
|
+
return this.weekdays[this.schedule.weekday]?.label ?? "";
|
|
4600
|
+
}
|
|
4601
|
+
setMode(mode) {
|
|
4602
|
+
this.update({
|
|
4603
|
+
mode,
|
|
4604
|
+
custom: mode === "custom" ? toFlowCron(this.schedule) : this.schedule.custom
|
|
4605
|
+
});
|
|
4606
|
+
}
|
|
4607
|
+
setTime(time) {
|
|
4608
|
+
const [hour, minute] = (time || "00:00").split(":").map(Number);
|
|
4609
|
+
this.update({
|
|
4610
|
+
hour,
|
|
4611
|
+
minute
|
|
4612
|
+
});
|
|
4613
|
+
}
|
|
4614
|
+
update(changes) {
|
|
4615
|
+
this.schedule = {
|
|
4616
|
+
...this.schedule,
|
|
4617
|
+
...changes
|
|
4618
|
+
};
|
|
4619
|
+
this.emitted = toFlowCron(this.schedule);
|
|
4620
|
+
this.valueChange.emit(this.emitted);
|
|
3982
4621
|
}
|
|
3983
4622
|
static {
|
|
3984
4623
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
3985
4624
|
minVersion: "12.0.0",
|
|
3986
4625
|
version: "22.2.3",
|
|
3987
4626
|
ngImport: i0,
|
|
3988
|
-
type:
|
|
3989
|
-
deps: [],
|
|
4627
|
+
type: FlowsCronFieldComponent,
|
|
4628
|
+
deps: [{ token: i2$4.TranslocoService }],
|
|
3990
4629
|
target: i0.ɵɵFactoryTarget.Component
|
|
3991
4630
|
});
|
|
3992
4631
|
}
|
|
@@ -3994,9 +4633,9 @@ var FlowsJsonFieldComponent = class FlowsJsonFieldComponent {
|
|
|
3994
4633
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3995
4634
|
minVersion: "17.0.0",
|
|
3996
4635
|
version: "22.2.3",
|
|
3997
|
-
type:
|
|
4636
|
+
type: FlowsCronFieldComponent,
|
|
3998
4637
|
isStandalone: false,
|
|
3999
|
-
selector: "pw-flows-
|
|
4638
|
+
selector: "pw-flows-cron-field",
|
|
4000
4639
|
inputs: {
|
|
4001
4640
|
value: "value",
|
|
4002
4641
|
inputId: "inputId",
|
|
@@ -4005,38 +4644,53 @@ var FlowsJsonFieldComponent = class FlowsJsonFieldComponent {
|
|
|
4005
4644
|
outputs: { valueChange: "valueChange" },
|
|
4006
4645
|
usesOnChanges: true,
|
|
4007
4646
|
ngImport: i0,
|
|
4008
|
-
template:
|
|
4009
|
-
<textarea
|
|
4010
|
-
class="form-control pw-json-field"
|
|
4011
|
-
rows="5"
|
|
4012
|
-
spellcheck="false"
|
|
4013
|
-
[id]="inputId"
|
|
4014
|
-
[readOnly]="readOnly"
|
|
4015
|
-
[(ngModel)]="text"
|
|
4016
|
-
[ngModelOptions]="{ standalone: true }"
|
|
4017
|
-
(blur)="commit()"
|
|
4018
|
-
></textarea>
|
|
4019
|
-
@if (invalid) {
|
|
4020
|
-
<pw-field-error-display
|
|
4021
|
-
[displayError]="true"
|
|
4022
|
-
[errorMsg]="'Flows.Versions.Editor.InvalidJson' | transloco"
|
|
4023
|
-
>
|
|
4024
|
-
</pw-field-error-display>
|
|
4025
|
-
}
|
|
4026
|
-
`,
|
|
4027
|
-
isInline: true,
|
|
4028
|
-
styles: [".pw-json-field{white-space:pre;overflow-x:auto}\n"],
|
|
4647
|
+
template: "<div class=\"d-flex flex-column gap-2\">\n <select class=\"form-select\"\n [id]=\"inputId\"\n [disabled]=\"readOnly\"\n [ngModel]=\"schedule.mode\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"setMode($event)\">\n @for (mode of modes; track mode) {\n <option [ngValue]=\"mode\">{{ 'Flows.Schedule.Mode.' + mode | transloco }}</option>\n }\n </select>\n\n @switch (schedule.mode) {\n @case ('minutes') {\n <select class=\"form-select\"\n [attr.aria-label]=\"'Flows.Schedule.Every' | transloco\"\n [disabled]=\"readOnly\"\n [ngModel]=\"schedule.every\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"update({ every: $event })\">\n @for (every of everyOptions; track every) {\n <option [ngValue]=\"every\">{{ 'Flows.Schedule.EveryMinutes' | transloco: { count: every } }}</option>\n }\n </select>\n }\n @case ('hourly') {\n <input class=\"form-control\"\n type=\"number\"\n min=\"0\"\n max=\"59\"\n [attr.aria-label]=\"'Flows.Schedule.Minute' | transloco\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"schedule.minute\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"update({ minute: +$event })\" />\n }\n @case ('custom') {\n <input class=\"form-control\"\n type=\"text\"\n placeholder=\"0 9 * * 1-5\"\n [attr.aria-label]=\"'Flows.Schedule.Mode.custom' | transloco\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"schedule.custom\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"update({ custom: $event })\" />\n }\n @default {\n <div class=\"d-flex gap-2\">\n @if (schedule.mode === 'weekly') {\n <select class=\"form-select\"\n [attr.aria-label]=\"'Flows.Schedule.Weekday' | transloco\"\n [disabled]=\"readOnly\"\n [ngModel]=\"schedule.weekday\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"update({ weekday: $event })\">\n @for (day of weekdays; track day.value) {\n <option [ngValue]=\"day.value\">{{ day.label }}</option>\n }\n </select>\n }\n @if (schedule.mode === 'monthly') {\n <select class=\"form-select\"\n [attr.aria-label]=\"'Flows.Schedule.Monthday' | transloco\"\n [disabled]=\"readOnly\"\n [ngModel]=\"schedule.monthday\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"update({ monthday: $event })\">\n @for (day of monthdays; track day) {\n <option [ngValue]=\"day\">{{ day }}</option>\n }\n </select>\n }\n <input class=\"form-control\"\n type=\"time\"\n [attr.aria-label]=\"'Flows.Schedule.Time' | transloco\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"time\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"setTime($event)\" />\n </div>\n }\n }\n\n @if (schedule.mode !== 'custom') {\n <small class=\"text-muted\">\n {{ 'Flows.Schedule.Summary.' + schedule.mode | transloco: { count: schedule.every, minute: schedule.minute, time: time, weekday: weekdayLabel, day: schedule.monthday } }}\n </small>\n }\n</div>\n",
|
|
4029
4648
|
dependencies: [
|
|
4649
|
+
{
|
|
4650
|
+
kind: "directive",
|
|
4651
|
+
type: i3$1.NgSelectOption,
|
|
4652
|
+
selector: "option",
|
|
4653
|
+
inputs: ["ngValue", "value"]
|
|
4654
|
+
},
|
|
4655
|
+
{
|
|
4656
|
+
kind: "directive",
|
|
4657
|
+
type: i3$1.ɵNgSelectMultipleOption,
|
|
4658
|
+
selector: "option",
|
|
4659
|
+
inputs: ["ngValue", "value"]
|
|
4660
|
+
},
|
|
4030
4661
|
{
|
|
4031
4662
|
kind: "directive",
|
|
4032
4663
|
type: i3$1.DefaultValueAccessor,
|
|
4033
4664
|
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
4034
4665
|
},
|
|
4666
|
+
{
|
|
4667
|
+
kind: "directive",
|
|
4668
|
+
type: i3$1.NumberValueAccessor,
|
|
4669
|
+
selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
|
|
4670
|
+
},
|
|
4671
|
+
{
|
|
4672
|
+
kind: "directive",
|
|
4673
|
+
type: i3$1.SelectControlValueAccessor,
|
|
4674
|
+
selector: "select:not([multiple]):not([ngNoCva])[formControlName],select:not([multiple]):not([ngNoCva])[formControl],select:not([multiple]):not([ngNoCva])[ngModel]",
|
|
4675
|
+
inputs: ["compareWith"]
|
|
4676
|
+
},
|
|
4035
4677
|
{
|
|
4036
4678
|
kind: "directive",
|
|
4037
4679
|
type: i3$1.NgControlStatus,
|
|
4038
4680
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
4039
4681
|
},
|
|
4682
|
+
{
|
|
4683
|
+
kind: "directive",
|
|
4684
|
+
type: i3$1.MinValidator,
|
|
4685
|
+
selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]",
|
|
4686
|
+
inputs: ["min"]
|
|
4687
|
+
},
|
|
4688
|
+
{
|
|
4689
|
+
kind: "directive",
|
|
4690
|
+
type: i3$1.MaxValidator,
|
|
4691
|
+
selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]",
|
|
4692
|
+
inputs: ["max"]
|
|
4693
|
+
},
|
|
4040
4694
|
{
|
|
4041
4695
|
kind: "directive",
|
|
4042
4696
|
type: i3$1.NgModel,
|
|
@@ -4050,12 +4704,6 @@ var FlowsJsonFieldComponent = class FlowsJsonFieldComponent {
|
|
|
4050
4704
|
outputs: ["ngModelChange"],
|
|
4051
4705
|
exportAs: ["ngModel"]
|
|
4052
4706
|
},
|
|
4053
|
-
{
|
|
4054
|
-
kind: "component",
|
|
4055
|
-
type: i2$1.FieldErrorDisplayComponent,
|
|
4056
|
-
selector: "pw-field-error-display",
|
|
4057
|
-
inputs: ["errorMsg", "displayError"]
|
|
4058
|
-
},
|
|
4059
4707
|
{
|
|
4060
4708
|
kind: "pipe",
|
|
4061
4709
|
type: i2$4.TranslocoPipe,
|
|
@@ -4069,298 +4717,75 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4069
4717
|
minVersion: "12.0.0",
|
|
4070
4718
|
version: "22.2.3",
|
|
4071
4719
|
ngImport: i0,
|
|
4072
|
-
type:
|
|
4720
|
+
type: FlowsCronFieldComponent,
|
|
4073
4721
|
decorators: [{
|
|
4074
4722
|
type: Component,
|
|
4075
4723
|
args: [{
|
|
4076
|
-
selector: "pw-flows-
|
|
4077
|
-
template: `
|
|
4078
|
-
<textarea
|
|
4079
|
-
class="form-control pw-json-field"
|
|
4080
|
-
rows="5"
|
|
4081
|
-
spellcheck="false"
|
|
4082
|
-
[id]="inputId"
|
|
4083
|
-
[readOnly]="readOnly"
|
|
4084
|
-
[(ngModel)]="text"
|
|
4085
|
-
[ngModelOptions]="{ standalone: true }"
|
|
4086
|
-
(blur)="commit()"
|
|
4087
|
-
></textarea>
|
|
4088
|
-
@if (invalid) {
|
|
4089
|
-
<pw-field-error-display
|
|
4090
|
-
[displayError]="true"
|
|
4091
|
-
[errorMsg]="'Flows.Versions.Editor.InvalidJson' | transloco"
|
|
4092
|
-
>
|
|
4093
|
-
</pw-field-error-display>
|
|
4094
|
-
}
|
|
4095
|
-
`,
|
|
4724
|
+
selector: "pw-flows-cron-field",
|
|
4096
4725
|
standalone: false,
|
|
4097
|
-
|
|
4726
|
+
template: "<div class=\"d-flex flex-column gap-2\">\n <select class=\"form-select\"\n [id]=\"inputId\"\n [disabled]=\"readOnly\"\n [ngModel]=\"schedule.mode\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"setMode($event)\">\n @for (mode of modes; track mode) {\n <option [ngValue]=\"mode\">{{ 'Flows.Schedule.Mode.' + mode | transloco }}</option>\n }\n </select>\n\n @switch (schedule.mode) {\n @case ('minutes') {\n <select class=\"form-select\"\n [attr.aria-label]=\"'Flows.Schedule.Every' | transloco\"\n [disabled]=\"readOnly\"\n [ngModel]=\"schedule.every\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"update({ every: $event })\">\n @for (every of everyOptions; track every) {\n <option [ngValue]=\"every\">{{ 'Flows.Schedule.EveryMinutes' | transloco: { count: every } }}</option>\n }\n </select>\n }\n @case ('hourly') {\n <input class=\"form-control\"\n type=\"number\"\n min=\"0\"\n max=\"59\"\n [attr.aria-label]=\"'Flows.Schedule.Minute' | transloco\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"schedule.minute\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"update({ minute: +$event })\" />\n }\n @case ('custom') {\n <input class=\"form-control\"\n type=\"text\"\n placeholder=\"0 9 * * 1-5\"\n [attr.aria-label]=\"'Flows.Schedule.Mode.custom' | transloco\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"schedule.custom\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"update({ custom: $event })\" />\n }\n @default {\n <div class=\"d-flex gap-2\">\n @if (schedule.mode === 'weekly') {\n <select class=\"form-select\"\n [attr.aria-label]=\"'Flows.Schedule.Weekday' | transloco\"\n [disabled]=\"readOnly\"\n [ngModel]=\"schedule.weekday\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"update({ weekday: $event })\">\n @for (day of weekdays; track day.value) {\n <option [ngValue]=\"day.value\">{{ day.label }}</option>\n }\n </select>\n }\n @if (schedule.mode === 'monthly') {\n <select class=\"form-select\"\n [attr.aria-label]=\"'Flows.Schedule.Monthday' | transloco\"\n [disabled]=\"readOnly\"\n [ngModel]=\"schedule.monthday\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"update({ monthday: $event })\">\n @for (day of monthdays; track day) {\n <option [ngValue]=\"day\">{{ day }}</option>\n }\n </select>\n }\n <input class=\"form-control\"\n type=\"time\"\n [attr.aria-label]=\"'Flows.Schedule.Time' | transloco\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"time\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"setTime($event)\" />\n </div>\n }\n }\n\n @if (schedule.mode !== 'custom') {\n <small class=\"text-muted\">\n {{ 'Flows.Schedule.Summary.' + schedule.mode | transloco: { count: schedule.every, minute: schedule.minute, time: time, weekday: weekdayLabel, day: schedule.monthday } }}\n </small>\n }\n</div>\n"
|
|
4098
4727
|
}]
|
|
4099
4728
|
}],
|
|
4729
|
+
ctorParameters: () => [{ type: i2$4.TranslocoService }],
|
|
4100
4730
|
propDecorators: {
|
|
4101
4731
|
value: [{ type: Input }],
|
|
4102
4732
|
inputId: [{ type: Input }],
|
|
4103
4733
|
readOnly: [{ type: Input }],
|
|
4104
4734
|
valueChange: [{ type: Output }]
|
|
4105
4735
|
}
|
|
4106
|
-
});
|
|
4107
|
-
const
|
|
4108
|
-
"
|
|
4109
|
-
"
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
"not_empty"
|
|
4117
|
-
];
|
|
4118
|
-
const LOGIC_OPS = {
|
|
4119
|
-
"==": "eq",
|
|
4120
|
-
"!=": "neq",
|
|
4121
|
-
">": "gt",
|
|
4122
|
-
">=": "gte",
|
|
4123
|
-
"<": "lt",
|
|
4124
|
-
"<=": "lte"
|
|
4125
|
-
};
|
|
4126
|
-
const OP_LOGIC = Object.fromEntries(Object.entries(LOGIC_OPS).map(([logic, op]) => [op, logic]));
|
|
4127
|
-
function isNumericOperator(operator) {
|
|
4128
|
-
return [
|
|
4129
|
-
"gt",
|
|
4130
|
-
"gte",
|
|
4131
|
-
"lt",
|
|
4132
|
-
"lte"
|
|
4133
|
-
].includes(operator);
|
|
4134
|
-
}
|
|
4135
|
-
function takesValue(operator) {
|
|
4136
|
-
return operator !== "empty" && operator !== "not_empty";
|
|
4137
|
-
}
|
|
4138
|
-
function emptyFlowConditionRule() {
|
|
4139
|
-
return {
|
|
4140
|
-
field: "",
|
|
4141
|
-
operator: "eq",
|
|
4142
|
-
value: "",
|
|
4143
|
-
valueType: "text"
|
|
4144
|
-
};
|
|
4145
|
-
}
|
|
4146
|
-
function typedValue(rule) {
|
|
4147
|
-
if (rule.valueType === "boolean") return rule.value === "true";
|
|
4148
|
-
return isNumericOperator(rule.operator) || rule.valueType === "number" ? Number(rule.value) : rule.value;
|
|
4149
|
-
}
|
|
4150
|
-
function isCompleteRule(rule) {
|
|
4151
|
-
if (!rule.field.trim()) return false;
|
|
4152
|
-
if (!takesValue(rule.operator)) return true;
|
|
4153
|
-
return isNumericOperator(rule.operator) || rule.valueType === "number" ? rule.value.trim() !== "" && Number.isFinite(Number(rule.value)) : true;
|
|
4154
|
-
}
|
|
4155
|
-
function ruleToLogic(rule) {
|
|
4156
|
-
const field = { var: rule.field.trim() };
|
|
4157
|
-
switch (rule.operator) {
|
|
4158
|
-
case "contains": return { in: [typedValue(rule), field] };
|
|
4159
|
-
case "empty": return { "==": [field, null] };
|
|
4160
|
-
case "not_empty": return { "!=": [field, null] };
|
|
4161
|
-
default: return { [OP_LOGIC[rule.operator]]: [field, typedValue(rule)] };
|
|
4162
|
-
}
|
|
4163
|
-
}
|
|
4164
|
-
function toJsonLogic(group) {
|
|
4165
|
-
if (!group.rules.length || !group.rules.every(isCompleteRule)) return;
|
|
4166
|
-
const logic = group.rules.map(ruleToLogic);
|
|
4167
|
-
return logic.length === 1 ? logic[0] : { [group.combinator === "all" ? "and" : "or"]: logic };
|
|
4168
|
-
}
|
|
4169
|
-
function asRecord(value) {
|
|
4170
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
4171
|
-
}
|
|
4172
|
-
function fieldOf(value) {
|
|
4173
|
-
const record = asRecord(value);
|
|
4174
|
-
const keys = record ? Object.keys(record) : [];
|
|
4175
|
-
return keys.length === 1 && keys[0] === "var" && typeof record?.["var"] === "string" ? record["var"] : null;
|
|
4176
|
-
}
|
|
4177
|
-
function valueRule(field, operator, value) {
|
|
4178
|
-
if (typeof value === "number") return {
|
|
4179
|
-
field,
|
|
4180
|
-
operator,
|
|
4181
|
-
value: String(value),
|
|
4182
|
-
valueType: "number"
|
|
4183
|
-
};
|
|
4184
|
-
if (typeof value === "boolean") return {
|
|
4185
|
-
field,
|
|
4186
|
-
operator,
|
|
4187
|
-
value: String(value),
|
|
4188
|
-
valueType: "boolean"
|
|
4189
|
-
};
|
|
4190
|
-
return typeof value === "string" ? {
|
|
4191
|
-
field,
|
|
4192
|
-
operator,
|
|
4193
|
-
value,
|
|
4194
|
-
valueType: "text"
|
|
4195
|
-
} : null;
|
|
4196
|
-
}
|
|
4197
|
-
function logicToRule(logic) {
|
|
4198
|
-
const record = asRecord(logic);
|
|
4199
|
-
const [op] = record ? Object.keys(record) : [];
|
|
4200
|
-
const args = record && Object.keys(record).length === 1 ? record[op] : null;
|
|
4201
|
-
if (!Array.isArray(args) || args.length !== 2) return null;
|
|
4202
|
-
if (op === "in") {
|
|
4203
|
-
const field = fieldOf(args[1]);
|
|
4204
|
-
return field ? valueRule(field, "contains", args[0]) : null;
|
|
4205
|
-
}
|
|
4206
|
-
const field = fieldOf(args[0]);
|
|
4207
|
-
const operator = LOGIC_OPS[op];
|
|
4208
|
-
if (!field || !operator) return null;
|
|
4209
|
-
if (args[1] === null && (operator === "eq" || operator === "neq")) return {
|
|
4210
|
-
field,
|
|
4211
|
-
operator: operator === "eq" ? "empty" : "not_empty",
|
|
4212
|
-
value: "",
|
|
4213
|
-
valueType: "text"
|
|
4214
|
-
};
|
|
4215
|
-
return valueRule(field, operator, args[1]);
|
|
4216
|
-
}
|
|
4217
|
-
function fromJsonLogic(logic) {
|
|
4218
|
-
const record = asRecord(logic);
|
|
4219
|
-
if (!record) return logic === void 0 || logic === null ? {
|
|
4220
|
-
combinator: "all",
|
|
4221
|
-
rules: []
|
|
4222
|
-
} : null;
|
|
4223
|
-
const [key] = Object.keys(record);
|
|
4224
|
-
const nested = Object.keys(record).length === 1 && (key === "and" || key === "or") ? record[key] : null;
|
|
4225
|
-
const rules = (Array.isArray(nested) ? nested : [logic]).map(logicToRule);
|
|
4226
|
-
if (rules.includes(null)) return null;
|
|
4227
|
-
return {
|
|
4228
|
-
combinator: key === "or" ? "any" : "all",
|
|
4229
|
-
rules
|
|
4230
|
-
};
|
|
4231
|
-
}
|
|
4232
|
-
const OPTION_KEYS = {
|
|
4233
|
-
operators: FLOW_CONDITION_OPERATORS.map((op) => [op, `Flows.Condition.Ops.${op}`]),
|
|
4234
|
-
types: [
|
|
4235
|
-
"text",
|
|
4236
|
-
"number",
|
|
4237
|
-
"boolean"
|
|
4238
|
-
].map((type) => [type, `Flows.Condition.Types.${type}`]),
|
|
4239
|
-
combinators: [["all", "Flows.Condition.All"], ["any", "Flows.Condition.Any"]],
|
|
4240
|
-
booleans: [["true", "Flows.Branch.true"], ["false", "Flows.Branch.false"]]
|
|
4241
|
-
};
|
|
4242
|
-
var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
4243
|
-
constructor(translation, cdr, destroyRef) {
|
|
4244
|
-
this.suggestions = [];
|
|
4245
|
-
this.readOnly = false;
|
|
4246
|
-
this.valueChange = new EventEmitter();
|
|
4247
|
-
this.icons = FLOWS_ICONS;
|
|
4248
|
-
this.options = {};
|
|
4249
|
-
this.takesValue = takesValue;
|
|
4250
|
-
this.isNumericOperator = isNumericOperator;
|
|
4251
|
-
this.group = {
|
|
4252
|
-
combinator: "all",
|
|
4253
|
-
rules: []
|
|
4254
|
-
};
|
|
4255
|
-
this.mode = "rules";
|
|
4256
|
-
this.incomplete = false;
|
|
4257
|
-
translation.selectTranslation("flows").pipe(takeUntilDestroyed(destroyRef)).subscribe(() => {
|
|
4258
|
-
this.options = Object.fromEntries(Object.entries(OPTION_KEYS).map(([name, entries]) => [name, entries.map(([value, key]) => ({
|
|
4259
|
-
value,
|
|
4260
|
-
label: translation.translate(key)
|
|
4261
|
-
}))]));
|
|
4262
|
-
cdr.markForCheck();
|
|
4263
|
-
});
|
|
4264
|
-
}
|
|
4265
|
-
ngOnChanges() {
|
|
4266
|
-
if (this.value !== void 0 && this.value === this.emitted) return;
|
|
4267
|
-
this.load(this.value);
|
|
4268
|
-
}
|
|
4269
|
-
get combinesRules() {
|
|
4270
|
-
return this.group.rules.length > 1;
|
|
4271
|
-
}
|
|
4272
|
-
get canUseRules() {
|
|
4273
|
-
return fromJsonLogic(this.value) !== null;
|
|
4274
|
-
}
|
|
4275
|
-
addRule() {
|
|
4276
|
-
this.group = {
|
|
4277
|
-
...this.group,
|
|
4278
|
-
rules: [...this.group.rules, emptyFlowConditionRule()]
|
|
4279
|
-
};
|
|
4280
|
-
this.incomplete = true;
|
|
4281
|
-
}
|
|
4282
|
-
removeRule(index) {
|
|
4283
|
-
this.group = {
|
|
4284
|
-
...this.group,
|
|
4285
|
-
rules: this.group.rules.filter((_, i) => i !== index)
|
|
4286
|
-
};
|
|
4287
|
-
this.commit();
|
|
4288
|
-
}
|
|
4289
|
-
useRules() {
|
|
4290
|
-
this.load(this.value);
|
|
4291
|
-
}
|
|
4292
|
-
useJson() {
|
|
4293
|
-
this.mode = "json";
|
|
4294
|
-
}
|
|
4295
|
-
commit() {
|
|
4296
|
-
if (this.readOnly) return;
|
|
4297
|
-
const logic = this.group.rules.length ? toJsonLogic(this.group) : void 0;
|
|
4298
|
-
this.incomplete = !!this.group.rules.length && logic === void 0;
|
|
4299
|
-
if (!this.incomplete) this.emit(logic);
|
|
4300
|
-
}
|
|
4301
|
-
emit(value) {
|
|
4302
|
-
this.emitted = value;
|
|
4303
|
-
this.valueChange.emit(value);
|
|
4304
|
-
}
|
|
4305
|
-
load(value) {
|
|
4306
|
-
const group = fromJsonLogic(value);
|
|
4307
|
-
this.mode = group ? "rules" : "json";
|
|
4308
|
-
this.group = group ?? {
|
|
4309
|
-
combinator: "all",
|
|
4310
|
-
rules: []
|
|
4311
|
-
};
|
|
4312
|
-
this.incomplete = false;
|
|
4736
|
+
});
|
|
4737
|
+
const ZONES = (() => {
|
|
4738
|
+
const zones = Intl.supportedValuesOf("timeZone");
|
|
4739
|
+
return zones.includes("UTC") ? zones : ["UTC", ...zones];
|
|
4740
|
+
})();
|
|
4741
|
+
var FlowsTimezoneFieldComponent = class FlowsTimezoneFieldComponent {
|
|
4742
|
+
constructor() {
|
|
4743
|
+
this.readOnly = false;
|
|
4744
|
+
this.valueChange = new EventEmitter();
|
|
4745
|
+
this.zones = ZONES;
|
|
4313
4746
|
}
|
|
4314
4747
|
static {
|
|
4315
4748
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4316
4749
|
minVersion: "12.0.0",
|
|
4317
4750
|
version: "22.2.3",
|
|
4318
4751
|
ngImport: i0,
|
|
4319
|
-
type:
|
|
4320
|
-
deps: [
|
|
4321
|
-
{ token: i2$4.TranslocoService },
|
|
4322
|
-
{ token: i0.ChangeDetectorRef },
|
|
4323
|
-
{ token: i0.DestroyRef }
|
|
4324
|
-
],
|
|
4752
|
+
type: FlowsTimezoneFieldComponent,
|
|
4753
|
+
deps: [],
|
|
4325
4754
|
target: i0.ɵɵFactoryTarget.Component
|
|
4326
4755
|
});
|
|
4327
4756
|
}
|
|
4328
4757
|
static {
|
|
4329
4758
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4330
|
-
minVersion: "
|
|
4759
|
+
minVersion: "14.0.0",
|
|
4331
4760
|
version: "22.2.3",
|
|
4332
|
-
type:
|
|
4761
|
+
type: FlowsTimezoneFieldComponent,
|
|
4333
4762
|
isStandalone: false,
|
|
4334
|
-
selector: "pw-flows-
|
|
4763
|
+
selector: "pw-flows-timezone-field",
|
|
4335
4764
|
inputs: {
|
|
4336
4765
|
value: "value",
|
|
4337
4766
|
inputId: "inputId",
|
|
4338
|
-
suggestions: "suggestions",
|
|
4339
4767
|
readOnly: "readOnly"
|
|
4340
4768
|
},
|
|
4341
4769
|
outputs: { valueChange: "valueChange" },
|
|
4342
|
-
usesOnChanges: true,
|
|
4343
4770
|
ngImport: i0,
|
|
4344
|
-
template:
|
|
4345
|
-
|
|
4771
|
+
template: `
|
|
4772
|
+
<p-select
|
|
4773
|
+
[inputId]="inputId"
|
|
4774
|
+
[options]="zones"
|
|
4775
|
+
[filter]="true"
|
|
4776
|
+
[showClear]="true"
|
|
4777
|
+
[disabled]="readOnly"
|
|
4778
|
+
[placeholder]="'Flows.Schedule.ServerTime' | transloco"
|
|
4779
|
+
[ngModel]="value"
|
|
4780
|
+
[ngModelOptions]="{ standalone: true }"
|
|
4781
|
+
(ngModelChange)="valueChange.emit($event || null)"
|
|
4782
|
+
appendTo="body"
|
|
4783
|
+
styleClass="w-100"
|
|
4784
|
+
>
|
|
4785
|
+
</p-select>
|
|
4786
|
+
`,
|
|
4787
|
+
isInline: true,
|
|
4346
4788
|
dependencies: [
|
|
4347
|
-
{
|
|
4348
|
-
kind: "directive",
|
|
4349
|
-
type: i3$1.NgSelectOption,
|
|
4350
|
-
selector: "option",
|
|
4351
|
-
inputs: ["ngValue", "value"]
|
|
4352
|
-
},
|
|
4353
|
-
{
|
|
4354
|
-
kind: "directive",
|
|
4355
|
-
type: i3$1.ɵNgSelectMultipleOption,
|
|
4356
|
-
selector: "option",
|
|
4357
|
-
inputs: ["ngValue", "value"]
|
|
4358
|
-
},
|
|
4359
|
-
{
|
|
4360
|
-
kind: "directive",
|
|
4361
|
-
type: i3$1.DefaultValueAccessor,
|
|
4362
|
-
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]"
|
|
4363
|
-
},
|
|
4364
4789
|
{
|
|
4365
4790
|
kind: "directive",
|
|
4366
4791
|
type: i3$1.NgControlStatus,
|
|
@@ -4379,34 +4804,6 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
4379
4804
|
outputs: ["ngModelChange"],
|
|
4380
4805
|
exportAs: ["ngModel"]
|
|
4381
4806
|
},
|
|
4382
|
-
{
|
|
4383
|
-
kind: "directive",
|
|
4384
|
-
type: i1$1.Tooltip,
|
|
4385
|
-
selector: "[pTooltip]",
|
|
4386
|
-
inputs: [
|
|
4387
|
-
"tooltipPosition",
|
|
4388
|
-
"tooltipEvent",
|
|
4389
|
-
"positionStyle",
|
|
4390
|
-
"tooltipStyleClass",
|
|
4391
|
-
"tooltipZIndex",
|
|
4392
|
-
"escape",
|
|
4393
|
-
"showDelay",
|
|
4394
|
-
"hideDelay",
|
|
4395
|
-
"life",
|
|
4396
|
-
"positionTop",
|
|
4397
|
-
"positionLeft",
|
|
4398
|
-
"autoHide",
|
|
4399
|
-
"fitContent",
|
|
4400
|
-
"hideOnEscape",
|
|
4401
|
-
"showOnEllipsis",
|
|
4402
|
-
"pTooltip",
|
|
4403
|
-
"tooltipDisabled",
|
|
4404
|
-
"tooltipOptions",
|
|
4405
|
-
"appendTo",
|
|
4406
|
-
"pTooltipPT",
|
|
4407
|
-
"pTooltipUnstyled"
|
|
4408
|
-
]
|
|
4409
|
-
},
|
|
4410
4807
|
{
|
|
4411
4808
|
kind: "component",
|
|
4412
4809
|
type: i4$1.Select,
|
|
@@ -4463,18 +4860,177 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
4463
4860
|
"filterValue",
|
|
4464
4861
|
"options",
|
|
4465
4862
|
"appendTo",
|
|
4466
|
-
"motionOptions"
|
|
4467
|
-
],
|
|
4468
|
-
outputs: [
|
|
4469
|
-
"onChange",
|
|
4470
|
-
"onFilter",
|
|
4471
|
-
"onFocus",
|
|
4472
|
-
"onBlur",
|
|
4473
|
-
"onClick",
|
|
4474
|
-
"onShow",
|
|
4475
|
-
"onHide",
|
|
4476
|
-
"onClear",
|
|
4477
|
-
"onLazyLoad"
|
|
4863
|
+
"motionOptions"
|
|
4864
|
+
],
|
|
4865
|
+
outputs: [
|
|
4866
|
+
"onChange",
|
|
4867
|
+
"onFilter",
|
|
4868
|
+
"onFocus",
|
|
4869
|
+
"onBlur",
|
|
4870
|
+
"onClick",
|
|
4871
|
+
"onShow",
|
|
4872
|
+
"onHide",
|
|
4873
|
+
"onClear",
|
|
4874
|
+
"onLazyLoad"
|
|
4875
|
+
]
|
|
4876
|
+
},
|
|
4877
|
+
{
|
|
4878
|
+
kind: "pipe",
|
|
4879
|
+
type: i2$4.TranslocoPipe,
|
|
4880
|
+
name: "transloco"
|
|
4881
|
+
}
|
|
4882
|
+
]
|
|
4883
|
+
});
|
|
4884
|
+
}
|
|
4885
|
+
};
|
|
4886
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
4887
|
+
minVersion: "12.0.0",
|
|
4888
|
+
version: "22.2.3",
|
|
4889
|
+
ngImport: i0,
|
|
4890
|
+
type: FlowsTimezoneFieldComponent,
|
|
4891
|
+
decorators: [{
|
|
4892
|
+
type: Component,
|
|
4893
|
+
args: [{
|
|
4894
|
+
selector: "pw-flows-timezone-field",
|
|
4895
|
+
template: `
|
|
4896
|
+
<p-select
|
|
4897
|
+
[inputId]="inputId"
|
|
4898
|
+
[options]="zones"
|
|
4899
|
+
[filter]="true"
|
|
4900
|
+
[showClear]="true"
|
|
4901
|
+
[disabled]="readOnly"
|
|
4902
|
+
[placeholder]="'Flows.Schedule.ServerTime' | transloco"
|
|
4903
|
+
[ngModel]="value"
|
|
4904
|
+
[ngModelOptions]="{ standalone: true }"
|
|
4905
|
+
(ngModelChange)="valueChange.emit($event || null)"
|
|
4906
|
+
appendTo="body"
|
|
4907
|
+
styleClass="w-100"
|
|
4908
|
+
>
|
|
4909
|
+
</p-select>
|
|
4910
|
+
`,
|
|
4911
|
+
standalone: false
|
|
4912
|
+
}]
|
|
4913
|
+
}],
|
|
4914
|
+
propDecorators: {
|
|
4915
|
+
value: [{ type: Input }],
|
|
4916
|
+
inputId: [{ type: Input }],
|
|
4917
|
+
readOnly: [{ type: Input }],
|
|
4918
|
+
valueChange: [{ type: Output }]
|
|
4919
|
+
}
|
|
4920
|
+
});
|
|
4921
|
+
var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
4922
|
+
constructor() {
|
|
4923
|
+
this.readOnly = false;
|
|
4924
|
+
this.valueChange = new EventEmitter();
|
|
4925
|
+
this.icons = FLOWS_ICONS;
|
|
4926
|
+
this.pairs = [];
|
|
4927
|
+
}
|
|
4928
|
+
ngOnChanges() {
|
|
4929
|
+
if (this.value !== void 0 && this.value === this.emitted) return;
|
|
4930
|
+
const record = this.value && typeof this.value === "object" && !Array.isArray(this.value) ? this.value : {};
|
|
4931
|
+
this.pairs = Object.entries(record).map(([key, value]) => ({
|
|
4932
|
+
key,
|
|
4933
|
+
value: typeof value === "string" ? value : JSON.stringify(value),
|
|
4934
|
+
original: value
|
|
4935
|
+
}));
|
|
4936
|
+
}
|
|
4937
|
+
addPair() {
|
|
4938
|
+
this.pairs = [...this.pairs, {
|
|
4939
|
+
key: "",
|
|
4940
|
+
value: ""
|
|
4941
|
+
}];
|
|
4942
|
+
}
|
|
4943
|
+
removePair(index) {
|
|
4944
|
+
this.pairs = this.pairs.filter((_, i) => i !== index);
|
|
4945
|
+
this.commit();
|
|
4946
|
+
}
|
|
4947
|
+
editValue(pair, value) {
|
|
4948
|
+
pair.value = value;
|
|
4949
|
+
delete pair.original;
|
|
4950
|
+
}
|
|
4951
|
+
commit() {
|
|
4952
|
+
const record = {};
|
|
4953
|
+
this.pairs.filter((pair) => pair.key.trim()).forEach((pair) => record[pair.key.trim()] = "original" in pair ? pair.original : pair.value);
|
|
4954
|
+
this.emitted = record;
|
|
4955
|
+
this.valueChange.emit(record);
|
|
4956
|
+
}
|
|
4957
|
+
static {
|
|
4958
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4959
|
+
minVersion: "12.0.0",
|
|
4960
|
+
version: "22.2.3",
|
|
4961
|
+
ngImport: i0,
|
|
4962
|
+
type: FlowsPairsFieldComponent,
|
|
4963
|
+
deps: [],
|
|
4964
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
4965
|
+
});
|
|
4966
|
+
}
|
|
4967
|
+
static {
|
|
4968
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4969
|
+
minVersion: "17.0.0",
|
|
4970
|
+
version: "22.2.3",
|
|
4971
|
+
type: FlowsPairsFieldComponent,
|
|
4972
|
+
isStandalone: false,
|
|
4973
|
+
selector: "pw-flows-pairs-field",
|
|
4974
|
+
inputs: {
|
|
4975
|
+
value: "value",
|
|
4976
|
+
inputId: "inputId",
|
|
4977
|
+
readOnly: "readOnly"
|
|
4978
|
+
},
|
|
4979
|
+
outputs: { valueChange: "valueChange" },
|
|
4980
|
+
usesOnChanges: true,
|
|
4981
|
+
ngImport: i0,
|
|
4982
|
+
template: "<div class=\"pw-pairs-field\"\n [id]=\"inputId\">\n @for (pair of pairs; track $index) {\n <div class=\"pw-pairs-field__row\"\n data-testid=\"flow-pair\">\n <input type=\"text\"\n class=\"form-control\"\n [attr.aria-label]=\"'Flows.Inspector.FieldName' | transloco\"\n [placeholder]=\"'Flows.Inspector.FieldName' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"pair.key\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n <input type=\"text\"\n class=\"form-control\"\n [attr.aria-label]=\"'Flows.Inspector.FieldValue' | transloco\"\n [placeholder]=\"'Flows.Inspector.FieldValue' | transloco\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"pair.value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"editValue(pair, $event)\"\n (blur)=\"commit()\" />\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-pairs-field__remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveField' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveField' | transloco\"\n appendTo=\"body\"\n (click)=\"removePair($index)\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </div>\n }\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n (click)=\"addPair()\">\n {{ 'Flows.Inspector.AddField' | transloco }}\n </button>\n }\n</div>\n",
|
|
4983
|
+
styles: [".pw-pairs-field{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.pw-pairs-field__row{display:flex;align-items:center;gap:8px;width:100%}.pw-pairs-field__remove{flex:none;color:#5a6473}\n"],
|
|
4984
|
+
dependencies: [
|
|
4985
|
+
{
|
|
4986
|
+
kind: "directive",
|
|
4987
|
+
type: i3$1.DefaultValueAccessor,
|
|
4988
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
4989
|
+
},
|
|
4990
|
+
{
|
|
4991
|
+
kind: "directive",
|
|
4992
|
+
type: i3$1.NgControlStatus,
|
|
4993
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
4994
|
+
},
|
|
4995
|
+
{
|
|
4996
|
+
kind: "directive",
|
|
4997
|
+
type: i3$1.NgModel,
|
|
4998
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
4999
|
+
inputs: [
|
|
5000
|
+
"name",
|
|
5001
|
+
"disabled",
|
|
5002
|
+
"ngModel",
|
|
5003
|
+
"ngModelOptions"
|
|
5004
|
+
],
|
|
5005
|
+
outputs: ["ngModelChange"],
|
|
5006
|
+
exportAs: ["ngModel"]
|
|
5007
|
+
},
|
|
5008
|
+
{
|
|
5009
|
+
kind: "directive",
|
|
5010
|
+
type: i1$1.Tooltip,
|
|
5011
|
+
selector: "[pTooltip]",
|
|
5012
|
+
inputs: [
|
|
5013
|
+
"tooltipPosition",
|
|
5014
|
+
"tooltipEvent",
|
|
5015
|
+
"positionStyle",
|
|
5016
|
+
"tooltipStyleClass",
|
|
5017
|
+
"tooltipZIndex",
|
|
5018
|
+
"escape",
|
|
5019
|
+
"showDelay",
|
|
5020
|
+
"hideDelay",
|
|
5021
|
+
"life",
|
|
5022
|
+
"positionTop",
|
|
5023
|
+
"positionLeft",
|
|
5024
|
+
"autoHide",
|
|
5025
|
+
"fitContent",
|
|
5026
|
+
"hideOnEscape",
|
|
5027
|
+
"showOnEllipsis",
|
|
5028
|
+
"pTooltip",
|
|
5029
|
+
"tooltipDisabled",
|
|
5030
|
+
"tooltipOptions",
|
|
5031
|
+
"appendTo",
|
|
5032
|
+
"pTooltipPT",
|
|
5033
|
+
"pTooltipUnstyled"
|
|
4478
5034
|
]
|
|
4479
5035
|
},
|
|
4480
5036
|
{
|
|
@@ -4514,17 +5070,6 @@ var FlowsConditionFieldComponent = class FlowsConditionFieldComponent {
|
|
|
4514
5070
|
"a11yRoleChange"
|
|
4515
5071
|
]
|
|
4516
5072
|
},
|
|
4517
|
-
{
|
|
4518
|
-
kind: "component",
|
|
4519
|
-
type: FlowsJsonFieldComponent,
|
|
4520
|
-
selector: "pw-flows-json-field",
|
|
4521
|
-
inputs: [
|
|
4522
|
-
"value",
|
|
4523
|
-
"inputId",
|
|
4524
|
-
"readOnly"
|
|
4525
|
-
],
|
|
4526
|
-
outputs: ["valueChange"]
|
|
4527
|
-
},
|
|
4528
5073
|
{
|
|
4529
5074
|
kind: "pipe",
|
|
4530
5075
|
type: i2$4.TranslocoPipe,
|
|
@@ -4538,71 +5083,84 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4538
5083
|
minVersion: "12.0.0",
|
|
4539
5084
|
version: "22.2.3",
|
|
4540
5085
|
ngImport: i0,
|
|
4541
|
-
type:
|
|
5086
|
+
type: FlowsPairsFieldComponent,
|
|
4542
5087
|
decorators: [{
|
|
4543
5088
|
type: Component,
|
|
4544
5089
|
args: [{
|
|
4545
|
-
selector: "pw-flows-
|
|
5090
|
+
selector: "pw-flows-pairs-field",
|
|
4546
5091
|
standalone: false,
|
|
4547
|
-
template: "<div class=\"pw-
|
|
4548
|
-
styles: [".pw-
|
|
5092
|
+
template: "<div class=\"pw-pairs-field\"\n [id]=\"inputId\">\n @for (pair of pairs; track $index) {\n <div class=\"pw-pairs-field__row\"\n data-testid=\"flow-pair\">\n <input type=\"text\"\n class=\"form-control\"\n [attr.aria-label]=\"'Flows.Inspector.FieldName' | transloco\"\n [placeholder]=\"'Flows.Inspector.FieldName' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"pair.key\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n <input type=\"text\"\n class=\"form-control\"\n [attr.aria-label]=\"'Flows.Inspector.FieldValue' | transloco\"\n [placeholder]=\"'Flows.Inspector.FieldValue' | transloco\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"pair.value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"editValue(pair, $event)\"\n (blur)=\"commit()\" />\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-pairs-field__remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveField' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveField' | transloco\"\n appendTo=\"body\"\n (click)=\"removePair($index)\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </div>\n }\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n (click)=\"addPair()\">\n {{ 'Flows.Inspector.AddField' | transloco }}\n </button>\n }\n</div>\n",
|
|
5093
|
+
styles: [".pw-pairs-field{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.pw-pairs-field__row{display:flex;align-items:center;gap:8px;width:100%}.pw-pairs-field__remove{flex:none;color:#5a6473}\n"]
|
|
4549
5094
|
}]
|
|
4550
5095
|
}],
|
|
4551
|
-
ctorParameters: () => [
|
|
4552
|
-
{ type: i2$4.TranslocoService },
|
|
4553
|
-
{ type: i0.ChangeDetectorRef },
|
|
4554
|
-
{ type: i0.DestroyRef }
|
|
4555
|
-
],
|
|
4556
5096
|
propDecorators: {
|
|
4557
5097
|
value: [{ type: Input }],
|
|
4558
5098
|
inputId: [{ type: Input }],
|
|
4559
|
-
suggestions: [{ type: Input }],
|
|
4560
5099
|
readOnly: [{ type: Input }],
|
|
4561
5100
|
valueChange: [{ type: Output }]
|
|
4562
5101
|
}
|
|
4563
5102
|
});
|
|
4564
|
-
|
|
5103
|
+
function flowChoiceName(name) {
|
|
5104
|
+
return name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
5105
|
+
}
|
|
5106
|
+
const FLOW_RESERVED_CHOICES = [
|
|
5107
|
+
"next",
|
|
5108
|
+
"error",
|
|
5109
|
+
"unsure"
|
|
5110
|
+
];
|
|
5111
|
+
function flowChoiceProblem(names, index) {
|
|
5112
|
+
const name = names[index];
|
|
5113
|
+
if (!name) return null;
|
|
5114
|
+
if (FLOW_RESERVED_CHOICES.includes(name)) return "Flows.Inspector.ChoiceReserved";
|
|
5115
|
+
return names.indexOf(name) < index ? "Flows.Inspector.ChoiceDuplicate" : null;
|
|
5116
|
+
}
|
|
5117
|
+
var FlowsChoicesFieldComponent = class FlowsChoicesFieldComponent {
|
|
4565
5118
|
constructor() {
|
|
4566
5119
|
this.readOnly = false;
|
|
4567
5120
|
this.valueChange = new EventEmitter();
|
|
4568
5121
|
this.icons = FLOWS_ICONS;
|
|
4569
|
-
this.
|
|
5122
|
+
this.choices = [];
|
|
5123
|
+
this.problems = [];
|
|
4570
5124
|
}
|
|
4571
5125
|
ngOnChanges() {
|
|
4572
5126
|
if (this.value !== void 0 && this.value === this.emitted) return;
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
value: typeof value === "string" ? value : JSON.stringify(value),
|
|
4577
|
-
original: value
|
|
5127
|
+
this.choices = (Array.isArray(this.value) ? this.value : []).filter((choice) => choice && typeof choice === "object").map((choice) => ({
|
|
5128
|
+
name: `${choice.name ?? ""}`,
|
|
5129
|
+
description: `${choice.description ?? ""}`
|
|
4578
5130
|
}));
|
|
5131
|
+
this.checkNames();
|
|
4579
5132
|
}
|
|
4580
|
-
|
|
4581
|
-
this.
|
|
4582
|
-
|
|
4583
|
-
|
|
5133
|
+
addChoice() {
|
|
5134
|
+
this.choices = [...this.choices, {
|
|
5135
|
+
name: "",
|
|
5136
|
+
description: ""
|
|
4584
5137
|
}];
|
|
5138
|
+
this.checkNames();
|
|
4585
5139
|
}
|
|
4586
|
-
|
|
4587
|
-
this.
|
|
5140
|
+
removeChoice(index) {
|
|
5141
|
+
this.choices = this.choices.filter((_, i) => i !== index);
|
|
4588
5142
|
this.commit();
|
|
4589
5143
|
}
|
|
4590
|
-
editValue(pair, value) {
|
|
4591
|
-
pair.value = value;
|
|
4592
|
-
delete pair.original;
|
|
4593
|
-
}
|
|
4594
5144
|
commit() {
|
|
4595
|
-
|
|
4596
|
-
this.
|
|
4597
|
-
this.
|
|
4598
|
-
|
|
5145
|
+
this.choices.forEach((choice) => choice.name = flowChoiceName(choice.name));
|
|
5146
|
+
this.checkNames();
|
|
5147
|
+
const kept = this.choices.filter((choice) => choice.name).map((choice) => ({
|
|
5148
|
+
name: choice.name,
|
|
5149
|
+
description: choice.description.trim()
|
|
5150
|
+
}));
|
|
5151
|
+
this.emitted = kept;
|
|
5152
|
+
this.valueChange.emit(kept);
|
|
5153
|
+
}
|
|
5154
|
+
checkNames() {
|
|
5155
|
+
const names = this.choices.map((choice) => choice.name);
|
|
5156
|
+
this.problems = names.map((_, index) => flowChoiceProblem(names, index));
|
|
4599
5157
|
}
|
|
4600
5158
|
static {
|
|
4601
5159
|
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
4602
5160
|
minVersion: "12.0.0",
|
|
4603
5161
|
version: "22.2.3",
|
|
4604
5162
|
ngImport: i0,
|
|
4605
|
-
type:
|
|
5163
|
+
type: FlowsChoicesFieldComponent,
|
|
4606
5164
|
deps: [],
|
|
4607
5165
|
target: i0.ɵɵFactoryTarget.Component
|
|
4608
5166
|
});
|
|
@@ -4611,9 +5169,9 @@ var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
|
4611
5169
|
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
4612
5170
|
minVersion: "17.0.0",
|
|
4613
5171
|
version: "22.2.3",
|
|
4614
|
-
type:
|
|
5172
|
+
type: FlowsChoicesFieldComponent,
|
|
4615
5173
|
isStandalone: false,
|
|
4616
|
-
selector: "pw-flows-
|
|
5174
|
+
selector: "pw-flows-choices-field",
|
|
4617
5175
|
inputs: {
|
|
4618
5176
|
value: "value",
|
|
4619
5177
|
inputId: "inputId",
|
|
@@ -4622,8 +5180,8 @@ var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
|
4622
5180
|
outputs: { valueChange: "valueChange" },
|
|
4623
5181
|
usesOnChanges: true,
|
|
4624
5182
|
ngImport: i0,
|
|
4625
|
-
template: "<div class=\"pw-
|
|
4626
|
-
styles: [".pw-
|
|
5183
|
+
template: "<div class=\"pw-choices-field\"\n [id]=\"inputId\">\n @for (choice of choices; track $index) {\n <div class=\"pw-choices-field__row\"\n data-testid=\"flow-choice\">\n <input type=\"text\"\n class=\"form-control\"\n [attr.aria-label]=\"'Flows.Inspector.ChoiceName' | transloco\"\n [placeholder]=\"'Flows.Inspector.ChoiceName' | transloco\"\n [readOnly]=\"readOnly\"\n maxlength=\"40\"\n [(ngModel)]=\"choice.name\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-choices-field__remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveChoice' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveChoice' | transloco\"\n appendTo=\"body\"\n (click)=\"removeChoice($index)\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n <textarea class=\"form-control pw-choices-field__description\"\n rows=\"2\"\n maxlength=\"200\"\n [attr.aria-label]=\"'Flows.Inspector.ChoiceDescription' | transloco\"\n [placeholder]=\"'Flows.Inspector.ChoiceDescription' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"choice.description\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\"></textarea>\n @if (problems[$index]; as problem) {\n <p class=\"pw-choices-field__problem\"\n role=\"status\"\n data-testid=\"flow-choice-problem\">\n <fa-icon [icon]=\"icons.warning\"\n aria-hidden=\"true\"></fa-icon>\n {{ problem | transloco: { name: choice.name } }}\n </p>\n }\n </div>\n }\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-choice-add\"\n (click)=\"addChoice()\">\n {{ 'Flows.Inspector.AddChoice' | transloco }}\n </button>\n }\n</div>\n",
|
|
5184
|
+
styles: [".pw-choices-field{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.pw-choices-field__row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 8px;width:100%;padding-bottom:8px;border-bottom:1px solid #e2e5ea}.pw-choices-field__description{grid-column:1/-1}.pw-choices-field__remove{color:#5a6473}.pw-choices-field__problem{grid-column:1/-1;display:flex;align-items:baseline;gap:6px;margin:0;color:#8a5a00;font-size:12px}\n"],
|
|
4627
5185
|
dependencies: [
|
|
4628
5186
|
{
|
|
4629
5187
|
kind: "directive",
|
|
@@ -4635,6 +5193,12 @@ var FlowsPairsFieldComponent = class FlowsPairsFieldComponent {
|
|
|
4635
5193
|
type: i3$1.NgControlStatus,
|
|
4636
5194
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
4637
5195
|
},
|
|
5196
|
+
{
|
|
5197
|
+
kind: "directive",
|
|
5198
|
+
type: i3$1.MaxLengthValidator,
|
|
5199
|
+
selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",
|
|
5200
|
+
inputs: ["maxlength"]
|
|
5201
|
+
},
|
|
4638
5202
|
{
|
|
4639
5203
|
kind: "directive",
|
|
4640
5204
|
type: i3$1.NgModel,
|
|
@@ -4726,14 +5290,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4726
5290
|
minVersion: "12.0.0",
|
|
4727
5291
|
version: "22.2.3",
|
|
4728
5292
|
ngImport: i0,
|
|
4729
|
-
type:
|
|
5293
|
+
type: FlowsChoicesFieldComponent,
|
|
4730
5294
|
decorators: [{
|
|
4731
5295
|
type: Component,
|
|
4732
5296
|
args: [{
|
|
4733
|
-
selector: "pw-flows-
|
|
5297
|
+
selector: "pw-flows-choices-field",
|
|
4734
5298
|
standalone: false,
|
|
4735
|
-
template: "<div class=\"pw-
|
|
4736
|
-
styles: [".pw-
|
|
5299
|
+
template: "<div class=\"pw-choices-field\"\n [id]=\"inputId\">\n @for (choice of choices; track $index) {\n <div class=\"pw-choices-field__row\"\n data-testid=\"flow-choice\">\n <input type=\"text\"\n class=\"form-control\"\n [attr.aria-label]=\"'Flows.Inspector.ChoiceName' | transloco\"\n [placeholder]=\"'Flows.Inspector.ChoiceName' | transloco\"\n [readOnly]=\"readOnly\"\n maxlength=\"40\"\n [(ngModel)]=\"choice.name\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\" />\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-choices-field__remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveChoice' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveChoice' | transloco\"\n appendTo=\"body\"\n (click)=\"removeChoice($index)\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n <textarea class=\"form-control pw-choices-field__description\"\n rows=\"2\"\n maxlength=\"200\"\n [attr.aria-label]=\"'Flows.Inspector.ChoiceDescription' | transloco\"\n [placeholder]=\"'Flows.Inspector.ChoiceDescription' | transloco\"\n [readOnly]=\"readOnly\"\n [(ngModel)]=\"choice.description\"\n [ngModelOptions]=\"{ standalone: true }\"\n (blur)=\"commit()\"></textarea>\n @if (problems[$index]; as problem) {\n <p class=\"pw-choices-field__problem\"\n role=\"status\"\n data-testid=\"flow-choice-problem\">\n <fa-icon [icon]=\"icons.warning\"\n aria-hidden=\"true\"></fa-icon>\n {{ problem | transloco: { name: choice.name } }}\n </p>\n }\n </div>\n }\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-default btn-sm\"\n data-testid=\"flow-choice-add\"\n (click)=\"addChoice()\">\n {{ 'Flows.Inspector.AddChoice' | transloco }}\n </button>\n }\n</div>\n",
|
|
5300
|
+
styles: [".pw-choices-field{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.pw-choices-field__row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 8px;width:100%;padding-bottom:8px;border-bottom:1px solid #e2e5ea}.pw-choices-field__description{grid-column:1/-1}.pw-choices-field__remove{color:#5a6473}.pw-choices-field__problem{grid-column:1/-1;display:flex;align-items:baseline;gap:6px;margin:0;color:#8a5a00;font-size:12px}\n"]
|
|
4737
5301
|
}]
|
|
4738
5302
|
}],
|
|
4739
5303
|
propDecorators: {
|
|
@@ -4956,20 +5520,268 @@ var FlowsMemberFieldComponent = class FlowsMemberFieldComponent {
|
|
|
4956
5520
|
"onAdd",
|
|
4957
5521
|
"onFocus",
|
|
4958
5522
|
"onBlur",
|
|
4959
|
-
"onDropdownClick",
|
|
4960
|
-
"onClear",
|
|
4961
|
-
"onInputKeydown",
|
|
4962
|
-
"onKeyUp",
|
|
5523
|
+
"onDropdownClick",
|
|
5524
|
+
"onClear",
|
|
5525
|
+
"onInputKeydown",
|
|
5526
|
+
"onKeyUp",
|
|
5527
|
+
"onShow",
|
|
5528
|
+
"onHide",
|
|
5529
|
+
"onLazyLoad"
|
|
5530
|
+
]
|
|
5531
|
+
},
|
|
5532
|
+
{
|
|
5533
|
+
kind: "component",
|
|
5534
|
+
type: i2$1.FieldErrorDisplayComponent,
|
|
5535
|
+
selector: "pw-field-error-display",
|
|
5536
|
+
inputs: ["errorMsg", "displayError"]
|
|
5537
|
+
},
|
|
5538
|
+
{
|
|
5539
|
+
kind: "pipe",
|
|
5540
|
+
type: i2$4.TranslocoPipe,
|
|
5541
|
+
name: "transloco"
|
|
5542
|
+
}
|
|
5543
|
+
]
|
|
5544
|
+
});
|
|
5545
|
+
}
|
|
5546
|
+
};
|
|
5547
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
5548
|
+
minVersion: "12.0.0",
|
|
5549
|
+
version: "22.2.3",
|
|
5550
|
+
ngImport: i0,
|
|
5551
|
+
type: FlowsMemberFieldComponent,
|
|
5552
|
+
decorators: [{
|
|
5553
|
+
type: Component,
|
|
5554
|
+
args: [{
|
|
5555
|
+
selector: "pw-flows-member-field",
|
|
5556
|
+
standalone: false,
|
|
5557
|
+
template: "<p-auto-complete class=\"w-100\"\n [inputId]=\"inputId\"\n [ngModel]=\"selection\"\n [ngModelOptions]=\"{ standalone: true }\"\n [suggestions]=\"suggestions\"\n [multiple]=\"multiple\"\n [forceSelection]=\"true\"\n [disabled]=\"readOnly\"\n [minQueryLength]=\"1\"\n [delay]=\"250\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'Flows.Inspector.NoMembers' | transloco\"\n optionLabel=\"name\"\n dataKey=\"id\"\n appendTo=\"body\"\n (completeMethod)=\"complete($event.query)\"\n (ngModelChange)=\"changed($event)\">\n <ng-template let-member\n #item>\n <div class=\"d-flex flex-column\">\n <span>{{ member.name }}</span>\n <small class=\"text-muted\">{{ member.email }}</small>\n </div>\n </ng-template>\n</p-auto-complete>\n@if (failed) {\n<pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Inspector.MembersUnavailable' | transloco\">\n</pw-field-error-display>\n}\n"
|
|
5558
|
+
}]
|
|
5559
|
+
}],
|
|
5560
|
+
ctorParameters: () => [{ type: FlowsMemberService }, { type: i0.ChangeDetectorRef }],
|
|
5561
|
+
propDecorators: {
|
|
5562
|
+
value: [{ type: Input }],
|
|
5563
|
+
multiple: [{ type: Input }],
|
|
5564
|
+
subscriptionId: [{ type: Input }],
|
|
5565
|
+
inputId: [{ type: Input }],
|
|
5566
|
+
readOnly: [{ type: Input }],
|
|
5567
|
+
valueChange: [{ type: Output }]
|
|
5568
|
+
}
|
|
5569
|
+
});
|
|
5570
|
+
function toIds(value) {
|
|
5571
|
+
return (Array.isArray(value) ? value : [value]).map(Number).filter((id) => Number.isInteger(id) && id > 0);
|
|
5572
|
+
}
|
|
5573
|
+
var FlowsParamFieldComponent = class FlowsParamFieldComponent {
|
|
5574
|
+
constructor(translation, cdr, destroyRef) {
|
|
5575
|
+
this.readOnly = false;
|
|
5576
|
+
this.listSuggestions = [];
|
|
5577
|
+
this.valueChange = new EventEmitter();
|
|
5578
|
+
this.mergeModes = [];
|
|
5579
|
+
this.defaultMergeMode = FLOW_MERGE_MODES[0];
|
|
5580
|
+
this.numberValue = flowNumberValue;
|
|
5581
|
+
translation.selectTranslation("flows").pipe(takeUntilDestroyed(destroyRef)).subscribe(() => {
|
|
5582
|
+
this.mergeModes = FLOW_MERGE_MODES.map((mode) => ({
|
|
5583
|
+
value: mode,
|
|
5584
|
+
label: translation.translate(`Flows.MergeModes.${mode}`)
|
|
5585
|
+
}));
|
|
5586
|
+
cdr.markForCheck();
|
|
5587
|
+
});
|
|
5588
|
+
}
|
|
5589
|
+
get kind() {
|
|
5590
|
+
return this.field.kind === "list" && !this.listSuggestions.length ? "text" : this.field.kind;
|
|
5591
|
+
}
|
|
5592
|
+
static {
|
|
5593
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
5594
|
+
minVersion: "12.0.0",
|
|
5595
|
+
version: "22.2.3",
|
|
5596
|
+
ngImport: i0,
|
|
5597
|
+
type: FlowsParamFieldComponent,
|
|
5598
|
+
deps: [
|
|
5599
|
+
{ token: i2$4.TranslocoService },
|
|
5600
|
+
{ token: i0.ChangeDetectorRef },
|
|
5601
|
+
{ token: i0.DestroyRef }
|
|
5602
|
+
],
|
|
5603
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
5604
|
+
});
|
|
5605
|
+
}
|
|
5606
|
+
static {
|
|
5607
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
5608
|
+
minVersion: "17.0.0",
|
|
5609
|
+
version: "22.2.3",
|
|
5610
|
+
type: FlowsParamFieldComponent,
|
|
5611
|
+
isStandalone: false,
|
|
5612
|
+
selector: "pw-flows-param-field",
|
|
5613
|
+
inputs: {
|
|
5614
|
+
field: "field",
|
|
5615
|
+
value: "value",
|
|
5616
|
+
readOnly: "readOnly",
|
|
5617
|
+
subscriptionId: "subscriptionId",
|
|
5618
|
+
listSuggestions: "listSuggestions"
|
|
5619
|
+
},
|
|
5620
|
+
outputs: { valueChange: "valueChange" },
|
|
5621
|
+
ngImport: i0,
|
|
5622
|
+
template: "@switch (kind) {\n@case ('textarea') {\n<textarea class=\"form-control\" rows=\"4\"\n [id]=\"field.id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"valueChange.emit($event)\"></textarea>\n}\n@case ('cron') {\n<pw-flows-cron-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-cron-field>\n}\n@case ('timezone') {\n<pw-flows-timezone-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-timezone-field>\n}\n@case ('pairs') {\n<pw-flows-pairs-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-pairs-field>\n}\n@case ('choices') {\n<pw-flows-choices-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-choices-field>\n}\n@case ('json') {\n<pw-flows-json-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-json-field>\n}\n@case ('member') {\n<pw-flows-member-field [inputId]=\"field.id\"\n [value]=\"value\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-member-field>\n}\n@case ('members') {\n<pw-flows-member-field [inputId]=\"field.id\"\n [multiple]=\"true\"\n [value]=\"value\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-member-field>\n}\n@case ('mode') {\n<p-select [inputId]=\"field.id\"\n [options]=\"mergeModes\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"value ?? defaultMergeMode\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"valueChange.emit($event)\"></p-select>\n}\n@case ('list') {\n<p-select [inputId]=\"field.id\"\n [options]=\"listSuggestions\"\n [editable]=\"true\"\n [placeholder]=\"'Flows.Inspector.SelectList' | transloco\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"valueChange.emit($event ?? undefined)\"></p-select>\n}\n@case ('select') {\n<p-select [inputId]=\"field.id\"\n [options]=\"field.options ?? []\"\n [placeholder]=\"field.placeholder ?? ''\"\n [showClear]=\"!field.required\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"valueChange.emit($event ?? undefined)\"></p-select>\n}\n@case ('number') {\n<input class=\"form-control\"\n type=\"text\"\n inputmode=\"decimal\"\n [id]=\"field.id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"valueChange.emit(numberValue($event))\" />\n}\n@default {\n<input class=\"form-control\" type=\"text\" autocomplete=\"off\"\n [attr.inputmode]=\"field.kind === 'email' ? 'email' : null\"\n [id]=\"field.id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"valueChange.emit($event)\" />\n}\n}\n",
|
|
5623
|
+
styles: [":host{display:block}\n"],
|
|
5624
|
+
dependencies: [
|
|
5625
|
+
{
|
|
5626
|
+
kind: "directive",
|
|
5627
|
+
type: i3$1.DefaultValueAccessor,
|
|
5628
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
5629
|
+
},
|
|
5630
|
+
{
|
|
5631
|
+
kind: "directive",
|
|
5632
|
+
type: i3$1.NgControlStatus,
|
|
5633
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
5634
|
+
},
|
|
5635
|
+
{
|
|
5636
|
+
kind: "directive",
|
|
5637
|
+
type: i3$1.NgModel,
|
|
5638
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
5639
|
+
inputs: [
|
|
5640
|
+
"name",
|
|
5641
|
+
"disabled",
|
|
5642
|
+
"ngModel",
|
|
5643
|
+
"ngModelOptions"
|
|
5644
|
+
],
|
|
5645
|
+
outputs: ["ngModelChange"],
|
|
5646
|
+
exportAs: ["ngModel"]
|
|
5647
|
+
},
|
|
5648
|
+
{
|
|
5649
|
+
kind: "component",
|
|
5650
|
+
type: i4$1.Select,
|
|
5651
|
+
selector: "p-select",
|
|
5652
|
+
inputs: [
|
|
5653
|
+
"id",
|
|
5654
|
+
"scrollHeight",
|
|
5655
|
+
"filter",
|
|
5656
|
+
"panelStyle",
|
|
5657
|
+
"panelStyleClass",
|
|
5658
|
+
"readonly",
|
|
5659
|
+
"editable",
|
|
5660
|
+
"tabindex",
|
|
5661
|
+
"placeholder",
|
|
5662
|
+
"loadingIcon",
|
|
5663
|
+
"filterPlaceholder",
|
|
5664
|
+
"filterLocale",
|
|
5665
|
+
"inputId",
|
|
5666
|
+
"dataKey",
|
|
5667
|
+
"filterBy",
|
|
5668
|
+
"filterFields",
|
|
5669
|
+
"autofocus",
|
|
5670
|
+
"resetFilterOnHide",
|
|
5671
|
+
"checkmark",
|
|
5672
|
+
"dropdownIcon",
|
|
5673
|
+
"loading",
|
|
5674
|
+
"optionLabel",
|
|
5675
|
+
"optionValue",
|
|
5676
|
+
"optionDisabled",
|
|
5677
|
+
"optionGroupLabel",
|
|
5678
|
+
"optionGroupChildren",
|
|
5679
|
+
"group",
|
|
5680
|
+
"showClear",
|
|
5681
|
+
"emptyFilterMessage",
|
|
5682
|
+
"emptyMessage",
|
|
5683
|
+
"lazy",
|
|
5684
|
+
"virtualScroll",
|
|
5685
|
+
"virtualScrollItemSize",
|
|
5686
|
+
"virtualScrollOptions",
|
|
5687
|
+
"overlayOptions",
|
|
5688
|
+
"ariaFilterLabel",
|
|
5689
|
+
"ariaLabel",
|
|
5690
|
+
"ariaLabelledBy",
|
|
5691
|
+
"filterMatchMode",
|
|
5692
|
+
"tooltip",
|
|
5693
|
+
"tooltipPosition",
|
|
5694
|
+
"tooltipPositionStyle",
|
|
5695
|
+
"tooltipStyleClass",
|
|
5696
|
+
"focusOnHover",
|
|
5697
|
+
"selectOnFocus",
|
|
5698
|
+
"multiple",
|
|
5699
|
+
"autoOptionFocus",
|
|
5700
|
+
"autofocusFilter",
|
|
5701
|
+
"filterValue",
|
|
5702
|
+
"options",
|
|
5703
|
+
"appendTo",
|
|
5704
|
+
"motionOptions"
|
|
5705
|
+
],
|
|
5706
|
+
outputs: [
|
|
5707
|
+
"onChange",
|
|
5708
|
+
"onFilter",
|
|
5709
|
+
"onFocus",
|
|
5710
|
+
"onBlur",
|
|
5711
|
+
"onClick",
|
|
4963
5712
|
"onShow",
|
|
4964
5713
|
"onHide",
|
|
5714
|
+
"onClear",
|
|
4965
5715
|
"onLazyLoad"
|
|
4966
5716
|
]
|
|
4967
5717
|
},
|
|
4968
5718
|
{
|
|
4969
5719
|
kind: "component",
|
|
4970
|
-
type:
|
|
4971
|
-
selector: "pw-
|
|
4972
|
-
inputs: [
|
|
5720
|
+
type: FlowsCronFieldComponent,
|
|
5721
|
+
selector: "pw-flows-cron-field",
|
|
5722
|
+
inputs: [
|
|
5723
|
+
"value",
|
|
5724
|
+
"inputId",
|
|
5725
|
+
"readOnly"
|
|
5726
|
+
],
|
|
5727
|
+
outputs: ["valueChange"]
|
|
5728
|
+
},
|
|
5729
|
+
{
|
|
5730
|
+
kind: "component",
|
|
5731
|
+
type: FlowsTimezoneFieldComponent,
|
|
5732
|
+
selector: "pw-flows-timezone-field",
|
|
5733
|
+
inputs: [
|
|
5734
|
+
"value",
|
|
5735
|
+
"inputId",
|
|
5736
|
+
"readOnly"
|
|
5737
|
+
],
|
|
5738
|
+
outputs: ["valueChange"]
|
|
5739
|
+
},
|
|
5740
|
+
{
|
|
5741
|
+
kind: "component",
|
|
5742
|
+
type: FlowsJsonFieldComponent,
|
|
5743
|
+
selector: "pw-flows-json-field",
|
|
5744
|
+
inputs: [
|
|
5745
|
+
"value",
|
|
5746
|
+
"inputId",
|
|
5747
|
+
"readOnly"
|
|
5748
|
+
],
|
|
5749
|
+
outputs: ["valueChange"]
|
|
5750
|
+
},
|
|
5751
|
+
{
|
|
5752
|
+
kind: "component",
|
|
5753
|
+
type: FlowsPairsFieldComponent,
|
|
5754
|
+
selector: "pw-flows-pairs-field",
|
|
5755
|
+
inputs: [
|
|
5756
|
+
"value",
|
|
5757
|
+
"inputId",
|
|
5758
|
+
"readOnly"
|
|
5759
|
+
],
|
|
5760
|
+
outputs: ["valueChange"]
|
|
5761
|
+
},
|
|
5762
|
+
{
|
|
5763
|
+
kind: "component",
|
|
5764
|
+
type: FlowsChoicesFieldComponent,
|
|
5765
|
+
selector: "pw-flows-choices-field",
|
|
5766
|
+
inputs: [
|
|
5767
|
+
"value",
|
|
5768
|
+
"inputId",
|
|
5769
|
+
"readOnly"
|
|
5770
|
+
],
|
|
5771
|
+
outputs: ["valueChange"]
|
|
5772
|
+
},
|
|
5773
|
+
{
|
|
5774
|
+
kind: "component",
|
|
5775
|
+
type: FlowsMemberFieldComponent,
|
|
5776
|
+
selector: "pw-flows-member-field",
|
|
5777
|
+
inputs: [
|
|
5778
|
+
"value",
|
|
5779
|
+
"multiple",
|
|
5780
|
+
"subscriptionId",
|
|
5781
|
+
"inputId",
|
|
5782
|
+
"readOnly"
|
|
5783
|
+
],
|
|
5784
|
+
outputs: ["valueChange"]
|
|
4973
5785
|
},
|
|
4974
5786
|
{
|
|
4975
5787
|
kind: "pipe",
|
|
@@ -4984,28 +5796,30 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4984
5796
|
minVersion: "12.0.0",
|
|
4985
5797
|
version: "22.2.3",
|
|
4986
5798
|
ngImport: i0,
|
|
4987
|
-
type:
|
|
5799
|
+
type: FlowsParamFieldComponent,
|
|
4988
5800
|
decorators: [{
|
|
4989
5801
|
type: Component,
|
|
4990
5802
|
args: [{
|
|
4991
|
-
selector: "pw-flows-
|
|
5803
|
+
selector: "pw-flows-param-field",
|
|
4992
5804
|
standalone: false,
|
|
4993
|
-
template: "<
|
|
5805
|
+
template: "@switch (kind) {\n@case ('textarea') {\n<textarea class=\"form-control\" rows=\"4\"\n [id]=\"field.id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"valueChange.emit($event)\"></textarea>\n}\n@case ('cron') {\n<pw-flows-cron-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-cron-field>\n}\n@case ('timezone') {\n<pw-flows-timezone-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-timezone-field>\n}\n@case ('pairs') {\n<pw-flows-pairs-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-pairs-field>\n}\n@case ('choices') {\n<pw-flows-choices-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-choices-field>\n}\n@case ('json') {\n<pw-flows-json-field [inputId]=\"field.id\"\n [value]=\"value\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-json-field>\n}\n@case ('member') {\n<pw-flows-member-field [inputId]=\"field.id\"\n [value]=\"value\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-member-field>\n}\n@case ('members') {\n<pw-flows-member-field [inputId]=\"field.id\"\n [multiple]=\"true\"\n [value]=\"value\"\n [subscriptionId]=\"subscriptionId\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"valueChange.emit($event)\"></pw-flows-member-field>\n}\n@case ('mode') {\n<p-select [inputId]=\"field.id\"\n [options]=\"mergeModes\"\n optionLabel=\"label\"\n optionValue=\"value\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"value ?? defaultMergeMode\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"valueChange.emit($event)\"></p-select>\n}\n@case ('list') {\n<p-select [inputId]=\"field.id\"\n [options]=\"listSuggestions\"\n [editable]=\"true\"\n [placeholder]=\"'Flows.Inspector.SelectList' | transloco\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"valueChange.emit($event ?? undefined)\"></p-select>\n}\n@case ('select') {\n<p-select [inputId]=\"field.id\"\n [options]=\"field.options ?? []\"\n [placeholder]=\"field.placeholder ?? ''\"\n [showClear]=\"!field.required\"\n appendTo=\"body\"\n styleClass=\"w-100\"\n [disabled]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"valueChange.emit($event ?? undefined)\"></p-select>\n}\n@case ('number') {\n<input class=\"form-control\"\n type=\"text\"\n inputmode=\"decimal\"\n [id]=\"field.id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"valueChange.emit(numberValue($event))\" />\n}\n@default {\n<input class=\"form-control\" type=\"text\" autocomplete=\"off\"\n [attr.inputmode]=\"field.kind === 'email' ? 'email' : null\"\n [id]=\"field.id\"\n [placeholder]=\"field.placeholder ?? ''\"\n [readOnly]=\"readOnly\"\n [ngModel]=\"value\"\n [ngModelOptions]=\"{ standalone: true, updateOn: 'blur' }\"\n (ngModelChange)=\"valueChange.emit($event)\" />\n}\n}\n",
|
|
5806
|
+
styles: [":host{display:block}\n"]
|
|
4994
5807
|
}]
|
|
4995
5808
|
}],
|
|
4996
|
-
ctorParameters: () => [
|
|
5809
|
+
ctorParameters: () => [
|
|
5810
|
+
{ type: i2$4.TranslocoService },
|
|
5811
|
+
{ type: i0.ChangeDetectorRef },
|
|
5812
|
+
{ type: i0.DestroyRef }
|
|
5813
|
+
],
|
|
4997
5814
|
propDecorators: {
|
|
5815
|
+
field: [{ type: Input }],
|
|
4998
5816
|
value: [{ type: Input }],
|
|
4999
|
-
multiple: [{ type: Input }],
|
|
5000
|
-
subscriptionId: [{ type: Input }],
|
|
5001
|
-
inputId: [{ type: Input }],
|
|
5002
5817
|
readOnly: [{ type: Input }],
|
|
5818
|
+
subscriptionId: [{ type: Input }],
|
|
5819
|
+
listSuggestions: [{ type: Input }],
|
|
5003
5820
|
valueChange: [{ type: Output }]
|
|
5004
5821
|
}
|
|
5005
5822
|
});
|
|
5006
|
-
function toIds(value) {
|
|
5007
|
-
return (Array.isArray(value) ? value : [value]).map(Number).filter((id) => Number.isInteger(id) && id > 0);
|
|
5008
|
-
}
|
|
5009
5823
|
var FlowsRetryFieldComponent = class FlowsRetryFieldComponent {
|
|
5010
5824
|
constructor() {
|
|
5011
5825
|
this.readOnly = false;
|
|
@@ -5473,7 +6287,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5473
6287
|
}
|
|
5474
6288
|
});
|
|
5475
6289
|
var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
5476
|
-
constructor(
|
|
6290
|
+
constructor(host) {
|
|
5477
6291
|
this.host = host;
|
|
5478
6292
|
this.definition = null;
|
|
5479
6293
|
this.readOnly = false;
|
|
@@ -5484,21 +6298,11 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5484
6298
|
this.nodeChange = new EventEmitter();
|
|
5485
6299
|
this.remove = new EventEmitter();
|
|
5486
6300
|
this.icons = FLOWS_ICONS;
|
|
5487
|
-
this.mergeModes = [];
|
|
5488
|
-
this.defaultMergeMode = FLOW_MERGE_MODES[0];
|
|
5489
6301
|
this.labelKey = flowNodeLabelKey;
|
|
5490
6302
|
this.paramLabelKey = flowParamLabelKey;
|
|
5491
6303
|
this.paramHelpKey = flowParamHelpKey;
|
|
5492
|
-
this.numberValue = flowNumberValue;
|
|
5493
6304
|
this.fields = [];
|
|
5494
6305
|
this.conditionNotAnObject = false;
|
|
5495
|
-
translation.selectTranslation("flows").pipe(takeUntilDestroyed(destroyRef)).subscribe(() => {
|
|
5496
|
-
this.mergeModes = FLOW_MERGE_MODES.map((mode) => ({
|
|
5497
|
-
value: mode,
|
|
5498
|
-
label: translation.translate(`Flows.MergeModes.${mode}`)
|
|
5499
|
-
}));
|
|
5500
|
-
cdr.markForCheck();
|
|
5501
|
-
});
|
|
5502
6306
|
}
|
|
5503
6307
|
ngOnChanges(changes) {
|
|
5504
6308
|
this.fields = (this.definition ? flowNodeFields(this.definition) : []).map((field) => ({
|
|
@@ -5519,9 +6323,6 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5519
6323
|
ngAfterViewChecked() {
|
|
5520
6324
|
this.leaving = void 0;
|
|
5521
6325
|
}
|
|
5522
|
-
kindOf(field) {
|
|
5523
|
-
return field.kind === "list" && !this.listSuggestions.length ? "text" : field.kind;
|
|
5524
|
-
}
|
|
5525
6326
|
fieldId(key) {
|
|
5526
6327
|
return `flow-node-${this.node.id}-${key}`;
|
|
5527
6328
|
}
|
|
@@ -5563,12 +6364,7 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5563
6364
|
version: "22.2.3",
|
|
5564
6365
|
ngImport: i0,
|
|
5565
6366
|
type: FlowsNodeInspectorComponent,
|
|
5566
|
-
deps: [
|
|
5567
|
-
{ token: i2$4.TranslocoService },
|
|
5568
|
-
{ token: i0.ChangeDetectorRef },
|
|
5569
|
-
{ token: i0.DestroyRef },
|
|
5570
|
-
{ token: i0.ElementRef }
|
|
5571
|
-
],
|
|
6367
|
+
deps: [{ token: i0.ElementRef }],
|
|
5572
6368
|
target: i0.ɵɵFactoryTarget.Component
|
|
5573
6369
|
});
|
|
5574
6370
|
}
|
|
@@ -5595,32 +6391,9 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5595
6391
|
},
|
|
5596
6392
|
usesOnChanges: true,
|
|
5597
6393
|
ngImport: i0,
|
|
5598
|
-
template: "<aside class=\"pw-node-inspector\"\n data-testid=\"flow-inspector\">\n @let key = labelKey(node.type);\n @let translated = key | transloco;\n <header class=\"pw-node-inspector__head\">\n <div>\n <h4 class=\"pw-node-inspector__title\">{{ translated === key ? (definition?.label ?? node.type) : translated }}</h4>\n <span class=\"pw-node-inspector__id\">{{ node.id }} · {{ node.type }}</span>\n </div>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-node-inspector__remove\"\n data-testid=\"flow-node-remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveNode' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveNode' | transloco\"\n appendTo=\"body\"\n (click)=\"remove.emit()\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </header>\n\n @if (!definition) {\n <p class=\"pw-node-inspector__note\"\n data-testid=\"flow-node-unknown\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Inspector.UnknownType' | transloco }}\n </p>\n }\n\n @if (definition && definition.category !== 'trigger' && fieldSources) {\n <pw-flows-available-fields class=\"pw-node-inspector__field\"\n data-testid=\"flow-available-fields\"\n [inputId]=\"fieldId('available-fields')\"\n [sources]=\"fieldSources\" [firstRun]=\"firstRun\" [nodeType]=\"node.type\"\n [readOnly]=\"readOnly\"></pw-flows-available-fields>\n }\n\n @for (field of fields; track field.id) {\n @let id = field.id;\n @let paramKey = paramLabelKey(field.key);\n @let paramLabel = paramKey | transloco;\n @let helpKey = paramHelpKey(node.type, field.key);\n @let helpText = helpKey | transloco;\n @let help = field.description || (helpText === helpKey ? '' : helpText);\n <pw-input-container class=\"pw-node-inspector__field\"\n [label]=\"field.label || (paramLabel === paramKey ? field.key : paramLabel)\"\n [required]=\"!!field.required\"\n [name]=\"field.key\"\n [controlId]=\"id\"\n [showTooltip]=\"!!help\"\n [tooltipText]=\"help\">\n
|
|
6394
|
+
template: "<aside class=\"pw-node-inspector\"\n data-testid=\"flow-inspector\">\n @let key = labelKey(node.type);\n @let translated = key | transloco;\n <header class=\"pw-node-inspector__head\">\n <div>\n <h4 class=\"pw-node-inspector__title\">{{ translated === key ? (definition?.label ?? node.type) : translated }}</h4>\n <span class=\"pw-node-inspector__id\">{{ node.id }} · {{ node.type }}</span>\n </div>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-node-inspector__remove\"\n data-testid=\"flow-node-remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveNode' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveNode' | transloco\"\n appendTo=\"body\"\n (click)=\"remove.emit()\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </header>\n\n @if (!definition) {\n <p class=\"pw-node-inspector__note\"\n data-testid=\"flow-node-unknown\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Inspector.UnknownType' | transloco }}\n </p>\n }\n\n @if (definition && definition.category !== 'trigger' && fieldSources) {\n <pw-flows-available-fields class=\"pw-node-inspector__field\"\n data-testid=\"flow-available-fields\"\n [inputId]=\"fieldId('available-fields')\"\n [sources]=\"fieldSources\" [firstRun]=\"firstRun\" [nodeType]=\"node.type\"\n [readOnly]=\"readOnly\"></pw-flows-available-fields>\n }\n\n @for (field of fields; track field.id) {\n @let id = field.id;\n @let paramKey = paramLabelKey(field.key);\n @let paramLabel = paramKey | transloco;\n @let helpKey = paramHelpKey(node.type, field.key);\n @let helpText = helpKey | transloco;\n @let help = field.description || (helpText === helpKey ? '' : helpText);\n <pw-input-container class=\"pw-node-inspector__field\"\n [label]=\"field.label || (paramLabel === paramKey ? field.key : paramLabel)\"\n [required]=\"!!field.required\"\n [name]=\"field.key\"\n [controlId]=\"id\"\n [showTooltip]=\"!!help\"\n [tooltipText]=\"help\">\n <pw-flows-param-field [field]=\"field\"\n [value]=\"param(field.key)\"\n [readOnly]=\"readOnly\"\n [subscriptionId]=\"subscriptionId\"\n [listSuggestions]=\"listSuggestions\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-param-field>\n <pw-flows-unknown-fields [value]=\"param(field.key)\" [known]=\"fieldSuggestions\"></pw-flows-unknown-fields>\n </pw-input-container>\n }\n\n @if (definition?.condition) {\n @let conditionKey = paramHelpKey(node.type, 'condition');\n @let conditionText = conditionKey | transloco;\n @let conditionHelp = conditionText === conditionKey ? '' : conditionText;\n <pw-input-container class=\"pw-node-inspector__field\"\n [label]=\"'Flows.Inspector.Condition' | transloco\"\n name=\"condition\"\n [controlId]=\"fieldId('condition')\"\n [showTooltip]=\"!!conditionHelp\"\n [tooltipText]=\"conditionHelp\">\n <pw-flows-condition-field [inputId]=\"fieldId('condition')\"\n [value]=\"node.condition\"\n [suggestions]=\"fieldSuggestions\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setCondition($event)\"></pw-flows-condition-field>\n @if (conditionNotAnObject) {\n <pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Inspector.ConditionNotAnObject' | transloco\">\n </pw-field-error-display>\n }\n </pw-input-container>\n }\n\n @if (definition?.category === 'action') {\n <div class=\"pw-node-inspector__field\"\n data-testid=\"flow-node-retry\">\n <pw-flows-retry-field [inputId]=\"fieldId('retry')\"\n [value]=\"node.retry\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setRetry($event)\"></pw-flows-retry-field>\n </div>\n }\n\n @if (definition && !fields.length && !definition.condition) {\n <p class=\"pw-node-inspector__note\">{{ 'Flows.Inspector.NoSettings' | transloco }}</p>\n }\n</aside>\n",
|
|
5599
6395
|
styles: [".pw-node-inspector ::ng-deep .info-circle{display:inline-block;margin-left:.35em;vertical-align:baseline}.pw-node-inspector ::ng-deep .info-circle:after{position:static;font-size:inherit;line-height:inherit}.pw-node-inspector{display:flex;flex-direction:column;gap:16px;padding:16px}.pw-node-inspector__head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding-bottom:12px;border-bottom:1px solid #e2e5ea}.pw-node-inspector__title{margin:0}.pw-node-inspector__id{color:#7c8696;font-size:12px;font-variant-numeric:tabular-nums}.pw-node-inspector__remove{color:#5a6473}.pw-node-inspector__field{display:block}.pw-node-inspector__note{margin:0;color:#5a6473;font-size:12px}\n"],
|
|
5600
6396
|
dependencies: [
|
|
5601
|
-
{
|
|
5602
|
-
kind: "directive",
|
|
5603
|
-
type: i3$1.DefaultValueAccessor,
|
|
5604
|
-
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]"
|
|
5605
|
-
},
|
|
5606
|
-
{
|
|
5607
|
-
kind: "directive",
|
|
5608
|
-
type: i3$1.NgControlStatus,
|
|
5609
|
-
selector: "[formControlName],[ngModel],[formControl]"
|
|
5610
|
-
},
|
|
5611
|
-
{
|
|
5612
|
-
kind: "directive",
|
|
5613
|
-
type: i3$1.NgModel,
|
|
5614
|
-
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
5615
|
-
inputs: [
|
|
5616
|
-
"name",
|
|
5617
|
-
"disabled",
|
|
5618
|
-
"ngModel",
|
|
5619
|
-
"ngModelOptions"
|
|
5620
|
-
],
|
|
5621
|
-
outputs: ["ngModelChange"],
|
|
5622
|
-
exportAs: ["ngModel"]
|
|
5623
|
-
},
|
|
5624
6397
|
{
|
|
5625
6398
|
kind: "directive",
|
|
5626
6399
|
type: i1$1.Tooltip,
|
|
@@ -5649,76 +6422,6 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5649
6422
|
"pTooltipUnstyled"
|
|
5650
6423
|
]
|
|
5651
6424
|
},
|
|
5652
|
-
{
|
|
5653
|
-
kind: "component",
|
|
5654
|
-
type: i4$1.Select,
|
|
5655
|
-
selector: "p-select",
|
|
5656
|
-
inputs: [
|
|
5657
|
-
"id",
|
|
5658
|
-
"scrollHeight",
|
|
5659
|
-
"filter",
|
|
5660
|
-
"panelStyle",
|
|
5661
|
-
"panelStyleClass",
|
|
5662
|
-
"readonly",
|
|
5663
|
-
"editable",
|
|
5664
|
-
"tabindex",
|
|
5665
|
-
"placeholder",
|
|
5666
|
-
"loadingIcon",
|
|
5667
|
-
"filterPlaceholder",
|
|
5668
|
-
"filterLocale",
|
|
5669
|
-
"inputId",
|
|
5670
|
-
"dataKey",
|
|
5671
|
-
"filterBy",
|
|
5672
|
-
"filterFields",
|
|
5673
|
-
"autofocus",
|
|
5674
|
-
"resetFilterOnHide",
|
|
5675
|
-
"checkmark",
|
|
5676
|
-
"dropdownIcon",
|
|
5677
|
-
"loading",
|
|
5678
|
-
"optionLabel",
|
|
5679
|
-
"optionValue",
|
|
5680
|
-
"optionDisabled",
|
|
5681
|
-
"optionGroupLabel",
|
|
5682
|
-
"optionGroupChildren",
|
|
5683
|
-
"group",
|
|
5684
|
-
"showClear",
|
|
5685
|
-
"emptyFilterMessage",
|
|
5686
|
-
"emptyMessage",
|
|
5687
|
-
"lazy",
|
|
5688
|
-
"virtualScroll",
|
|
5689
|
-
"virtualScrollItemSize",
|
|
5690
|
-
"virtualScrollOptions",
|
|
5691
|
-
"overlayOptions",
|
|
5692
|
-
"ariaFilterLabel",
|
|
5693
|
-
"ariaLabel",
|
|
5694
|
-
"ariaLabelledBy",
|
|
5695
|
-
"filterMatchMode",
|
|
5696
|
-
"tooltip",
|
|
5697
|
-
"tooltipPosition",
|
|
5698
|
-
"tooltipPositionStyle",
|
|
5699
|
-
"tooltipStyleClass",
|
|
5700
|
-
"focusOnHover",
|
|
5701
|
-
"selectOnFocus",
|
|
5702
|
-
"multiple",
|
|
5703
|
-
"autoOptionFocus",
|
|
5704
|
-
"autofocusFilter",
|
|
5705
|
-
"filterValue",
|
|
5706
|
-
"options",
|
|
5707
|
-
"appendTo",
|
|
5708
|
-
"motionOptions"
|
|
5709
|
-
],
|
|
5710
|
-
outputs: [
|
|
5711
|
-
"onChange",
|
|
5712
|
-
"onFilter",
|
|
5713
|
-
"onFocus",
|
|
5714
|
-
"onBlur",
|
|
5715
|
-
"onClick",
|
|
5716
|
-
"onShow",
|
|
5717
|
-
"onHide",
|
|
5718
|
-
"onClear",
|
|
5719
|
-
"onLazyLoad"
|
|
5720
|
-
]
|
|
5721
|
-
},
|
|
5722
6425
|
{
|
|
5723
6426
|
kind: "component",
|
|
5724
6427
|
type: i2$1.FieldErrorDisplayComponent,
|
|
@@ -5785,39 +6488,6 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5785
6488
|
"a11yRoleChange"
|
|
5786
6489
|
]
|
|
5787
6490
|
},
|
|
5788
|
-
{
|
|
5789
|
-
kind: "component",
|
|
5790
|
-
type: FlowsCronFieldComponent,
|
|
5791
|
-
selector: "pw-flows-cron-field",
|
|
5792
|
-
inputs: [
|
|
5793
|
-
"value",
|
|
5794
|
-
"inputId",
|
|
5795
|
-
"readOnly"
|
|
5796
|
-
],
|
|
5797
|
-
outputs: ["valueChange"]
|
|
5798
|
-
},
|
|
5799
|
-
{
|
|
5800
|
-
kind: "component",
|
|
5801
|
-
type: FlowsTimezoneFieldComponent,
|
|
5802
|
-
selector: "pw-flows-timezone-field",
|
|
5803
|
-
inputs: [
|
|
5804
|
-
"value",
|
|
5805
|
-
"inputId",
|
|
5806
|
-
"readOnly"
|
|
5807
|
-
],
|
|
5808
|
-
outputs: ["valueChange"]
|
|
5809
|
-
},
|
|
5810
|
-
{
|
|
5811
|
-
kind: "component",
|
|
5812
|
-
type: FlowsJsonFieldComponent,
|
|
5813
|
-
selector: "pw-flows-json-field",
|
|
5814
|
-
inputs: [
|
|
5815
|
-
"value",
|
|
5816
|
-
"inputId",
|
|
5817
|
-
"readOnly"
|
|
5818
|
-
],
|
|
5819
|
-
outputs: ["valueChange"]
|
|
5820
|
-
},
|
|
5821
6491
|
{
|
|
5822
6492
|
kind: "component",
|
|
5823
6493
|
type: FlowsConditionFieldComponent,
|
|
@@ -5832,25 +6502,14 @@ var FlowsNodeInspectorComponent = class FlowsNodeInspectorComponent {
|
|
|
5832
6502
|
},
|
|
5833
6503
|
{
|
|
5834
6504
|
kind: "component",
|
|
5835
|
-
type:
|
|
5836
|
-
selector: "pw-flows-
|
|
5837
|
-
inputs: [
|
|
5838
|
-
"value",
|
|
5839
|
-
"inputId",
|
|
5840
|
-
"readOnly"
|
|
5841
|
-
],
|
|
5842
|
-
outputs: ["valueChange"]
|
|
5843
|
-
},
|
|
5844
|
-
{
|
|
5845
|
-
kind: "component",
|
|
5846
|
-
type: FlowsMemberFieldComponent,
|
|
5847
|
-
selector: "pw-flows-member-field",
|
|
6505
|
+
type: FlowsParamFieldComponent,
|
|
6506
|
+
selector: "pw-flows-param-field",
|
|
5848
6507
|
inputs: [
|
|
6508
|
+
"field",
|
|
5849
6509
|
"value",
|
|
5850
|
-
"
|
|
6510
|
+
"readOnly",
|
|
5851
6511
|
"subscriptionId",
|
|
5852
|
-
"
|
|
5853
|
-
"readOnly"
|
|
6512
|
+
"listSuggestions"
|
|
5854
6513
|
],
|
|
5855
6514
|
outputs: ["valueChange"]
|
|
5856
6515
|
},
|
|
@@ -5902,16 +6561,11 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5902
6561
|
args: [{
|
|
5903
6562
|
selector: "pw-flows-node-inspector",
|
|
5904
6563
|
standalone: false,
|
|
5905
|
-
template: "<aside class=\"pw-node-inspector\"\n data-testid=\"flow-inspector\">\n @let key = labelKey(node.type);\n @let translated = key | transloco;\n <header class=\"pw-node-inspector__head\">\n <div>\n <h4 class=\"pw-node-inspector__title\">{{ translated === key ? (definition?.label ?? node.type) : translated }}</h4>\n <span class=\"pw-node-inspector__id\">{{ node.id }} · {{ node.type }}</span>\n </div>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-node-inspector__remove\"\n data-testid=\"flow-node-remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveNode' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveNode' | transloco\"\n appendTo=\"body\"\n (click)=\"remove.emit()\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </header>\n\n @if (!definition) {\n <p class=\"pw-node-inspector__note\"\n data-testid=\"flow-node-unknown\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Inspector.UnknownType' | transloco }}\n </p>\n }\n\n @if (definition && definition.category !== 'trigger' && fieldSources) {\n <pw-flows-available-fields class=\"pw-node-inspector__field\"\n data-testid=\"flow-available-fields\"\n [inputId]=\"fieldId('available-fields')\"\n [sources]=\"fieldSources\" [firstRun]=\"firstRun\" [nodeType]=\"node.type\"\n [readOnly]=\"readOnly\"></pw-flows-available-fields>\n }\n\n @for (field of fields; track field.id) {\n @let id = field.id;\n @let paramKey = paramLabelKey(field.key);\n @let paramLabel = paramKey | transloco;\n @let helpKey = paramHelpKey(node.type, field.key);\n @let helpText = helpKey | transloco;\n @let help = field.description || (helpText === helpKey ? '' : helpText);\n <pw-input-container class=\"pw-node-inspector__field\"\n [label]=\"field.label || (paramLabel === paramKey ? field.key : paramLabel)\"\n [required]=\"!!field.required\"\n [name]=\"field.key\"\n [controlId]=\"id\"\n [showTooltip]=\"!!help\"\n [tooltipText]=\"help\">\n
|
|
6564
|
+
template: "<aside class=\"pw-node-inspector\"\n data-testid=\"flow-inspector\">\n @let key = labelKey(node.type);\n @let translated = key | transloco;\n <header class=\"pw-node-inspector__head\">\n <div>\n <h4 class=\"pw-node-inspector__title\">{{ translated === key ? (definition?.label ?? node.type) : translated }}</h4>\n <span class=\"pw-node-inspector__id\">{{ node.id }} · {{ node.type }}</span>\n </div>\n @if (!readOnly) {\n <button type=\"button\"\n class=\"btn btn-link pw-node-inspector__remove\"\n data-testid=\"flow-node-remove\"\n [attr.aria-label]=\"'Flows.Inspector.RemoveNode' | transloco\"\n [pTooltip]=\"'Flows.Inspector.RemoveNode' | transloco\"\n appendTo=\"body\"\n (click)=\"remove.emit()\">\n <fa-icon [icon]=\"icons.delete\"></fa-icon>\n </button>\n }\n </header>\n\n @if (!definition) {\n <p class=\"pw-node-inspector__note\"\n data-testid=\"flow-node-unknown\">\n <fa-icon [icon]=\"icons.warning\"></fa-icon>\n {{ 'Flows.Inspector.UnknownType' | transloco }}\n </p>\n }\n\n @if (definition && definition.category !== 'trigger' && fieldSources) {\n <pw-flows-available-fields class=\"pw-node-inspector__field\"\n data-testid=\"flow-available-fields\"\n [inputId]=\"fieldId('available-fields')\"\n [sources]=\"fieldSources\" [firstRun]=\"firstRun\" [nodeType]=\"node.type\"\n [readOnly]=\"readOnly\"></pw-flows-available-fields>\n }\n\n @for (field of fields; track field.id) {\n @let id = field.id;\n @let paramKey = paramLabelKey(field.key);\n @let paramLabel = paramKey | transloco;\n @let helpKey = paramHelpKey(node.type, field.key);\n @let helpText = helpKey | transloco;\n @let help = field.description || (helpText === helpKey ? '' : helpText);\n <pw-input-container class=\"pw-node-inspector__field\"\n [label]=\"field.label || (paramLabel === paramKey ? field.key : paramLabel)\"\n [required]=\"!!field.required\"\n [name]=\"field.key\"\n [controlId]=\"id\"\n [showTooltip]=\"!!help\"\n [tooltipText]=\"help\">\n <pw-flows-param-field [field]=\"field\"\n [value]=\"param(field.key)\"\n [readOnly]=\"readOnly\"\n [subscriptionId]=\"subscriptionId\"\n [listSuggestions]=\"listSuggestions\"\n (valueChange)=\"setParam(field.key, $event)\"></pw-flows-param-field>\n <pw-flows-unknown-fields [value]=\"param(field.key)\" [known]=\"fieldSuggestions\"></pw-flows-unknown-fields>\n </pw-input-container>\n }\n\n @if (definition?.condition) {\n @let conditionKey = paramHelpKey(node.type, 'condition');\n @let conditionText = conditionKey | transloco;\n @let conditionHelp = conditionText === conditionKey ? '' : conditionText;\n <pw-input-container class=\"pw-node-inspector__field\"\n [label]=\"'Flows.Inspector.Condition' | transloco\"\n name=\"condition\"\n [controlId]=\"fieldId('condition')\"\n [showTooltip]=\"!!conditionHelp\"\n [tooltipText]=\"conditionHelp\">\n <pw-flows-condition-field [inputId]=\"fieldId('condition')\"\n [value]=\"node.condition\"\n [suggestions]=\"fieldSuggestions\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setCondition($event)\"></pw-flows-condition-field>\n @if (conditionNotAnObject) {\n <pw-field-error-display [displayError]=\"true\"\n [errorMsg]=\"'Flows.Inspector.ConditionNotAnObject' | transloco\">\n </pw-field-error-display>\n }\n </pw-input-container>\n }\n\n @if (definition?.category === 'action') {\n <div class=\"pw-node-inspector__field\"\n data-testid=\"flow-node-retry\">\n <pw-flows-retry-field [inputId]=\"fieldId('retry')\"\n [value]=\"node.retry\"\n [readOnly]=\"readOnly\"\n (valueChange)=\"setRetry($event)\"></pw-flows-retry-field>\n </div>\n }\n\n @if (definition && !fields.length && !definition.condition) {\n <p class=\"pw-node-inspector__note\">{{ 'Flows.Inspector.NoSettings' | transloco }}</p>\n }\n</aside>\n",
|
|
5906
6565
|
styles: [".pw-node-inspector ::ng-deep .info-circle{display:inline-block;margin-left:.35em;vertical-align:baseline}.pw-node-inspector ::ng-deep .info-circle:after{position:static;font-size:inherit;line-height:inherit}.pw-node-inspector{display:flex;flex-direction:column;gap:16px;padding:16px}.pw-node-inspector__head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding-bottom:12px;border-bottom:1px solid #e2e5ea}.pw-node-inspector__title{margin:0}.pw-node-inspector__id{color:#7c8696;font-size:12px;font-variant-numeric:tabular-nums}.pw-node-inspector__remove{color:#5a6473}.pw-node-inspector__field{display:block}.pw-node-inspector__note{margin:0;color:#5a6473;font-size:12px}\n"]
|
|
5907
6566
|
}]
|
|
5908
6567
|
}],
|
|
5909
|
-
ctorParameters: () => [
|
|
5910
|
-
{ type: i2$4.TranslocoService },
|
|
5911
|
-
{ type: i0.ChangeDetectorRef },
|
|
5912
|
-
{ type: i0.DestroyRef },
|
|
5913
|
-
{ type: i0.ElementRef }
|
|
5914
|
-
],
|
|
6568
|
+
ctorParameters: () => [{ type: i0.ElementRef }],
|
|
5915
6569
|
propDecorators: {
|
|
5916
6570
|
node: [{ type: Input }],
|
|
5917
6571
|
definition: [{ type: Input }],
|
|
@@ -6623,7 +7277,7 @@ var FlowsWorkflowVersionsComponent = class FlowsWorkflowVersionsComponent extend
|
|
|
6623
7277
|
},
|
|
6624
7278
|
{
|
|
6625
7279
|
kind: "pipe",
|
|
6626
|
-
type:
|
|
7280
|
+
type: i14.DateFormatPipe,
|
|
6627
7281
|
name: "dateFormat"
|
|
6628
7282
|
},
|
|
6629
7283
|
{
|
|
@@ -7140,7 +7794,7 @@ var FlowsWorkflowsComponent = class FlowsWorkflowsComponent extends AppBaseCompo
|
|
|
7140
7794
|
},
|
|
7141
7795
|
{
|
|
7142
7796
|
kind: "pipe",
|
|
7143
|
-
type:
|
|
7797
|
+
type: i14.DateFormatPipe,
|
|
7144
7798
|
name: "dateFormat"
|
|
7145
7799
|
}
|
|
7146
7800
|
]
|
|
@@ -7284,6 +7938,7 @@ var FlowsPrivateModule = class FlowsPrivateModule {
|
|
|
7284
7938
|
FlowsRunInspectorComponent,
|
|
7285
7939
|
FlowsRunProgressComponent,
|
|
7286
7940
|
FlowsStepErrorComponent,
|
|
7941
|
+
FlowsRunErrorComponent,
|
|
7287
7942
|
FlowsGraphCanvasComponent,
|
|
7288
7943
|
FlowsCanvasNodeComponent,
|
|
7289
7944
|
FlowsCanvasSocketComponent,
|
|
@@ -7293,12 +7948,15 @@ var FlowsPrivateModule = class FlowsPrivateModule {
|
|
|
7293
7948
|
FlowsJsonFieldComponent,
|
|
7294
7949
|
FlowsConditionFieldComponent,
|
|
7295
7950
|
FlowsPairsFieldComponent,
|
|
7951
|
+
FlowsChoicesFieldComponent,
|
|
7952
|
+
FlowsParamFieldComponent,
|
|
7296
7953
|
FlowsMemberFieldComponent,
|
|
7297
7954
|
FlowsRetryFieldComponent,
|
|
7298
7955
|
FlowsAvailableFieldsComponent,
|
|
7299
7956
|
FlowsUnknownFieldsComponent,
|
|
7300
7957
|
FlowsWorkflowStatusComponent,
|
|
7301
|
-
FlowWorkflowBadgePipe
|
|
7958
|
+
FlowWorkflowBadgePipe,
|
|
7959
|
+
FlowJsonLinesPipe
|
|
7302
7960
|
],
|
|
7303
7961
|
imports: [
|
|
7304
7962
|
PwStickyActionsComponent,
|
|
@@ -7403,6 +8061,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
7403
8061
|
FlowsRunInspectorComponent,
|
|
7404
8062
|
FlowsRunProgressComponent,
|
|
7405
8063
|
FlowsStepErrorComponent,
|
|
8064
|
+
FlowsRunErrorComponent,
|
|
7406
8065
|
FlowsGraphCanvasComponent,
|
|
7407
8066
|
FlowsCanvasNodeComponent,
|
|
7408
8067
|
FlowsCanvasSocketComponent,
|
|
@@ -7412,12 +8071,15 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
7412
8071
|
FlowsJsonFieldComponent,
|
|
7413
8072
|
FlowsConditionFieldComponent,
|
|
7414
8073
|
FlowsPairsFieldComponent,
|
|
8074
|
+
FlowsChoicesFieldComponent,
|
|
8075
|
+
FlowsParamFieldComponent,
|
|
7415
8076
|
FlowsMemberFieldComponent,
|
|
7416
8077
|
FlowsRetryFieldComponent,
|
|
7417
8078
|
FlowsAvailableFieldsComponent,
|
|
7418
8079
|
FlowsUnknownFieldsComponent,
|
|
7419
8080
|
FlowsWorkflowStatusComponent,
|
|
7420
|
-
FlowWorkflowBadgePipe
|
|
8081
|
+
FlowWorkflowBadgePipe,
|
|
8082
|
+
FlowJsonLinesPipe
|
|
7421
8083
|
]
|
|
7422
8084
|
}]
|
|
7423
8085
|
}]
|