@orchestrator-ui/orchestrator-ui-components 8.7.1 → 8.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- npm notice run @orchestrator-ui/orchestrator-ui-components@8.7.1 build
1
+ npm notice run @orchestrator-ui/orchestrator-ui-components@8.7.2 build
2
2
  npm notice run npm run generate-version && tsup src/index.ts
3
- npm notice run @orchestrator-ui/orchestrator-ui-components@8.7.1 generate-version
3
+ npm notice run @orchestrator-ui/orchestrator-ui-components@8.7.2 generate-version
4
4
  npm notice run node -p "'export const ORCHESTRATOR_UI_LIBRARY_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'" > src/configuration/version.ts && prettier --write src/configuration/version.ts
5
5
  src/configuration/version.ts 44ms
6
6
  CLI Building entry: src/index.ts
@@ -10,9 +10,9 @@ src/configuration/version.ts 44ms
10
10
  CLI Target: es2022
11
11
  CLI Cleaning output folder
12
12
  ESM Build start
13
- ESM dist/index.js 878.47 KB
13
+ ESM dist/index.js 878.76 KB
14
14
  ESM dist/index.js.map 1.51 MB
15
- ESM ⚡️ Build success in 323ms
15
+ ESM ⚡️ Build success in 314ms
16
16
  DTS Build start
17
- DTS ⚡️ Build success in 22597ms
17
+ DTS ⚡️ Build success in 24972ms
18
18
  DTS dist/index.d.ts 1.53 MB
@@ -1,2 +1,2 @@
1
- npm notice run @orchestrator-ui/orchestrator-ui-components@8.7.1 lint
1
+ npm notice run @orchestrator-ui/orchestrator-ui-components@8.7.2 lint
2
2
  npm notice run eslint
@@ -1,11 +1,11 @@
1
- npm notice run @orchestrator-ui/orchestrator-ui-components@8.7.1 test
1
+ npm notice run @orchestrator-ui/orchestrator-ui-components@8.7.2 test
2
2
  npm notice run jest
3
- PASS Wfo-UI Tests src/components/WfoTree/treeUtils.spec.ts
4
- PASS Wfo-UI Tests src/pages/processes/timelineUtils.spec.ts
5
- PASS Wfo-UI Tests src/utils/date.spec.ts
6
3
  PASS Wfo-UI Tests src/components/WfoSubscription/utils/utils.spec.ts
4
+ PASS Wfo-UI Tests src/utils/date.spec.ts
5
+ PASS Wfo-UI Tests src/components/WfoTree/treeUtils.spec.ts
7
6
  PASS Wfo-UI Tests src/utils/string.spec.ts
8
7
  PASS Wfo-UI Tests src/components/WfoTable/utils/tableUtils.spec.ts
8
+ PASS Wfo-UI Tests src/pages/processes/timelineUtils.spec.ts
9
9
  PASS Wfo-UI Tests src/utils/getProductNamesFromProcess.spec.ts
10
10
  PASS Wfo-UI Tests src/components/WfoTable/WfoTable/WfoGroupedTable/utils.spec.ts
11
11
  PASS Wfo-UI Tests src/components/WfoTable/WfoTableWithFilter/updateQueryString.spec.ts
@@ -14,33 +14,33 @@ PASS Wfo-UI Tests src/utils/optionalArray.spec.ts
14
14
  PASS Wfo-UI Tests src/components/WfoTable/utils/tableConfigPersistence.spec.ts
15
15
  PASS Wfo-UI Tests src/messages/getTranslationMessages.spec.ts
16
16
  PASS Wfo-UI Tests src/rtk/utils.spec.ts
