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
[#9255] Migrate Instructor Course Student Details Edit page to Angular #9301
[#9255] Migrate Instructor Course Student Details Edit page to Angular #9301
Conversation
@tanhengyeow see if you can build the front-end on top of instructor course student details page instead (already migrated thanks to @tran-tien-dat's good work). |
@wkurniawan07 AFAIK the current instructor course student details page is just a static page showing the student details with no functionality for edits. The different user flow for instructor course student details edit is as follow:
Are you suggesting towards the idea of not having a separate edit page but instead allow edits on instructor course student details page? If that's the case, we need to take note to discontinue the "Edit" button for the current user flow I've mentioned above. |
0ebd603
to
7060a1b
Compare
Is it too hard to do? The way I see it, it would in fact make your life a lot easier, but I could be wrong on it. Or alternatively you could just migrate it as is and we can take a look later on whether to merge it. |
8a04183
to
ceb9e1d
Compare
@wkurniawan07 Ready for review. PR description is updated with the summary of the changes. |
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.
Mostly good work! Some changes requested.
Also, you should remove the action classes, tests, and JS/JSP/tag files that have been migrated.
src/main/java/teammates/ui/newcontroller/GetStudentEditDetailsAction.java
Outdated
Show resolved
Hide resolved
src/main/java/teammates/ui/newcontroller/GetStudentEditDetailsAction.java
Outdated
Show resolved
Hide resolved
|
||
/** | ||
* Initializes the student details edit form with the fields fetched from the backend. | ||
* Subscriptions are set up to listen to changes in the 'teamname' fields and 'newstudentemail' fields. |
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.
👍👍
...tructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.ts
Outdated
Show resolved
Hide resolved
...tructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.ts
Outdated
Show resolved
Hide resolved
/** | ||
* Sets the boolean value of `isSessionSummarySendEmail` to true if | ||
* user chooses to resend past session link to the new email. | ||
* Submits the form otherwise. |
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 is not accurate? It submits the form regardless of the value.
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.
@wkurniawan07 This is intended. The default value of isSessionSummarySendEmail
is declared false initially.
In the event the user clicks No, just save the changes
, the form will still be submitted with the boolean being false. If the user clicks Yes, save changes and resend links
, the form will be submitted with the boolean being true.
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 point remains that whatever the value is, calling this function will result in the form being submitted?
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.
@wkurniawan07 Yup! That's right. When the user reaches this modal, pressing any of the primary-coloured buttons will lead to the form being submitted, which is what this function is doing.
Btw, ready for latest review :)
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.
So "Submits the form otherwise." is not accurate because it submits the form always.
Not a big deal since it's just a comment and can be addressed later.
ceb9e1d
to
0fd8d3d
Compare
4e9519c
to
03cc79b
Compare
@tanhengyeow let's not remove the browser tests yet. We still need them for reference when migrating the E2E tests later on. |
f12f784
to
2885d44
Compare
2885d44
to
e9317f7
Compare
@wkurniawan07 Ready for review again 😄 |
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.
Tested, mostly there! Few minor changes requested.
this.router.navigate(['../../', 'details'], | ||
{ relativeTo: this.route }, | ||
); | ||
// TODO: Show success status message in courses/details page after successful edit |
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.
You can use NavigationService
to achieve this.
/** | ||
* Sets the boolean value of `isSessionSummarySendEmail` to true if | ||
* user chooses to resend past session link to the new email. | ||
* Submits the form otherwise. |
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 point remains that whatever the value is, calling this function will result in the form being submitted?
(click)="modal.dismiss()">×</button> | ||
</div> | ||
<div class="modal-body"> | ||
Do you want to resend past session links of this course to the new email {{ editForm.get('newstudentemail') }}? |
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.
editForm.get('newstudentemail')
results in [object Object]
. Need further processing.
412f49a
to
b1c58f8
Compare
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.
Ok, this page is clear to go.
#9301) * Setup new Action that would replace instructorCourseStudentDetailsEditSave * Changed courseId and studentEmail to use getNonNullRequestParamValue * Added method verifyInaccessibleWithoutModifyStudentPrivilege for test * Added test for PutCourseStudentDetailsEditAction * Initial setup of edit form structure * Add new action to fetch student edit page details * Added test for GetStudentEditDetailsAction * Finish up page migration * Added relevant imports for spec file and fix lint errors * Dlt deprecated inst course student edit files except E2E related files * Fix code according to review * Use updated test method * Fix logic bug * Updated success message and use NavigationService
#9301) * Setup new Action that would replace instructorCourseStudentDetailsEditSave * Changed courseId and studentEmail to use getNonNullRequestParamValue * Added method verifyInaccessibleWithoutModifyStudentPrivilege for test * Added test for PutCourseStudentDetailsEditAction * Initial setup of edit form structure * Add new action to fetch student edit page details * Added test for GetStudentEditDetailsAction * Finish up page migration * Added relevant imports for spec file and fix lint errors * Dlt deprecated inst course student edit files except E2E related files * Fix code according to review * Use updated test method * Fix logic bug * Updated success message and use NavigationService
Part of #9255
Summary of PR:
InstructorCourseStudentDetailsEditSaveAction
toPutCourseStudentDetailsEditAction
/webapi/courses/students/details/edit
courseid
andstudentemail
to check for current student to edit. Other query parameters are sent through the form and fields are updated accordingly.PutCourseStudentDetailsEditActionTest
to test for the new action.GetStudentEditDetailsAction
to fetch required data for the student details edit page. In v6, relevant data is generated at the backend and mapped to the template page (via JSP) to be served to the users. In v7, where both front-end and back-end are separate, a new endpoint is needed to fetch the required data for this page./webapi/courses/students/editDetails
courseid
andstudentemail
to check for current student details to fetch.GetStudentEditDetailsActionTest
to test for the new action.instructor-course-student-edit-page.*
Team name
andEmail
instructor-course-student-edit-page.component.ts
InstructorCourseStudentDetailsEditPageAction
will not be migrated into a new action as its' purpose is to show the edit page.To delete (once PR is reviewed):
src/main/java/teammates/ui/controller/ActionFactory.java
InstructorCourseStudentDetailsEdit*
.java files (exceptbrowsertests
andpageobjects
related files)WEB-INF/tags/instructor/courseStudentDetailsEdit/studentInformationTable.tag
webapp-backup/jsp/instructorCourseStudentEdit.jsp
Const.java
webapp-backup/dev/js/main/instructorCourseStudentEdit.js
Points to note:
In v7, this message has to be passed along to the instructor course details page once it is migrated.