diff --git a/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/client/resources/PerunRegistrarTranslation.java b/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/client/resources/PerunRegistrarTranslation.java index c5e7e5ad..0ec7f087 100644 --- a/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/client/resources/PerunRegistrarTranslation.java +++ b/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/client/resources/PerunRegistrarTranslation.java @@ -50,13 +50,13 @@ public interface PerunRegistrarTranslation extends PerunTranslation { @DefaultMessage("Email verification needed") public String emailVerificationNeededTitle(); - @DefaultMessage("You have successfully extend your membership") + @DefaultMessage("You have successfully extended your membership") public String extendTitleAutoApproval(); // MESSAGES @DefaultMessage("Please check your mailbox {0} and click the link to verify your email address. " + - "Without verification it is not possible to approve your application.") + "Your membership application is pending until then.") public String verifyMail(String mail); @DefaultMessage("Please wait until your application has been approved. You will be notified by email.") @@ -74,9 +74,12 @@ public interface PerunRegistrarTranslation extends PerunTranslation { @DefaultMessage("After acceptation you will become member of \"{0}\" automatically.") String waitForVoExtension(String groupName); - @DefaultMessage("You are now a member of {0}.") + @DefaultMessage("You became a member of {0}. It can take several minutes before you can access all services. You may close this window now.") public String registered(String voOrGroupName); + @DefaultMessage("You became a member of {0}. It can take several minutes before you can access all services.") + public String registeredRedirect(String voOrGroupName); + @DefaultMessage("Your membership in {0} is valid now.") public String extended(String voOrGroupName); @@ -109,7 +112,7 @@ public interface PerunRegistrarTranslation extends PerunTranslation { @DefaultMessage("<i>User don`t have identity suitable for automatic joining. If it`s you, <b>please contact support at: <a href=\"mailto:{0}\">{0}</a></b>.</i>") public String noIdentityForJoining(String mailAddress); - @DefaultMessage("Please wait, redirecting you back to the service ...") + @DefaultMessage("Please wait, we will redirect you to the next page in several seconds ...") public String redirectingBackToService(); @@ -404,7 +407,7 @@ public interface PerunRegistrarTranslation extends PerunTranslation { @DefaultMessage("The preapproved invitation you have received is in an invalid state.") public String InvalidInvitationStatus(); - @DefaultMessage("The preapproved invitation you have received has already been accepted.") + @DefaultMessage("This invitation was accepted. If you have problem with access, try waiting for a few minutes. If the problem persists, contact support.") public String InvalidInvitationStatusAccepted(); @DefaultMessage("The preapproved invitation you have received is expired.") @@ -413,10 +416,10 @@ public interface PerunRegistrarTranslation extends PerunTranslation { @DefaultMessage("The preapproved invitation you have received is revoked.") public String InvalidInvitationStatusRevoked(); - @DefaultMessage("The preapproved invitation you have received has been deleted.") + @DefaultMessage("This invitation was not found in the system. Ask the sender to send new invitation or contact support.") public String InvitationNotExists(); - @DefaultMessage("There is a mismatch between the group you were invited to and the group you are applying to. Please contact your administrator.") + @DefaultMessage("This invitation cannot be used because it is for another group. Ask the sender to send new invitation or contact support.") public String InvitationWrongGroup(); @DefaultMessage("Application to {0} has been submitted, but not approved automatically, due to unexpected error. Your administrator has been informed and he will deal with it.") diff --git a/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/pages/steps/SummaryStep.java b/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/pages/steps/SummaryStep.java index 2ac02315..2e83060a 100644 --- a/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/pages/steps/SummaryStep.java +++ b/perun-wui-registrar/src/main/java/cz/metacentrum/perun/wui/registrar/pages/steps/SummaryStep.java @@ -64,6 +64,7 @@ public class SummaryStep implements Step { private boolean exceptionDisplayed = false; private String redirectTo = null; + private boolean redirectPresent; private ListGroupItem verifyMail; private ListGroup messages; private Heading title; @@ -71,6 +72,10 @@ public class SummaryStep implements Step { public SummaryStep(FormView formView) { this.formView = formView; this.translation = formView.getTranslation(); + String redirectFromInvitation = formView.getForm().getInvitation() != null ? + formView.getForm().getInvitation().getRedirectUrl() : null; + String redirectFromUrlNew = Window.Location.getParameter(TARGET_NEW); + this.redirectPresent = redirectFromUrlNew != null || redirectFromInvitation != null; } @Override @@ -120,7 +125,9 @@ private void caseVoInit(Summary summary, Heading title, ListGroup messages) { if (res.hasAutoApproval()) { title.add(new Text(" "+translation.initTitleAutoApproval())); - msg.setText(translation.registered(res.getBean().getName())); + msg.setText(redirectPresent ? + translation.registeredRedirect(res.getBean().getName()) : + translation.registered(res.getBean().getName())); } else { title.add(new Text(" "+translation.initTitle())); msg.setText(translation.waitForAcceptation()); @@ -265,7 +272,9 @@ private void caseGroupInit(Summary summary, Heading title, ListGroup messages) { msg.setText(translation.waitForVoAcceptation(((Group) res.getBean()).getShortName())); } else { title.add(new Text(" " + translation.initTitleAutoApproval())); - msg.setText(translation.registered(((Group) res.getBean()).getShortName())); + msg.setText(redirectPresent ? + translation.registeredRedirect(((Group) res.getBean()).getShortName()) : + translation.registered(((Group) res.getBean()).getShortName())); } } else { title.add(new Text(" " + translation.initTitle())); @@ -452,7 +461,9 @@ private void caseVoInitGroupInit(Summary summary, Result resultVo, Result result ListGroupItem msg = new ListGroupItem(); if (resultVo.hasAutoApproval()) { - msg.setText(translation.registered(resultVo.getBean().getName())); + msg.setText(redirectPresent ? + translation.registeredRedirect(resultVo.getBean().getName()) : + translation.registered(resultVo.getBean().getName())); } else { // Message from group application is sufficient in this case. } @@ -492,7 +503,9 @@ private void caseVoInitGroupInit(Summary summary, Result resultVo, Result result if (resultGroup.hasAutoApproval()) { if (resultVo.hasAutoApproval()) { title.add(new Text(" " + translation.initTitleAutoApproval())); - msg.setText(translation.registered(((Group) resultGroup.getBean()).getShortName())); + msg.setText(redirectPresent ? + translation.registeredRedirect(((Group) resultGroup.getBean()).getShortName()) : + translation.registered(((Group) resultGroup.getBean()).getShortName())); } else { title.add(new Text(" " + translation.initTitle())); msg.setText(translation.waitForVoAcceptation(((Group) resultGroup.getBean()).getShortName())); @@ -588,7 +601,9 @@ private void caseVoExtGroupInit(Summary summary, Heading title, ListGroup messag if (resultGroup.hasAutoApproval()) { if (resultVo.hasAutoApproval()) { // FIXME - tohle by se mělo vyhodnotit z předchozího stavu (není auto nebo byla chyba) title.add(new Text(" "+translation.initTitleAutoApproval())); - msg.setText(translation.registered(((Group) resultGroup.getBean()).getShortName())); + msg.setText(redirectPresent ? + translation.registeredRedirect(((Group) resultGroup.getBean()).getShortName()) : + translation.registered(((Group) resultGroup.getBean()).getShortName())); } else { title.add(new Text(" "+translation.initTitle())); msg.setText(translation.waitForVoExtension(((Group) resultGroup.getBean()).getShortName())); diff --git a/perun-wui-registrar/src/main/resources/cz/metacentrum/perun/wui/registrar/client/resources/PerunRegistrarTranslation_cs.properties b/perun-wui-registrar/src/main/resources/cz/metacentrum/perun/wui/registrar/client/resources/PerunRegistrarTranslation_cs.properties index 7d327c89..9298a582 100644 --- a/perun-wui-registrar/src/main/resources/cz/metacentrum/perun/wui/registrar/client/resources/PerunRegistrarTranslation_cs.properties +++ b/perun-wui-registrar/src/main/resources/cz/metacentrum/perun/wui/registrar/client/resources/PerunRegistrarTranslation_cs.properties @@ -23,13 +23,14 @@ extendTitleAutoApproval=Úspěšně jste prodloužil členství # // MESSAGES -verifyMail=Prosím zkontrolujte si poštovní schránku {0} a ověřte Vaši e-mailovou adresu. Bez ověření není možné Vaši žádost schválit. +verifyMail=Prosím zkontrolujte si poštovní schránku {0} a ověřte Vaši e-mailovou adresu. Vaše žádost o členství bude do té doby čekajíci. waitForAcceptation=Prosím vyčkejte dokud administrátor neschválí Vaši žádost. O schválení nebo zamítnutí budete informován e-mailem. seeOrEditApplicationHere=<p><p>Přihlášku si můžete <b>zkontrolovat nebo upravit <a href="{0}#appdetail;id={1}">zde</b></a>. waitForExtAcceptation=Prosím vyčkejte dokud administrátor neschválí Vaši žádost o prodloužení. O schválení nebo zamítnutí budete informován e-mailem. waitForVoAcceptation=Po schválení se stanete členem "{0}" automaticky. waitForVoExtension=Po schválení se stanete členem "{0}" automaticky. -registered=Od teď jste členem {0}. +registered=Od teď jste členem {0}. Může to trvat několik minut, než získáte přístup ke všem službám. Toto okno můžete nyní zavřít. +registeredRedirect=Od teď jste členem {0}. Může to trvat několik minut, než získáte přístup ke všem službám. extended=Vaše členství v {0} bylo prodlouženo a je platné. groupFailedAlreadyApplied=Vypadá to, že chcete požádat o členství ve skupině {0}, ale už jste o něj zažádal. groupFailedAlreadyRegistered=Vypadá to, že chcete požádat o členství ve skupině {0}, ale už jste členem. @@ -43,7 +44,7 @@ offerMembershipExtensionMessage=Vaše členství v <b>{0}</b> vypršelo nebo zan offerMembershipExtensionNoThanks=Děkuji, nechci offerMembershipExtensionExtend=Prodloužit noIdentityForJoining=<i>Uživatel nemá identitu vhodnou pro automatické sloučení. Jestli jste to vy, <b>kontaktujte podporu na <a href="mailto:{0}">{0}</a></b>.</i> -redirectingBackToService=Prosím počkejte, probíhá přesměrování zpět na službu ... +redirectingBackToService=Prosím počkejte, za několik sekund vás přesměrujeme zpět na službu ... # // -------------- REGISTRATION FORM WIDGETS ------------------------ // @@ -153,11 +154,11 @@ applicationNotCreatedBecauseLogin=Žádost nemohla být vytvořena. Pravděpodob applicationNotCreated=Žádost nemohla být vytvořena. registrarException=Vaše přihláška do {0} byla odeslána, ale nastala neočekávaná chyba. Váš administrátor byl informován e-mailem a bude chybu řešit. InvalidInvitationStatus=Předschválená pozvánka, kterou jste obdrželi, již není platná. -InvalidInvitationStatusAccepted=Předschválená pozvánka, kterou jste obdrželi, již byla přijmuta. +InvalidInvitationStatusAccepted=Tato předschválená pozvánka již byla přijmuta. Pokud máte problém s přístupem, zkuste několik minut počkat. Pokud problém přetrvává, kontaktujte podporu. InvalidInvitationStatusExpired=Platnost předschválené pozvánky, kterou jste obdrželi, vypršela. InvalidInvitationStatusRevoked=Předschválená pozvánka, kterou jste obdrželi, byla zrušena. -InvitationNotExists=Předschválená pozvánka, kterou jste obdrželi, byla smazána. -InvitationWrongGroup=Skupina, do které jste byli pozváni, se liší od skupiny, do které se snažíte zaregistrovat. Obraťte se prosím na svého správce. +InvitationNotExists=Tato předschválená pozvánka nebyla nalezena v systému. Požádejte odesílatele o zaslání nové pozvánky nebo kontaktujte podporu. +InvitationWrongGroup=Tuto pozvánku nelze použít, protože je určena pro jinou skupinu. Požádejte odesílatele o zaslání nové pozvánky nebo kontaktujte podporu. cantBeApproved=Vaše přihláška do {0} byla podána, ale nemohla být automaticky schválena, protože nastala neočekávaná chyba. Váš administrátor byl informován e-mailem a bude chybu řešit. unableToSubmit=Formulář nelze odeslat cantSubmitLoA=Nelze podat přihlášku