Web: Fixed registration form if the user received an invitation by email.

This commit is contained in:
Tatiana Lopaeva 2024-02-22 15:04:50 +03:00
parent 1125472aad
commit 508833e20c
4 changed files with 15 additions and 12 deletions

View File

@ -27,6 +27,7 @@
"SetAppDescription": "Two-factor authentication is enabled. Configure your authenticator app to continue working in the DocSpace. You can use Google Authenticator for <1>Android</1> and <4>iOS</4> or Authenticator for <8>Windows Phone</8>.", "SetAppDescription": "Two-factor authentication is enabled. Configure your authenticator app to continue working in the DocSpace. You can use Google Authenticator for <1>Android</1> and <4>iOS</4> or Authenticator for <8>Windows Phone</8>.",
"SetAppInstallDescription": "To connect the app, scan the QR code or manually enter your secret key <1>{{ secretKey }}</1>, and then enter a 6-digit code from your app in the field below.", "SetAppInstallDescription": "To connect the app, scan the QR code or manually enter your secret key <1>{{ secretKey }}</1>, and then enter a 6-digit code from your app in the field below.",
"SetAppTitle": "Configure your authenticator application", "SetAppTitle": "Configure your authenticator application",
"SignUp": "Sign up",
"SuccessDeactivate": "Your account has been successfully deactivated. In 10 seconds you will be redirected to the <1>site</1>.", "SuccessDeactivate": "Your account has been successfully deactivated. In 10 seconds you will be redirected to the <1>site</1>.",
"SuccessReactivate": "Your account has been successfully reactivated. In 10 seconds you will be redirected to the <1>portal</1>.", "SuccessReactivate": "Your account has been successfully reactivated. In 10 seconds you will be redirected to the <1>portal</1>.",
"SuccessRemoved": "Your account has been successfully removed. In 10 seconds you will be redirected to the <1>site</1>.", "SuccessRemoved": "Your account has been successfully removed. In 10 seconds you will be redirected to the <1>site</1>.",

View File

@ -132,14 +132,14 @@ export const RegisterContainer = styled.div`
p{ p{
text-align: center; text-align: center;
} }
.sign-in-container { .back-sign-in-container {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative; position: relative;
margin-bottom: 16px; margin-bottom: 16px;
p:first-child { .back-button {
position: absolute; position: absolute;
max-width: 60px; max-width: 60px;
text-overflow: ellipsis; text-overflow: ellipsis;

View File

@ -52,19 +52,21 @@ const DEFAULT_PORTAL_TEXT =
const DEFAULT_CREATION_TEXT = const DEFAULT_CREATION_TEXT =
"A DocSpace account will be created for {{email}}. Please, complete your registration:"; "A DocSpace account will be created for {{email}}. Please, complete your registration:";
const RegistrationFormGreeting = ({ email, t, setRegistrationForm }) => { const RegistrationFormGreeting = ({ email, t, setRegistrationForm, type }) => {
const onClickBack = () => { const onClickBack = () => {
setRegistrationForm(false); setRegistrationForm(false);
}; };
return ( return (
<div className="greeting-container"> <div className="greeting-container">
<div className="sign-in-container"> <div className="back-sign-in-container">
<Text fontWeight={600} onClick={onClickBack}> {type === "LinkInvite" && (
{t("Back")} <Text fontWeight={600} onClick={onClickBack} className="back-button">
</Text> {t("Back")}
</Text>
)}
<Text fontWeight={600} fontSize={"16px"}> <Text fontWeight={600} fontSize={"16px"}>
{t("Common:LoginButton")} {t("SignUp")}
</Text> </Text>
</div> </div>
<Text> <Text>
@ -472,7 +474,7 @@ const CreateUserForm = (props) => {
<ConfirmContainer> <ConfirmContainer>
<GreetingContainer> <GreetingContainer>
<DocspaceLogo className="docspace-logo" /> <DocspaceLogo className="docspace-logo" />
{showGreeting && ( {showGreeting && linkData.type === "LinkInvite" && (
<div className="tooltip"> <div className="tooltip">
<Text fontSize="16px"> <Text fontSize="16px">
<Trans <Trans
@ -558,6 +560,7 @@ const CreateUserForm = (props) => {
email={email} email={email}
t={t} t={t}
setRegistrationForm={setRegistrationForm} setRegistrationForm={setRegistrationForm}
type={linkData.type}
/> />
<FieldContainer <FieldContainer
className="form-field" className="form-field"
@ -671,7 +674,7 @@ const CreateUserForm = (props) => {
label={ label={
isLoading isLoading
? t("Common:LoadingProcessing") ? t("Common:LoadingProcessing")
: t("LoginRegistryButton") : t("SignUp")
} }
tabIndex={1} tabIndex={1}
isDisabled={isLoading} isDisabled={isLoading}

View File

@ -61,7 +61,6 @@ const Login: React.FC<ILoginProps> = ({
useEffect(() => { useEffect(() => {
if (search) { if (search) {
const encodeString = search.slice(search.indexOf("=") + 1); const encodeString = search.slice(search.indexOf("=") + 1);
const decodeString = atob(encodeString); const decodeString = atob(encodeString);
@ -200,7 +199,7 @@ const Login: React.FC<ILoginProps> = ({
ssoSVG: SSOIcon, ssoSVG: SSOIcon,
} }
: {}; : {};
console.log("invitationLinkData.type", invitationLinkData.type);
return ( return (
<LoginFormWrapper <LoginFormWrapper
id="login-page" id="login-page"