-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resending an invite should use the language setting the original invi…
…te was sent in
- Loading branch information
Showing
6 changed files
with
21 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
server/src/main/resources/db/mysql/migration/V28_0__invitation_language.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ALTER TABLE `invitations` ADD `language` VARCHAR(255) DEFAULT NULL; | ||
UPDATE `invitations` SET `language` = 'en'; | ||
ALTER TABLE `invitations` MODIFY `language` VARCHAR(255) NOT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -590,31 +590,31 @@ public void doSeed() { | |
Instant expiryDate = Instant.now().plus(14, ChronoUnit.DAYS); | ||
|
||
Invitation superUserInvitation = | ||
new Invitation(Authority.SUPER_USER, Authority.SUPER_USER.name(), "[email protected]", false, false, false, message, | ||
new Invitation(Authority.SUPER_USER, Authority.SUPER_USER.name(), "[email protected]", false, false, false, message, Language.en, | ||
inviter,expiryDate, roleExpiryDate, Set.of()); | ||
Invitation managerInvitation = | ||
new Invitation(Authority.MANAGER, Authority.MANAGER.name(), "[email protected]", false, false, false, message, | ||
new Invitation(Authority.MANAGER, Authority.MANAGER.name(), "[email protected]", false, false, false, message, Language.en, | ||
inviter, expiryDate,roleExpiryDate, Set.of(new InvitationRole(research))); | ||
Invitation inviterInvitation = | ||
new Invitation(Authority.INVITER, Authority.INVITER.name(), "[email protected]", false, false, true, message, | ||
new Invitation(Authority.INVITER, Authority.INVITER.name(), "[email protected]", false, false, true, message, Language.en, | ||
inviter, expiryDate,roleExpiryDate, Set.of(new InvitationRole(calendar), new InvitationRole(mail))); | ||
inviterInvitation.setEnforceEmailEquality(true); | ||
Invitation guestInvitation = | ||
new Invitation(Authority.GUEST, Authority.GUEST.name(), "[email protected]", | ||
false, false, false, message, | ||
false, false, false, message, Language.en, | ||
inviter, expiryDate,roleExpiryDate, Set.of(new InvitationRole(mail))); | ||
guestInvitation.setEduIDOnly(true); | ||
//To test graph callback | ||
guestInvitation.setSubInvitee(GUEST_SUB); | ||
|
||
Invitation institutionAdminInvitation = | ||
new Invitation(Authority.INSTITUTION_ADMIN, INSTITUTION_ADMIN_INVITATION_HASH, "[email protected]", | ||
false, false, false, message, | ||
false, false, false, message, Language.en, | ||
institutionAdmin, expiryDate, roleExpiryDate, Set.of(new InvitationRole(network))); | ||
|
||
Invitation graphInvitation = | ||
new Invitation(Authority.GUEST, GRAPH_INVITATION_HASH, "[email protected]", | ||
false, false, false, message, | ||
false, false, false, message, Language.en, | ||
inviter,expiryDate, roleExpiryDate, Set.of(new InvitationRole(network))); | ||
doSave(invitationRepository, superUserInvitation, managerInvitation, inviterInvitation, guestInvitation, | ||
institutionAdminInvitation, graphInvitation); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ class InvitationTest extends WithApplicationTest { | |
void constructorWithoutDefaults() { | ||
Role role = new Role("mail", "description", application( "1", EntityType.SAML20_SP), 30, false, false); | ||
|
||
Invitation invitation = new Invitation(Authority.GUEST, "hash", "[email protected]", false, false, false, "Please join..", new User(), | ||
Invitation invitation = new Invitation(Authority.GUEST, "hash", "[email protected]", false, false, false, "Please join..", Language.en, new User(), | ||
null, Instant.now().plus(30, ChronoUnit.DAYS), | ||
Set.of(new InvitationRole(role))); | ||
|
||
|
@@ -29,7 +29,7 @@ void constructorWithoutDefaults() { | |
void constructorWithDefaults() { | ||
Role role = new Role("mail", "description", application( "1", EntityType.SAML20_SP), null, false, false); | ||
|
||
Invitation invitation = new Invitation(Authority.MANAGER, "hash", "[email protected]", false, false, false, "Please join..", new User(), | ||
Invitation invitation = new Invitation(Authority.MANAGER, "hash", "[email protected]", false, false, false, "Please join..", Language.en, new User(), | ||
null, null, Set.of(new InvitationRole(role))); | ||
assertEquals(13, Instant.now().until(invitation.getExpiryDate(), ChronoUnit.DAYS)); | ||
assertNull(invitation.getRoleExpiryDate()); | ||
|
@@ -39,7 +39,8 @@ void constructorWithDefaults() { | |
void roleExpiryDate() { | ||
Role role = new Role("mail", "description", application("1", EntityType.SAML20_SP), 30, false, false); | ||
|
||
Invitation invitation = new Invitation(Authority.GUEST, "hash", "[email protected]", false, false, false, "Please join..", new User(), | ||
Invitation invitation = new Invitation(Authority.GUEST, "hash", "[email protected]", | ||
false, false, false, "Please join..", Language.en, new User(), | ||
null, null, | ||
Set.of(new InvitationRole(role))); | ||
|
||
|