@prorobotech/openapi-k8s-toolkit 1.4.0-alpha.28 → 1.4.0-alpha.29

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.
Files changed (26) hide show
  1. package/dist/{index-B_XefWfH.mjs → index-BrZRCWIA.mjs} +29 -3
  2. package/dist/index-BrZRCWIA.mjs.map +1 -0
  3. package/dist/{index-DXgHgkkD.mjs → index-DRnDV8gA.mjs} +451 -314
  4. package/dist/index-DRnDV8gA.mjs.map +1 -0
  5. package/dist/openapi-k8s-toolkit.es.js +1 -1
  6. package/dist/openapi-k8s-toolkit.umd.js +476 -311
  7. package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
  8. package/dist/types/components/atoms/ErrorBoundary/ErrorBoundary.d.ts +38 -0
  9. package/dist/types/components/atoms/ErrorBoundary/ErrorBoundary.test.d.ts +1 -0
  10. package/dist/types/components/atoms/ErrorBoundary/ErrorBoundaryWithDataReset.d.ts +14 -0
  11. package/dist/types/components/atoms/ErrorBoundary/index.d.ts +2 -0
  12. package/dist/types/components/atoms/index.d.ts +1 -0
  13. package/dist/types/components/organisms/DynamicComponents/molecules/ParsedText/ParsedText.test.d.ts +1 -0
  14. package/dist/types/components/organisms/DynamicComponents/molecules/PerRequestError/PerRequestError.d.ts +7 -0
  15. package/dist/types/components/organisms/DynamicComponents/molecules/PerRequestError/PerRequestError.test.d.ts +1 -0
  16. package/dist/types/components/organisms/DynamicComponents/molecules/PerRequestError/index.d.ts +1 -0
  17. package/dist/types/components/organisms/DynamicComponents/molecules/hooks/index.d.ts +1 -0
  18. package/dist/types/components/organisms/DynamicComponents/molecules/hooks/mergePerRequestErrors.d.ts +10 -0
  19. package/dist/types/components/organisms/DynamicComponents/molecules/hooks/types.d.ts +5 -0
  20. package/dist/types/components/organisms/DynamicComponents/molecules/hooks/useAutoPerRequestError.d.ts +15 -0
  21. package/dist/types/components/organisms/DynamicComponents/molecules/hooks/useAutoPerRequestError.test.d.ts +1 -0
  22. package/dist/types/components/organisms/DynamicComponents/molecules/utils.d.ts +19 -0
  23. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/hybridDataProvider/hybridDataProvider.d.ts +4 -0
  24. package/package.json +1 -1
  25. package/dist/index-B_XefWfH.mjs.map +0 -1
  26. package/dist/index-DXgHgkkD.mjs.map +0 -1
@@ -8602,91 +8602,44 @@
8602
8602
  ] });
8603
8603
  };
8604
8604
 
8605
- const PositionRelativeContainer = styled.div`
8606
- position: relative;
8607
- `;
8608
- const FullWidthContainer = styled.div`
8609
- width: 100%;
8610
-
8611
- .ant-dropdown-trigger svg {
8612
- display: none;
8613
- }
8614
- `;
8615
- const NoWrapContainer = styled.div`
8616
- position: absolute;
8617
- visibility: hidden;
8618
- pointer-events: none;
8619
-
8620
- /* stylelint-disable declaration-no-important */
8621
-
8622
- * {
8623
- white-space: nowrap !important;
8624
- }
8625
-
8626
- ol {
8627
- flex-wrap: nowrap !important;
8628
- }
8629
- `;
8630
- const Styled$F = {
8631
- PositionRelativeContainer,
8632
- FullWidthContainer,
8633
- NoWrapContainer
8605
+ const keysMatch = (a, b) => {
8606
+ if (a.length !== b.length) return false;
8607
+ return a.every((val, i) => Object.is(val, i < b.length ? b[i] : void 0));
8634
8608
  };
8635
-
8636
- const CollapsibleBreadcrumb = ({ items }) => {
8637
- const [isCollapsed, setIsCollapsed] = React$1.useState(false);
8638
- const containerRef = React$1.useRef(null);
8639
- const breadcrumbRef = React$1.useRef(null);
8640
- React$1.useLayoutEffect(() => {
8641
- const checkWidth = () => {
8642
- if (containerRef.current && breadcrumbRef.current) {
8643
- const containerWidth = containerRef.current.clientWidth;
8644
- const breadcrumbWidth = breadcrumbRef.current.scrollWidth;
8645
- setIsCollapsed(breadcrumbWidth > containerWidth);
8646
- }
8647
- };
8648
- checkWidth();
8649
- window.addEventListener("resize", checkWidth);
8650
- return () => window.removeEventListener("resize", checkWidth);
8651
- }, [items]);
8652
- const renderItems = () => {
8653
- if (!isCollapsed) {
8654
- return items;
8609
+ class ErrorBoundary extends React$1.Component {
8610
+ constructor(props) {
8611
+ super(props);
8612
+ this.state = { hasError: false, error: null, prevResetKeys: props.resetKeys ?? [] };
8613
+ }
8614
+ static getDerivedStateFromError(error) {
8615
+ return { hasError: true, error };
8616
+ }
8617
+ static getDerivedStateFromProps(props, state) {
8618
+ const nextKeys = props.resetKeys ?? [];
8619
+ if (state.hasError && !keysMatch(state.prevResetKeys, nextKeys)) {
8620
+ return { hasError: false, error: null, prevResetKeys: nextKeys };
8655
8621
  }
8656
- if (items.length <= 2) {
8657
- return items;
8622
+ if (!keysMatch(state.prevResetKeys, nextKeys)) {
8623
+ return { prevResetKeys: nextKeys };
8658
8624
  }
8659
- const firstItem = items[0];
8660
- const lastItem = items[items.length - 1];
8661
- const hiddenItems = items.slice(1, -1);
8662
- const menuItems = hiddenItems.map((item, index) => ({
8663
- key: String(index),
8664
- label: item.href ? /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: item.href, children: item.title }) : item.title
8665
- }));
8666
- const ellipsisItem = {
8667
- title: "...",
8668
- menu: { items: menuItems },
8669
- dropdownProps: { arrow: false }
8670
- };
8671
- return [firstItem, ellipsisItem, lastItem];
8672
- };
8673
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$F.PositionRelativeContainer, { children: [
8674
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$F.FullWidthContainer, { ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items: renderItems() }) }),
8675
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$F.NoWrapContainer, { ref: breadcrumbRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items, style: { display: "flex", flexWrap: "nowrap" } }) })
8676
- ] });
8677
- };
8678
-
8679
- const HeightDiv$1 = styled.div`
8680
- min-height: 22px;
8681
- width: 100%;
8682
- `;
8683
- const Styled$E = {
8684
- HeightDiv: HeightDiv$1
8685
- };
8686
-
8687
- const ManageableBreadcrumbs = ({ data }) => {
8688
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$E.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleBreadcrumb, { items: data.breadcrumbItems }) });
8689
- };
8625
+ return null;
8626
+ }
8627
+ componentDidCatch(error, errorInfo) {
8628
+ const { onError } = this.props;
8629
+ onError?.(error, errorInfo);
8630
+ }
8631
+ render() {
8632
+ const { hasError, error } = this.state;
8633
+ const { fallback, children } = this.props;
8634
+ if (hasError) {
8635
+ if (fallback) {
8636
+ return fallback;
8637
+ }
8638
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Result, { status: "500", title: "Something went wrong", subTitle: error?.message || "An unexpected error occurred" });
8639
+ }
8640
+ return children;
8641
+ }
8642
+ }
8690
8643
 
8691
8644
  const kindByGvr = (entries) => (gvr) => {
8692
8645
  const [group = "", v = "", resource = ""] = gvr.split("~", 3);
@@ -9632,6 +9585,154 @@
9632
9585
  };
9633
9586
  };
9634
9587
 
