@prorobotech/openapi-k8s-toolkit 1.4.0-alpha.21 → 1.4.0-alpha.23

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.
@@ -9550,8 +9550,13 @@ const checkIfBuiltInInstanceNamespaceScoped = async ({
9550
9550
  return data;
9551
9551
  };
9552
9552
 
9553
- const useSmartResourceParams = ({ cluster, namespace }) => {
9553
+ const useSmartResourceParams = ({
9554
+ cluster,
9555
+ namespace,
9556
+ enabler
9557
+ }) => {
9554
9558
  const [searchParams] = useSearchParams();
9559
+ const clusterPrepared = cluster ?? "";
9555
9560
  const rawEntries = useMemo(() => {
9556
9561
  const raw = searchParams.get("resources");
9557
9562
  if (!raw) return [];
@@ -9559,19 +9564,20 @@ const useSmartResourceParams = ({ cluster, namespace }) => {
9559
9564
  const [apiGroup = "", apiVersion = "", plural = ""] = entry.split("/");
9560
9565
  const normalizedGroup = apiGroup === "builtin" || apiGroup === "" ? void 0 : apiGroup;
9561
9566
  return {
9562
- cluster,
9567
+ cluster: clusterPrepared,
9563
9568
  plural,
9564
9569
  apiGroup: normalizedGroup,
9565
9570
  apiVersion
9566
9571
  };
9567
9572
  }).filter((e) => Boolean(e.plural));
9568
- }, [searchParams, cluster]);
9573
+ }, [searchParams, clusterPrepared]);
9569
9574
  const scopeQueries = useQueries({
9570
9575
  queries: rawEntries.map((e) => {
9571
9576
  const isApi = Boolean(e.apiGroup);
9577
+ const scopeEnabler = Boolean((enabler ?? true) && e.cluster && e.plural && (!isApi || e.apiVersion));
9572
9578
  return {
9573
9579
  queryKey: ["resource-scope", e.cluster, isApi ? e.apiGroup : "builtin", e.apiVersion ?? "", e.plural],
9574
- enabled: Boolean(e.cluster && e.plural && (!isApi || e.apiVersion)),
9580
+ enabled: scopeEnabler,
9575
9581
  queryFn: () => {
9576
9582
  if (isApi) {
9577
9583
  return checkIfApiInstanceNamespaceScoped({
@@ -43778,8 +43784,7 @@ const YamlEditorSingleton$1 = ({
43778
43784
  const body = currentValues;
43779
43785
  const endpoint = `/api/clusters/${cluster}/k8s/${type === "builtin" ? "" : "apis/"}${apiGroupApiVersion}${isNameSpaced ? `/namespaces/${namespace}` : ""}/${plural}/${isCreate ? "" : name}`;
43780
43786
  if (isCreate) {
43781
- createNewEntry({ endpoint, body }).then((res) => {
43782
- console.log(res);
43787
+ createNewEntry({ endpoint, body }).then(() => {
43783
43788
  if (backlink) {
43784
43789
  navigate(backlink);
43785
43790
  }
@@ -43797,8 +43802,7 @@ const YamlEditorSingleton$1 = ({
43797
43802
  setError(error2);
43798
43803
  });
43799
43804
  } else {
43800
- updateEntry({ endpoint, body }).then((res) => {
43801
- console.log(res);
43805
+ updateEntry({ endpoint, body }).then(() => {
43802
43806
  if (backlink) {
43803
43807
  navigate(backlink);
43804
43808
  }
@@ -44084,8 +44088,7 @@ const parseArrayOfAny = (value) => {
44084
44088
  let flattenArrayOfUnknown = [];
44085
44089
  try {
44086
44090
  flattenArrayOfUnknown = flattenOnce$3(value);
44087
- } catch (e) {
44088
- console.log(e);
44091
+ } catch {
44089
44092
  return { error: "Error while flattening" };
44090
44093
  }
44091
44094
  if (isRecordArray(flattenArrayOfUnknown)) {
@@ -44154,8 +44157,7 @@ const getItemCounterItemsInside = (value) => {
44154
44157
  let flattenArrayOfUnknown = [];
44155
44158
  try {
44156
44159
  flattenArrayOfUnknown = flattenOnce$2(value);
44157
- } catch (e) {
44158
- console.log(e);
44160
+ } catch {
44159
44161
  return { error: "Error while flattening" };
44160
44162
  }
44161
44163
  return { counter: flattenArrayOfUnknown.length };
@@ -44191,13 +44193,11 @@ const ItemCounter = ({
44191
44193
  }, {});
44192
44194
  const jsonRoot = multiQueryData[`req${reqIndex}`];
44193
44195
  if (jsonRoot === void 0) {
44194
- console.log(`Item Counter: ${id}: No root for json path`);
44195
44196
  return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: errorText });
44196
44197
  }
44197
44198
  const anythingForNow = jp.query(jsonRoot || {}, `$${jsonPathToArray}`);
44198
44199
  const { counter, error: errorArrayOfObjects } = getItemCounterItemsInside(anythingForNow);
44199
44200
  if (errorArrayOfObjects) {
44200
- console.log(`Item Counter: ${id}: ${errorArrayOfObjects}`);
44201
44201
  return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: errorText });
44202
44202
  }
44203
44203
  const parsedText = parseAll({ text, replaceValues, multiQueryData });
@@ -44248,13 +44248,11 @@ const KeyCounter = ({
44248
44248
  }, {});
44249
44249
  const jsonRoot = multiQueryData[`req${reqIndex}`];
44250
44250
  if (jsonRoot === void 0) {
44251
- console.log(`Key Counter: ${id}: No root for json path`);
44252
44251
  return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: errorText });
44253
44252
  }
44254
44253
  const anythingForNow = jp.query(jsonRoot || {}, `$${jsonPathToObj}`);
44255
44254
  const { counter, error: errorArrayOfObjects } = getKeyCounterItemsInside(anythingForNow);
44256
44255
  if (errorArrayOfObjects) {
44257
- console.log(`Key Counter: ${id}: ${errorArrayOfObjects}`);
44258
44256
  return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: errorText });
44259
44257
  }
44260
44258
  const parsedText = parseAll({ text, replaceValues, multiQueryData });
@@ -44476,7 +44474,6 @@ const LabelsEditModal = ({
44476
44474
  const [key, value] = label.split("=");
44477
44475
  result[key] = value || "";
44478
44476
  });
44479
- console.log(JSON.stringify(result));
44480
44477
  setIsLoading(true);
44481
44478
  setError(void 0);
44482
44479
  patchEntryWithReplaceOp({ endpoint, pathToValue, body: result }).then(() => {
@@ -44612,7 +44609,6 @@ const TaintsEditModal = ({
44612
44609
  }, [open, form]);
44613
44610
  const submit = () => {
44614
44611
  form.validateFields().then(() => {
44615
- console.log(JSON.stringify(taints));
44616
44612
  setIsLoading(true);
44617
44613
  setError(void 0);
44618
44614
  patchEntryWithReplaceOp({ endpoint, pathToValue, body: taints }).then(() => {
@@ -44765,7 +44761,6 @@ const TolerationsEditModal = ({
44765
44761
  }, [open, form]);
44766
44762
  const submit = () => {
44767
44763
  form.validateFields().then(() => {
44768
- console.log(JSON.stringify(tolerations));
44769
44764
  setIsLoading(true);
44770
44765
  setError(void 0);
44771
44766
  patchEntryWithReplaceOp({ endpoint, pathToValue, body: tolerations }).then(() => {
@@ -44966,7 +44961,6 @@ const AnnotationsEditModal = ({
44966
44961
  annotations.forEach(({ key, value }) => {
44967
44962
  result[key] = value || "";
44968
44963
  });
44969
- console.log(JSON.stringify(result));
44970
44964
  setIsLoading(true);
44971
44965
  setError(void 0);
44972
44966
  patchEntryWithReplaceOp({ endpoint, pathToValue, body: result }).then(() => {
@@ -45477,10 +45471,8 @@ const LabelsToSearchParams = ({ data, children }) => {
45477
45471
  };
45478
45472
  if (!labelsRaw) {
45479
45473
  if (errorArrayOfObjects) {
45480
- console.log(errorArrayOfObjects);
45481
45474
  return renderErrorFallback();
45482
45475
  }
45483
- console.log("Not a valid data structure");
45484
45476
  return renderErrorFallback();
45485
45477
  }
45486
45478
  const labels = Object.entries(labelsRaw).map(([key, value]) => `${key}=${value}`).join(",");
@@ -45559,8 +45551,7 @@ const getTaintsItemsInside = (value) => {
45559
45551
  let flattenArrayOfUnknown = [];
45560
45552
  try {
45561
45553
  flattenArrayOfUnknown = flattenOnce$1(value);
45562
- } catch (e) {
45563
- console.log(e);
45554
+ } catch {
45564
45555
  return { error: "Error while flattening" };
45565
45556
  }
45566
45557
  return { counter: flattenArrayOfUnknown.length, taints: filterTaintLikes(flattenArrayOfUnknown) };
@@ -45631,7 +45622,6 @@ const Taints = ({ data, children }) => {
45631
45622
  }
45632
45623
  const jsonRoot = multiQueryData[`req${reqIndex}`];
45633
45624
  if (jsonRoot === void 0) {
45634
- console.log(`Item Counter: ${id}: No root for json path`);
45635
45625
  return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: errorText });
45636
45626
  }
45637
45627
  const anythingForNow = jp.query(jsonRoot || {}, `$${jsonPathToArray}`);
@@ -45659,7 +45649,6 @@ const Taints = ({ data, children }) => {
45659
45649
  });
45660
45650
  };
45661
45651
  if (errorArrayOfObjects) {
45662
- console.log(`Item Counter: ${id}: ${errorArrayOfObjects}`);
45663
45652
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
45664
45653
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
45665
45654
  errorText,
@@ -45774,8 +45763,7 @@ const getTolerationsItemsInside = (value) => {
45774
45763
  let flattenArrayOfUnknown = [];
45775
45764
  try {
45776
45765
  flattenArrayOfUnknown = flattenOnce(value);
45777
- } catch (e) {
45778
- console.log(e);
45766
+ } catch {
45779
45767
  return { error: "Error while flattening" };
45780
45768
  }
45781
45769
  return { counter: flattenArrayOfUnknown.length, tolerations: filterTolerations(flattenArrayOfUnknown) };
@@ -45848,7 +45836,6 @@ const Tolerations = ({
45848
45836
  }
45849
45837
  const jsonRoot = multiQueryData[`req${reqIndex}`];
45850
45838
  if (jsonRoot === void 0) {
45851
- console.log(`Item Counter: ${id}: No root for json path`);
45852
45839
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
45853
45840
  }
45854
45841
  const anythingForNow = jp.query(jsonRoot || {}, `$${jsonPathToArray}`);
@@ -45876,7 +45863,6 @@ const Tolerations = ({
45876
45863
  });
45877
45864
  };
45878
45865
  if (errorArrayOfObjects) {
45879
- console.log(`Item Counter: ${id}: ${errorArrayOfObjects}`);
45880
45866
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
45881
45867
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
45882
45868
  errorText,
@@ -46040,7 +46026,6 @@ const Annotations = ({
46040
46026
  }
46041
46027
  const jsonRoot = multiQueryData[`req${reqIndex}`];
46042
46028
  if (jsonRoot === void 0) {
46043
- console.log(`Item Counter: ${id}: No root for json path`);
46044
46029
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
46045
46030
  }
46046
46031
  const anythingForNow = jp.query(jsonRoot || {}, `$${jsonPathToObj}`);
@@ -46068,7 +46053,6 @@ const Annotations = ({
46068
46053
  });
46069
46054
  };
46070
46055
  if (errorArrayOfObjects) {
46071
- console.log(`Item Counter: ${id}: ${errorArrayOfObjects}`);
46072
46056
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
46073
46057
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
46074
46058
  errorText,
@@ -78379,7 +78363,6 @@ const AnnotationsModal = ({
78379
78363
  }, {});
78380
78364
  const jsonRoot = multiQueryData[`req${reqIndex}`];
78381
78365
  if (jsonRoot === void 0) {
78382
- console.log(`Item Counter: No root for json path`);
78383
78366
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "No root for json path" });
78384
78367
  }
78385
78368
  const anythingForNow = jp.query(jsonRoot || {}, `$${jsonPathToObj}`);
@@ -78407,7 +78390,6 @@ const AnnotationsModal = ({
78407
78390
  });
78408
78391
  };
78409
78392
  if (errorArrayOfObjects) {
78410
- console.log(`Item Counter: ${errorArrayOfObjects}`);
78411
78393
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
78412
78394
  contextHolder,
78413
78395
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -78490,9 +78472,6 @@ const TaintsModal = ({
78490
78472
  return acc;
78491
78473
  }, {});
78492
78474
  const jsonRoot = multiQueryData[`req${reqIndex}`];
78493
- if (jsonRoot === void 0) {
78494
- console.log(`Item Counter: No root for json path`);
78495
- }
78496
78475
  const anythingForNow = jp.query(jsonRoot || {}, `$${jsonPathToArray}`);
78497
78476
  const { taints, error: errorArrayOfObjects } = getTaintsItemsInside(anythingForNow);
78498
78477
  const notificationSuccessMessagePrepared = notificationSuccessMessage ? parseAll({
@@ -78518,7 +78497,6 @@ const TaintsModal = ({
78518
78497
  });
78519
78498
  };
78520
78499
  if (errorArrayOfObjects) {
78521
- console.log(`Item Counter: ${errorArrayOfObjects}`);
78522
78500
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
78523
78501
  contextHolder,
78524
78502
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -78602,7 +78580,6 @@ const TolerationsModal = ({
78602
78580
  }, {});
78603
78581
  const jsonRoot = multiQueryData[`req${reqIndex}`];
78604
78582
  if (jsonRoot === void 0) {
78605
- console.log(`Item Counter: No root for json path`);
78606
78583
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "No root for json path" });
78607
78584
  }
78608
78585
  const anythingForNow = jp.query(jsonRoot || {}, `$${jsonPathToArray}`);
@@ -78630,7 +78607,6 @@ const TolerationsModal = ({
78630
78607
  });
78631
78608
  };
78632
78609
  if (errorArrayOfObjects) {
78633
- console.log(`Item Counter: ${errorArrayOfObjects}`);
78634
78610
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
78635
78611
  contextHolder,
78636
78612
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -78679,7 +78655,7 @@ const TolerationsModal = ({
78679
78655
  };
78680
78656
 
78681
78657
  const LazyEnrichedTableModal = lazy(
78682
- () => import('./index-CVP6M61v.mjs').then((mod) => ({ default: mod.EnrichedTableModal }))
78658
+ () => import('./index-oRwnOGcM.mjs').then((mod) => ({ default: mod.EnrichedTableModal }))
78683
78659
  );
78684
78660
  const renderActiveType = (activeType, extraProps) => {
78685
78661
  if (!activeType) return null;
@@ -78833,7 +78809,6 @@ const AggregatedCounterCard = ({ data, children }) => {
78833
78809
  }
78834
78810
  const jsonRoot = multiQueryData[`req${counter.props.reqIndex}`];
78835
78811
  if (jsonRoot === void 0) {
78836
- console.log(`Counter: ${id}: No root for json path`);
78837
78812
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
78838
78813
  Styled$o.Card,
78839
78814
  {
@@ -78867,7 +78842,6 @@ const AggregatedCounterCard = ({ data, children }) => {
78867
78842
  const anythingForNow = jp.query(jsonRoot || {}, `$${path}`);
78868
78843
  const { counter: counterToDisplay, error: errorParsingCounter } = counter.type === "item" ? getItemCounterItemsInside(anythingForNow) : getKeyCounterItemsInside(anythingForNow);
78869
78844
  if (errorParsingCounter) {
78870
- console.log(`Counter: ${id}: ${errorParsingCounter}`);
78871
78845
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
78872
78846
  Styled$o.Card,
78873
78847
  {
@@ -81454,7 +81428,6 @@ const Volumes = ({ data, children }) => {
81454
81428
  }
81455
81429
  const jsonRoot = multiQueryData[`req${reqIndex}`];
81456
81430
  if (jsonRoot === void 0) {
81457
- console.log(`Volumes: ${id}: No root for json path`);
81458
81431
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
81459
81432
  }
81460
81433
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
@@ -85429,6 +85402,7 @@ const buildConcretePathForNewItem = (tpl, arrayPath, newIndex) => {
85429
85402
  const result = [...realizedPrefix, newIndex, ...w.slice(arrayPath.length + 1)];
85430
85403
  return result;
85431
85404
  };
85405
+ const getConcretePathsForNewArrayItem = (templates, arrayPath, newIndex) => templates.filter((tpl) => templateMatchesArray(tpl, arrayPath)).map((tpl) => buildConcretePathForNewItem(tpl, arrayPath, newIndex));
85432
85406
  const scrubLiteralWildcardKeys = (input) => {
85433
85407
  if (Array.isArray(input)) return input.map(scrubLiteralWildcardKeys);
85434
85408
  if (_$1.isPlainObject(input)) {
@@ -85626,7 +85600,15 @@ const BlackholeForm = ({
85626
85600
  return value;
85627
85601
  });
85628
85602
  };
85629
- const [persistedKeys, setPersistedKeys] = useState(persistedPaths || []);
85603
+ const exactPersistedPaths = useMemo(
85604
+ () => (persistedPaths || []).filter((path) => !path.some((seg) => seg === "*")),
85605
+ [persistedPaths]
85606
+ );
85607
+ const persistedWildcardTemplates = useMemo(
85608
+ () => (persistedPaths || []).filter((path) => path.some((seg) => seg === "*")).map((path) => ({ wildcardPath: sanitizeWildcardPath(path) })),
85609
+ [persistedPaths]
85610
+ );
85611
+ const [persistedKeys, setPersistedKeys] = useState(exactPersistedPaths);
85630
85612
  const [resolvedHiddenPaths, setResolvedHiddenPaths] = useState([]);
85631
85613
  const blockedPathsRef = useRef(/* @__PURE__ */ new Set());
85632
85614
  const manualBlockedPathsRef = useRef(/* @__PURE__ */ new Set());
@@ -85700,8 +85682,7 @@ const BlackholeForm = ({
85700
85682
  const body = data;
85701
85683
  const endpoint = `/api/clusters/${cluster}/k8s/${type === "builtin" ? "" : "apis/"}${apiGroupApiVersion}${isNameSpaced ? `/namespaces/${namespace}` : ""}/${plural}/${isCreate ? "" : name}`;
85702
85684
  if (isCreate) {
85703
- createNewEntry({ endpoint, body }).then((res) => {
85704
- console.log(res);
85685
+ createNewEntry({ endpoint, body }).then(() => {
85705
85686
  if (resolvedBacklink) {
85706
85687
  navigate(resolvedBacklink);
85707
85688
  }
@@ -85715,8 +85696,7 @@ const BlackholeForm = ({
85715
85696
  setError(error2);
85716
85697
  });
85717
85698
  } else {
85718
- updateEntry({ endpoint, body }).then((res) => {
85719
- console.log(res);
85699
+ updateEntry({ endpoint, body }).then(() => {
85720
85700
  if (resolvedBacklink) {
85721
85701
  navigate(resolvedBacklink);
85722
85702
  }
@@ -85813,6 +85793,29 @@ const BlackholeForm = ({
85813
85793
  },
85814
85794
  [form, prefillTemplates]
85815
85795
  );
85796
+ const applyPersistedForNewArrayItem = useCallback(
85797
+ (arrayPath, newIndex) => {
85798
+ const concretePaths = getConcretePathsForNewArrayItem(
85799
+ persistedWildcardTemplates,
85800
+ arrayPath,
85801
+ newIndex
85802
+ );
85803
+ if (!concretePaths.length) return;
85804
+ setPersistedKeys((prev) => {
85805
+ const seen = new Set(prev.map((x) => JSON.stringify(x)));
85806
+ const merged = [...prev];
85807
+ concretePaths.forEach((path) => {
85808
+ const key = JSON.stringify(path);
85809
+ if (!seen.has(key)) {
85810
+ seen.add(key);
85811
+ merged.push(path);
85812
+ }
85813
+ });
85814
+ return merged;
85815
+ });
85816
+ },
85817
+ [persistedWildcardTemplates]
85818
+ );
85816
85819
  const hiddenWildcardTemplates = useMemo(() => {
85817
85820
  const raw = hiddenPaths ?? [];
85818
85821
  raw.forEach((p, i) => wdbg(`#${i}`, p));
@@ -85849,7 +85852,26 @@ const BlackholeForm = ({
85849
85852
  }
85850
85853
  return merged;
85851
85854
  });
85852
- }, [initialValues, hiddenWildcardTemplates, expandedWildcardTemplates]);
85855
+ const persistedResolved = expandWildcardTemplates(
85856
+ persistedWildcardTemplates.map((tpl) => tpl.wildcardPath),
85857
+ initialValues,
85858
+ {
85859
+ includeMissingFinalForWildcard: true
85860
+ }
85861
+ );
85862
+ setPersistedKeys((prev) => {
85863
+ const seen = new Set(prev.map((x) => JSON.stringify(x)));
85864
+ const merged = [...prev];
85865
+ for (const p of persistedResolved) {
85866
+ const k = JSON.stringify(p);
85867
+ if (!seen.has(k)) {
85868
+ seen.add(k);
85869
+ merged.push(p);
85870
+ }
85871
+ }
85872
+ return merged;
85873
+ });
85874
+ }, [initialValues, hiddenWildcardTemplates, expandedWildcardTemplates, persistedWildcardTemplates]);
85853
85875
  const resolvedHiddenStringPaths = useMemo(
85854
85876
  () => resolvedHiddenPaths.map(toStringPath),
85855
85877
  [resolvedHiddenPaths]
@@ -85991,6 +86013,7 @@ const BlackholeForm = ({
85991
86013
  }
85992
86014
  blockedPathsRef.current.delete(JSON.stringify(itemPath));
85993
86015
  applyPrefillForNewArrayItem(arrayPath, i);
86016
+ applyPersistedForNewArrayItem(arrayPath, i);
85994
86017
  }
85995
86018
  }
85996
86019
  }
@@ -86003,6 +86026,7 @@ const BlackholeForm = ({
86003
86026
  const arrayPath = JSON.parse(k);
86004
86027
  for (let i = prevLen; i < newLen; i++) {
86005
86028
  applyPrefillForNewArrayItem(arrayPath, i);
86029
+ applyPersistedForNewArrayItem(arrayPath, i);
86006
86030
  }
86007
86031
  }
86008
86032
  }
@@ -86021,6 +86045,7 @@ const BlackholeForm = ({
86021
86045
  persistedKeys,
86022
86046
  debouncedPostValuesToYaml,
86023
86047
  applyPrefillForNewArrayItem,
86048
+ applyPersistedForNewArrayItem,
86024
86049
  hiddenWildcardTemplates,
86025
86050
  expandedWildcardTemplates
86026
86051
  ]
@@ -86122,7 +86147,6 @@ const BlackholeForm = ({
86122
86147
  const prev = prevInitialValues.current;
86123
86148
  if (!_$1.isEqual(prev, initialValues)) {
86124
86149
  if (initialValues) {
86125
- console.log("fired initial values", initialValues);
86126
86150
  onValuesChangeCallback(initialValues);
86127
86151
  }
86128
86152
  prevInitialValues.current = initialValues;
@@ -86293,7 +86317,6 @@ const BlackholeForm = ({
86293
86317
  });
86294
86318
  };
86295
86319
  const onPersistUnmark = (value) => {
86296
- console.log(value);
86297
86320
  setPersistedKeys([...persistedKeys.filter((arr) => JSON.stringify(arr) !== JSON.stringify(value))]);
86298
86321
  };
86299
86322
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
@@ -86438,6 +86461,13 @@ const BlackholeFormProvider = ({
86438
86461
  plural: "customformsoverrides",
86439
86462
  isEnabled: Boolean(cluster && forcingCustomization.baseApiGroup && forcingCustomization.baseApiVersion)
86440
86463
  });
86464
+ const { data: prefillsData, isLoading: prefillsLoading } = useK8sSmartResource({
86465
+ cluster,
86466
+ apiGroup: forcingCustomization.baseApiGroup,
86467
+ apiVersion: forcingCustomization.baseApiVersion,
86468
+ plural: "customformsprefills",
86469
+ isEnabled: Boolean(cluster && forcingCustomization.baseApiGroup && forcingCustomization.baseApiVersion)
86470
+ });
86441
86471
  const { data: mappingData, isLoading: mappingLoading } = useK8sSmartResource({
86442
86472
  cluster,
86443
86473
  apiGroup: forcingCustomization.baseApiGroup,
@@ -86473,20 +86503,28 @@ const BlackholeFormProvider = ({
86473
86503
  const hasForcedMatchingOverride = Boolean(
86474
86504
  forcedCustomizationId && overridesData?.items?.some((item) => item?.spec?.customizationId === forcedCustomizationId)
86475
86505
  );
86476
- const isResolutionReady = !customizationId || !overridesLoading && !mappingLoading;
86506
+ const hasMatchingPrefill = Boolean(
86507
+ customizationId && prefillsData?.items?.some((item) => item?.spec?.customizationId === customizationId)
86508
+ );
86509
+ const hasForcedMatchingPrefill = Boolean(
86510
+ forcedCustomizationId && prefillsData?.items?.some((item) => item?.spec?.customizationId === forcedCustomizationId)
86511
+ );
86512
+ const isResolutionReady = !customizationId || !overridesLoading && !prefillsLoading && !mappingLoading;
86477
86513
  const resolvedCustomizationId = isResolutionReady ? hasMatchingOverride ? customizationId : hasForcedMatchingOverride ? forcedCustomizationId : forcingCustomization.fallbackId : void 0;
86514
+ const resolvedCustomizationIdPrefill = isResolutionReady ? hasMatchingPrefill ? customizationId : hasForcedMatchingPrefill ? forcedCustomizationId : forcingCustomization.fallbackId : void 0;
86478
86515
  useEffect(() => {
86479
86516
  if (!cluster) {
86480
86517
  setIsLoading(false);
86481
86518
  return;
86482
86519
  }
86483
86520
  if (!isResolutionReady) return;
86484
- if (customizationId && !resolvedCustomizationId) return;
86521
+ if (customizationId && (!resolvedCustomizationId || !resolvedCustomizationIdPrefill)) return;
86485
86522
  setIsLoading(true);
86486
86523
  const payload = {
86487
86524
  data,
86488
86525
  cluster,
86489
- customizationId: resolvedCustomizationId
86526
+ customizationId: resolvedCustomizationId,
86527
+ customizationIdPrefill: resolvedCustomizationIdPrefill
86490
86528
  };
86491
86529
  axios.post(`/api/clusters/${cluster}/openapi-bff/forms/formPrepare/prepareFormProps`, payload).then(({ data: data2 }) => {
86492
86530
  if (data2.isNamespaced) {
@@ -86494,7 +86532,6 @@ const BlackholeFormProvider = ({
86494
86532
  }
86495
86533
  if (data2.result === "error") {
86496
86534
  setIsError(data2.error);
86497
- console.warn(data2.error);
86498
86535
  if (data2.forceViewMode) {
86499
86536
  applyForceViewMode(data2.forceViewMode);
86500
86537
  } else {
@@ -86525,6 +86562,7 @@ const BlackholeFormProvider = ({
86525
86562
  data,
86526
86563
  customizationId,
86527
86564
  resolvedCustomizationId,
86565
+ resolvedCustomizationIdPrefill,
86528
86566
  isResolutionReady,
86529
86567
  fallbackToManualMode,
86530
86568
  applyForceViewMode
@@ -90897,7 +90935,8 @@ const useApiResourceSingle = ({
90897
90935
  apiVersion,
90898
90936
  plural,
90899
90937
  name,
90900
- refetchInterval
90938
+ refetchInterval,
90939
+ enabler
90901
90940
  }) => {
90902
90941
  return useQuery({
90903
90942
  queryKey: ["useApiResourceSingle", cluster, namespace, apiGroup, apiVersion, plural, name],
@@ -90909,7 +90948,8 @@ const useApiResourceSingle = ({
90909
90948
  plural,
90910
90949
  name
90911
90950
  })).data,
90912
- refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3
90951
+ refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3,
90952
+ enabled: enabler ?? true
90913
90953
  });
90914
90954
  };
90915
90955
 
@@ -90951,12 +90991,14 @@ const useBuiltinResourceSingle = ({
90951
90991
  namespace,
90952
90992
  plural,
90953
90993
  name,
90954
- refetchInterval
90994
+ refetchInterval,
90995
+ enabler
90955
90996
  }) => {
90956
90997
  return useQuery({
90957
90998
  queryKey: ["useBuiltinResourceSingle", cluster, namespace, plural, name],
90958
90999
  queryFn: async () => (await getBuiltinResourceSingle({ cluster, namespace, plural, name })).data,
90959
- refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3
91000
+ refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3,
91001
+ enabled: enabler ?? true
90960
91002
  });
90961
91003
  };
90962
91004
 
@@ -91012,7 +91054,7 @@ const useCrdResourceSingle = ({
91012
91054
  });
91013
91055
  };
91014
91056
 
91015
- const useApisResourceTypes = ({ cluster }) => {
91057
+ const useApisResourceTypes = ({ cluster, enabler }) => {
91016
91058
  return useQuery({
91017
91059
  queryKey: ["useApisResourceTypes", cluster],
91018
91060
  queryFn: async () => {
@@ -91023,13 +91065,15 @@ const useApisResourceTypes = ({ cluster }) => {
91023
91065
  }
91024
91066
  return data;
91025
91067
  },
91026
- refetchInterval: 5e3
91068
+ refetchInterval: 5e3,
91069
+ enabled: enabler ?? true
91027
91070
  });
91028
91071
  };
91029
91072
  const useApiResourceTypesByGroup = ({
91030
91073
  cluster,
91031
91074
  apiGroup,
91032
- apiVersion
91075
+ apiVersion,
91076
+ enabler
91033
91077
  }) => {
91034
91078
  return useQuery({
91035
91079
  queryKey: ["useApiResourceTypesByGroup", cluster, apiGroup, apiVersion],
@@ -91045,11 +91089,12 @@ const useApiResourceTypesByGroup = ({
91045
91089
  }
91046
91090
  return data;
91047
91091
  },
91048
- refetchInterval: 5e3
91092
+ refetchInterval: 5e3,
91093
+ enabled: enabler ?? true
91049
91094
  });
91050
91095
  };
91051
91096
 
91052
- const useBuiltinResourceTypes = ({ cluster }) => {
91097
+ const useBuiltinResourceTypes = ({ cluster, enabler }) => {
91053
91098
  return useQuery({
91054
91099
  queryKey: ["useBuiltinResourceTypes", cluster],
91055
91100
  queryFn: async () => {
@@ -91060,7 +91105,8 @@ const useBuiltinResourceTypes = ({ cluster }) => {
91060
91105
  }
91061
91106
  return data;
91062
91107
  },
91063
- refetchInterval: 5e3
91108
+ refetchInterval: 5e3,
91109
+ enabled: enabler ?? true
91064
91110
  });
91065
91111
  };
91066
91112
 
@@ -91087,9 +91133,9 @@ const useCrdData = ({
91087
91133
  });
91088
91134
  };
91089
91135
 
91090
- const useResourceScope = ({ plural, cluster, apiGroup, apiVersion }) => {
91136
+ const useResourceScope = ({ plural, cluster, apiGroup, apiVersion, enabler }) => {
91091
91137
  const computedResourceType = apiGroup ? "api" : "builtin";
91092
- const enabled = Boolean(cluster) && Boolean(plural) && (computedResourceType === "builtin" || Boolean(apiVersion));
91138
+ const enabled = (enabler ?? true) && Boolean(cluster) && Boolean(plural) && (computedResourceType === "builtin" || Boolean(apiVersion));
91093
91139
  return useQuery({
91094
91140
  queryKey: ["resource-scope", computedResourceType, cluster, plural, apiGroup, apiVersion],
91095
91141
  enabled,
@@ -91132,4 +91178,4 @@ const usePluginManifest = ({
91132
91178
  };
91133
91179
 
91134
91180
  export { useInfiniteSentinel as $, getBuiltinResourceTypes as A, getCrdData as B, getDirectUnknownResource as C, DeleteIcon as D, EnrichedTableProvider as E, checkPermission as F, getSwagger as G, filterIfApiInstanceNamespaceScoped as H, filterIfBuiltInInstanceNamespaceScoped as I, checkIfApiInstanceNamespaceScoped as J, checkIfBuiltInInstanceNamespaceScoped as K, getKinds as L, useClusterList as M, useApiResources as N, useApiResourceSingle as O, PaddingContainer as P, useBuiltinResources as Q, ReadOnlyModal as R, useBuiltinResourceSingle as S, useCrdResources as T, useCrdResourceSingle as U, useApisResourceTypes as V, useApiResourceTypesByGroup as W, useBuiltinResourceTypes as X, useCrdData as Y, useListWatch as Z, _$1 as _, useTheme as a, parseQuotaValueCpu as a$, useK8sVerbs as a0, useManyK8sSmartResource as a1, useSmartResourceParams as a2, useResourceScope as a3, useKinds as a4, usePluginManifest as a5, Spacer$1 as a6, TreeWithSearch as a7, ConfirmModal as a8, UpIcon as a9, EnrichedTable as aA, ClusterListTable as aB, getEnrichedColumns as aC, getEnrichedColumnsWithControls as aD, YamlEditorSingleton$1 as aE, BlackholeFormProvider as aF, BlackholeForm as aG, getObjectFormItemsDraft as aH, MarketPlace as aI, MarketplaceCard as aJ, ProjectInfoCard as aK, PodTerminal as aL, NodeTerminal as aM, PodLogs as aN, PodLogsMonaco as aO, VMVNC as aP, Search as aQ, Events as aR, DynamicRenderer as aS, DynamicComponents as aT, DynamicRendererWithProviders as aU, prepareTemplate as aV, isFlatObject as aW, filterSelectOptions as aX, getStringByName as aY, floorToDecimal as aZ, parseQuotaValue as a_, DownIcon as aa, BackToDefaultIcon as ab, SuccessIcon as ac, feedbackIcons as ad, PlusIcon as ae, MinusIcon as af, LockedIcon as ag, UnlockedIcon as ah, PauseCircleIcon as ai, ResumeCircleIcon as aj, LookingGlassIcon as ak, EarthIcon as al, ContentCard$1 as am, FlexGrow as an, UncontrolledSelect as ao, CustomSelect$4 as ap, CursorPointerTag as aq, CursorPointerTagMinContent as ar, CursorDefaultDiv as as, ResourceLink as at, ManageableBreadcrumbsProvider as au, prepareDataForManageableBreadcrumbs as av, ManageableBreadcrumbs as aw, ManageableSidebarProvider as ax, prepareDataForManageableSidebar as ay, ManageableSidebar as az, usePartsOfUrl as b, parseQuotaValueMemoryAndStorage as b0, normalizeValuesForQuotasToNumber as b1, getAllPathsFromObj as b2, getPrefixSubarrays as b3, groupsToTreeData as b4, getBuiltinTreeData as b5, getGroupsByCategory as b6, createContextFactory as b7, prepareUrlsToFetchForDynamicRenderer as b8, deepMerge as b9, getSortedKinds as ba, getSortedKindsAll as bb, hslFromString as bc, getUppercase as bd, kindByGvr as be, pluralByKind as bf, namespacedByGvr as bg, getLinkToBuiltinForm as bh, getLinkToApiForm as bi, isMultilineString as bj, isMultilineFromYaml as bk, includesArray as bl, getResourceLink as bm, getNamespaceLink as bn, convertBytes as bo, formatBytesAuto as bp, toBytes as bq, convertStorage as br, parseValueWithUnit as bs, convertCores as bt, formatCoresAuto as bu, toCores as bv, convertCompute as bw, parseCoresWithUnit as bx, formatDateAuto as by, isValidRFC3339 as bz, usePermissions as c, useDirectUnknownResource as d, useK8sSmartResource as e, jsxRuntimeExports as f, EditIcon as g, getLinkToForm as h, DeleteModal as i, jp as j, DeleteModalMany as k, getClusterList as l, createNewEntry as m, updateEntry as n, deleteEntry as o, parseAll as p, getApiResources as q, getApiResourceSingle as r, serializeLabelsWithNoEncoding$1 as s, getBuiltinResources as t, useMultiQuery as u, getBuiltinResourceSingle as v, getCrdResources as w, getCrdResourceSingle as x, getApiResourceTypes as y, getApiResourceTypesByApiGroup as z };
91135
- //# sourceMappingURL=index-BIeCsSQi.mjs.map
91181
+ //# sourceMappingURL=index-C3GT20Hj.mjs.map