-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[#13066] Combine Admin Add Account Request Flow into Instructor Account Request Flow #13124
base: master
Are you sure you want to change the base?
[#13066] Combine Admin Add Account Request Flow into Instructor Account Request Flow #13124
Conversation
Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢 |
Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢 |
1 similar comment
Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢 |
Folks, This PR seems to be stalling (no activities for the past 9 days). 🐌 😢 |
Folks, This PR seems to be stalling (no activities for the past 8 days). 🐌 😢 |
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.
LGTM
@Andy-W-Developer is the PR done? or isit still on going. Your current changes LGTM |
@mingyuanc Yes this PR is done, if there's anything else that could be added, let me know, thanks. |
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.
Sorry for getting to this so late, thanks a lot of taking this issue on, it definitely isn't a small one to handle. I think some changes need to be made, please review the comments and let us know if you need any assistance
@@ -34,16 +34,6 @@ public void testAll() { | |||
|
|||
homePage.queueInstructorForAdding(singleLineDetails); | |||
|
|||
homePage.addAllInstructors(); |
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.
As part of our migration to SQL, please keep the E2E tests the same as its non-SQL counterpart as much as possible. The logic here does not represent the same logic in src/e2e/java/teammates/e2e/cases/AdminHomePageE2ETest.java
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.
Both tests use the same logic now, the page reload was removed because fetchAccountRequests()
makes it unnecessary.
instructorInstitution: instructorDetailSplit[2], | ||
}; | ||
|
||
this.accountService.createAccountRequest(requestData) |
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.
This batch processing needs better error handling, this implementation essentially ignores any errors. I understand that this is for the first input form. Perhaps a better way to do this is push back to the invalid lines upon error and show an error toast to indicate that the creation of certain requests. Note that requests may fail for different reasons too (duplicate email, invalid email etc.)
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.
It now on error, pushes the line to invalidLines
, rejoins invalidLines
then shows an error toast.
} | ||
|
||
public String getMessageForInstructor(int i) { | ||
By by = By.id("message-instructor-" + i); | ||
public String getToastTextContent() { |
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.
There should be a method (i think its named verifyStatusMessage
) in the superclass AppPage
to verify the toast contents. I'd suggest using that method as it has a retry mechanism
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.
Switched over to verifyStatusMessage, thanks.
this.accountService.createAccountRequest(requestData) | ||
.subscribe({ | ||
next: () => { | ||
this.fetchAccountRequests(); |
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.
This makes an API call for each account request, I think you can just call this once at the end of the entire loop after all requests are processed, since this is a batch creation feature anyway
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.
I ran into an issue where the account requests are not updated if the fetch is moved outside of the subscribe, I'm assuming because the API call is not instant - logging seemed to show that was happening.
What is the recommended way of waiting for the requests to finish before moving onto the next statement?
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.
- Moved
createAccountRequest()
into a promise and push to an array of promises - Moved
fetchAccountRequests()
into an allSettled thenable.
assertTrue(successMessage.contains( | ||
"Instructor \"AHPUiT Instrúctör WithPlusInEmail\" has been successfully created")); | ||
|
||
String failureMessage = homePage.getMessageForInstructor(1); |
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.
Try not to remove this negative test case
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.
I've added back an error toast for when a single line request has an invalid email under validateAndAddInstructorDetails
, it works when I add a request manually but when running the e2e test, no toast is shown.
A toast made by the approve account button - under the account request table still works, any ideas why on this is happening?
https://github.com/user-attachments/assets/c985d4dd-5a51-4ca0-90e1-67ee7e48197a
I've tried rerunning the e2e tests after deleting all the postgres data and remaking all docker containers.
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.
The issue was user error, I forgot to build the front-end files after editing.
I've added back in the negative test case with a updated error message.
@domoberzin Mostly ready for review. I need help with the I've tried looking into finalize but don't think it'll work unless A less than ideal way could be to move the account requests into a separate list and for loop then have an if statement inside Let me know your thoughts, thanks. |
@Andy-W-Developer could you look into why the SQL tests are failing first before we review? |
Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢 |
Sorry for the late update. The previously failing test in InstructorNotificationsPageE2ETest might be unrelated. I rewrote The component tests are failing because changes to I'm looking into why, after mocking the observables, the code inside the subscribe doesn't seem to run or only partially run. |
Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢 |
@mingyuanc Ready for review. |
Folks, This PR seems to be stalling (no activities for the past 9 days). 🐌 😢 |
Fixes #13066
Outline of Solution
The "Add Instructor" and "Add Instructors" buttons now create account requests and pushes them to accountReqs for account-request-table to manage.
Removed the results table, some related functions and tests.
Changed remaining tests to reflect the changes.
Adding, removing and editing is now handled by account-request-table.
new_account_request_test.mp4