9588
+ const MultiQueryContext = React$1.createContext(void 0);
9589
+ const MultiQueryProvider = ({ items, dataToApplyToContext, children }) => {
9590
+ const k8sItems = React$1.useMemo(
9591
+ () => items.filter((x) => typeof x !== "string"),
9592
+ [items]
9593
+ );
9594
+ const urlItems = React$1.useMemo(() => items.filter((x) => typeof x === "string"), [items]);
9595
+ const k8sCount = k8sItems.length;
9596
+ const urlCount = urlItems.length;
9597
+ const k8sResults = useManyK8sSmartResource(k8sItems);
9598
+ const urlQueries = reactQuery.useQueries({
9599
+ queries: urlItems.map((url, i) => ({
9600
+ queryKey: ["multi-url", i, url],
9601
+ queryFn: async () => {
9602
+ const res = await axios.get(url);
9603
+ return structuredClone(res.data);
9604
+ },
9605
+ structuralSharing: false,
9606
+ refetchInterval: 5e3
9607
+ }))
9608
+ });
9609
+ const value = (() => {
9610
+ const data = {};
9611
+ const errors = [];
9612
+ const hasExtraReq0 = typeof dataToApplyToContext !== "undefined";
9613
+ const baseIndex = hasExtraReq0 ? 1 : 0;
9614
+ for (let i = 0; i < k8sCount; i++) {
9615
+ const result = k8sResults[i];
9616
+ const idx = baseIndex + i;
9617
+ data[`req${idx}`] = result?.data;
9618
+ errors[idx] = result?.isError ? result.error ?? null : null;
9619
+ }
9620
+ for (let i = 0; i < urlCount; i++) {
9621
+ const q = urlQueries[i];
9622
+ const idx = baseIndex + k8sCount + i;
9623
+ data[`req${idx}`] = q?.data;
9624
+ errors[idx] = q?.isError ? q.error ?? null : null;
9625
+ }
9626
+ if (hasExtraReq0) {
9627
+ data.req0 = dataToApplyToContext;
9628
+ errors[0] = null;
9629
+ }
9630
+ const isLoading = k8sResults.some((r) => r.isLoading) || urlQueries.some((q) => q.isLoading);
9631
+ const isError = k8sResults.some((r) => r.isError) || urlQueries.some((q) => q.isError);
9632
+ const hasErrorForReq = (reqIndex) => Boolean(errors[reqIndex]);
9633
+ const getErrorForReq = (reqIndex) => errors[reqIndex] ?? null;
9634
+ return { data, isLoading, isError, errors, hasErrorForReq, getErrorForReq };
9635
+ })();
9636
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(MultiQueryContext.Provider, { value, children });
9637
+ };
9638
+ const useMultiQuery = () => {
9639
+ const ctx = React$1.useContext(MultiQueryContext);
9640
+ if (!ctx) throw new Error("useMultiQuery must be used within a MultiQueryProvider");
9641
+ return ctx;
9642
+ };
9643
+
9644
+ const ErrorBoundaryWithDataReset = ({ children }) => {
9645
+ const { isError } = useMultiQuery();
9646
+ const location = reactRouterDom.useLocation();
9647
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { resetKeys: [location.pathname, isError], children });
9648
+ };
9649
+
9650
+ const PositionRelativeContainer = styled.div`
9651
+ position: relative;
9652
+ `;
9653
+ const FullWidthContainer = styled.div`
9654
+ width: 100%;
9655
+
9656
+ .ant-dropdown-trigger svg {
9657
+ display: none;
9658
+ }
9659
+ `;
9660
+ const NoWrapContainer = styled.div`
9661
+ position: absolute;
9662
+ visibility: hidden;
9663
+ pointer-events: none;
9664
+
9665
+ /* stylelint-disable declaration-no-important */
9666
+
9667
+ * {
9668
+ white-space: nowrap !important;
9669
+ }
9670
+
9671
+ ol {
9672
+ flex-wrap: nowrap !important;
9673
+ }
9674
+ `;
9675
+ const Styled$F = {
9676
+ PositionRelativeContainer,
9677
+ FullWidthContainer,
9678
+ NoWrapContainer
9679
+ };
9680
+
9681
+ const CollapsibleBreadcrumb = ({ items }) => {
9682
+ const [isCollapsed, setIsCollapsed] = React$1.useState(false);
9683
+ const containerRef = React$1.useRef(null);
9684
+ const breadcrumbRef = React$1.useRef(null);
9685
+ React$1.useLayoutEffect(() => {
9686
+ const checkWidth = () => {
9687
+ if (containerRef.current && breadcrumbRef.current) {
9688
+ const containerWidth = containerRef.current.clientWidth;
9689
+ const breadcrumbWidth = breadcrumbRef.current.scrollWidth;
9690
+ setIsCollapsed(breadcrumbWidth > containerWidth);
9691
+ }
9692
+ };
9693
+ checkWidth();
9694
+ window.addEventListener("resize", checkWidth);
9695
+ return () => window.removeEventListener("resize", checkWidth);
9696
+ }, [items]);
9697
+ const renderItems = () => {
9698
+ if (!isCollapsed) {
9699
+ return items;
9700
+ }
9701
+ if (items.length <= 2) {
9702
+ return items;
9703
+ }
9704
+ const firstItem = items[0];
9705
+ const lastItem = items[items.length - 1];
9706
+ const hiddenItems = items.slice(1, -1);
9707
+ const menuItems = hiddenItems.map((item, index) => ({
9708
+ key: String(index),
9709
+ label: item.href ? /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: item.href, children: item.title }) : item.title
9710
+ }));
9711
+ const ellipsisItem = {
9712
+ title: "...",
9713
+ menu: { items: menuItems },
9714
+ dropdownProps: { arrow: false }
9715
+ };
9716
+ return [firstItem, ellipsisItem, lastItem];
9717
+ };
9718
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$F.PositionRelativeContainer, { children: [
9719
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$F.FullWidthContainer, { ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items: renderItems() }) }),
9720
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$F.NoWrapContainer, { ref: breadcrumbRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items, style: { display: "flex", flexWrap: "nowrap" } }) })
9721
+ ] });
9722
+ };
9723
+
9724
+ const HeightDiv$1 = styled.div`
9725
+ min-height: 22px;
9726
+ width: 100%;
9727
+ `;
9728
+ const Styled$E = {
9729
+ HeightDiv: HeightDiv$1
9730
+ };
9731
+
9732
+ const ManageableBreadcrumbs = ({ data }) => {
9733
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$E.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleBreadcrumb, { items: data.breadcrumbItems }) });
9734
+ };
9735
+
9635
9736
  const prepareTemplate = ({
9636
9737
  template,
9637
9738
  replaceValues
@@ -33821,6 +33922,39 @@
33821
33922
  var lodashExports = lodash.exports;
33822
33923
  const _$1 = /*@__PURE__*/getDefaultExportFromCjs(lodashExports);
33823
33924
 
33925
+ const parseReqIndex = (reqIndex) => {
33926
+ if (typeof reqIndex === "number") return Number.isNaN(reqIndex) ? void 0 : reqIndex;
33927
+ if (typeof reqIndex === "string") {
33928
+ const parsed = parseInt(reqIndex, 10);
33929
+ return Number.isNaN(parsed) ? void 0 : parsed;
33930
+ }
33931
+ return void 0;
33932
+ };
33933
+ const REQ_INDEX_REGEX = /\{reqs(?:JsonPath)?\[(\d+)\]/g;
33934
+ const extractReqIndices = (text) => {
33935
+ const indices = /* @__PURE__ */ new Set();
33936
+ REQ_INDEX_REGEX.lastIndex = 0;
33937
+ let match = REQ_INDEX_REGEX.exec(text);
33938
+ while (match !== null) {
33939
+ indices.add(parseInt(match[1], 10));
33940
+ match = REQ_INDEX_REGEX.exec(text);
33941
+ }
33942
+ return [...indices];
33943
+ };
33944
+ const extractReqIndicesFromData = (data) => {
33945
+ const indices = /* @__PURE__ */ new Set();
33946
+ const walk = (value) => {
33947
+ if (typeof value === "string") {
33948
+ extractReqIndices(value).forEach((idx) => indices.add(idx));
33949
+ } else if (Array.isArray(value)) {
33950
+ value.forEach(walk);
33951
+ } else if (value !== null && typeof value === "object") {
33952
+ Object.values(value).forEach(walk);
33953
+ }
33954
+ };
33955
+ Object.values(data).forEach(walk);
33956
+ return [...indices];
33957
+ };
33824
33958
  const parsePartsOfUrl = ({
33825
33959
  template,
33826
33960
  replaceValues
@@ -34879,60 +35013,6 @@
34879
35013
  ] });
34880
35014
  };
34881
35015
 
34882
- const MultiQueryContext = React$1.createContext(void 0);
34883
- const MultiQueryProvider = ({ items, dataToApplyToContext, children }) => {
34884
- const k8sItems = React$1.useMemo(
34885
- () => items.filter((x) => typeof x !== "string"),
34886
- [items]
34887
- );
34888
- const urlItems = React$1.useMemo(() => items.filter((x) => typeof x === "string"), [items]);
34889
- const k8sCount = k8sItems.length;
34890
- const urlCount = urlItems.length;
34891
- const k8sResults = useManyK8sSmartResource(k8sItems);
34892
- const urlQueries = reactQuery.useQueries({
34893
- queries: urlItems.map((url, i) => ({
34894
- queryKey: ["multi-url", i, url],
34895
- queryFn: async () => {
34896
- const res = await axios.get(url);
34897
- return structuredClone(res.data);
34898
- },
34899
- structuralSharing: false,
34900
- refetchInterval: 5e3
34901
- }))
34902
- });
34903
- const value = (() => {
34904
- const data = {};
34905
- const errors = [];
34906
- const hasExtraReq0 = typeof dataToApplyToContext !== "undefined";
34907
- const baseIndex = hasExtraReq0 ? 1 : 0;
34908
- for (let i = 0; i < k8sCount; i++) {
34909
- const result = k8sResults[i];
34910
- const idx = baseIndex + i;
34911
- data[`req${idx}`] = result?.data;
34912
- errors[idx] = result?.isError ? result.error ?? null : null;
34913
- }
34914
- for (let i = 0; i < urlCount; i++) {
34915
- const q = urlQueries[i];
34916
- const idx = baseIndex + k8sCount + i;
34917
- data[`req${idx}`] = q?.data;
34918
- errors[idx] = q?.isError ? q.error ?? null : null;
34919
- }
34920
- if (hasExtraReq0) {
34921
- data.req0 = dataToApplyToContext;
34922
- errors[0] = null;
34923
- }
34924
- const isLoading = k8sResults.some((r) => r.isLoading) || urlQueries.some((q) => q.isLoading);
34925
- const isError = k8sResults.some((r) => r.isError) || urlQueries.some((q) => q.isError);
34926
- return { data, isLoading, isError, errors };
34927
- })();
34928
- return /* @__PURE__ */ jsxRuntimeExports.jsx(MultiQueryContext.Provider, { value, children });
34929
- };
34930
- const useMultiQuery = () => {
34931
- const ctx = React$1.useContext(MultiQueryContext);
34932
- if (!ctx) throw new Error("useMultiQuery must be used within a MultiQueryProvider");
34933
- return ctx;
34934
- };
34935
-
34936
35016
  const createContextFactory = () => {
34937
35017
  const Context = React$1.createContext(null);
34938
35018
  const useTypedContext = () => {
@@ -34956,6 +35036,35 @@
34956
35036
  const PartsOfUrlProvider = partsOfUrlContext.Provider;
34957
35037
  const usePartsOfUrl = partsOfUrlContext.useTypedContext;
34958
35038
 
35039
+ const useAutoPerRequestError = (data) => {
35040
+ const { hasErrorForReq, getErrorForReq } = useMultiQuery();
35041
+ const fromTemplates = extractReqIndicesFromData(data);
35042
+ const raw = data.reqIndex;
35043
+ if (typeof raw === "string" || typeof raw === "number") {
35044
+ const explicit = parseReqIndex(raw);
35045
+ if (explicit !== void 0) {
35046
+ fromTemplates.push(explicit);
35047
+ }
35048
+ }
35049
+ const reqIndices = [...new Set(fromTemplates)];
35050
+ if (reqIndices.length === 0) {
35051
+ return { shouldShowError: false, errorToShow: null };
35052
+ }
35053
+ const failedIdx = reqIndices.find((idx) => hasErrorForReq(idx));
35054
+ if (failedIdx !== void 0) {
35055
+ return { shouldShowError: true, errorToShow: getErrorForReq(failedIdx) };
35056
+ }
35057
+ return { shouldShowError: false, errorToShow: null };
35058
+ };
35059
+
35060
+ const PerRequestError = ({ error }) => {
35061
+ if (!error) return null;
35062
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35063
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
35064
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof error === "string" ? error : error.message }) })
35065
+ ] });
35066
+ };
35067
+
34959
35068
  const isExternalHref = (href) => {
34960
35069
  if (!href) {
34961
35070
  return false;
@@ -34980,6 +35089,7 @@
34980
35089
  }) => {
34981
35090
  const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
34982
35091
  const partsOfUrl = usePartsOfUrl();
35092
+ const { shouldShowError, errorToShow } = useAutoPerRequestError({ ...data });
34983
35093
  const navigate = reactRouterDom.useNavigate();
34984
35094
  const { id, text, href, title, ...linkProps } = data;
34985
35095
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -34993,6 +35103,9 @@
34993
35103
  if (isMultiqueryLoading) {
34994
35104
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
34995
35105
  }
35106
+ if (shouldShowError) {
35107
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
35108
+ }
34996
35109
  const content = /* @__PURE__ */ jsxRuntimeExports.jsxs(
34997
35110
  antd.Typography.Link,
34998
35111
  {
@@ -35213,16 +35326,14 @@
35213
35326
  };
35214
35327
 
35215
35328
  const MultiQuery = ({ data }) => {
35216
- const { data: multiQueryData, isLoading, isError, errors } = useMultiQuery();
35329
+ const { data: multiQueryData, isLoading } = useMultiQuery();
35330
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
35217
35331
  const preparedText = parseMutliqueryText({ text: data.text, multiQueryData });
35218
35332
  if (isLoading) {
35219
35333
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
35220
35334
  }
35221
- if (isError) {
35222
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35223
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
35224
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
35225
- ] });
35335
+ if (shouldShowError) {
35336
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
35226
35337
  }
35227
35338
  return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: preparedText });
35228
35339
  };
@@ -35243,16 +35354,14 @@
35243
35354
  };
35244
35355
 
35245
35356
  const ParsedText = ({ data }) => {
35246
- const { data: multiQueryData, isLoading, isError, errors } = useMultiQuery();
35357
+ const { data: multiQueryData, isLoading } = useMultiQuery();
35247
35358
  const partsOfUrl = usePartsOfUrl();
35359
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
35248
35360
  if (isLoading) {
35249
35361
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
35250
35362
  }
35251
- if (isError) {
35252
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35253
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
35254
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
35255
- ] });
35363
+ if (shouldShowError) {
35364
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
35256
35365
  }
35257
35366
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
35258
35367
  acc[index.toString()] = value;
@@ -35270,16 +35379,14 @@
35270
35379
 
35271
35380
  const MappedParsedText = ({ data }) => {
35272
35381
  const { value, valueMap, style } = data;
35273
- const { data: multiQueryData, isLoading, isError, errors } = useMultiQuery();
35382
+ const { data: multiQueryData, isLoading } = useMultiQuery();
35274
35383
  const partsOfUrl = usePartsOfUrl();
35384
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
35275
35385
  if (isLoading) {
35276
35386
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
35277
35387
  }
35278
- if (isError) {
35279
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35280
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
35281
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
35282
- ] });
35388
+ if (shouldShowError) {
35389
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
35283
35390
  }
35284
35391
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, item, index) => {
35285
35392
  acc[index.toString()] = item;
@@ -35295,7 +35402,7 @@
35295
35402
  children
35296
35403
  }) => {
35297
35404
  const { id, cluster, namespace, accessGroups, ...props } = data;
35298
- const { data: multiQueryData, isError, errors } = useMultiQuery();
35405
+ const { data: multiQueryData } = useMultiQuery();
35299
35406
  const partsOfUrl = usePartsOfUrl();
35300
35407
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
35301
35408
  acc[index.toString()] = value;
@@ -35306,11 +35413,9 @@
35306
35413
  const parsedAccessGroups = accessGroups.map(
35307
35414
  (accessGroup) => parseAll({ text: accessGroup, replaceValues, multiQueryData })
35308
35415
  );
35309
- if (isError) {
35310
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35311
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
35312
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
35313
- ] });
35416
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
35417
+ if (shouldShowError) {
35418
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
35314
35419
  }
35315
35420
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ProjectInfoCard, { cluster: clusterPrepared, namespace: namespacePrepared, accessGroups: parsedAccessGroups, ...props, children });
35316
35421
  };
@@ -35321,7 +35426,7 @@
35321
35426
  children
35322
35427
  }) => {
35323
35428
  const { id, cluster, namespace, ...props } = data;
35324
- const { data: multiQueryData, isError, errors } = useMultiQuery();
35429
+ const { data: multiQueryData } = useMultiQuery();
35325
35430
  const partsOfUrl = usePartsOfUrl();
35326
35431
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
35327
35432
  acc[index.toString()] = value;
@@ -35329,11 +35434,9 @@
35329
35434
  }, {});
35330
35435
  const clusterPrepared = parseAll({ text: cluster, replaceValues, multiQueryData });
35331
35436
  const namespacePrepared = parseAll({ text: namespace, replaceValues, multiQueryData });
35332
- if (isError) {
35333
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35334
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
35335
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
35336
- ] });
35437
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
35438
+ if (shouldShowError) {
35439
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
35337
35440
  }
35338
35441
  return /* @__PURE__ */ jsxRuntimeExports.jsx(MarketPlace, { cluster: clusterPrepared, namespace: namespacePrepared, ...props });
35339
35442
  };
@@ -35411,7 +35514,7 @@
35411
35514
  fallbackText,
35412
35515
  ...props
35413
35516
  } = data;
35414
- const { data: multiQueryData, isLoading: isMultiqueryLoading, isError, errors } = useMultiQuery();
35517
+ const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
35415
35518
  const partsOfUrl = usePartsOfUrl();
35416
35519
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
35417
35520
  acc[index.toString()] = value;
@@ -35421,14 +35524,12 @@
35421
35524
  const errorTextPrepared = parseAll({ text: errorText, replaceValues, multiQueryData });
35422
35525
  const fallbackTextPrepared = parseAll({ text: fallbackText, replaceValues, multiQueryData });
35423
35526
  const valuesPrepared = values.map((el) => parseAll({ text: el, replaceValues, multiQueryData }));
35527
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
35424
35528
  if (isMultiqueryLoading) {
35425
35529
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
35426
35530
  }
35427
- if (isError) {
35428
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35429
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
35430
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
35431
- ] });
35531
+ if (shouldShowError) {
35532
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
35432
35533
  }
35433
35534
  const { type, text } = getResult({
35434
35535
  valuesPrepared,
@@ -35577,6 +35678,18 @@
35577
35678
  return entries.map(([k, v]) => `${k}=${v}`).join(",");
35578
35679
  };
35579
35680
 
35681
+ const mergePerRequestErrors = (autoResult, hasErrorForReq, nestedReqIndices) => {
35682
+ if (autoResult.shouldShowError) return autoResult;
35683
+ const failedIdx = nestedReqIndices.find((idx) => idx !== void 0 && hasErrorForReq(idx));
35684
+ if (failedIdx !== void 0) {
35685
+ return {
35686
+ shouldShowError: true,
35687
+ errorToShow: "A dependent request failed"
35688
+ };
35689
+ }
35690
+ return autoResult;
35691
+ };
35692
+
35580
35693
  const isValidLabelSelectorObject = (input) => {
35581
35694
  if (typeof input !== "object" || input === null || Array.isArray(input) || Object.getPrototypeOf(input) !== Object.prototype) {
35582
35695
  return false;
@@ -35600,7 +35713,7 @@
35600
35713
  const [isDeleteModalManyOpen, setIsDeleteModalManyOpen] = React$1.useState(
35601
35714
  false
35602
35715
  );
35603
- const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
35716
+ const { data: multiQueryData, isLoading: isMultiqueryLoading, hasErrorForReq } = useMultiQuery();
35604
35717
  const {
35605
35718
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
35606
35719
  id,
@@ -35621,6 +35734,11 @@
35621
35734
  } = data;
35622
35735
  const theme = useTheme();
35623
35736
  const partsOfUrl = usePartsOfUrl();
35737
+ const autoErrorResult = useAutoPerRequestError(data);
35738
+ const { shouldShowError, errorToShow } = mergePerRequestErrors(autoErrorResult, hasErrorForReq, [
35739
+ labelSelectorFull?.reqIndex,
35740
+ ...additionalReqsDataToEachItem ?? []
35741
+ ]);
35624
35742
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
35625
35743
  acc[index.toString()] = value;
35626
35744
  return acc;
@@ -35716,6 +35834,9 @@
35716
35834
  if (k8sResourceToFetchPrepared && isMultiqueryLoading) {
35717
35835
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
35718
35836
  }
35837
+ if (shouldShowError) {
35838
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
35839
+ }
35719
35840
  if (fetchUrlPrepared && isFetchedDataLoading) {
35720
35841
  return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}) });
35721
35842
  }
@@ -35859,6 +35980,7 @@
35859
35980
  children
35860
35981
  }) => {
35861
35982
  const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
35983
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
35862
35984
  const {
35863
35985
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
35864
35986
  id,
@@ -35892,6 +36014,9 @@
35892
36014
  if (isMultiqueryLoading) {
35893
36015
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
35894
36016
  }
36017
+ if (shouldShowError) {
36018
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
36019
+ }
35895
36020
  if (isLoadingPodInfo) {
35896
36021
  return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}) });
35897
36022
  }
@@ -35927,6 +36052,7 @@
35927
36052
  children
35928
36053
  }) => {
35929
36054
  const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
36055
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
35930
36056
  const {
35931
36057
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
35932
36058
  id,
@@ -35946,6 +36072,9 @@
35946
36072
  if (isMultiqueryLoading) {
35947
36073
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
35948
36074
  }
36075
+ if (shouldShowError) {
36076
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
36077
+ }
35949
36078
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
35950
36079
  /* @__PURE__ */ jsxRuntimeExports.jsx(
35951
36080
  NodeTerminal,
@@ -35973,6 +36102,7 @@
35973
36102
  }) => {
35974
36103
  const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
35975
36104
  const theme = useTheme();
36105
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
35976
36106
  const {
35977
36107
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
35978
36108
  id,
@@ -36010,6 +36140,9 @@
36010
36140
  if (isMultiqueryLoading) {
36011
36141
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
36012
36142
  }
36143
+ if (shouldShowError) {
36144
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
36145
+ }
36013
36146
  if (isLoadingPodInfo) {
36014
36147
  return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}) });
36015
36148
  }
@@ -43937,6 +44070,7 @@
43937
44070
  }, [substractHeight]);
43938
44071
  const theme = useTheme();
43939
44072
  const partsOfUrl = usePartsOfUrl();
44073
+ const { shouldShowError, errorToShow } = useAutoPerRequestError({ ...data, reqIndex: data.prefillValuesRequestIndex });
43940
44074
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
43941
44075
  acc[index.toString()] = value;
43942
44076
  return acc;
@@ -43971,6 +44105,9 @@
43971
44105
  if (isMultiqueryLoading) {
43972
44106
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
43973
44107
  }
44108
+ if (shouldShowError) {
44109
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
44110
+ }
43974
44111
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
43975
44112
  /* @__PURE__ */ jsxRuntimeExports.jsx(
43976
44113
  YamlEditorSingleton$1,
@@ -44008,6 +44145,7 @@
44008
44145
  }) => {
44009
44146
  const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
44010
44147
  const partsOfUrl = usePartsOfUrl();
44148
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
44011
44149
  const {
44012
44150
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
44013
44151
  id,
@@ -44042,6 +44180,9 @@
44042
44180
  if (isMultiqueryLoading) {
44043
44181
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
44044
44182
  }
44183
+ if (shouldShowError) {
44184
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
44185
+ }
44045
44186
  const shouldAutoHide = !criteria && (!valuePrepared || valuePrepared === "~undefined-value~");
44046
44187
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$y.VisibilityContainer, { $hidden: shouldAutoHide || shouldHideByCriteria, children });
44047
44188
  };
@@ -44092,15 +44233,13 @@
44092
44233
  keyFieldStyle,
44093
44234
  valueFieldStyle
44094
44235
  } = data;
44095
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
44236
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
44237
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
44096
44238
  if (isMultiQueryLoading) {
44097
44239
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
44098
44240
  }
44099
- if (isMultiQueryErrors) {
44100
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
44101
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
44102
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
44103
- ] });
44241
+ if (shouldShowError) {
44242
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
44104
44243
  }
44105
44244
  const jsonRoot = multiQueryData[`req${reqIndex}`];
44106
44245
  if (jsonRoot === void 0) {
@@ -44157,16 +44296,14 @@
44157
44296
  errorText,
44158
44297
  style
44159
44298
  } = data;
44160
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
44299
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
44161
44300
  const partsOfUrl = usePartsOfUrl();
44301
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
44162
44302
  if (isMultiQueryLoading) {
44163
44303
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
44164
44304
  }
44165
- if (isMultiQueryErrors) {
44166
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
44167
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
44168
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
44169
- ] });
44305
+ if (shouldShowError) {
44306
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
44170
44307
  }
44171
44308
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
44172
44309
  acc[index.toString()] = value;
@@ -44212,16 +44349,14 @@
44212
44349
  errorText,
44213
44350
  style
44214
44351
  } = data;
44215
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
44352
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
44216
44353
  const partsOfUrl = usePartsOfUrl();
44354
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
44217
44355
  if (isMultiQueryLoading) {
44218
44356
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
44219
44357
  }
44220
- if (isMultiQueryErrors) {
44221
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
44222
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
44223
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
44224
- ] });
44358
+ if (shouldShowError) {
44359
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
44225
44360
  }
44226
44361
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
44227
44362
  acc[index.toString()] = value;
@@ -45104,7 +45239,7 @@
45104
45239
  const navigate = reactRouterDom.useNavigate();
45105
45240
  const [open, setOpen] = React$1.useState(false);
45106
45241
  const { maxTagTextLength, ...restSelectProps } = selectProps || { maxTagTextLength: void 0 };
45107
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
45242
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
45108
45243
  const partsOfUrl = usePartsOfUrl();
45109
45244
  const safeMultiQueryData = multiQueryData || {};
45110
45245
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -45131,14 +45266,12 @@
45131
45266
  const shouldGateEdit = Boolean(permissions || permissionContext);
45132
45267
  const canOpenEdit = !readOnly;
45133
45268
  const canSubmitEdit = !readOnly && (!shouldGateEdit || canPatch === true);
45269
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
45134
45270
  if (isMultiQueryLoading) {
45135
45271
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
45136
45272
  }
45137
- if (isMultiQueryErrors) {
45138
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
45139
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
45140
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
45141
- ] });
45273
+ if (shouldShowError) {
45274
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
45142
45275
  }
45143
45276
  const jsonRoot = multiQueryData[`req${reqIndex}`];
45144
45277
  if (jsonRoot === void 0) {
@@ -45405,16 +45538,14 @@
45405
45538
  ...linkProps
45406
45539
  } = data;
45407
45540
  const navigate = reactRouterDom.useNavigate();
45408
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
45541
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
45409
45542
  const partsOfUrl = usePartsOfUrl();
45543
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
45410
45544
  if (isMultiQueryLoading) {
45411
45545
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
45412
45546
  }
45413
- if (isMultiQueryErrors) {
45414
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
45415
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
45416
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
45417
- ] });
45547
+ if (shouldShowError) {
45548
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
45418
45549
  }
45419
45550
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
45420
45551
  acc[index.toString()] = value;
@@ -45565,7 +45696,7 @@
45565
45696
  } = data;
45566
45697
  const [api, contextHolder] = antd.notification.useNotification();
45567
45698
  const [open, setOpen] = React$1.useState(false);
45568
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
45699
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
45569
45700
  const partsOfUrl = usePartsOfUrl();
45570
45701
  const safeMultiQueryData = multiQueryData || {};
45571
45702
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -45592,14 +45723,12 @@
45592
45723
  const shouldGateEdit = Boolean(permissions || permissionContext);
45593
45724
  const canOpenEdit = !readOnly;
45594
45725
  const canSubmitEdit = !readOnly && (!shouldGateEdit || canPatch === true);
45726
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
45595
45727
  if (isMultiQueryLoading) {
45596
45728
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
45597
45729
  }
45598
- if (isMultiQueryErrors) {
45599
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
45600
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
45601
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
45602
- ] });
45730
+ if (shouldShowError) {
45731
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
45603
45732
  }
45604
45733
  const jsonRoot = multiQueryData[`req${reqIndex}`];
45605
45734
  if (jsonRoot === void 0) {
@@ -45779,7 +45908,7 @@
45779
45908
  } = data;
45780
45909
  const [api, contextHolder] = antd.notification.useNotification();
45781
45910
  const [open, setOpen] = React$1.useState(false);
45782
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
45911
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
45783
45912
  const partsOfUrl = usePartsOfUrl();
45784
45913
  const safeMultiQueryData = multiQueryData || {};
45785
45914
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -45806,14 +45935,12 @@
45806
45935
  const shouldGateEdit = Boolean(permissions || permissionContext);
45807
45936
  const canOpenEdit = !readOnly;
45808
45937
  const canSubmitEdit = !readOnly && (!shouldGateEdit || canPatch === true);
45938
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
45809
45939
  if (isMultiQueryLoading) {
45810
45940
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
45811
45941
  }
45812
- if (isMultiQueryErrors) {
45813
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
45814
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
45815
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
45816
- ] });
45942
+ if (shouldShowError) {
45943
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
45817
45944
  }
45818
45945
  const jsonRoot = multiQueryData[`req${reqIndex}`];
45819
45946
  if (jsonRoot === void 0) {
@@ -45969,7 +46096,7 @@
45969
46096
  } = data;
45970
46097
  const [api, contextHolder] = antd.notification.useNotification();
45971
46098
  const [open, setOpen] = React$1.useState(false);
45972
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
46099
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
45973
46100
  const partsOfUrl = usePartsOfUrl();
45974
46101
  const safeMultiQueryData = multiQueryData || {};
45975
46102
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -45996,14 +46123,12 @@
45996
46123
  const shouldGateEdit = Boolean(permissions || permissionContext);
45997
46124
  const canOpenEdit = !readOnly;
45998
46125
  const canSubmitEdit = !readOnly && (!shouldGateEdit || canPatch === true);
46126
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
45999
46127
  if (isMultiQueryLoading) {
46000
46128
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
46001
46129
  }
46002
- if (isMultiQueryErrors) {
46003
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
46004
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
46005
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
46006
- ] });
46130
+ if (shouldShowError) {
46131
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
46007
46132
  }
46008
46133
  const jsonRoot = multiQueryData[`req${reqIndex}`];
46009
46134
  if (jsonRoot === void 0) {
@@ -46132,16 +46257,14 @@
46132
46257
  notANumberText,
46133
46258
  style
46134
46259
  } = data;
46135
- const { data: multiQueryData, isLoading, isError, errors } = useMultiQuery();
46260
+ const { data: multiQueryData, isLoading } = useMultiQuery();
46136
46261
  const partsOfUrl = usePartsOfUrl();
46262
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
46137
46263
  if (isLoading) {
46138
46264
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
46139
46265
  }
46140
- if (isError) {
46141
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
46142
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
46143
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
46144
- ] });
46266
+ if (shouldShowError) {
46267
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
46145
46268
  }
46146
46269
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
46147
46270
  acc[index.toString()] = value;
@@ -46232,16 +46355,14 @@
46232
46355
  notANumberText,
46233
46356
  style
46234
46357
  } = data;
46235
- const { data: multiQueryData, isLoading, isError, errors } = useMultiQuery();
46358
+ const { data: multiQueryData, isLoading } = useMultiQuery();
46236
46359
  const partsOfUrl = usePartsOfUrl();
46360
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
46237
46361
  if (isLoading) {
46238
46362
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
46239
46363
  }
46240
- if (isError) {
46241
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
46242
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
46243
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
46244
- ] });
46364
+ if (shouldShowError) {
46365
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
46245
46366
  }
46246
46367
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
46247
46368
  acc[index.toString()] = value;
@@ -47142,17 +47263,15 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
47142
47263
  const [hidden, setHidden] = React$1.useState(hiddenDefault);
47143
47264
  const [hiddenByKey, setHiddenByKey] = React$1.useState({});
47144
47265
  const [notificationApi, contextHolder] = antd.notification.useNotification();
47145
- const { data: multiQueryData, isLoading, isError, errors } = useMultiQuery();
47266
+ const { data: multiQueryData, isLoading } = useMultiQuery();
47146
47267
  const partsOfUrl = usePartsOfUrl();
47147
47268
  const theme = useTheme();
47269
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
47148
47270
  if (isLoading) {
47149
47271
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
47150
47272
  }
47151
- if (isError) {
47152
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
47153
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
47154
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
47155
- ] });
47273
+ if (shouldShowError) {
47274
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
47156
47275
  }
47157
47276
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value2, index) => {
47158
47277
  acc[index.toString()] = value2;
@@ -47317,17 +47436,15 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
47317
47436
  abbreviation,
47318
47437
  style
47319
47438
  } = data;
47320
- const { data: multiQueryData, isLoading, isError, errors } = useMultiQuery();
47439
+ const { data: multiQueryData, isLoading } = useMultiQuery();
47321
47440
  const partsOfUrl = usePartsOfUrl();
47322
47441
  const theme = useTheme();
47442
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
47323
47443
  if (isLoading) {
47324
47444
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
47325
47445
  }
47326
- if (isError) {
47327
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
47328
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
47329
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
47330
- ] });
47446
+ if (shouldShowError) {
47447
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
47331
47448
  }
47332
47449
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value2, index) => {
47333
47450
  acc[index.toString()] = value2;
@@ -47375,7 +47492,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
47375
47492
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
47376
47493
  children
47377
47494
  }) => {
47378
- const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
47495
+ const { data: multiQueryData, isLoading: isMultiqueryLoading, hasErrorForReq } = useMultiQuery();
47379
47496
  const {
47380
47497
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
47381
47498
  id,
@@ -47399,6 +47516,10 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
47399
47516
  } = data;
47400
47517
  const theme = useTheme();
47401
47518
  const partsOfUrl = usePartsOfUrl();
47519
+ const autoErrorResult = useAutoPerRequestError(data);
47520
+ const { shouldShowError, errorToShow } = mergePerRequestErrors(autoErrorResult, hasErrorForReq, [
47521
+ labelSelectorFull?.reqIndex
47522
+ ]);
47402
47523
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
47403
47524
  acc[index.toString()] = value;
47404
47525
  return acc;
@@ -47469,6 +47590,9 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
47469
47590
  if (isMultiqueryLoading) {
47470
47591
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
47471
47592
  }
47593
+ if (shouldShowError) {
47594
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
47595
+ }
47472
47596
  if (isPermissionCheckEnabled && (listPermission.isPending || watchPermission.isPending)) {
47473
47597
  return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { vertical: true, gap: 8, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Alert, { type: "info", message: "Checking permissions for events stream...", showIcon: true }) });
47474
47598
  }
@@ -47736,6 +47860,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
47736
47860
  } = data;
47737
47861
  const theme = useTheme();
47738
47862
  const partsOfUrl = usePartsOfUrl();
47863
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
47739
47864
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
47740
47865
  acc[index.toString()] = value;
47741
47866
  return acc;
@@ -47755,6 +47880,9 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
47755
47880
  template: forcedNamespace,
47756
47881
  replaceValues
47757
47882
  }) : void 0;
47883
+ if (shouldShowError) {
47884
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
47885
+ }
47758
47886
  const jsonRoot = multiQueryData[`req${reqIndex}`];
47759
47887
  if (jsonRoot === void 0) {
47760
47888
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
@@ -47825,16 +47953,14 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
47825
47953
  } = data;
47826
47954
  const [api, contextHolder] = antd.notification.useNotification();
47827
47955
  const queryClient = reactQuery.useQueryClient();
47828
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
47956
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
47829
47957
  const partsOfUrl = usePartsOfUrl();
47958
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
47830
47959
  if (isMultiQueryLoading) {
47831
47960
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
47832
47961
  }
47833
- if (isMultiQueryErrors) {
47834
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
47835
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
47836
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
47837
- ] });
47962
+ if (shouldShowError) {
47963
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
47838
47964
  }
47839
47965
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
47840
47966
  acc[index.toString()] = value;
@@ -47978,16 +48104,14 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
47978
48104
  } = data;
47979
48105
  const [api, contextHolder] = antd.notification.useNotification();
47980
48106
  const queryClient = reactQuery.useQueryClient();
47981
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
48107
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
47982
48108
  const partsOfUrl = usePartsOfUrl();
48109
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
47983
48110
  if (isMultiQueryLoading) {
47984
48111
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
47985
48112
  }
47986
- if (isMultiQueryErrors) {
47987
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
47988
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
47989
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
47990
- ] });
48113
+ if (shouldShowError) {
48114
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
47991
48115
  }
47992
48116
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
47993
48117
  acc[index.toString()] = value;
@@ -48070,6 +48194,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
48070
48194
  children
48071
48195
  }) => {
48072
48196
  const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
48197
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
48073
48198
  const {
48074
48199
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
48075
48200
  id,
@@ -48092,6 +48217,9 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
48092
48217
  if (isMultiqueryLoading) {
48093
48218
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
48094
48219
  }
48220
+ if (shouldShowError) {
48221
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
48222
+ }
48095
48223
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
48096
48224
  /* @__PURE__ */ jsxRuntimeExports.jsx(
48097
48225
  VMVNC,
@@ -77931,6 +78059,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
77931
78059
  ...props
77932
78060
  } = data;
77933
78061
  const partsOfUrl = usePartsOfUrl();
78062
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
77934
78063
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
77935
78064
  acc[index.toString()] = value;
77936
78065
  return acc;
@@ -77961,6 +78090,9 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
77961
78090
  if (isMultiqueryLoading) {
77962
78091
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
77963
78092
  }
78093
+ if (shouldShowError) {
78094
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
78095
+ }
77964
78096
  const Graph = COMPONENTS[type];
77965
78097
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
77966
78098
  /* @__PURE__ */ jsxRuntimeExports.jsx(Graph, { ...preparedProps }),
@@ -77977,16 +78109,14 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
77977
78109
  ...props
77978
78110
  } = data;
77979
78111
  const theme = useTheme();
77980
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
78112
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
77981
78113
  const partsOfUrl = usePartsOfUrl();
78114
+ const { shouldShowError, errorToShow } = useAutoPerRequestError({ ...data });
77982
78115
  if (isMultiQueryLoading) {
77983
78116
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
77984
78117
  }
77985
- if (isMultiQueryErrors) {
77986
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
77987
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
77988
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
77989
- ] });
78118
+ if (shouldShowError) {
78119
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
77990
78120
  }
77991
78121
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
77992
78122
  acc[index.toString()] = value;
@@ -78111,6 +78241,10 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
78111
78241
  });
78112
78242
  navigate(finalUrl);
78113
78243
  };
78244
+ const { shouldShowError: shouldShowMultiQueryError, errorToShow: multiQueryError } = useAutoPerRequestError(data);
78245
+ if (shouldShowMultiQueryError) {
78246
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: multiQueryError });
78247
+ }
78114
78248
  if (isLoading) {
78115
78249
  return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, { size: "small" });
78116
78250
  }
@@ -78151,6 +78285,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
78151
78285
  const [messageApi, contextHolder] = antd.message.useMessage();
78152
78286
  const { data: multiQueryData, isLoading } = useMultiQuery();
78153
78287
  const partsOfUrl = usePartsOfUrl();
78288
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
78154
78289
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
78155
78290
  acc[index.toString()] = value;
78156
78291
  return acc;
@@ -78172,6 +78307,9 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
78172
78307
  if (isLoading) {
78173
78308
  return null;
78174
78309
  }
78310
+ if (shouldShowError) {
78311
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
78312
+ }
78175
78313
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
78176
78314
  contextHolder,
78177
78315
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -78210,16 +78348,14 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
78210
78348
  paddingContainerEnd
78211
78349
  }) => {
78212
78350
  const [api, contextHolder] = antd.notification.useNotification();
78213
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
78351
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
78214
78352
  const partsOfUrl = usePartsOfUrl();
78353
+ const { shouldShowError, errorToShow } = useAutoPerRequestError({ reqIndex });
78215
78354
  if (isMultiQueryLoading) {
78216
78355
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
78217
78356
  }
78218
- if (isMultiQueryErrors) {
78219
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
78220
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
78221
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
78222
- ] });
78357
+ if (shouldShowError) {
78358
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
78223
78359
  }
78224
78360
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
78225
78361
  acc[index.toString()] = value;
@@ -78327,16 +78463,14 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
78327
78463
  cols
78328
78464
  }) => {
78329
78465
  const [api, contextHolder] = antd.notification.useNotification();
78330
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
78466
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
78331
78467
  const partsOfUrl = usePartsOfUrl();
78468
+ const { shouldShowError, errorToShow } = useAutoPerRequestError({ reqIndex });
78332
78469
  if (isMultiQueryLoading) {
78333
78470
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
78334
78471
  }
78335
- if (isMultiQueryErrors) {
78336
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
78337
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
78338
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
78339
- ] });
78472
+ if (shouldShowError) {
78473
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
78340
78474
  }
78341
78475
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
78342
78476
  acc[index.toString()] = value;
@@ -78437,16 +78571,14 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
78437
78571
  cols
78438
78572
  }) => {
78439
78573
  const [api, contextHolder] = antd.notification.useNotification();
78440
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
78574
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
78441
78575
  const partsOfUrl = usePartsOfUrl();
78576
+ const { shouldShowError, errorToShow } = useAutoPerRequestError({ reqIndex });
78442
78577
  if (isMultiQueryLoading) {
78443
78578
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
78444
78579
  }
78445
- if (isMultiQueryErrors) {
78446
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
78447
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
78448
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
78449
- ] });
78580
+ if (shouldShowError) {
78581
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
78450
78582
  }
78451
78583
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
78452
78584
  acc[index.toString()] = value;
@@ -78544,16 +78676,14 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
78544
78676
  cols
78545
78677
  }) => {
78546
78678
  const [api, contextHolder] = antd.notification.useNotification();
78547
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
78679
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
78548
78680
  const partsOfUrl = usePartsOfUrl();
78681
+ const { shouldShowError, errorToShow } = useAutoPerRequestError({ reqIndex });
78549
78682
  if (isMultiQueryLoading) {
78550
78683
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
78551
78684
  }
78552
- if (isMultiQueryErrors) {
78553
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
78554
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
78555
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
78556
- ] });
78685
+ if (shouldShowError) {
78686
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
78557
78687
  }
78558
78688
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
78559
78689
  acc[index.toString()] = value;
@@ -78730,7 +78860,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
78730
78860
  } = data;
78731
78861
  const { token } = antd.theme.useToken();
78732
78862
  const [open, setOpen] = React$1.useState(false);
78733
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
78863
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
78734
78864
  const partsOfUrl = usePartsOfUrl();
78735
78865
  const safeMultiQueryData = multiQueryData || {};
78736
78866
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -78779,14 +78909,12 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
78779
78909
  setOpen(false);
78780
78910
  }
78781
78911
  }, [open, canOpenActiveType]);
78912
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(counter.props);
78782
78913
  if (isMultiQueryLoading) {
78783
78914
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
78784
78915
  }
78785
- if (isMultiQueryErrors) {
78786
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
78787
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
78788
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
78789
- ] });
78916
+ if (shouldShowError) {
78917
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
78790
78918
  }
78791
78919
  const jsonRoot = multiQueryData[`req${counter.props.reqIndex}`];
78792
78920
  if (jsonRoot === void 0) {
@@ -79331,6 +79459,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
79331
79459
  const [clampedUsedPercent, setClampedUsedPercent] = React$1.useState(null);
79332
79460
  const [clampedRequestedPercent, setClampedRequestedPercent] = React$1.useState(null);
79333
79461
  const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
79462
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
79334
79463
  const { token } = antd.theme.useToken();
79335
79464
  const {
79336
79465
  title = "CPU, core",
@@ -79536,6 +79665,9 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
79536
79665
  observer.disconnect();
79537
79666
  };
79538
79667
  }, [updateUsedBadgeClamp, updateRequestedLabelClamp]);
79668
+ if (shouldShowError) {
79669
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
79670
+ }
79539
79671
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$o.Wrapper, { style: containerStyle, $colorBgContainer: token.colorBgContainer, $colorBorder: token.colorBorder, children: [
79540
79672
  /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$o.Header, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$o.Title, { $colorText: token.colorText, children: title }) }),
79541
79673
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$o.ChartContainer, { children: [
@@ -81085,7 +81217,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
81085
81217
 
81086
81218
  const ActionsDropdown = ({ data, children }) => {
81087
81219
  const { buttonText = "Actions", buttonVariant = "default", containerStyle, actions, permissions } = data;
81088
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryError, errors } = useMultiQuery();
81220
+ const { data: multiQueryData, isLoading: isMultiQueryLoading } = useMultiQuery();
81089
81221
  const partsOfUrl = usePartsOfUrl();
81090
81222
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
81091
81223
  acc[index.toString()] = value;
@@ -81144,12 +81276,17 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
81144
81276
  replaceValues,
81145
81277
  multiQueryData: safeMultiQueryData
81146
81278
  });
81279
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
81147
81280
  if (isMultiQueryLoading) {
81148
81281
  return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, { size: "small" });
81149
81282
  }
81150
- if (isMultiQueryError) {
81151
- const errorMessage = errors.filter((e) => e !== null).map((e) => typeof e === "string" ? e : e.message).join("; ");
81152
- return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: errorMessage || "Failed to load data", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AntIcons.WarningOutlined, { style: { color: "red" } }) });
81283
+ if (shouldShowError) {
81284
+ const resolveMessage = () => {
81285
+ if (!errorToShow) return "Failed to load data";
81286
+ return typeof errorToShow === "string" ? errorToShow : errorToShow.message;
81287
+ };
81288
+ const errorMessage = resolveMessage();
81289
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: errorMessage, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AntIcons.WarningOutlined, { style: { color: "red" } }) });
81153
81290
  }
81154
81291
  const menuItems = getMenuItems(visibleActions, handleActionClick, effectivePermissions);
81155
81292
  const handleDropdownOpenChange = (nextOpen) => {
@@ -81642,7 +81779,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
81642
81779
  } = data;
81643
81780
  const theme = useTheme();
81644
81781
  const partsOfUrl = usePartsOfUrl();
81645
- const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryErrors, errors } = useMultiQuery();
81782
+ const { data: multiQueryData, isLoading: isMultiQueryLoading, hasErrorForReq } = useMultiQuery();
81646
81783
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
81647
81784
  acc[index.toString()] = value;
81648
81785
  return acc;
@@ -81666,8 +81803,10 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
81666
81803
  });
81667
81804
  const baseFactoriesMapping = navigationDataArr && navigationDataArr.items && navigationDataArr.items.length > 0 ? navigationDataArr.items[0].spec?.baseFactoriesMapping : void 0;
81668
81805
  const customColumns = React$1.useMemo(() => buildCustomColumns(containerFactoryKey), [containerFactoryKey]);
81806
+ const parsedReqIndex = typeof reqIndex === "string" ? parseInt(reqIndex, 10) : reqIndex;
81807
+ const ownReqFailed = !Number.isNaN(parsedReqIndex) && hasErrorForReq(parsedReqIndex);
81669
81808
  const dataSourceWithoutHref = React$1.useMemo(() => {
81670
- if (isMultiQueryLoading || isMultiQueryErrors || !multiQueryData) return [];
81809
+ if (isMultiQueryLoading || ownReqFailed || !multiQueryData) return [];
81671
81810
  const jsonRoot2 = multiQueryData[`req${reqIndex}`];
81672
81811
  if (jsonRoot2 === void 0) return [];
81673
81812
  const specResult = jp.query(jsonRoot2 || {}, `$${jsonPathToSpec}`);
@@ -81707,7 +81846,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
81707
81846
  }, [
81708
81847
  multiQueryData,
81709
81848
  isMultiQueryLoading,
81710
- isMultiQueryErrors,
81849
+ ownReqFailed,
81711
81850
  reqIndex,
81712
81851
  jsonPathToSpec,
81713
81852
  jsonPathToPodName,
@@ -81738,7 +81877,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
81738
81877
  baseFactoryClusterSceopedBuiltinKey
81739
81878
  }) : void 0;
81740
81879
  const hasPendingLinkPrefixInputs = hasLinkableVolumeTypes && (isPendingLinkSegment(clusterPrepared) || isPendingLinkSegment(linkableNamespace) || isPendingLinkSegment(configMapFactoryKey) || isPendingLinkSegment(secretFactoryKey));
81741
- const isLinkPrefixLoading = hasLinkableVolumeTypes && !isMultiQueryErrors && !isNavigationError && (isNavigationLoading || hasPendingLinkPrefixInputs);
81880
+ const isLinkPrefixLoading = hasLinkableVolumeTypes && !ownReqFailed && !isNavigationError && (isNavigationLoading || hasPendingLinkPrefixInputs);
81742
81881
  const resourceLinkPrefixes = React$1.useMemo(() => {
81743
81882
  if (!hasLinkableVolumeTypes || isLinkPrefixLoading) {
81744
81883
  return void 0;
@@ -81792,14 +81931,12 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
81792
81931
  })),
81793
81932
  [dataSourceWithoutHref, resourceLinkPrefixes]
81794
81933
  );
81934
+ const { shouldShowError, errorToShow } = useAutoPerRequestError(data);
81795
81935
  if (isMultiQueryLoading || isLinkPrefixLoading) {
81796
81936
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
81797
81937
  }
81798
- if (isMultiQueryErrors) {
81799
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
81800
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
81801
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
81802
- ] });
81938
+ if (shouldShowError) {
81939
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
81803
81940
  }
81804
81941
  const jsonRoot = multiQueryData[`req${reqIndex}`];
81805
81942
  if (jsonRoot === void 0) {
@@ -81870,7 +82007,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
81870
82007
  return "Error";
81871
82008
  };
81872
82009
  const AntdResult = ({ data, children }) => {
81873
- const { data: multiQueryData, isLoading, errors } = useMultiQuery();
82010
+ const { data: multiQueryData, isLoading, getErrorForReq } = useMultiQuery();
81874
82011
  const partsOfUrl = usePartsOfUrl();
81875
82012
  if (isLoading) {
81876
82013
  return null;
@@ -81880,7 +82017,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
81880
82017
  return acc;
81881
82018
  }, {});
81882
82019
  if (typeof data.reqIndex === "number") {
81883
- const error = errors[data.reqIndex];
82020
+ const error = getErrorForReq(data.reqIndex);
81884
82021
  const shouldCheckEmpty = data.checkEmpty !== false;
81885
82022
  const itemsPath = data.itemsPath ?? ".items";
81886
82023
  const emptyListDetected = !error && shouldCheckEmpty && isEmptyAtPath(multiQueryData, data.reqIndex, itemsPath);
@@ -82022,7 +82159,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
82022
82159
  {
82023
82160
  items: [...preparedK8sResoucesUrls, ...preparedUrlsToFetch],
82024
82161
  dataToApplyToContext,
82025
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicRenderer, { ...props })
82162
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundaryWithDataReset, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicRenderer, { ...props }) })
82026
82163
  }
82027
82164
  ) }) }) })
82028
82165
  }
@@ -91689,9 +91826,32 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
91689
91826
  const [isDeleteModalManyOpen, setIsDeleteModalManyOpen] = React$1.useState(
91690
91827
  false
91691
91828
  );
91692
- const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
91829
+ const { data: multiQueryData, isLoading: isMultiqueryLoading, hasErrorForReq } = useMultiQuery();
91693
91830
  const theme = useTheme();
91694
91831
  const partsOfUrl = usePartsOfUrl();
91832
+ const allProps = {
91833
+ fetchUrl,
91834
+ k8sResourceToFetch,
91835
+ pathToItems,
91836
+ additionalReqsDataToEachItem,
91837
+ cluster,
91838
+ labelSelector,
91839
+ labelSelectorFull,
91840
+ fieldSelector,
91841
+ namespace,
91842
+ k8sResource,
91843
+ dataForControls,
91844
+ baseprefix,
91845
+ pathToKey,
91846
+ modalTitle,
91847
+ modalDescriptionText,
91848
+ ...props
91849
+ };
91850
+ const autoErrorResult = useAutoPerRequestError(allProps);
91851
+ const { shouldShowError, errorToShow } = mergePerRequestErrors(autoErrorResult, hasErrorForReq, [
91852
+ labelSelectorFull?.reqIndex,
91853
+ ...additionalReqsDataToEachItem ?? []
91854
+ ]);
91695
91855
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
91696
91856
  acc[index.toString()] = value;
91697
91857
  return acc;
@@ -91785,6 +91945,9 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
91785
91945
  if (k8sResourceToFetchPrepared && isMultiqueryLoading) {
91786
91946
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
91787
91947
  }
91948
+ if (shouldShowError) {
91949
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PerRequestError, { error: errorToShow });
91950
+ }
91788
91951
  if (fetchUrlPrepared && isFetchedDataLoading) {
91789
91952
  return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}) });
91790
91953
  }
@@ -91958,6 +92121,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
91958
92121
  exports.EditIcon = EditIcon;
91959
92122
  exports.EnrichedTable = EnrichedTable;
91960
92123
  exports.EnrichedTableProvider = EnrichedTableProvider;
92124
+ exports.ErrorBoundary = ErrorBoundary;
92125
+ exports.ErrorBoundaryWithDataReset = ErrorBoundaryWithDataReset;
91961
92126
  exports.Events = Events;
91962
92127
  exports.FlexGrow = FlexGrow;
91963
92128
  exports.LockedIcon = LockedIcon;