@hiver/connector-admin 4.19.0-multiStore-beta.0 → 4.19.0-multiStore-beta.1

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.
package/index.es.js CHANGED
@@ -38124,37 +38124,37 @@ const AB = S(Dn)`
38124
38124
  const t = aX(e);
38125
38125
  return hy(t ? rX[t] : void 0);
38126
38126
  }, sX = ({ connectorDetails: e }) => {
38127
- const [t, n] = Z(!1), [r, o] = Z(!1), [i, a] = Z(void 0), A = nn(), s = Zn(), l = !!(e != null && e.showAddStore), g = (!!(e != null && e.isStore) ? e == null ? void 0 : e.parentConnectorId : e == null ? void 0 : e.id) ?? "", p = async (m) => {
38127
+ const [t, n] = Z(!1), [r, o] = Z(!1), [i, a] = Z(void 0), A = nn(), s = Zn(), l = !!(e != null && e.showAddStore), g = (!!(e != null && e.isStore) ? e == null ? void 0 : e.parentConnectorId : e == null ? void 0 : e.id) ?? "", p = async (v) => {
38128
38128
  if (!e) return;
38129
38129
  a(void 0), o(!0);
38130
- const v = e.templateId ?? "";
38130
+ const y = e.templateId ?? "";
38131
38131
  try {
38132
- const { valid: y, reason: b } = await GW({
38133
- templateId: v,
38132
+ const { valid: b, reason: Q } = await GW({
38133
+ templateId: y,
38134
38134
  parentConnectorId: g,
38135
- name: m
38135
+ name: v
38136
38136
  });
38137
- if (!y) {
38138
- a(hy(b)), o(!1);
38137
+ if (!b) {
38138
+ a(hy(Q)), o(!1);
38139
38139
  return;
38140
38140
  }
38141
- await WW({ templateId: v, parentConnectorId: g, name: m }), n(!1), Ht({ message: nX(m), type: Mr }), s($i()), A(`${Ue.BASEPATH}${Ue.DASHBOARD}`);
38142
- } catch (y) {
38143
- a(AX(y)), o(!1);
38141
+ await WW({ templateId: y, parentConnectorId: g, name: v }), n(!1), Ht({ message: nX(v), type: Mr }), s($i()), A(`${Ue.BASEPATH}${Ue.DASHBOARD}`);
38142
+ } catch (b) {
38143
+ a(AX(b)), o(!1);
38144
38144
  }
38145
38145
  };
38146
38146
  if (!l)
38147
38147
  return null;
38148
- const h = !!(e != null && e.canAddStore), f = (e == null ? void 0 : e.storesUsed) ?? 0, C = (e == null ? void 0 : e.maxStores) ?? 0, d = !h, B = d ? tX(f, C) : "", E = () => {
38148
+ const h = !!(e != null && e.canAddStore), f = (e == null ? void 0 : e.storesUsed) ?? 0, C = (e == null ? void 0 : e.maxStores) ?? 0, d = (e == null ? void 0 : e.addStoreDisabledMessage) ?? null, B = !h || d !== null, E = B ? d ?? tX(f, C) : "", I = () => {
38149
38149
  a(void 0), n(!0);
38150
- }, I = /* @__PURE__ */ c.jsx(
38150
+ }, m = /* @__PURE__ */ c.jsx(
38151
38151
  it,
38152
38152
  {
38153
38153
  "data-testid": "add-new-store-button",
38154
38154
  variant: "outlined",
38155
38155
  color: "tertiary",
38156
38156
  size: "medium",
38157
- disabled: d,
38157
+ disabled: B,
38158
38158
  sx: {
38159
38159
  height: "32px",
38160
38160
  textTransform: "none",
@@ -38163,16 +38163,16 @@ const AB = S(Dn)`
38163
38163
  color: "#343C45",
38164
38164
  "&:hover": { borderColor: "#D6DDE8" }
38165
38165
  },
38166
- onClick: E,
38166
+ onClick: I,
38167
38167
  children: JK
38168
38168
  }
38169
38169
  );
38170
38170
  return /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
38171
- d ? (
38171
+ B ? (
38172
38172
  // MUI Tooltip does not fire on a disabled button; wrap in a span so the
38173
38173
  // usage tooltip still shows on hover.
38174
- /* @__PURE__ */ c.jsx(Ct, { title: B, placement: "bottom", children: /* @__PURE__ */ c.jsx("span", { "data-testid": "add-new-store-button-tooltip-wrapper", children: I }) })
38175
- ) : I,
38174
+ /* @__PURE__ */ c.jsx(Ct, { title: E, placement: "bottom", children: /* @__PURE__ */ c.jsx("span", { "data-testid": "add-new-store-button-tooltip-wrapper", children: m }) })
38175
+ ) : m,
38176
38176
  /* @__PURE__ */ c.jsx("div", { "data-testid": "add-new-store-divider", className: "w-px h-6 bg-[#D6DDE8] mx-2" }),
38177
38177
  /* @__PURE__ */ c.jsx(
38178
38178
  iX,