-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#790 members einladen #793
Merged
janikEndtner
merged 23 commits into
multitenancy_main
from
feature/790_members_einladen
May 31, 2024
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
87ca431
#790 create dialog to invite members
janikEndtner 13cbb67
[FM] Automated formating frontend
actions-user 4e03df3
#790 format
janikEndtner 6927b65
#790 create backend methods to create users
janikEndtner b31995c
#790 call backend when creating users
janikEndtner 540b106
Merge remote-tracking branch 'origin/feature/790_members_einladen' in…
janikEndtner e411790
[FM] Automated formating backend
actions-user 74a46a3
#790 add cypress tests
janikEndtner 3f0019b
Merge remote-tracking branch 'origin/feature/790_members_einladen' in…
janikEndtner edcbf1c
#790 fix frontend tests
janikEndtner e3acf21
#790 fix column width of new-user columns
janikEndtner cd4beac
#790 some minor changes from review
janikEndtner e281ca8
#790 change form to reactiveForm for better validation
janikEndtner 57fcf1a
[FM] Automated formating frontend
actions-user b42d808
#790 fix frontend unit tests
janikEndtner e04fea1
Merge remote-tracking branch 'origin/feature/790_members_einladen' in…
janikEndtner 15c1024
[FM] Automated formating frontend
actions-user b081bfe
#790 improve email validation
janikEndtner b609505
#790 fix padding in input fields
janikEndtner ed8655f
Merge remote-tracking branch 'origin/feature/790_members_einladen' in…
janikEndtner 088f785
Merge remote-tracking branch 'origin/multitenancy_main' into feature/…
janikEndtner 7f86c70
Merge branch 'multitenancy_main' into feature/790_members_einladen
janikEndtner 419b424
#790 fix test error messages
janikEndtner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package ch.puzzle.okr.dto; | ||
|
||
public record NewUserDto(String firstname, String lastname, String email) { | ||
} |
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
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
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 |
---|---|---|
|
@@ -141,6 +141,50 @@ describe('Team management tests', () => { | |
}); | ||
}); | ||
|
||
describe('invite members', () => { | ||
it('invite two members', () => { | ||
const mailUserClaudia = uniqueSuffix('claudia.meier@test') + '.ch'; | ||
const mailUserStefan = uniqueSuffix('stefan.schmidt@test') + '.ch'; | ||
const firstNameClaudia = uniqueSuffix('Claudia'); | ||
const firstNameStefan = uniqueSuffix('Stefan'); | ||
|
||
cy.getByTestId('invite-member').click(); | ||
fillOutNewUser(firstNameClaudia, 'Meier', mailUserClaudia); | ||
cy.tabForward(); | ||
cy.tabForward(); | ||
cy.realPress('Enter'); | ||
fillOutNewUser(firstNameStefan, 'Schmidt', mailUserStefan); | ||
cy.tabForward(); | ||
cy.tabForward(); | ||
cy.realPress('Enter'); | ||
|
||
// test error messages | ||
fillOutNewUser('Robin', '', 'papierer'); | ||
cy.getByTestId('invite').click(); | ||
cy.contains('Angabe benötigt'); | ||
cy.contains('E-Mail ungültig'); | ||
cy.getByTestId('email-col_2').focus(); | ||
cy.realType('@puzzle.ch'); | ||
cy.contains('E-Mail ungültig').should('not.exist'); | ||
cy.contains('E-Mail existiert bereits'); | ||
cy.tabBackward(); | ||
cy.realType('Papirer'); | ||
cy.contains('Angabe benötigt').should('not.exist'); | ||
|
||
// delete last entry | ||
cy.tabForward(); | ||
cy.tabForward(); | ||
cy.realPress('Enter'); | ||
cy.contains('[email protected]').should('not.exist'); | ||
|
||
// save | ||
cy.getByTestId('invite').click(); | ||
cy.contains('Die Members wurden erfolgreich registriert'); | ||
cy.contains(firstNameClaudia); | ||
cy.contains(firstNameStefan); | ||
}); | ||
}); | ||
|
||
it('Navigate to Bobs profile and add him to BBT and LoremIpsum', () => { | ||
cy.intercept('PUT', '**/updateaddteammembership/*').as('updateEsha'); | ||
|
||
|
@@ -202,7 +246,7 @@ describe('Team management tests', () => { | |
cy.getByTestId('edit-okr-champion-checkbox').click(); | ||
cy.getByTestId('edit-okr-champion-readonly').contains('OKR Champion:'); | ||
cy.getByTestId('edit-okr-champion-readonly').contains('Ja'); | ||
cy.contains('Der User wurde erfolgreich aktualisiert.'); | ||
cy.contains('Der Member wurde erfolgreich aktualisiert.'); | ||
|
||
// reset okr champion to false | ||
cy.getByTestId('edit-okr-champion-edit').click(); | ||
|
@@ -362,3 +406,11 @@ function navigateToUser(userName: string) { | |
cy.get('td').contains(userName).click(); | ||
cy.wait('@getUser'); | ||
} | ||
|
||
function fillOutNewUser(firstname: string, lastname: string, email: string) { | ||
cy.realType(firstname, { delay: 1 }); | ||
cy.tabForward(); | ||
cy.realType(lastname, { delay: 1 }); | ||
cy.tabForward(); | ||
cy.realType(email, { delay: 1 }); | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface NewUser { | ||
firstname: string; | ||
lastname: string; | ||
email: string; | ||
} |
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,5 @@ | ||
export interface NewUserForm<T> { | ||
firstname: T; | ||
email: T; | ||
lastname: T; | ||
} |
41 changes: 41 additions & 0 deletions
41
frontend/src/app/team-management/invite-user-dialog/invite-user-dialog.component.html
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,41 @@ | ||
<section mat-dialog-title> | ||
<div class="d-flex justify-content-between align-items-center position-relative dialog-header mt-1"> | ||
<span class="title w-100 mb-2"> | ||
<span>Members registrieren</span> | ||
</span> | ||
</div> | ||
</section> | ||
<mat-dialog-content> | ||
<div class="dialog-content" tabindex="-1"> | ||
<form> | ||
@for (userFormGroup of form.controls; track $index) { | ||
<div class="w-100 d-flex justify-content-between align-items-center pe-4"> | ||
<app-new-user | ||
(removeUser)="removeUser($index)" | ||
[index]="$index" | ||
[userFormGroup]="userFormGroup" | ||
[triedToSubmit]="triedToSubmit" | ||
></app-new-user> | ||
</div> | ||
} | ||
<div class="w-100 d-flex justify-content-start"> | ||
<button (click)="addUser()" class="px-0 mb-3 pe-2 align-new-icon" color="primary" mat-button> | ||
<span class="d-flex align-items-center fw-bold add-text"> | ||
<img alt="Add User button" class="add-cross-button" src="/assets/icons/new-icon.svg" /> | ||
Weiterer Member hinzufügen | ||
janikEndtner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</span> | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
</mat-dialog-content> | ||
<mat-dialog-actions> | ||
<div class="d-flex justify-content-between p-0 mt-2" mat-dialog-actions> | ||
<div class="d-flex p-0"> | ||
<button color="primary" [attr.data-testId]="'invite'" mat-flat-button type="submit" (click)="registerUsers()"> | ||
Einladen | ||
</button> | ||
<button color="primary" mat-button mat-dialog-close class="ms-2">Abbrechen</button> | ||
</div> | ||
</div> | ||
</mat-dialog-actions> |
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to add a test for the new user to log-in after registering, to verify the first or last name got updated and the assignment via email works? (Debatable, might be much effort to do)