@fayz-ai/admin 0.43.1 → 0.43.2

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/dist/index.js CHANGED
@@ -10225,31 +10225,31 @@ function ConnectPanel({
10225
10225
  const secretFieldCount = (def.fields ?? []).filter(isSecretField).length;
10226
10226
  const hasStoredCredential = connector.state === "connected" || connector.state === "needs_setup";
10227
10227
  const [formKey, setFormKey] = React133__default.useState(0);
10228
- if (def.authKind === "oauth") {
10229
- return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
10230
- /* @__PURE__ */ jsx(Note, { children: t("connectors.authorize.oauthOnly") }),
10231
- /* @__PURE__ */ jsxs(
10232
- Button,
10233
- {
10234
- disabled: busy === "oauth" || !def.startOAuth,
10235
- onClick: () => run("oauth", async () => {
10236
- const url = await def.startOAuth(window.location.href, { tenantId: tenantId2 });
10237
- window.location.href = url;
10238
- }),
10239
- children: [
10240
- busy === "oauth" ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Plug, { className: "h-4 w-4" }),
10241
- `${t("connectors.connect")} ${def.name}`
10242
- ]
10243
- }
10244
- )
10245
- ] });
10246
- }
10247
10228
  const fields = def.fields ?? [];
10229
+ const oauthDoor = def.authKind === "oauth" ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
10230
+ /* @__PURE__ */ jsx(Note, { children: t(fields.length > 0 ? "connectors.authorize.oauthOrKey" : "connectors.authorize.oauthOnly") }),
10231
+ /* @__PURE__ */ jsxs(
10232
+ Button,
10233
+ {
10234
+ disabled: busy === "oauth" || !def.startOAuth,
10235
+ onClick: () => run("oauth", async () => {
10236
+ const url = await def.startOAuth(window.location.href, { tenantId: tenantId2 });
10237
+ window.location.href = url;
10238
+ }),
10239
+ children: [
10240
+ busy === "oauth" ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Plug, { className: "h-4 w-4" }),
10241
+ `${t("connectors.connect")} ${def.name}`
10242
+ ]
10243
+ }
10244
+ )
10245
+ ] }) : null;
10246
+ if (oauthDoor && fields.length === 0) return oauthDoor;
10248
10247
  return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
10248
+ oauthDoor,
10249
10249
  /* @__PURE__ */ jsx(ProviderInstallStep, { connector: def }),
10250
10250
  needsSink && /* @__PURE__ */ jsx(Note, { children: sinkMissing ? t("connectors.credentials.noSink") : t("connectors.credentials.held") }),
10251
10251
  needsSink && !sinkMissing && secretFieldCount > 1 && hasStoredCredential && /* @__PURE__ */ jsx(Note, { children: t("connectors.credentials.replaces") }),
10252
- fields.length === 0 && !def.providerInstall && /* @__PURE__ */ jsx(Note, { children: t("connectors.authorize.nothingToFill") }),
10252
+ fields.length === 0 && !def.providerInstall && !oauthDoor && /* @__PURE__ */ jsx(Note, { children: t("connectors.authorize.nothingToFill") }),
10253
10253
  /* @__PURE__ */ jsx("div", { className: "grid gap-3 sm:grid-cols-2", children: fields.map(
10254
10254
  (f) => isSecretField(f) ? /* @__PURE__ */ jsxs("label", { className: "block", children: [
10255
10255
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-muted-foreground", children: f.label }),