@prorobotech/openapi-k8s-toolkit 1.1.0-alpha.12 → 1.1.0-alpha.13

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.
@@ -38396,6 +38396,7 @@ const OwnerRefs = ({
38396
38396
  keysToForcedLabel,
38397
38397
  forcedRelatedValuePath,
38398
38398
  jsonPathToArrayOfRefs,
38399
+ forcedApiVersion,
38399
38400
  forcedNamespace,
38400
38401
  baseFactoryNamespacedAPIKey,
38401
38402
  baseFactoryClusterSceopedAPIKey,
@@ -38415,6 +38416,16 @@ const OwnerRefs = ({
38415
38416
  template: clusterNamePartOfUrl,
38416
38417
  replaceValues
38417
38418
  });
38419
+ const preparedForcedApiVersion = forcedApiVersion ? forcedApiVersion.map(({ kind, apiVersion }) => ({
38420
+ kind: prepareTemplate({
38421
+ template: kind,
38422
+ replaceValues
38423
+ }),
38424
+ apiVersion: prepareTemplate({
38425
+ template: apiVersion,
38426
+ replaceValues
38427
+ })
38428
+ })) : void 0;
38418
38429
  const preparedForcedNamespace = forcedNamespace ? prepareTemplate({
38419
38430
  template: forcedNamespace,
38420
38431
  replaceValues
@@ -38423,17 +38434,24 @@ const OwnerRefs = ({
38423
38434
  if (jsonRoot === void 0) {
38424
38435
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
38425
38436
  }
38426
- const refsArr = jp.query(jsonRoot, `$${jsonPathToArrayOfRefs}`)[0];
38437
+ const refsArr = jp.query(jsonRoot, `$${jsonPathToArrayOfRefs}`).flat();
38427
38438
  if (!Array.isArray(refsArr)) {
38428
38439
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: notArrayErrorText });
38429
38440
  }
38430
38441
  if (refsArr.length === 0) {
38431
38442
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: emptyArrayErrorText });
38432
38443
  }
38433
- if (refsArr.some((el) => !isOwnerReference(el))) {
38444
+ const refsArrWithForcedApiVersion = refsArr.map((el) => {
38445
+ const forceFound = preparedForcedApiVersion?.find((force) => force.kind === el.kind);
38446
+ if (forceFound) {
38447
+ return { ...el, apiVersion: forceFound.apiVersion };
38448
+ }
38449
+ return el;
38450
+ });
38451
+ if (refsArrWithForcedApiVersion.some((el) => !isOwnerReference(el))) {
38434
38452
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: isNotRefsArrayErrorText });
38435
38453
  }
38436
- const guardedRefsArr = refsArr;
38454
+ const guardedRefsArr = refsArrWithForcedApiVersion;
38437
38455
  if (isMultiqueryLoading) {
38438
38456
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
38439
38457
  }
@@ -38851,6 +38869,9 @@ const getCellRender = ({
38851
38869
  }) => {
38852
38870
  if (possibleCustomTypeWithProps) {
38853
38871
  const { type, customProps } = possibleCustomTypeWithProps;
38872
+ if (type === "factory") {
38873
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(TableFactory, { record, customProps, theme });
38874
+ }
38854
38875
  if (value === void 0 && possibleUndefinedValue) {
38855
38876
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ShortenedTextWithTooltip, { trimLength: possibleTrimLength, text: possibleUndefinedValue });
38856
38877
  }
@@ -38888,9 +38909,6 @@ const getCellRender = ({
38888
38909
  }
38889
38910
  return /* @__PURE__ */ jsxRuntimeExports.jsx(TrimmedTags, { tags, trimLength: possibleTrimLength });
38890
38911
  }
38891
- if (type === "factory") {
38892
- return /* @__PURE__ */ jsxRuntimeExports.jsx(TableFactory, { record, customProps, theme });
38893
- }
38894
38912
  }
38895
38913
  if (value === null) {
38896
38914
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "null" });