@asgardeo/react 0.14.2 → 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.
|
@@ -78,6 +78,10 @@ export interface BaseInviteUserRenderProps {
|
|
|
78
78
|
* Whether the invite link was copied.
|
|
79
79
|
*/
|
|
80
80
|
inviteLinkCopied: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Whether the invite email was sent successfully.
|
|
83
|
+
*/
|
|
84
|
+
isEmailSent: boolean;
|
|
81
85
|
/**
|
|
82
86
|
* Whether the invite link has been generated (admin flow complete).
|
|
83
87
|
*/
|
package/dist/index.js
CHANGED
|
@@ -8454,8 +8454,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8454
8454
|
);
|
|
8455
8455
|
}
|
|
8456
8456
|
case EmbeddedFlowComponentType.Timer: {
|
|
8457
|
-
const
|
|
8458
|
-
const textTemplate = timerConfig.text || "Time remaining: {time}";
|
|
8457
|
+
const textTemplate = resolve(component.label) || "Time remaining: {time}";
|
|
8459
8458
|
const timeoutMs = Number(options.additionalData?.["stepTimeout"]) || 0;
|
|
8460
8459
|
const expiresIn = timeoutMs > 0 ? Math.max(0, Math.floor((timeoutMs - Date.now()) / 1e3)) : 0;
|
|
8461
8460
|
return /* @__PURE__ */ jsx66(FlowTimer_default, { expiresIn, textTemplate }, key);
|
|
@@ -11469,6 +11468,7 @@ var BaseInviteUser = ({
|
|
|
11469
11468
|
const [touchedFields, setTouchedFields] = useState21({});
|
|
11470
11469
|
const [inviteLink, setInviteLink] = useState21();
|
|
11471
11470
|
const [inviteLinkCopied, setInviteLinkCopied] = useState21(false);
|
|
11471
|
+
const [emailSent, setEmailSent] = useState21(false);
|
|
11472
11472
|
const [isFormValid, setIsFormValid] = useState21(true);
|
|
11473
11473
|
const initializationAttemptedRef = useRef10(false);
|
|
11474
11474
|
const handleError = useCallback14(
|
|
@@ -11580,6 +11580,9 @@ var BaseInviteUser = ({
|
|
|
11580
11580
|
setInviteLink(inviteLinkValue);
|
|
11581
11581
|
onInviteLinkGenerated?.(inviteLinkValue, response.flowId);
|
|
11582
11582
|
}
|
|
11583
|
+
if (response.data?.additionalData?.["emailSent"] === "true") {
|
|
11584
|
+
setEmailSent(true);
|
|
11585
|
+
}
|
|
11583
11586
|
if (response.flowStatus === "ERROR") {
|
|
11584
11587
|
handleError(response);
|
|
11585
11588
|
return;
|
|
@@ -11631,6 +11634,7 @@ var BaseInviteUser = ({
|
|
|
11631
11634
|
setTouchedFields({});
|
|
11632
11635
|
setInviteLink(void 0);
|
|
11633
11636
|
setInviteLinkCopied(false);
|
|
11637
|
+
setEmailSent(false);
|
|
11634
11638
|
initializationAttemptedRef.current = false;
|
|
11635
11639
|
}, []);
|
|
11636
11640
|
useEffect20(() => {
|
|
@@ -11722,6 +11726,7 @@ var BaseInviteUser = ({
|
|
|
11722
11726
|
const { title, subtitle } = extractHeadings(components);
|
|
11723
11727
|
const componentsWithoutHeadings = filterHeadings(components);
|
|
11724
11728
|
const isInviteGenerated = !!inviteLink;
|
|
11729
|
+
const isEmailSent = emailSent;
|
|
11725
11730
|
const renderProps = {
|
|
11726
11731
|
components,
|
|
11727
11732
|
copyInviteLink,
|
|
@@ -11733,6 +11738,7 @@ var BaseInviteUser = ({
|
|
|
11733
11738
|
handleSubmit,
|
|
11734
11739
|
inviteLink,
|
|
11735
11740
|
inviteLinkCopied,
|
|
11741
|
+
isEmailSent,
|
|
11736
11742
|
isInviteGenerated,
|
|
11737
11743
|
isLoading,
|
|
11738
11744
|
isValid: isFormValid,
|
|
@@ -11758,6 +11764,15 @@ var BaseInviteUser = ({
|
|
|
11758
11764
|
/* @__PURE__ */ jsx83(Alert_default.Description, { children: apiError.message })
|
|
11759
11765
|
] }) }) });
|
|
11760
11766
|
}
|
|
11767
|
+
if (isInviteGenerated && isEmailSent) {
|
|
11768
|
+
return /* @__PURE__ */ jsxs33(Card_default, { className: cx23(className, styles.card), variant, children: [
|
|
11769
|
+
/* @__PURE__ */ jsx83(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx83(Card_default.Title, { level: 2, className: styles.title, children: "Invite Email Sent!" }) }),
|
|
11770
|
+
/* @__PURE__ */ jsxs33(Card_default.Content, { children: [
|
|
11771
|
+
/* @__PURE__ */ jsx83(Alert_default, { variant: "success", children: /* @__PURE__ */ jsx83(Alert_default.Description, { children: "An invitation email has been sent successfully. The user can complete their registration using the link in the email." }) }),
|
|
11772
|
+
/* @__PURE__ */ jsx83("div", { style: { display: "flex", gap: "0.5rem", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsx83(Button_default, { variant: "outline", onClick: resetFlow, children: "Invite Another User" }) })
|
|
11773
|
+
] })
|
|
11774
|
+
] });
|
|
11775
|
+
}
|
|
11761
11776
|
if (isInviteGenerated && inviteLink) {
|
|
11762
11777
|
return /* @__PURE__ */ jsxs33(Card_default, { className: cx23(className, styles.card), variant, children: [
|
|
11763
11778
|
/* @__PURE__ */ jsx83(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx83(Card_default.Title, { level: 2, className: styles.title, children: "Invite Link Generated!" }) }),
|