This repository has been archived by the owner on Apr 24, 2022. It is now read-only.
forked from TEAMMATES/teammates
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TEAMMATES#11655] Devise a better way to handle duplicate account req…
…uests (TEAMMATES#11657)
- Loading branch information
1 parent
489106f
commit cafe194
Showing
39 changed files
with
1,317 additions
and
54 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
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,55 @@ | ||
{ | ||
"accounts": { | ||
"AHome.instructor1OfCourse1": { | ||
"googleId": "tm.e2e.AHome.inst1", | ||
"name": "Teammates Instr1", | ||
"isInstructor": true, | ||
"email": "AHome.instr1@gmail.tmt", | ||
"institute": "TEAMMATES Test Institute 1" | ||
} | ||
}, | ||
"accountRequests": { | ||
"AHome.instructor1OfCourse1": { | ||
"name": "Teammates Instr1", | ||
"email": "AHome.instr1@gmail.tmt", | ||
"institute": "TEAMMATES Test Institute 1", | ||
"createdAt": "2011-01-01T00:00:00Z", | ||
"registeredAt": "1970-02-14T00:00:00Z" | ||
} | ||
}, | ||
"courses": { | ||
"AHome.typicalCourse1": { | ||
"createdAt": "2012-03-20T23:59:00Z", | ||
"id": "tm.e2e.AHome.course1", | ||
"name": "Typical Course 1", | ||
"institute": "TEAMMATES Test Institute 1", | ||
"timeZone": "Africa/Johannesburg" | ||
} | ||
}, | ||
"instructors": { | ||
"AHome.instructor1OfCourse1": { | ||
"googleId": "tm.e2e.AHome.inst1", | ||
"courseId": "tm.e2e.AHome.course1", | ||
"name": "Teammates Instr1", | ||
"email": "AHome.instr1@gmail.tmt", | ||
"isArchived": false, | ||
"role": "Co-owner", | ||
"isDisplayedToStudents": true, | ||
"displayedName": "Instructor", | ||
"privileges": { | ||
"courseLevel": { | ||
"canModifyCourse": true, | ||
"canModifyInstructor": true, | ||
"canModifySession": true, | ||
"canModifyStudent": true, | ||
"canViewStudentInSections": true, | ||
"canViewSessionInSections": true, | ||
"canSubmitSessionInSections": true, | ||
"canModifySessionCommentsInSections": true | ||
}, | ||
"sectionLevel": {}, | ||
"sessionLevel": {} | ||
} | ||
} | ||
} | ||
} |
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
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,23 @@ | ||
package teammates.ui.output; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import teammates.common.datatransfer.attributes.AccountAttributes; | ||
|
||
/** | ||
* The API output format of a list of accounts. | ||
*/ | ||
public class AccountsData extends ApiOutput { | ||
|
||
private List<AccountData> accounts; | ||
|
||
public AccountsData(List<AccountAttributes> accountAttributes) { | ||
this.accounts = accountAttributes.stream().map(AccountData::new).collect(Collectors.toList()); | ||
} | ||
|
||
public List<AccountData> getAccounts() { | ||
return accounts; | ||
} | ||
|
||
} |
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,25 @@ | ||
package teammates.ui.webapi; | ||
|
||
import java.util.List; | ||
|
||
import teammates.common.datatransfer.attributes.AccountAttributes; | ||
import teammates.common.util.Const; | ||
import teammates.common.util.SanitizationHelper; | ||
import teammates.ui.output.AccountsData; | ||
|
||
/** | ||
* Gets all accounts with the given email. | ||
*/ | ||
class GetAccountsAction extends AdminOnlyAction { | ||
|
||
@Override | ||
public JsonResult execute() { | ||
String email = getNonNullRequestParamValue(Const.ParamsNames.USER_EMAIL); | ||
email = SanitizationHelper.sanitizeEmail(email); | ||
|
||
List<AccountAttributes> accounts = logic.getAccountsForEmail(email); | ||
|
||
return new JsonResult(new AccountsData(accounts)); | ||
} | ||
|
||
} |
Oops, something went wrong.