Skip to content

Conversation

@SahiruWithanage
Copy link

@SahiruWithanage SahiruWithanage commented May 19, 2025

Description

This update extends the Staff Grant Extension Form by adding the Student Search and Select feature, enabling staff users to search for individual students and select multiple students for bulk extension grants. This feature builds on the functionality introduced in PR #330, enhancing the form's usability and efficiency for larger classes.

The updated form now:

  • Allows staff to search for specific students within the extension form.
  • Supports multi-student selection for bulk extension grants.
  • Integrates directly within the form provided in PR #330.
  • Provides a smoother user experience with responsive UI elements for efficient student selection.

Commit History Note:
Except for the last three commits, which involves only two files being modified, all other commits in this PR are from PR #330, which this feature depends on.

Screenshot 2025-05-19 at 4 03 19 pm Screenshot 2025-05-19 at 4 03 39 pm

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

To test this feature, follow these steps:

  1. Accessing the Grant Extension Button:

    • Log in as a student.
    • Select a unit and task that you want to grant an extension for.
    • Copy the URL of the selected task.
    • Log out of the student account.
    • Log in as an admin, convenor, or tutor.
    • Paste the copied URL to navigate directly to the selected task.
    • Confirm that the Grant Extension button is visible.
  2. Form Testing:

    • Opened the form and filled it up with a few students from the list, both directly and using the search feature.
    • Tested selecting all students in one instance, then selecting all and deselecting one after searching in another.
    • Entered a test reason and extension duration for each scenario.
    • Submitted the form each time, verifying successful POST messages and their contents in the Network tab (201 response).

Testing Checklist:

  • Tested in latest Chrome
  • Tested in latest Safari
  • Tested in latest Firefox

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

JoeMacl and others added 14 commits March 29, 2025 15:12
…ant extension form

This commit adds the Student Search and Select feature to the Staff Grant Extension form,
enhancing the form's usability by allowing staff to search for individual students and select
multiple students for bulk extension grants. This update integrates directly with the existing
extension form backend, improving the overall user experience for staff handling large classes.

Changes include:
- Added student search input for filtering student lists.
- Implemented multi-student selection support for bulk operations.
- Improved UI components for efficient student selection.
- Integrated with the existing form backend for seamless data flow.

References:
- Related to JoeMacl's Grant Extension Form PR thoth-tech#330
- Addresses requirements for bulk extension management.
Copy link

@Pasindufdo98 Pasindufdo98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good To ME

Hi @SahiruWithanage & @JoeMacl
I’ve pulled the branch locally and tested the new student search and multi-select feature within the Grant Extension form. Everything worked smoothly across my testing.

Key Things I Verified:

  • The "Grant Extension" button appears correctly when navigating as a staff user using a copied student task URL.
  • Student search and multi-select are working as expected (including “Select All” and individual toggling).
  • The form correctly submits extension details with the appropriate POST request (verified via DevTools – 201 Created).
  • The success toast ("Extension granted successfully") appears after each submission.

Note:

Before testing this PR (#359), I had to pull and run PR #56, which provides the backend API support for the grant extension feature.

Screenshot (947)

Screenshot (940)

Screenshot (942)


Nice work on making the extension process smoother and scalable!
Let me know if you'd like me to test anything further.

Copy link

@JoeMacl JoeMacl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems to be working correctly. I was able to test the Grant Extension form and confirm it successfully submits a 201 response. The search and multi-select features also function as expected. Nice work!

Only suggestion is the long student list gets a bit overwhelming. Maybe wrapping it in something like mat-selection-list or another UI component could make it easier to scan.

Great work overall! :)

Copy link

@aNebula aNebula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all .rb files

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the frontend code have .rb files?

Copy link
Author

@SahiruWithanage SahiruWithanage May 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for the last three commits, which involves only two files being modified, all other commits in this PR are from PR #330, which this feature depends on.

I believe the .rb files are from Joe’s PR. This PR is intended to be sent upstream after Joe’s main PR has been merged.

UPDATE: The files have been deleted.

Comment on lines +43 to +66
// List of test students to choose from
students = [
{ id: 1, name: 'Joe M' },
{ id: 2, name: 'Sahiru W' },
{ id: 3, name: 'Samindi M' },
{ id: 4, name: 'Student 4' },
{ id: 5, name: 'Student 5' },
{ id: 6, name: 'Student 6' },
{ id: 7, name: 'Student 7' },
{ id: 8, name: 'Student 8' },
{ id: 9, name: 'Student 9' },
{ id: 10, name: 'Student 10' },
{ id: 11, name: 'Student 11' },
{ id: 12, name: 'Student 12' },
{ id: 13, name: 'Student 13' },
{ id: 14, name: 'Student 14' },
{ id: 15, name: 'Student 15' },
{ id: 16, name: 'Student 16' },
{ id: 17, name: 'Student 17' },
{ id: 18, name: 'Student 18' },
{ id: 19, name: 'Student 19' },
{ id: 20, name: 'Student 20' }
];
filteredStudents = this.students;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be list of students fetched from the backend?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the note! This PR specifically focuses on the Student Search and Select UI, building on PR #330. The current test list is for demo purposes—backend integration should be handled in a follow-up PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants