@prorobotech/openapi-k8s-toolkit 0.0.1-alpha.85 → 0.0.1-alpha.86

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.
@@ -44249,12 +44249,12 @@ const getCreatePathToNav = ({
44249
44249
  return pathToNav;
44250
44250
  }
44251
44251
  if (type === "crd") {
44252
- return `/${baseprefix}/${clusterName}/${namespace}/forms/crds/${apiGroup}/${apiVersion}/${typeName}`;
44252
+ return `/${baseprefix}/${clusterName}/${namespace}/forms/crds/${apiGroup}/${apiVersion}/${typeName}?backlink=${window.location.pathname}`;
44253
44253
  }
44254
44254
  if (type === "nonCrd") {
44255
- return `/${baseprefix}/${clusterName}/${namespace}/forms/apis/${apiGroup}/${apiVersion}/${typeName}`;
44255
+ return `/${baseprefix}/${clusterName}/${namespace}/forms/apis/${apiGroup}/${apiVersion}/${typeName}?backlink=${window.location.pathname}`;
44256
44256
  }
44257
- return `/${baseprefix}/${clusterName}/${namespace}/forms/builtin/${apiVersion}/${typeName}`;
44257
+ return `/${baseprefix}/${clusterName}/${namespace}/forms/builtin/${apiVersion}/${typeName}?backlink=${window.location.pathname}`;
44258
44258
  };
44259
44259
  const getListPath = ({
44260
44260
  clusterName,
@@ -44372,7 +44372,8 @@ const MarketplaceCard$1 = ({
44372
44372
  isEditMode,
44373
44373
  onDeleteClick,
44374
44374
  onEditClick,
44375
- addedMode
44375
+ addedMode,
44376
+ standalone
44376
44377
  }) => {
44377
44378
  const { useToken } = theme;
44378
44379
  const { token } = useToken();
@@ -44383,7 +44384,7 @@ const MarketplaceCard$1 = ({
44383
44384
  } catch {
44384
44385
  decodedIcon = "Can't decode";
44385
44386
  }
44386
- const navigateUrl = addedMode ? getPathToNav({
44387
+ const navigateUrl = addedMode || standalone ? getPathToNav({
44387
44388
  clusterName,
44388
44389
  namespace,
44389
44390
  type,
@@ -44529,7 +44530,8 @@ const MarketPlace = ({
44529
44530
  baseApiVersion,
44530
44531
  mpResourceName,
44531
44532
  mpResourceKind,
44532
- baseprefix
44533
+ baseprefix,
44534
+ standalone
44533
44535
  }) => {
44534
44536
  const [api, contextHolder] = notification.useNotification();
44535
44537
  const [isEditMode, setIsEditMode] = useState(false);
@@ -44682,7 +44684,8 @@ const MarketPlace = ({
44682
44684
  },
44683
44685
  onEditClick: () => {
44684
44686
  setIsAddEditOpen(marketplacePanels.items.find(({ spec }) => spec.name === name) || false);
44685
- }
44687
+ },
44688
+ standalone
44686
44689
  },
44687
44690
  name
44688
44691
  )
@@ -46137,21 +46140,19 @@ const StatusText = ({
46137
46140
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
46138
46141
  children
46139
46142
  }) => {
46140
- const { id, requestIndex, jsonPath, criteria, valueToCompare, successText, errorText, ...props } = data;
46141
- const { data: multiQueryData, isLoading, isError, errors } = useMultiQuery();
46142
- let jpQueryResult;
46143
- try {
46144
- ;
46145
- [jpQueryResult] = jp.query(multiQueryData[`req${requestIndex}`], `$${jsonPath}`);
46146
- } catch (err) {
46147
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
46148
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
46149
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: JSON.stringify(err) })
46150
- ] });
46151
- }
46152
- const result = criteria === "equals" ? valueToCompare === jpQueryResult : valueToCompare !== jpQueryResult;
46153
- if (isLoading) {
46154
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
46143
+ const { id, value, criteria, valueToCompare, successText, errorText, ...props } = data;
46144
+ const { data: multiQueryData, isLoading: isMultiqueryLoading, isError, errors } = useMultiQuery();
46145
+ const partsOfUrl = usePartsOfUrl();
46146
+ const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value2, index) => {
46147
+ acc[index.toString()] = value2;
46148
+ return acc;
46149
+ }, {});
46150
+ const successTextPrepared = parseAll({ text: successText, replaceValues, multiQueryData });
46151
+ const errorTextPrepared = parseAll({ text: errorText, replaceValues, multiQueryData });
46152
+ const valuePrepared = parseAll({ text: value, replaceValues, multiQueryData });
46153
+ const result = criteria === "equals" ? valueToCompare === valuePrepared : valueToCompare !== valuePrepared;
46154
+ if (isMultiqueryLoading) {
46155
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
46155
46156
  }
46156
46157
  if (isError) {
46157
46158
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
@@ -46160,7 +46161,7 @@ const StatusText = ({
46160
46161
  ] });
46161
46162
  }
46162
46163
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography.Text, { type: result ? "success" : "danger", ...props, children: [
46163
- result ? successText : errorText,
46164
+ result ? successTextPrepared : errorTextPrepared,
46164
46165
  children
46165
46166
  ] });
46166
46167
  };