17
- PASS Wfo-UI Tests src/components/WfoTable/WfoTable/utils.spec.ts (5.648 s)
18
- PASS Wfo-UI Tests src/components/WfoPydanticForm/fields/WfoCron.spec.ts (5.113 s)
17
+ PASS Wfo-UI Tests src/components/WfoTable/WfoTable/utils.spec.ts (6.379 s)
18
+ PASS Wfo-UI Tests src/components/WfoPydanticForm/fields/WfoCron.spec.ts (5.541 s)
19
19
  PASS Wfo-UI Tests src/utils/resultFlattener.spec.ts
20
20
  PASS Wfo-UI Tests src/utils/getQueryParams.spec.ts
21
- PASS Wfo-UI Tests src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.spec.ts
22
21
  PASS Wfo-UI Tests src/utils/getEnvironmentVariables.spec.ts
23
22
  PASS Wfo-UI Tests src/components/WfoPageTemplate/WfoSidebar/utils/menuItemIsAllowed.spec.ts
24
23
  PASS Wfo-UI Tests src/utils/getToastMessage.spec.ts
25
24
  PASS Wfo-UI Tests src/components/WfoTable/utils/columns.spec.ts
25
+ PASS Wfo-UI Tests src/components/WfoTable/WfoTableSettingsModal/WfoTableSettingsModal.spec.ts
26
26
  PASS Wfo-UI Tests src/utils/toSortedObjectKeys.spec.ts
27
27
  PASS Wfo-UI Tests src/components/WfoWorkflowSteps/stepListUtils.spec.ts
28
28
  PASS Wfo-UI Tests src/utils/filterData.spec.ts
29
- PASS Wfo-UI Tests src/utils/getTokenName.spec.ts
30
29
  PASS Wfo-UI Tests src/utils/toObjectWithSerializedValues.spec.ts
30
+ PASS Wfo-UI Tests src/utils/getTokenName.spec.ts
31
31
  PASS Wfo-UI Tests src/utils/uuid.spec.ts
32
32
  PASS Wfo-UI Tests src/utils/environmentVariables.spec.ts
33
33
  PASS Wfo-UI Tests src/utils/integer.spec.ts
34
- PASS Wfo-UI Tests src/utils/getTypedFieldFromObject.spec.ts
35
34
  PASS Wfo-UI Tests src/utils/onlyUnique.spec.ts
35
+ PASS Wfo-UI Tests src/utils/getTypedFieldFromObject.spec.ts
36
36
  PASS Wfo-UI Tests src/utils/cacheTag.spec.ts
37
37
  PASS Wfo-UI Tests src/utils/getQueryVariablesForExport.spec.ts
38
- PASS Wfo-UI Tests src/components/WfoPageTemplate/WfoPageHeader/utils/toHexColorWithOpacity.spec.ts
39
38
  PASS Wfo-UI Tests src/utils/getQueryUrl.spec.ts
39
+ PASS Wfo-UI Tests src/components/WfoPageTemplate/WfoPageHeader/utils/toHexColorWithOpacity.spec.ts
40
40
  PASS Wfo-UI Tests src/components/WfoPydanticForm/fields/wfoPydanticFormUtils.spec.ts
41
41
 
42
42
  Test Suites: 38 passed, 38 total
43
43
  Tests: 257 passed, 257 total
44
44
  Snapshots: 0 total
45
- Time: 9.057 s
45
+ Time: 10.181 s
46
46
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @orchestrator-ui/orchestrator-ui-components
2
2
 
3
+ ## 8.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - a5ce17a: Minor comment improvements
8
+ - af9eaf6: Fixes subscription search has component and range filters
9
+
3
10
  ## 8.7.1
4
11
 
5
12
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -28882,7 +28882,7 @@ declare const METADATA_WORKFLOWS_ENDPOINT = "workflows";
28882
28882
  declare const METADATA_SCHEDULES_ENDPOINT = "schedules";
28883
28883
  declare const SEARCH_QUERY_RESULTS_ENDPOINT = "search/queries";
28884
28884
 
28885
- declare const ORCHESTRATOR_UI_LIBRARY_VERSION = "8.7.1";
28885
+ declare const ORCHESTRATOR_UI_LIBRARY_VERSION = "8.7.2";
28886
28886
 
28887
28887
  declare const useGetTranslationMessages: (locale: string | undefined) => {
28888
28888
  pydanticForms: {
package/dist/index.js CHANGED
@@ -61,7 +61,7 @@ var PolicyResource = /* @__PURE__ */ ((PolicyResource2) => {
61
61
  })(PolicyResource || {});
62
62
 
63
63
  // src/configuration/version.ts
64
- var ORCHESTRATOR_UI_LIBRARY_VERSION = "8.7.1";
64
+ var ORCHESTRATOR_UI_LIBRARY_VERSION = "8.7.2";
65
65
 
66
66
  // src/types/types.ts
67
67
  var EngineStatus = /* @__PURE__ */ ((EngineStatus2) => {
@@ -12209,7 +12209,7 @@ var WfoFieldSelector = ({ handleOnChange, disabled, rule, context }) => {
12209
12209
  const storeFieldOperators = (selectedValue2) => {
12210
12210
  const matchingPath = paths.find((path) => path.path === selectedValue2) ?? paths.find((path) => path.availablePaths?.includes(selectedValue2));
12211
12211
  const operators = matchingPath?.operators ?? prefilledFieldOptions2.get(selectedValue2) ?? [];
12212
- context?.onFieldSelected?.(selectedValue2, operators);
12212
+ context?.onFieldSelected?.(selectedValue2, operators, matchingPath);
12213
12213
  };
12214
12214
  const handleFieldSelection = (selectedOptions) => {
12215
12215
  const selectedOption = selectedOptions[0];
@@ -12281,6 +12281,10 @@ import { defaultOperators } from "react-querybuilder";
12281
12281
  import { EuiSelect as EuiSelect2 } from "@elastic/eui";
12282
12282
  import { jsx as jsx182 } from "@emotion/react/jsx-runtime";
12283
12283
  var isOptionGroup = (operator) => "options" in operator;
12284
+ var FALLBACK_OPERATOR_LABELS = {
12285
+ notNull: "\u2713 has component",
12286
+ null: "\u2717 does not have component"
12287
+ };
12284
12288
  var WfoOperatorSelector = (props) => {
12285
12289
  const { value, handleOnChange } = props;
12286
12290
  const flatOptions = props.options.flatMap(
@@ -12302,7 +12306,13 @@ var WfoOperatorSelector = (props) => {
12302
12306
  }
12303
12307
  }, [optionsKey, selectOptions, value, handleOnChange]);
12304
12308
  const currentValueIsListed = !value || selectOptions.some((option) => option.value === value);
12305
- const displayOptions = currentValueIsListed ? selectOptions : [...selectOptions, { value, text: defaultOperators.find((operator) => operator.name === value)?.label ?? value }];
12309
+ const displayOptions = currentValueIsListed ? selectOptions : [
12310
+ ...selectOptions,
12311
+ {
12312
+ value,
12313
+ text: FALLBACK_OPERATOR_LABELS[value] ?? defaultOperators.find((operator) => operator.name === value)?.label ?? value
12314
+ }
12315
+ ];
12306
12316
  return /* @__PURE__ */ jsx182(
12307
12317
  EuiSelect2,
12308
12318
  {
@@ -12438,40 +12448,42 @@ import { EuiButtonGroup as EuiButtonGroup2, EuiDatePicker as EuiDatePicker2, Eui
12438
12448
  import { useEffect as useEffect22, useState as useState32 } from "react";
12439
12449
  import { EuiFlexGroup as EuiFlexGroup20 } from "@elastic/eui";
12440
12450
  import { jsx as jsx189, jsxs as jsxs95 } from "@emotion/react/jsx-runtime";
12441
- var WfoRangeEditor = ({ handleOnChange, operator, Element, value: currentValue }) => {
12442
- const [currentOperator, setCurrentOperator] = useState32(operator);
12451
+ var WfoRangeEditor = ({ handleOnChange, InputElement, value: currentValue }) => {
12443
12452
  const startValue = currentValue ? currentValue?.toString().split(",") : [];
12444
12453
  const [value, setValue] = useState32(startValue);
12454
+ const handleRangeChange = (newValue, rangeIndex) => {
12455
+ setValue((currentValues) => {
12456
+ const next = [...currentValues];
12457
+ const isCleared = newValue === void 0 || typeof newValue === "number" && Number.isNaN(newValue);
12458
+ next[rangeIndex] = isCleared ? void 0 : String(newValue);
12459
+ return next;
12460
+ });
12461
+ };
12445
12462
  useEffect22(() => {
12446
- if (operator !== currentOperator && (operator === "between" || currentOperator === "between")) {
12447
- setValue([]);
12448
- handleOnChange("");
12449
- setCurrentOperator(operator);
12450
- }
12451
- }, [currentOperator, handleOnChange, operator]);
12452
- const handleChange = (value2, rangeIndex = 0) => {
12453
- if (operator === "between") {
12454
- setValue((currentDates) => {
12455
- if (value2 === null) {
12456
- return currentDates.filter((_7, index) => index !== rangeIndex);
12457
- }
12458
- currentDates[rangeIndex] = value2;
12459
- if (currentDates.length === 2) {
12460
- handleOnChange(`${currentDates[0]},${currentDates[1]}`);
12461
- }
12462
- return currentDates;
12463
- });
12464
- } else {
12465
- handleOnChange(value2);
12463
+ if (value[0] !== void 0 && value[1] !== void 0) {
12464
+ handleOnChange(`${value[0]},${value[1]}`);
12466
12465
  }
12467
- };
12468
- if (operator === "between") {
12469
- return /* @__PURE__ */ jsxs95(EuiFlexGroup20, { direction: "row", gutterSize: "s", children: [
12470
- /* @__PURE__ */ jsx189(Element, { handleOnChange: handleChange, rangeIndex: 0, value: value[0] }),
12471
- /* @__PURE__ */ jsx189(Element, { handleOnChange: handleChange, rangeIndex: 1, value: value[1] })
12472
- ] });
12473
- }
12474
- return /* @__PURE__ */ jsx189(Element, { handleOnChange, value: value[0] });
12466
+ }, [value]);
12467
+ return /* @__PURE__ */ jsxs95(EuiFlexGroup20, { direction: "row", gutterSize: "s", children: [
12468
+ /* @__PURE__ */ jsx189(
12469
+ InputElement,
12470
+ {
12471
+ handleOnChange: (value2) => {
12472
+ handleRangeChange(value2, 0);
12473
+ },
12474
+ value: value[0]
12475
+ }
12476
+ ),
12477
+ /* @__PURE__ */ jsx189(
12478
+ InputElement,
12479
+ {
12480
+ handleOnChange: (value2) => {
12481
+ handleRangeChange(value2, 1);
12482
+ },
12483
+ value: value[1]
12484
+ }
12485
+ )
12486
+ ] });
12475
12487
  };
12476
12488
 
12477
12489
  // src/components/WfoTable/WfoStructuredSearchTable/WfoValueEditor.tsx
@@ -12524,14 +12536,14 @@ var TextEditor = ({ handleOnChange, value: currentValue = "" }) => {
12524
12536
  };
12525
12537
  return /* @__PURE__ */ jsx190(EuiFieldText3, { value, onChange: handleTextChange, onBlur: handleOnBlur, onKeyDown: handleOnKeyDown });
12526
12538
  };
12527
- var NumberEditor = ({ handleOnChange, rangeIndex, value: currentValue }) => {
12539
+ var NumberEditor = ({ handleOnChange, value: currentValue }) => {
12528
12540
  const [value, setValue] = useState33(currentValue?.toString() || "");
12529
12541
  const handleNumberChange = (e) => {
12530
12542
  setValue(e.target.value || "");
12531
12543
  };
12532
12544
  const handleOnBlur = () => {
12533
12545
  const numberValue = parseFloat(value);
12534
- handleOnChange(numberValue, rangeIndex);
12546
+ handleOnChange(numberValue);
12535
12547
  };
12536
12548
  const handleOnKeyDown = (e) => {
12537
12549
  if (e.key === "Enter") {
@@ -12548,7 +12560,7 @@ var NumberEditor = ({ handleOnChange, rangeIndex, value: currentValue }) => {
12548
12560
  }
12549
12561
  );
12550
12562
  };
12551
- var DatePicker = ({ handleOnChange, rangeIndex, value: currentValue }) => {
12563
+ var DatePicker = ({ handleOnChange, value: currentValue }) => {
12552
12564
  const [date, setDate] = useState33(currentValue || "");
12553
12565
  const t = useTranslations46("search.page");
12554
12566
  return /* @__PURE__ */ jsx190(
@@ -12558,9 +12570,8 @@ var DatePicker = ({ handleOnChange, rangeIndex, value: currentValue }) => {
12558
12570
  onChange: (date2) => {
12559
12571
  const utcDate = date2 ? moment3.utc(date2) : void 0;
12560
12572
  setDate(utcDate?.toISOString() || "");
12561
- handleOnChange(utcDate?.toISOString(), rangeIndex);
12573
+ handleOnChange(utcDate?.toISOString());
12562
12574
  },
12563
- id: rangeIndex ? `date-range-${rangeIndex}` : "date-range",
12564
12575
  css: { width: "330px" },
12565
12576
  showTimeSelect: true,
12566
12577
  dateFormat: "yyyy-MM-dd HH:mm",
@@ -12579,20 +12590,24 @@ var WfoValueEditor = ({
12579
12590
  value,
12580
12591
  className
12581
12592
  }) => {
12593
+ if (operator === "null" || operator === "notNull") {
12594
+ return null;
12595
+ }
12596
+ const getComponentByType = () => {
12597
+ if (uiFieldType === "boolean" /* boolean */) return BooleanEditor;
12598
+ if (uiFieldType === "datetime" /* datetime */) return DatePicker;
12599
+ if (uiFieldType === "number" /* number */) return NumberEditor;
12600
+ return TextEditor;
12601
+ };
12582
12602
  const fieldPathInfoMap = context?.fieldPathInfoMap;
12583
12603
  const fieldInfo = fieldPathInfoMap && fieldPathInfoMap.has(fieldName) ? fieldPathInfoMap.get(fieldName) : void 0;
12584
- const uiFieldType = fieldInfo?.ui_types[0] || "text" /* text */;
12604
+ const uiFieldType = fieldInfo?.ui_types?.[0] || "text" /* text */;
12585
12605
  const getEditor = () => {
12586
- if (uiFieldType === "boolean" /* boolean */) {
12587
- return /* @__PURE__ */ jsx190(BooleanEditor, { handleOnChange, value });
12588
- }
12589
- if (uiFieldType === "datetime" /* datetime */) {
12590
- return /* @__PURE__ */ jsx190(WfoRangeEditor, { handleOnChange, operator, Element: DatePicker, value });
12591
- }
12592
- if (uiFieldType === "number" /* number */) {
12593
- return /* @__PURE__ */ jsx190(WfoRangeEditor, { handleOnChange, operator, Element: NumberEditor, value });
12606
+ const InputElement = getComponentByType();
12607
+ if (operator === "between") {
12608
+ return /* @__PURE__ */ jsx190(WfoRangeEditor, { handleOnChange, value, InputElement });
12594
12609
  }
12595
- return /* @__PURE__ */ jsx190(TextEditor, { handleOnChange, value });
12610
+ return /* @__PURE__ */ jsx190(InputElement, { handleOnChange, value });
12596
12611
  };
12597
12612
  const handleWrapperKeyDown = (event) => {
12598
12613
  if (event.key !== "Enter") return;
@@ -12612,8 +12627,11 @@ var SEARCH_OPERATOR_TO_RQB_OPERATOR_MAP = {
12612
12627
  gt: ">",
12613
12628
  gte: ">=",
12614
12629
  between: "between",
12615
- like: "contains"
12630
+ like: "contains",
12631
+ has_component: "notNull",
12632
+ not_has_component: "null"
12616
12633
  };
12634
+ var RQB_UNARY_OPERATORS = ["null", "notNull"];
12617
12635
  var OPERATOR_MAP2 = {
12618
12636
  eq: { symbol: "=", description: "equals" },
12619
12637
  neq: { symbol: "\u2260", description: "not equals" },
@@ -12649,21 +12667,32 @@ var WfoFilterBuilder = ({
12649
12667
  return (operators ?? []).map((operator) => {
12650
12668
  const { symbol, description } = OPERATOR_MAP2[operator] || { symbol: operator, description: operator };
12651
12669
  const rqbOperator = SEARCH_OPERATOR_TO_RQB_OPERATOR_MAP[operator] ?? operator;
12652
- return { name: rqbOperator, label: `${symbol} ${description}`, value: rqbOperator };
12670
+ return {
12671
+ name: rqbOperator,
12672
+ label: `${symbol} ${description}`,
12673
+ value: rqbOperator,
12674
+ ...RQB_UNARY_OPERATORS.includes(rqbOperator) && { arity: "unary" }
12675
+ };
12653
12676
  });
12654
12677
  };
12655
12678
  const t = useTranslations47("common");
12656
12679
  const { queryBuilderContainerStyles } = useWithOrchestratorTheme(getWfoStructuredSearchTableStyles);
12657
12680
  const [fieldToOperatorMap, setFieldToOperatorMap] = useState34(prefilledFieldOptions2);
12681
+ const [fieldPathInfoMap, setFieldPathInfoMap] = useState34(/* @__PURE__ */ new Map());
12658
12682
  const latestRuleGroupRef = useRef13(queryBuilderRuleGroup);
12659
12683
  latestRuleGroupRef.current = queryBuilderRuleGroup;
12660
12684
  const handleValueEditorEnter = () => {
12661
12685
  handleSearch({ ruleGroup: latestRuleGroupRef.current });
12662
12686
  };
12663
- const handleFieldSelected = (field, operators) => {
12687
+ const handleFieldSelected = (field, operators, pathInfo) => {
12664
12688
  setFieldToOperatorMap((previousMap) => {
12665
12689
  return new Map(previousMap).set(field, operators);
12666
12690
  });
12691
+ if (pathInfo) {
12692
+ setFieldPathInfoMap((previousMap) => {
12693
+ return new Map(previousMap).set(field, pathInfo);
12694
+ });
12695
+ }
12667
12696
  };
12668
12697
  return /* @__PURE__ */ jsx191(EuiFlexGroup21, { css: queryBuilderContainerStyles, children: /* @__PURE__ */ jsxs96(EuiFlexGroup21, { direction: "column", children: [
12669
12698
  /* @__PURE__ */ jsx191(EuiFlexItem21, { children: /* @__PURE__ */ jsx191(
@@ -12678,6 +12707,7 @@ var WfoFilterBuilder = ({
12678
12707
  context: {
12679
12708
  onFieldSelected: handleFieldSelected,
12680
12709
  prefilledFieldOptions: prefilledFieldOptions2,
12710
+ fieldPathInfoMap,
12681
12711
  onValueEditorEnter: handleValueEditorEnter
12682
12712
  },
12683
12713
  getOperators: (field) => {