@asgardeo/react 0.14.3 → 0.14.4
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/cjs/index.js
CHANGED
|
@@ -11506,6 +11506,7 @@ var BaseInviteUser = ({
|
|
|
11506
11506
|
const [touchedFields, setTouchedFields] = (0, import_react71.useState)({});
|
|
11507
11507
|
const [inviteLink, setInviteLink] = (0, import_react71.useState)();
|
|
11508
11508
|
const [inviteLinkCopied, setInviteLinkCopied] = (0, import_react71.useState)(false);
|
|
11509
|
+
const [emailSent, setEmailSent] = (0, import_react71.useState)(false);
|
|
11509
11510
|
const [isFormValid, setIsFormValid] = (0, import_react71.useState)(true);
|
|
11510
11511
|
const initializationAttemptedRef = (0, import_react71.useRef)(false);
|
|
11511
11512
|
const handleError = (0, import_react71.useCallback)(
|
|
@@ -11617,6 +11618,9 @@ var BaseInviteUser = ({
|
|
|
11617
11618
|
setInviteLink(inviteLinkValue);
|
|
11618
11619
|
onInviteLinkGenerated?.(inviteLinkValue, response.flowId);
|
|
11619
11620
|
}
|
|
11621
|
+
if (response.data?.additionalData?.["emailSent"] === "true") {
|
|
11622
|
+
setEmailSent(true);
|
|
11623
|
+
}
|
|
11620
11624
|
if (response.flowStatus === "ERROR") {
|
|
11621
11625
|
handleError(response);
|
|
11622
11626
|
return;
|
|
@@ -11668,6 +11672,7 @@ var BaseInviteUser = ({
|
|
|
11668
11672
|
setTouchedFields({});
|
|
11669
11673
|
setInviteLink(void 0);
|
|
11670
11674
|
setInviteLinkCopied(false);
|
|
11675
|
+
setEmailSent(false);
|
|
11671
11676
|
initializationAttemptedRef.current = false;
|
|
11672
11677
|
}, []);
|
|
11673
11678
|
(0, import_react71.useEffect)(() => {
|
|
@@ -11759,6 +11764,7 @@ var BaseInviteUser = ({
|
|
|
11759
11764
|
const { title, subtitle } = extractHeadings(components);
|
|
11760
11765
|
const componentsWithoutHeadings = filterHeadings(components);
|
|
11761
11766
|
const isInviteGenerated = !!inviteLink;
|
|
11767
|
+
const isEmailSent = emailSent;
|
|
11762
11768
|
const renderProps = {
|
|
11763
11769
|
components,
|
|
11764
11770
|
copyInviteLink,
|
|
@@ -11770,6 +11776,7 @@ var BaseInviteUser = ({
|
|
|
11770
11776
|
handleSubmit,
|
|
11771
11777
|
inviteLink,
|
|
11772
11778
|
inviteLinkCopied,
|
|
11779
|
+
isEmailSent,
|
|
11773
11780
|
isInviteGenerated,
|
|
11774
11781
|
isLoading,
|
|
11775
11782
|
isValid: isFormValid,
|
|
@@ -11795,6 +11802,15 @@ var BaseInviteUser = ({
|
|
|
11795
11802
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Alert_default.Description, { children: apiError.message })
|
|
11796
11803
|
] }) }) });
|
|
11797
11804
|
}
|
|
11805
|
+
if (isInviteGenerated && isEmailSent) {
|
|
11806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Card_default, { className: (0, import_css42.cx)(className, styles.card), variant, children: [
|
|
11807
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card_default.Title, { level: 2, className: styles.title, children: "Invite Email Sent!" }) }),
|
|
11808
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Card_default.Content, { children: [
|
|
11809
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Alert_default, { variant: "success", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Alert_default.Description, { children: "An invitation email has been sent successfully. The user can complete their registration using the link in the email." }) }),
|
|
11810
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { style: { display: "flex", gap: "0.5rem", marginTop: "1.5rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Button_default, { variant: "outline", onClick: resetFlow, children: "Invite Another User" }) })
|
|
11811
|
+
] })
|
|
11812
|
+
] });
|
|
11813
|
+
}
|
|
11798
11814
|
if (isInviteGenerated && inviteLink) {
|
|
11799
11815
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Card_default, { className: (0, import_css42.cx)(className, styles.card), variant, children: [
|
|
11800
11816
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card_default.Title, { level: 2, className: styles.title, children: "Invite Link Generated!" }) }),
|