@influenzanet/case-web-app-core 2.8.5-staging → 2.8.7-staging

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/build/index.es.js CHANGED
@@ -21025,6 +21025,8 @@ var SignupForm = function (props) {
21025
21025
  var confirmPasswordInputLabel = t('signup.confirmPasswordInputLabel');
21026
21026
  var confirmPasswordPlaceholder = t('signup.confirmPasswordInputLabel');
21027
21027
  var phoneInputLabel = t('signup.phoneInputLabel');
21028
+ var phoneOptional = t('signup.phoneOptional');
21029
+ var phoneOptionalWithExplanation = t('signup.phoneOptionalWithExplanation');
21028
21030
  var phoneInputPlaceholder = t('signup.phoneInputPlaceholder');
21029
21031
  var dialogSize = consentDialogSize();
21030
21032
  return (jsxs(React__default$1.Fragment, { children: [infoText && infoText.length > 0 ?
@@ -21045,7 +21047,7 @@ var SignupForm = function (props) {
21045
21047
  }, onChange: function (event) {
21046
21048
  var value = event.target.value;
21047
21049
  setSignupData(function (prev) { return __assign(__assign({}, prev), { confirmPassword: value }); });
21048
- } }, void 0), jsx(PhoneNumberInput, { className: marginBottomClass, value: signupData.phone, label: phoneInputLabel + " (opzionale)", placeholder: phoneInputPlaceholder + " (opzionale per notifiche WhatsApp)", autoFocus: false, onChange: function (fullPhoneNumber) {
21050
+ } }, void 0), jsx(PhoneNumberInput, { className: marginBottomClass, value: signupData.phone, label: phoneInputLabel + (phoneOptional), placeholder: phoneInputPlaceholder + (phoneOptionalWithExplanation), autoFocus: false, onChange: function (fullPhoneNumber) {
21049
21051
  setSignupData(function (prev) { return __assign(__assign({}, prev), { phone: fullPhoneNumber }); });
21050
21052
  }, onBlur: function () {
21051
21053
  setShowPhoneError(true);
@@ -24072,19 +24074,20 @@ var AccountSettings = function (props) {
24072
24074
  return [4 /*yield*/, resendWhatsAppCodeReq()];
24073
24075
  case 2:
24074
24076
  _a.sent();
24075
- setResendMessage({
24076
- type: 'success',
24077
- text: t("".concat(props.itemKey, ".phone.resendSuccess"), 'Codice inviato con successo!')
24078
- });
24079
- // Open the verify WhatsApp dialog with phone number after a small delay
24080
- setTimeout(function () {
24077
+ console.log('Opening dialog with phone:', phoneInfo === null || phoneInfo === void 0 ? void 0 : phoneInfo.phone);
24078
+ // Use requestAnimationFrame to wait for React to finish rendering
24079
+ requestAnimationFrame(function () {
24081
24080
  dispatch(dialogActions.openVerifyWhatsAppDialog({
24082
24081
  type: 'verifyWhatsApp',
24083
24082
  payload: {
24084
24083
  phoneNumber: (phoneInfo === null || phoneInfo === void 0 ? void 0 : phoneInfo.phone) || '',
24085
24084
  }
24086
24085
  }));
24087
- }, 100);
24086
+ });
24087
+ setResendMessage({
24088
+ type: 'success',
24089
+ text: t("".concat(props.itemKey, ".phone.resendSuccess"), 'Codice inviato con successo!')
24090
+ });
24088
24091
  return [3 /*break*/, 5];
24089
24092
  case 3:
24090
24093
  error_1 = _a.sent();
@@ -24096,7 +24099,6 @@ var AccountSettings = function (props) {
24096
24099
  return [3 /*break*/, 5];
24097
24100
  case 4:
24098
24101
  setIsResending(false);
24099
- setTimeout(function () { return setResendMessage(null); }, 5000); // Clear message after 5 seconds
24100
24102
  return [7 /*endfinally*/];
24101
24103
  case 5: return [2 /*return*/];
24102
24104
  }
@@ -24108,7 +24110,7 @@ var AccountSettings = function (props) {
24108
24110
  }
24109
24111
  return jsxs(React__default$1.Fragment, { children: [jsx("h4", __assign({ className: "fw-bold mt-2" }, { children: t("".concat(props.itemKey, ".profiles.title")) }), void 0), jsx("p", __assign({ className: "mb-1 text-grey-7" }, { children: t("".concat(props.itemKey, ".profiles.info")) }), void 0), jsx(EditBtn, __assign({ onClick: function () { return dispatch(dialogActions.openDialogWithoutPayload({ type: 'manageProfiles' })); } }, { children: t("".concat(props.itemKey, ".profiles.btn"), { count: currentUser.profiles.length }) }), void 0)] }, void 0);
24110
24112
  };
24111
- return (jsxs("div", __assign({ className: "border-primary border-top-2 pt-2" }, { children: [jsx("h2", { children: t("".concat(props.itemKey, ".title")) }, void 0), jsx("h4", __assign({ className: "fw-bold mt-2" }, { children: t("".concat(props.itemKey, ".email.title")) }), void 0), jsx("p", __assign({ className: "mb-1 text-grey-7" }, { children: t("".concat(props.itemKey, ".email.info")) }), void 0), jsx(EditBtn, __assign({ onClick: function () { return dispatch(dialogActions.openDialogWithoutPayload({ type: 'changeEmail' })); } }, { children: blurEmail(currentUser.account.accountId) }), void 0), jsxs("div", __assign({ className: "d-flex align-items-center mt-2" }, { children: [jsx("h4", __assign({ className: "fw-bold mb-0" }, { children: t("".concat(props.itemKey, ".phone.title")) }), void 0), phoneInfo && (phoneInfo.confirmedAt === undefined || !phoneInfo.confirmedAt || phoneInfo.confirmedAt === 0) && (jsx("span", __assign({ className: "badge bg-warning text-dark ms-2" }, { children: t("".concat(props.itemKey, ".phone.notConfirmed")) }), void 0)), phoneInfo && phoneInfo.confirmedAt && phoneInfo.confirmedAt > 0 && (jsxs("span", __assign({ className: "badge bg-success ms-2" }, { children: [jsx("i", { className: "fas fa-check me-1" }, void 0), t("".concat(props.itemKey, ".phone.confirmed"))] }), void 0))] }), void 0), phoneInfo ? (jsx("p", __assign({ className: "mb-1 text-grey-7" }, { children: t("".concat(props.itemKey, ".phone.info")) }), void 0)) : (jsx("p", __assign({ className: "mb-1 text-grey-7" }, { children: t("".concat(props.itemKey, ".phone.infoAdd")) }), void 0)), jsxs("div", __assign({ className: "m-0 d-flex align-items-center py-2" }, { children: [phoneInfo ? (jsxs(Fragment, { children: [jsx(EditBtn, __assign({ onClick: function () { return dispatch(dialogActions.openDialogWithoutPayload({ type: 'changePhone' })); } }, { children: blurPhone(phoneInfo.phone) }), void 0), (phoneInfo.confirmedAt === undefined || !phoneInfo.confirmedAt || phoneInfo.confirmedAt === 0) && (jsx(EditBtn, __assign({ onClick: handleResendCode, disabled: isResending, className: "ms-2" }, { children: isResending ? (jsxs(Fragment, { children: [jsx("span", { className: "spinner-border spinner-border-sm me-2", role: "status", "aria-hidden": "true" }, void 0), t("".concat(props.itemKey, ".phone.resending"), 'Invio...')] }, void 0)) : (jsxs(Fragment, { children: [jsx("i", { className: "fas fa-paper-plane me-2" }, void 0), t("".concat(props.itemKey, ".phone.resendBtn"), 'Invia di nuovo codice')] }, void 0)) }), void 0))] }, void 0)) : (jsx(EditBtn, __assign({ onClick: function () { return dispatch(dialogActions.openDialogWithoutPayload({ type: 'addPhone' })); } }, { children: t("".concat(props.itemKey, ".phone.btn")) }), void 0)), phoneInfo && (jsx("button", __assign({ className: "btn btn-danger-light ms-2", onClick: function () {
24113
+ return (jsxs("div", __assign({ className: "border-primary border-top-2 pt-2" }, { children: [jsx("h2", { children: t("".concat(props.itemKey, ".title")) }, void 0), jsx("h4", __assign({ className: "fw-bold mt-2" }, { children: t("".concat(props.itemKey, ".email.title")) }), void 0), jsx("p", __assign({ className: "mb-1 text-grey-7" }, { children: t("".concat(props.itemKey, ".email.info")) }), void 0), jsx(EditBtn, __assign({ onClick: function () { return dispatch(dialogActions.openDialogWithoutPayload({ type: 'changeEmail' })); } }, { children: blurEmail(currentUser.account.accountId) }), void 0), jsxs("div", __assign({ className: "d-flex align-items-center mt-2" }, { children: [jsx("h4", __assign({ className: "fw-bold mb-0" }, { children: t("".concat(props.itemKey, ".phone.title")) }), void 0), phoneInfo && (phoneInfo.confirmedAt === undefined || !phoneInfo.confirmedAt || phoneInfo.confirmedAt === 0) && (jsx("span", __assign({ className: "badge bg-warning text-dark ms-2" }, { children: t("".concat(props.itemKey, ".phone.notConfirmed")) }), void 0)), phoneInfo && phoneInfo.confirmedAt && phoneInfo.confirmedAt > 0 && (jsxs("span", __assign({ className: "badge bg-success ms-2" }, { children: [jsx("i", { className: "fas fa-check me-1" }, void 0), t("".concat(props.itemKey, ".phone.confirmed"))] }), void 0))] }), void 0), phoneInfo ? (jsx("p", __assign({ className: "mb-1 text-grey-7" }, { children: t("".concat(props.itemKey, ".phone.info")) }), void 0)) : (jsx("p", __assign({ className: "mb-1 text-grey-7" }, { children: t("".concat(props.itemKey, ".phone.infoAdd")) }), void 0)), jsxs("div", __assign({ className: "m-0 d-flex align-items-center py-2" }, { children: [phoneInfo ? (jsxs(Fragment, { children: [jsx(EditBtn, __assign({ onClick: function () { return dispatch(dialogActions.openDialogWithoutPayload({ type: 'changePhone' })); } }, { children: blurPhone(phoneInfo.phone) }), void 0), (phoneInfo.confirmedAt === undefined || !phoneInfo.confirmedAt || phoneInfo.confirmedAt === 0) && (jsx("button", __assign({ className: "btn btn-primary d-flex align-items-center ms-2", onClick: handleResendCode, disabled: isResending }, { children: isResending ? (jsxs(Fragment, { children: [jsx("span", { className: "spinner-border spinner-border-sm me-2", role: "status", "aria-hidden": "true" }, void 0), t("".concat(props.itemKey, ".phone.resending"), 'Invio...')] }, void 0)) : (jsxs(Fragment, { children: [t("".concat(props.itemKey, ".phone.resendBtn"), 'Invia di nuovo codice'), jsx("span", __assign({ className: "material-icons ms-1", style: { fontSize: 'inherit' } }, { children: "send" }), void 0)] }, void 0)) }), void 0))] }, void 0)) : (jsx(EditBtn, __assign({ onClick: function () { return dispatch(dialogActions.openDialogWithoutPayload({ type: 'addPhone' })); } }, { children: t("".concat(props.itemKey, ".phone.btn")) }), void 0)), phoneInfo && (jsx("button", __assign({ className: "btn btn-danger-light ms-2", onClick: function () {
24112
24114
  dispatch(dialogActions.openDialogWithoutPayload({ type: 'deletePhone' }));
24113
24115
  } }, { children: jsx("i", { className: "fas fa-trash text-grey-5" }, void 0) }), void 0))] }), void 0), resendMessage && (jsx("div", __assign({ className: "alert alert-".concat(resendMessage.type === 'success' ? 'success' : 'danger', " mt-2") }, { children: resendMessage.text }), void 0)), jsx("h4", __assign({ className: "fw-bold mt-2" }, { children: t("".concat(props.itemKey, ".password.title")) }), void 0), jsx("p", __assign({ className: "mb-1 text-grey-7" }, { children: t("".concat(props.itemKey, ".password.info")) }), void 0), jsx(EditBtn, __assign({ onClick: function () { return dispatch(dialogActions.openDialogWithoutPayload({ type: 'changePassword' })); } }, { children: "••••••••••••••" }), void 0), renderProfileSettings()] }), void 0));
24114
24116
  };