<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Skalyan3</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Skalyan3"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Skalyan3"/>
	<updated>2026-06-03T10:32:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165082</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165082"/>
		<updated>2025-04-23T02:58:51Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source Ruby on Rails platform designed to facilitate peer learning by allowing students to create and submit assignments, review one another’s work, and collaborate on projects. One of its core features is the Participants interface: a tab linked directly to each Assignment that displays who is enrolled, their roles (e.g. student, reviewer, instructor), and allows administrators or instructors to add, edit, or remove participants.&lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
The two goals of this project are&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. Seamless Frontend-Backend Integration&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Replace static stub data with real API calls to the Rails ParticipantsController, ensuring every CRUD operation (Create, Read, Update, Delete) happens in real time and reflects immediately in the UI.&lt;br /&gt;
&lt;br /&gt;
*Implement proper loading states, retries, and error displays so users know exactly when an action is in progress or has failed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. Modernized, Consistent UI&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Rework the Participants table using React, TypeScript, SCSS/CSS Modules, and React-Bootstrap components to match the latest Expertiza design guidelines such as typography, spacing, color schemes.&lt;br /&gt;
&lt;br /&gt;
*Add advanced table features—client-side sorting, server-driven filtering, and pagination controls so that instructors can efficiently navigate hundreds of participants.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problems ====&lt;br /&gt;
&amp;lt;b&amp;gt;1. Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 After-participant-list-2.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|600px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;3. Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;4. Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025- E2540 Font-size-test.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/j8TTvYDc-3w here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [https://github.com/expertiza/reimplementation-front-end/pull/101].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [https://github.com/expertiza/reimplementation-back-end/pull/201].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165078</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165078"/>
		<updated>2025-04-23T02:58:35Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source Ruby on Rails platform designed to facilitate peer learning by allowing students to create and submit assignments, review one another’s work, and collaborate on projects. One of its core features is the Participants interface: a tab linked directly to each Assignment that displays who is enrolled, their roles (e.g. student, reviewer, instructor), and allows administrators or instructors to add, edit, or remove participants.&lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
The two goals of this project are&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. Seamless Frontend-Backend Integration&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Replace static stub data with real API calls to the Rails ParticipantsController, ensuring every CRUD operation (Create, Read, Update, Delete) happens in real time and reflects immediately in the UI.&lt;br /&gt;
&lt;br /&gt;
*Implement proper loading states, retries, and error displays so users know exactly when an action is in progress or has failed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Modernized, Consistent UI&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Rework the Participants table using React, TypeScript, SCSS/CSS Modules, and React-Bootstrap components to match the latest Expertiza design guidelines such as typography, spacing, color schemes.&lt;br /&gt;
&lt;br /&gt;
*Add advanced table features—client-side sorting, server-driven filtering, and pagination controls so that instructors can efficiently navigate hundreds of participants.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problems ====&lt;br /&gt;
&amp;lt;b&amp;gt;1. Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 After-participant-list-2.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|600px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;3. Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;4. Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025- E2540 Font-size-test.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/j8TTvYDc-3w here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [https://github.com/expertiza/reimplementation-front-end/pull/101].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [https://github.com/expertiza/reimplementation-back-end/pull/201].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165062</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165062"/>
		<updated>2025-04-23T02:54:56Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives. The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well.&lt;br /&gt;
&lt;br /&gt;
Project Goals&lt;br /&gt;
There are 2 main goals for this project -&lt;br /&gt;
&lt;br /&gt;
Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problems ====&lt;br /&gt;
&amp;lt;b&amp;gt;1. Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 After-participant-list-2.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|600px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;3. Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;4. Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025- E2540 Font-size-test.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/j8TTvYDc-3w here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [https://github.com/expertiza/reimplementation-front-end/pull/101].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [https://github.com/expertiza/reimplementation-back-end/pull/201].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165022</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165022"/>
		<updated>2025-04-23T02:42:23Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Problems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problems ====&lt;br /&gt;
&amp;lt;b&amp;gt;1. Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 After-participant-list-2.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|600px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;3. Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;4. Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025- E2540 Font-size-test.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/j8TTvYDc-3w here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [https://github.com/expertiza/reimplementation-front-end/pull/101].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [https://github.com/expertiza/reimplementation-back-end/pull/201].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165021</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165021"/>
		<updated>2025-04-23T02:41:52Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Problem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problems ====&lt;br /&gt;
&amp;lt;b&amp;gt;1. Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 After-participant-list-2.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|600px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;3. Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;4. Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025- E2540 Font-size-test.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/j8TTvYDc-3w here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [https://github.com/expertiza/reimplementation-front-end/pull/101].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [https://github.com/expertiza/reimplementation-back-end/pull/201].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165020</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165020"/>
		<updated>2025-04-23T02:41:32Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Update Frontend UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&amp;lt;b&amp;gt;1. Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 After-participant-list-2.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|600px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;3. Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;4. Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025- E2540 Font-size-test.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/j8TTvYDc-3w here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [https://github.com/expertiza/reimplementation-front-end/pull/101].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [https://github.com/expertiza/reimplementation-back-end/pull/201].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165019</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165019"/>
		<updated>2025-04-23T02:40:18Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Update Frontend UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 After-participant-list-2.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|600px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025- E2540 Font-size-test.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/j8TTvYDc-3w here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [https://github.com/expertiza/reimplementation-front-end/pull/101].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [https://github.com/expertiza/reimplementation-back-end/pull/201].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165002</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=165002"/>
		<updated>2025-04-23T02:18:29Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Pull Requests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 After-participant-list-2.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|600px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|600px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025- E2540 Font-size-test.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/j8TTvYDc-3w here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [https://github.com/expertiza/reimplementation-front-end/pull/101].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [https://github.com/expertiza/reimplementation-back-end/pull/201].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164944</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164944"/>
		<updated>2025-04-23T01:20:26Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* UI Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|600px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|600px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164940</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164940"/>
		<updated>2025-04-23T01:19:39Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Implemented Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|600px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|600px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164937</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164937"/>
		<updated>2025-04-23T01:18:50Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Implemented Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|600px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|600px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|600px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164936</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164936"/>
		<updated>2025-04-23T01:17:54Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Manage Participant Frontend Integration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164933</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164933"/>
		<updated>2025-04-23T01:16:05Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Add/Edit/Remove Participants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164932</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164932"/>
		<updated>2025-04-23T01:15:28Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Technologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Backend:&amp;lt;/b&amp;gt; Ruby on Rails, ActiveRecord ORM, MySQL, JWT-based authentication&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164927</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164927"/>
		<updated>2025-04-23T01:13:02Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* 2. Backend */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164926</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164926"/>
		<updated>2025-04-23T01:12:42Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* 2. Backend */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
The backend is implemented in Ruby on Rails (API mode), leveraging convention-over-configuration, the ActiveRecord ORM, and RESTful routing to provide rapid scaffolding, consistent database migrations, and built-in testing—resulting in a secure, maintainable, and robust service layer.&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164925</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164925"/>
		<updated>2025-04-23T01:11:14Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* 2. Backend */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164924</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164924"/>
		<updated>2025-04-23T01:10:52Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Styling and UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
This backend design provides a clean, secure, and performant foundation for the React frontend to manage participants, while keeping the API surface minimal and well-documented.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164923</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164923"/>
		<updated>2025-04-23T01:10:23Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Main Table Component: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Component=====&lt;br /&gt;
*Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
*Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
*Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
This backend design provides a clean, secure, and performant foundation for the React frontend to manage participants, while keeping the API surface minimal and well-documented.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164920</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164920"/>
		<updated>2025-04-23T01:09:39Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Main Table Component: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
Row Components:&lt;br /&gt;
Represent individual units of data such as one Assignment participant entry or one review entry.&lt;br /&gt;
Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
This backend design provides a clean, secure, and performant foundation for the React frontend to manage participants, while keeping the API surface minimal and well-documented.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164919</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164919"/>
		<updated>2025-04-23T01:08:11Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Styling and UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
This backend design provides a clean, secure, and performant foundation for the React frontend to manage participants, while keeping the API surface minimal and well-documented.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164918</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164918"/>
		<updated>2025-04-23T01:07:28Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* 4. Backend */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====2. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
This backend design provides a clean, secure, and performant foundation for the React frontend to manage participants, while keeping the API surface minimal and well-documented.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164917</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164917"/>
		<updated>2025-04-23T01:07:17Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* 2. State Management */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
This backend design provides a clean, secure, and performant foundation for the React frontend to manage participants, while keeping the API surface minimal and well-documented.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164916</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164916"/>
		<updated>2025-04-23T01:06:46Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* 1. Frontend */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
==== Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
This backend design provides a clean, secure, and performant foundation for the React frontend to manage participants, while keeping the API surface minimal and well-documented.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164915</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164915"/>
		<updated>2025-04-23T01:06:31Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* 3. Styling and UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
This backend design provides a clean, secure, and performant foundation for the React frontend to manage participants, while keeping the API surface minimal and well-documented.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164914</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164914"/>
		<updated>2025-04-23T01:06:20Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* 1. Frontend */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
This backend design provides a clean, secure, and performant foundation for the React frontend to manage participants, while keeping the API surface minimal and well-documented.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164912</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164912"/>
		<updated>2025-04-23T01:05:35Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* 4. Backend */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Framework &amp;amp; API Style=====&lt;br /&gt;
&lt;br /&gt;
*Built as a Ruby on Rails API, using RESTful routes under /participants.&lt;br /&gt;
&lt;br /&gt;
*All endpoints return JSON and follow standard HTTP status codes (200 for success, 401/403 for auth failures, 404 for missing records, 422 for validation errors).&lt;br /&gt;
&lt;br /&gt;
=====Data Modeling &amp;amp; Validation=====&lt;br /&gt;
&lt;br /&gt;
* Participant model links User, Assignment, and Role (each as a belongs_to).&lt;br /&gt;
&lt;br /&gt;
* Validates presence of each foreign key and uniqueness of the (assignment_id, user_id) pair to prevent duplicate entries.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses token-based authentication so only logged-in users can call the API.&lt;br /&gt;
&lt;br /&gt;
*Public endpoints are skipped from auth checks but  all /participants actions enforce a valid token.&lt;br /&gt;
&lt;br /&gt;
*Role-based guards ensure that only instructors or super-admins can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
This backend design provides a clean, secure, and performant foundation for the React frontend to manage participants, while keeping the API surface minimal and well-documented.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164900</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164900"/>
		<updated>2025-04-23T00:59:04Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Authentication &amp;amp; Authorization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Models &amp;amp; Validations=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Participant:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*belongs_to :assignment, :user, and :role.&lt;br /&gt;
&lt;br /&gt;
*Validates presence of all three foreign keys and uniqueness of assignment_id, user_id to prevent duplicates.&lt;br /&gt;
&lt;br /&gt;
*Role, User, and Assignment models expose minimal JSON via ActiveModelSerializers so the frontend can render names, handles, and role labels without additional lookup.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization:=====&lt;br /&gt;
&lt;br /&gt;
*Uses a custom JWT-based Authorization concern injected into ApplicationController.&lt;br /&gt;
&lt;br /&gt;
*skip_before_action :authorize_request, only: [:login] on AuthenticationController#login to allow credential exchange &lt;br /&gt;
&lt;br /&gt;
*All /participants routes require a valid token; unauthorized requests return 401.&lt;br /&gt;
&lt;br /&gt;
*Role-based checks in a has_privileges_of? method (in authorization.rb) ensure only Super Administrators or Instructors for that assignment can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
This backend design ensures a secure, performant, and well-tested API that cleanly surfaces exactly the data the React frontend needs, supports pagination for large classes, and enforces role-based permissions at every step.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164897</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164897"/>
		<updated>2025-04-23T00:58:28Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Authentication &amp;amp; Authorization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Models &amp;amp; Validations=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Participant:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*belongs_to :assignment, :user, and :role.&lt;br /&gt;
&lt;br /&gt;
*Validates presence of all three foreign keys and uniqueness of assignment_id, user_id to prevent duplicates.&lt;br /&gt;
&lt;br /&gt;
*Role, User, and Assignment models expose minimal JSON via ActiveModelSerializers so the frontend can render names, handles, and role labels without additional lookup.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses a custom JWT-based Authorization concern injected into ApplicationController.&lt;br /&gt;
&lt;br /&gt;
*skip_before_action :authorize_request, only: [:login] on AuthenticationController#login to allow credential exchange &lt;br /&gt;
&lt;br /&gt;
*All /participants routes require a valid token; unauthorized requests return 401.&lt;br /&gt;
&lt;br /&gt;
*Role-based checks in a has_privileges_of? method (in authorization.rb) ensure only Super Administrators or Instructors for that assignment can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
This backend design ensures a secure, performant, and well-tested API that cleanly surfaces exactly the data the React frontend needs, supports pagination for large classes, and enforces role-based permissions at every step.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164895</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164895"/>
		<updated>2025-04-23T00:58:08Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* 4. Backend */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
=====Models &amp;amp; Validations=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Participant:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*belongs_to :assignment, :user, and :role.&lt;br /&gt;
&lt;br /&gt;
*Validates presence of all three foreign keys and uniqueness of assignment_id, user_id to prevent duplicates.&lt;br /&gt;
&lt;br /&gt;
*Role, User, and Assignment models expose minimal JSON via ActiveModelSerializers so the frontend can render names, handles, and role labels without additional lookup.&lt;br /&gt;
&lt;br /&gt;
=====Authentication &amp;amp; Authorization=====&lt;br /&gt;
&lt;br /&gt;
*Uses a custom JWT-based Authorization concern injected into ApplicationController.&lt;br /&gt;
&lt;br /&gt;
*skip_before_action :authorize_request, only: [:login] on AuthenticationController#login to allow credential exchange &lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
*All /participants routes require a valid token; unauthorized requests return 401.&lt;br /&gt;
&lt;br /&gt;
*Role-based checks in a has_privileges_of? method (in authorization.rb) ensure only Super Administrators or Instructors for that assignment can add, edit, or delete participants.&lt;br /&gt;
&lt;br /&gt;
This backend design ensures a secure, performant, and well-tested API that cleanly surfaces exactly the data the React frontend needs, supports pagination for large classes, and enforces role-based permissions at every step.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164864</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164864"/>
		<updated>2025-04-23T00:19:11Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Design Principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164863</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164863"/>
		<updated>2025-04-23T00:19:00Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Design Principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles like DRY to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164862</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164862"/>
		<updated>2025-04-23T00:18:35Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Design principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles (e.g., SRP, DRY) to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2523:_Enhancing_UI_Consistency_in_Expertiza_2&amp;diff=164861</id>
		<title>CSC/ECE 517 Spring 2025 - E2523: Enhancing UI Consistency in Expertiza 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2523:_Enhancing_UI_Consistency_in_Expertiza_2&amp;diff=164861"/>
		<updated>2025-04-23T00:18:00Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Design Principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review. This project provides the tools necessary for an instructor to manage courses and assignments, for which students can be assigned to teams and submit assignments. After submission, peer assessment allows for students to give feedback to each other, facilitating critical thinking and learning. Both the frontend and backend of Expertiza are currently going through reimplementations. In particular, the frontend is being developed in Typescript.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Expertiza is an open-source project, so many developers contribute to the project, and often with differing design choices. This UI project aims to provide more consistency between different pages and tools. In particular, the focus is on the Submissions and Courses pages, and subsequent pages/modals. The changes should reduce visual clutter and provide consistency between UI, making the interface much easier to use.&lt;br /&gt;
&lt;br /&gt;
== Functional Requirements ==&lt;br /&gt;
&lt;br /&gt;
==== Overall Requirements ====&lt;br /&gt;
&lt;br /&gt;
====== Merging Past Pull Requests ======&lt;br /&gt;
The UI changes that were changed in this project are done on top of three pull requests of the frontend reimplementation project, and thus, the tasks of this project were separated in accordance to these pull requests. These pull requests were [https://github.com/expertiza/reimplementation-front-end/pull/70 UI for Courses], [https://github.com/expertiza/reimplementation-front-end/pull/72 Reimplement add TA], and [https://github.com/expertiza/reimplementation-front-end/pull/57 UI for View Submissions].&lt;br /&gt;
&lt;br /&gt;
====== UI Design Guidelines ======&lt;br /&gt;
This project follows design guidelines shown in this document. All tables need to use the prebuilt Table component. This Table component uses a Pagination component, which allows users to select different pages of a table. However, this Pagination component should only be visible if there are more than one page. Another important guideline is the text formatting. Headings should follow camel case capitalization, while other text should capitalize only the first letter of the first word. Most changes done in this project are made to adhere to this guideline. Finally, the icons, buttons, and notifications all needed to follow particular styles provided in the design document.&lt;br /&gt;
&lt;br /&gt;
====== Non-task Specific Requirements ======&lt;br /&gt;
There are some requirements that are applied to components used by all three tasks.&lt;br /&gt;
* Pagination should only be visible if there is more than one page of entries.&lt;br /&gt;
* The Table component needs to include a “disableGlobalFilter” option&lt;br /&gt;
&lt;br /&gt;
==== Task 1 Requirements ====&lt;br /&gt;
Task 1 deals with the UI changes needed for UI for Courses. All of these changes are done to the Courses page.&lt;br /&gt;
* The page’s header needs to be updated to follow text formatting guidelines.&lt;br /&gt;
* The table headers should follow non-header capitalization guidelines.&lt;br /&gt;
* The table should not use either the global or column filters.&lt;br /&gt;
* The date format used for the “Creation date” and “Updated date” should show the user’s local time and should not show seconds and milliseconds.&lt;br /&gt;
* The button for creating a course should be red, and contain the text “Create Course”.&lt;br /&gt;
* Confirmation buttons should be red.&lt;br /&gt;
* Text labels should follow non-header capitalization guidelines.&lt;br /&gt;
* Subsequent modals should also follow the same guidelines.&lt;br /&gt;
* Note: Manage TAs is part of task 2&lt;br /&gt;
&lt;br /&gt;
==== Task 2 Requirements ====&lt;br /&gt;
Task 2 deals with the UI changes needed for Reimplement add TA. All of these changes are done to the Manage TAs modal of the Courses page.&lt;br /&gt;
* The table headers should follow non-header capitalization guidelines.&lt;br /&gt;
* The table should not use either the global or column filters.&lt;br /&gt;
* The button for adding a TA should be updated.&lt;br /&gt;
* Confirmation buttons should be red.&lt;br /&gt;
* Error notification should use the Alert component.&lt;br /&gt;
* Text labels should follow non-header capitalization guidelines.&lt;br /&gt;
* Subsequent modals should also follow the same guidelines.&lt;br /&gt;
&lt;br /&gt;
==== Task 3 Requirements ====&lt;br /&gt;
Task 3 deals with the UI changes needed for UI for View Submissions.&lt;br /&gt;
* The table headers should follow non-header capitalization guidelines.&lt;br /&gt;
* The table should not use either the global or column filters.&lt;br /&gt;
* Text labels should follow non-header capitalization guidelines.&lt;br /&gt;
* Submission History should also follow the same guidelines&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one TA entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
== Design principles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Reusability: &amp;lt;/b&amp;gt; Promotes the reuse of modular table components and UI elements (like buttons, badges, or input fields) to reduce duplication and ensure uniform behavior throughout the application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Feedback &amp;amp; Visibility: &amp;lt;/b&amp;gt; Provides immediate feedback through hover states, alerts, and visual cues for actions like submission, deletion, or errors.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
&lt;br /&gt;
==== Task 1 ====&lt;br /&gt;
&lt;br /&gt;
Manage Courses &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-task-1-course-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-task-1-courses-after.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No pagination if there is only one page in the reimplemented UI:&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-task-1-courses-after-no-pagination.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
Global filter span in the Table component changed:&lt;br /&gt;
&lt;br /&gt;
[[File: Tablespanchange.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code snippet was added to allow the global filter to be disabled via a &amp;quot;disableGlobalFilter&amp;quot; option of the Table component.&lt;br /&gt;
&lt;br /&gt;
==== Task 2 ====&lt;br /&gt;
&lt;br /&gt;
Manage TA modal &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:Manage-ta-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-TAmodal_after.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Add TA modal &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-task-2-manage-ta-add-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Manage-ta-add-after.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Add TA alert&lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Old-alert.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-alert-after.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Code Snippet:&lt;br /&gt;
&lt;br /&gt;
Icon change for adding TA:&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Code_snippets_for_icons_-a.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code snippet shows the updated button in the Manage TA modal of the Courses page.&lt;br /&gt;
&lt;br /&gt;
Alert messages change:&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-alerts.png|400px]]&lt;br /&gt;
&lt;br /&gt;
This code snippet shows the new Alert component that is consistent with the design guidelines.&lt;br /&gt;
&lt;br /&gt;
==== Task 3 ====&lt;br /&gt;
&lt;br /&gt;
Submissions Table &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Submission-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:Task3subafter.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Submissions History Table&lt;br /&gt;
&lt;br /&gt;
Original UI &lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Submission-history-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:Task3subhistafter.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Navbar &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Navbar-before.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:Task3navbarafter.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Code Snippet:&lt;br /&gt;
&lt;br /&gt;
New Table:&lt;br /&gt;
&lt;br /&gt;
[[File:Task3-Code-Table.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
This code snippet shows the options used for the Table component that is in line with the design guidelines. In particular, both the global and column filters are disabled, and the table data uses the correct font size and line height.&lt;br /&gt;
&lt;br /&gt;
New Navbar:&lt;br /&gt;
&lt;br /&gt;
[[File:Codenavbar.png|400px]]&lt;br /&gt;
&lt;br /&gt;
The Submissions page was incorrectly named &amp;quot;Assignment&amp;quot; in the navigation bar, so now it has been moved into the Manage dropdown.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
Please find the demo video going over the features at https://youtu.be/hhPBc9CfjSs&lt;br /&gt;
&lt;br /&gt;
== List of Changes ==&lt;br /&gt;
&lt;br /&gt;
==== Non-task Specific ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
* &amp;lt;b&amp;gt;src/components/Table/Table.tsx&amp;lt;/b&amp;gt; - Updated table component to include a &amp;quot;disableGlobalFilter&amp;quot; option&lt;br /&gt;
&lt;br /&gt;
==== Task 1 ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/Courses.tsx&amp;lt;/b&amp;gt; - Updated text, table, and button formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/CourseColumns.tsx&amp;lt;/b&amp;gt; - Updated text and table formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/CourseCopy.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/CourseDelete.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/CourseEditor.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
&lt;br /&gt;
==== Task 2 ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/TA/TA.tsx &amp;lt;/b&amp;gt; - Updated Icon, text and button formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/TA/TAColumns.tsx &amp;lt;/b&amp;gt; - Updated Icon&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/TA/TAEditor.tsx &amp;lt;/b&amp;gt; - Updated Icon, button, text and warning message formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/TA/TADelete.tsx &amp;lt;/b&amp;gt; - Updated button formatting&lt;br /&gt;
&lt;br /&gt;
==== Task 3 ====&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/Submissions/SubmissionsView.tsx &amp;lt;/b&amp;gt; - Added new Table component. Updated text and button formatting&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/Submissions/SubmissionsHistoryView.tsx &amp;lt;/b&amp;gt; - Added new Table component. Updated text and button formatting.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/Submissions/SubmissionsTable/SubmissionsEntry.tsx &amp;lt;/b&amp;gt; - Added new Table component. Updated text and button formatting.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/Submissions/SubmissionsTable/SubmissionsList.tsx &amp;lt;/b&amp;gt; - Added new Table component. Updated text and button formatting.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/layout/Header.tsx &amp;lt;/b&amp;gt; - Removed the Assignments tab to add the Submissions tab under Manage.&lt;br /&gt;
&lt;br /&gt;
== Pull Request ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in this project through [https://github.com/expertiza/reimplementation-front-end/pull/93 this pull request].&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
The enhancements implemented in this project have greatly improved the UI consistency, usability, and maintainability of the Expertiza platform. By reworking outdated components and aligning them with modern design guidelines, we ensured a cleaner, more user-friendly experience across different user roles.&lt;br /&gt;
The following pull requests were central to our reimplementation work:&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/70&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/72&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/57&lt;br /&gt;
These PRs focused on restructuring table components, refining modal behavior, updating icons, enhancing accessibility, and ensuring overall alignment with the Expertiza design system. We successfully completed all assigned features and UI refinements while strictly adhering to the Expertiza design guidlines provided. This included updates to typography, spacing, component styling, and standardized interactions across the application.&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Enhancing TA UX: &amp;lt;/b&amp;gt; Improve user experience with editing and managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt; Backend Implementation/Integration of Submissions and Submissions History: &amp;lt;/b&amp;gt; Currently, the Submissions page uses mock data, as the backend is currently not developed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt; Implementation of Deleting TAs: &amp;lt;/b&amp;gt; While out of the scope of this project, the past project did not implement the deletion of TAs, so that feature is currently not available.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt; More Robust Logging: &amp;lt;/b&amp;gt; With more standardized logging, the debugging process could be streamlined, as useful information can be shown in the console.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/70&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/72&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/57&lt;br /&gt;
* https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2461._UI_and_Backend_for_Courses&lt;br /&gt;
* https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&lt;br /&gt;
* https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2467._UI_for_View_Submissions&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Aryan Inguva &amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt; &lt;br /&gt;
* &amp;lt;b&amp;gt; Maya Mei &amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt; Shuba Shwetha Kalyanasundaram &amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2523:_Enhancing_UI_Consistency_in_Expertiza_2&amp;diff=164858</id>
		<title>CSC/ECE 517 Spring 2025 - E2523: Enhancing UI Consistency in Expertiza 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2523:_Enhancing_UI_Consistency_in_Expertiza_2&amp;diff=164858"/>
		<updated>2025-04-23T00:16:44Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Design Principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review. This project provides the tools necessary for an instructor to manage courses and assignments, for which students can be assigned to teams and submit assignments. After submission, peer assessment allows for students to give feedback to each other, facilitating critical thinking and learning. Both the frontend and backend of Expertiza are currently going through reimplementations. In particular, the frontend is being developed in Typescript.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Expertiza is an open-source project, so many developers contribute to the project, and often with differing design choices. This UI project aims to provide more consistency between different pages and tools. In particular, the focus is on the Submissions and Courses pages, and subsequent pages/modals. The changes should reduce visual clutter and provide consistency between UI, making the interface much easier to use.&lt;br /&gt;
&lt;br /&gt;
== Functional Requirements ==&lt;br /&gt;
&lt;br /&gt;
==== Overall Requirements ====&lt;br /&gt;
&lt;br /&gt;
====== Merging Past Pull Requests ======&lt;br /&gt;
The UI changes that were changed in this project are done on top of three pull requests of the frontend reimplementation project, and thus, the tasks of this project were separated in accordance to these pull requests. These pull requests were [https://github.com/expertiza/reimplementation-front-end/pull/70 UI for Courses], [https://github.com/expertiza/reimplementation-front-end/pull/72 Reimplement add TA], and [https://github.com/expertiza/reimplementation-front-end/pull/57 UI for View Submissions].&lt;br /&gt;
&lt;br /&gt;
====== UI Design Guidelines ======&lt;br /&gt;
This project follows design guidelines shown in this document. All tables need to use the prebuilt Table component. This Table component uses a Pagination component, which allows users to select different pages of a table. However, this Pagination component should only be visible if there are more than one page. Another important guideline is the text formatting. Headings should follow camel case capitalization, while other text should capitalize only the first letter of the first word. Most changes done in this project are made to adhere to this guideline. Finally, the icons, buttons, and notifications all needed to follow particular styles provided in the design document.&lt;br /&gt;
&lt;br /&gt;
====== Non-task Specific Requirements ======&lt;br /&gt;
There are some requirements that are applied to components used by all three tasks.&lt;br /&gt;
* Pagination should only be visible if there is more than one page of entries.&lt;br /&gt;
* The Table component needs to include a “disableGlobalFilter” option&lt;br /&gt;
&lt;br /&gt;
==== Task 1 Requirements ====&lt;br /&gt;
Task 1 deals with the UI changes needed for UI for Courses. All of these changes are done to the Courses page.&lt;br /&gt;
* The page’s header needs to be updated to follow text formatting guidelines.&lt;br /&gt;
* The table headers should follow non-header capitalization guidelines.&lt;br /&gt;
* The table should not use either the global or column filters.&lt;br /&gt;
* The date format used for the “Creation date” and “Updated date” should show the user’s local time and should not show seconds and milliseconds.&lt;br /&gt;
* The button for creating a course should be red, and contain the text “Create Course”.&lt;br /&gt;
* Confirmation buttons should be red.&lt;br /&gt;
* Text labels should follow non-header capitalization guidelines.&lt;br /&gt;
* Subsequent modals should also follow the same guidelines.&lt;br /&gt;
* Note: Manage TAs is part of task 2&lt;br /&gt;
&lt;br /&gt;
==== Task 2 Requirements ====&lt;br /&gt;
Task 2 deals with the UI changes needed for Reimplement add TA. All of these changes are done to the Manage TAs modal of the Courses page.&lt;br /&gt;
* The table headers should follow non-header capitalization guidelines.&lt;br /&gt;
* The table should not use either the global or column filters.&lt;br /&gt;
* The button for adding a TA should be updated.&lt;br /&gt;
* Confirmation buttons should be red.&lt;br /&gt;
* Error notification should use the Alert component.&lt;br /&gt;
* Text labels should follow non-header capitalization guidelines.&lt;br /&gt;
* Subsequent modals should also follow the same guidelines.&lt;br /&gt;
&lt;br /&gt;
==== Task 3 Requirements ====&lt;br /&gt;
Task 3 deals with the UI changes needed for UI for View Submissions.&lt;br /&gt;
* The table headers should follow non-header capitalization guidelines.&lt;br /&gt;
* The table should not use either the global or column filters.&lt;br /&gt;
* Text labels should follow non-header capitalization guidelines.&lt;br /&gt;
* Submission History should also follow the same guidelines&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one TA entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles (e.g., SRP, DRY) to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
&lt;br /&gt;
==== Task 1 ====&lt;br /&gt;
&lt;br /&gt;
Manage Courses &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-task-1-course-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-task-1-courses-after.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No pagination if there is only one page in the reimplemented UI:&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-task-1-courses-after-no-pagination.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
Global filter span in the Table component changed:&lt;br /&gt;
&lt;br /&gt;
[[File: Tablespanchange.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code snippet was added to allow the global filter to be disabled via a &amp;quot;disableGlobalFilter&amp;quot; option of the Table component.&lt;br /&gt;
&lt;br /&gt;
==== Task 2 ====&lt;br /&gt;
&lt;br /&gt;
Manage TA modal &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:Manage-ta-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-TAmodal_after.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Add TA modal &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-task-2-manage-ta-add-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Manage-ta-add-after.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Add TA alert&lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Old-alert.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-alert-after.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Code Snippet:&lt;br /&gt;
&lt;br /&gt;
Icon change for adding TA:&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Code_snippets_for_icons_-a.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code snippet shows the updated button in the Manage TA modal of the Courses page.&lt;br /&gt;
&lt;br /&gt;
Alert messages change:&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-alerts.png|400px]]&lt;br /&gt;
&lt;br /&gt;
This code snippet shows the new Alert component that is consistent with the design guidelines.&lt;br /&gt;
&lt;br /&gt;
==== Task 3 ====&lt;br /&gt;
&lt;br /&gt;
Submissions Table &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Submission-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:Task3subafter.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Submissions History Table&lt;br /&gt;
&lt;br /&gt;
Original UI &lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Submission-history-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:Task3subhistafter.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Navbar &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Navbar-before.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:Task3navbarafter.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Code Snippet:&lt;br /&gt;
&lt;br /&gt;
New Table:&lt;br /&gt;
&lt;br /&gt;
[[File:Task3-Code-Table.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
This code snippet shows the options used for the Table component that is in line with the design guidelines. In particular, both the global and column filters are disabled, and the table data uses the correct font size and line height.&lt;br /&gt;
&lt;br /&gt;
New Navbar:&lt;br /&gt;
&lt;br /&gt;
[[File:Codenavbar.png|400px]]&lt;br /&gt;
&lt;br /&gt;
The Submissions page was incorrectly named &amp;quot;Assignment&amp;quot; in the navigation bar, so now it has been moved into the Manage dropdown.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
Please find the demo video going over the features at https://youtu.be/hhPBc9CfjSs&lt;br /&gt;
&lt;br /&gt;
== List of Changes ==&lt;br /&gt;
&lt;br /&gt;
==== Non-task Specific ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
* &amp;lt;b&amp;gt;src/components/Table/Table.tsx&amp;lt;/b&amp;gt; - Updated table component to include a &amp;quot;disableGlobalFilter&amp;quot; option&lt;br /&gt;
&lt;br /&gt;
==== Task 1 ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/Courses.tsx&amp;lt;/b&amp;gt; - Updated text, table, and button formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/CourseColumns.tsx&amp;lt;/b&amp;gt; - Updated text and table formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/CourseCopy.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/CourseDelete.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/CourseEditor.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
&lt;br /&gt;
==== Task 2 ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/TA/TA.tsx &amp;lt;/b&amp;gt; - Updated Icon, text and button formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/TA/TAColumns.tsx &amp;lt;/b&amp;gt; - Updated Icon&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/TA/TAEditor.tsx &amp;lt;/b&amp;gt; - Updated Icon, button, text and warning message formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/TA/TADelete.tsx &amp;lt;/b&amp;gt; - Updated button formatting&lt;br /&gt;
&lt;br /&gt;
==== Task 3 ====&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/Submissions/SubmissionsView.tsx &amp;lt;/b&amp;gt; - Added new Table component. Updated text and button formatting&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/Submissions/SubmissionsHistoryView.tsx &amp;lt;/b&amp;gt; - Added new Table component. Updated text and button formatting.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/Submissions/SubmissionsTable/SubmissionsEntry.tsx &amp;lt;/b&amp;gt; - Added new Table component. Updated text and button formatting.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/Submissions/SubmissionsTable/SubmissionsList.tsx &amp;lt;/b&amp;gt; - Added new Table component. Updated text and button formatting.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/layout/Header.tsx &amp;lt;/b&amp;gt; - Removed the Assignments tab to add the Submissions tab under Manage.&lt;br /&gt;
&lt;br /&gt;
== Pull Request ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in this project through [https://github.com/expertiza/reimplementation-front-end/pull/93 this pull request].&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
The enhancements implemented in this project have greatly improved the UI consistency, usability, and maintainability of the Expertiza platform. By reworking outdated components and aligning them with modern design guidelines, we ensured a cleaner, more user-friendly experience across different user roles.&lt;br /&gt;
The following pull requests were central to our reimplementation work:&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/70&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/72&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/57&lt;br /&gt;
These PRs focused on restructuring table components, refining modal behavior, updating icons, enhancing accessibility, and ensuring overall alignment with the Expertiza design system. We successfully completed all assigned features and UI refinements while strictly adhering to the Expertiza design guidlines provided. This included updates to typography, spacing, component styling, and standardized interactions across the application.&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Enhancing TA UX: &amp;lt;/b&amp;gt; Improve user experience with editing and managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt; Backend Implementation/Integration of Submissions and Submissions History: &amp;lt;/b&amp;gt; Currently, the Submissions page uses mock data, as the backend is currently not developed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt; Implementation of Deleting TAs: &amp;lt;/b&amp;gt; While out of the scope of this project, the past project did not implement the deletion of TAs, so that feature is currently not available.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt; More Robust Logging: &amp;lt;/b&amp;gt; With more standardized logging, the debugging process could be streamlined, as useful information can be shown in the console.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/70&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/72&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/57&lt;br /&gt;
* https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2461._UI_and_Backend_for_Courses&lt;br /&gt;
* https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&lt;br /&gt;
* https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2467._UI_for_View_Submissions&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Aryan Inguva &amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt; &lt;br /&gt;
* &amp;lt;b&amp;gt; Maya Mei &amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt; Shuba Shwetha Kalyanasundaram &amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2523:_Enhancing_UI_Consistency_in_Expertiza_2&amp;diff=164857</id>
		<title>CSC/ECE 517 Spring 2025 - E2523: Enhancing UI Consistency in Expertiza 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2523:_Enhancing_UI_Consistency_in_Expertiza_2&amp;diff=164857"/>
		<updated>2025-04-23T00:16:07Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Design Principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review. This project provides the tools necessary for an instructor to manage courses and assignments, for which students can be assigned to teams and submit assignments. After submission, peer assessment allows for students to give feedback to each other, facilitating critical thinking and learning. Both the frontend and backend of Expertiza are currently going through reimplementations. In particular, the frontend is being developed in Typescript.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
Expertiza is an open-source project, so many developers contribute to the project, and often with differing design choices. This UI project aims to provide more consistency between different pages and tools. In particular, the focus is on the Submissions and Courses pages, and subsequent pages/modals. The changes should reduce visual clutter and provide consistency between UI, making the interface much easier to use.&lt;br /&gt;
&lt;br /&gt;
== Functional Requirements ==&lt;br /&gt;
&lt;br /&gt;
==== Overall Requirements ====&lt;br /&gt;
&lt;br /&gt;
====== Merging Past Pull Requests ======&lt;br /&gt;
The UI changes that were changed in this project are done on top of three pull requests of the frontend reimplementation project, and thus, the tasks of this project were separated in accordance to these pull requests. These pull requests were [https://github.com/expertiza/reimplementation-front-end/pull/70 UI for Courses], [https://github.com/expertiza/reimplementation-front-end/pull/72 Reimplement add TA], and [https://github.com/expertiza/reimplementation-front-end/pull/57 UI for View Submissions].&lt;br /&gt;
&lt;br /&gt;
====== UI Design Guidelines ======&lt;br /&gt;
This project follows design guidelines shown in this document. All tables need to use the prebuilt Table component. This Table component uses a Pagination component, which allows users to select different pages of a table. However, this Pagination component should only be visible if there are more than one page. Another important guideline is the text formatting. Headings should follow camel case capitalization, while other text should capitalize only the first letter of the first word. Most changes done in this project are made to adhere to this guideline. Finally, the icons, buttons, and notifications all needed to follow particular styles provided in the design document.&lt;br /&gt;
&lt;br /&gt;
====== Non-task Specific Requirements ======&lt;br /&gt;
There are some requirements that are applied to components used by all three tasks.&lt;br /&gt;
* Pagination should only be visible if there is more than one page of entries.&lt;br /&gt;
* The Table component needs to include a “disableGlobalFilter” option&lt;br /&gt;
&lt;br /&gt;
==== Task 1 Requirements ====&lt;br /&gt;
Task 1 deals with the UI changes needed for UI for Courses. All of these changes are done to the Courses page.&lt;br /&gt;
* The page’s header needs to be updated to follow text formatting guidelines.&lt;br /&gt;
* The table headers should follow non-header capitalization guidelines.&lt;br /&gt;
* The table should not use either the global or column filters.&lt;br /&gt;
* The date format used for the “Creation date” and “Updated date” should show the user’s local time and should not show seconds and milliseconds.&lt;br /&gt;
* The button for creating a course should be red, and contain the text “Create Course”.&lt;br /&gt;
* Confirmation buttons should be red.&lt;br /&gt;
* Text labels should follow non-header capitalization guidelines.&lt;br /&gt;
* Subsequent modals should also follow the same guidelines.&lt;br /&gt;
* Note: Manage TAs is part of task 2&lt;br /&gt;
&lt;br /&gt;
==== Task 2 Requirements ====&lt;br /&gt;
Task 2 deals with the UI changes needed for Reimplement add TA. All of these changes are done to the Manage TAs modal of the Courses page.&lt;br /&gt;
* The table headers should follow non-header capitalization guidelines.&lt;br /&gt;
* The table should not use either the global or column filters.&lt;br /&gt;
* The button for adding a TA should be updated.&lt;br /&gt;
* Confirmation buttons should be red.&lt;br /&gt;
* Error notification should use the Alert component.&lt;br /&gt;
* Text labels should follow non-header capitalization guidelines.&lt;br /&gt;
* Subsequent modals should also follow the same guidelines.&lt;br /&gt;
&lt;br /&gt;
==== Task 3 Requirements ====&lt;br /&gt;
Task 3 deals with the UI changes needed for UI for View Submissions.&lt;br /&gt;
* The table headers should follow non-header capitalization guidelines.&lt;br /&gt;
* The table should not use either the global or column filters.&lt;br /&gt;
* Text labels should follow non-header capitalization guidelines.&lt;br /&gt;
* Submission History should also follow the same guidelines&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, Teaching Assistant (TA) lists, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one TA entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Reusability: &amp;lt;/b&amp;gt; Promotes the reuse of modular table components and UI elements (like buttons, badges, or input fields) to reduce duplication and ensure uniform behavior throughout the application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Feedback &amp;amp; Visibility: &amp;lt;/b&amp;gt; Provides immediate feedback through hover states, alerts, and visual cues for actions like submission, deletion, or errors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Role-Based CRUD Operations: &amp;lt;/b&amp;gt; Implement precise role-based access control, allowing Admins and Instructors full CRUD permissions on assignment participants.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Modular and Scalable Architecture: &amp;lt;/b&amp;gt; Structure the backend with modular components and adhere to design principles (e.g., SRP, DRY) to make the system maintainable and scalable, allowing for future extensions with minimal code duplication and impact on existing functionality.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
&lt;br /&gt;
==== Task 1 ====&lt;br /&gt;
&lt;br /&gt;
Manage Courses &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-task-1-course-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-task-1-courses-after.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No pagination if there is only one page in the reimplemented UI:&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-task-1-courses-after-no-pagination.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Code snippet:&lt;br /&gt;
&lt;br /&gt;
Global filter span in the Table component changed:&lt;br /&gt;
&lt;br /&gt;
[[File: Tablespanchange.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code snippet was added to allow the global filter to be disabled via a &amp;quot;disableGlobalFilter&amp;quot; option of the Table component.&lt;br /&gt;
&lt;br /&gt;
==== Task 2 ====&lt;br /&gt;
&lt;br /&gt;
Manage TA modal &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:Manage-ta-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-TAmodal_after.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Add TA modal &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-task-2-manage-ta-add-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Manage-ta-add-after.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Add TA alert&lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Old-alert.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-alert-after.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Code Snippet:&lt;br /&gt;
&lt;br /&gt;
Icon change for adding TA:&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Code_snippets_for_icons_-a.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code snippet shows the updated button in the Manage TA modal of the Courses page.&lt;br /&gt;
&lt;br /&gt;
Alert messages change:&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-alerts.png|400px]]&lt;br /&gt;
&lt;br /&gt;
This code snippet shows the new Alert component that is consistent with the design guidelines.&lt;br /&gt;
&lt;br /&gt;
==== Task 3 ====&lt;br /&gt;
&lt;br /&gt;
Submissions Table &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Submission-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:Task3subafter.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Submissions History Table&lt;br /&gt;
&lt;br /&gt;
Original UI &lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Submission-history-before.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:Task3subhistafter.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Navbar &lt;br /&gt;
&lt;br /&gt;
Original UI&lt;br /&gt;
&lt;br /&gt;
[[File:E2523-Navbar-before.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Reimplemented UI&lt;br /&gt;
&lt;br /&gt;
[[File:Task3navbarafter.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Code Snippet:&lt;br /&gt;
&lt;br /&gt;
New Table:&lt;br /&gt;
&lt;br /&gt;
[[File:Task3-Code-Table.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
This code snippet shows the options used for the Table component that is in line with the design guidelines. In particular, both the global and column filters are disabled, and the table data uses the correct font size and line height.&lt;br /&gt;
&lt;br /&gt;
New Navbar:&lt;br /&gt;
&lt;br /&gt;
[[File:Codenavbar.png|400px]]&lt;br /&gt;
&lt;br /&gt;
The Submissions page was incorrectly named &amp;quot;Assignment&amp;quot; in the navigation bar, so now it has been moved into the Manage dropdown.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
Please find the demo video going over the features at https://youtu.be/hhPBc9CfjSs&lt;br /&gt;
&lt;br /&gt;
== List of Changes ==&lt;br /&gt;
&lt;br /&gt;
==== Non-task Specific ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
* &amp;lt;b&amp;gt;src/components/Table/Table.tsx&amp;lt;/b&amp;gt; - Updated table component to include a &amp;quot;disableGlobalFilter&amp;quot; option&lt;br /&gt;
&lt;br /&gt;
==== Task 1 ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/Courses.tsx&amp;lt;/b&amp;gt; - Updated text, table, and button formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/CourseColumns.tsx&amp;lt;/b&amp;gt; - Updated text and table formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/CourseCopy.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/CourseDelete.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;src/pages/Courses/CourseEditor.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
&lt;br /&gt;
==== Task 2 ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/TA/TA.tsx &amp;lt;/b&amp;gt; - Updated Icon, text and button formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/TA/TAColumns.tsx &amp;lt;/b&amp;gt; - Updated Icon&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/TA/TAEditor.tsx &amp;lt;/b&amp;gt; - Updated Icon, button, text and warning message formatting&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/TA/TADelete.tsx &amp;lt;/b&amp;gt; - Updated button formatting&lt;br /&gt;
&lt;br /&gt;
==== Task 3 ====&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/Submissions/SubmissionsView.tsx &amp;lt;/b&amp;gt; - Added new Table component. Updated text and button formatting&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/Submissions/SubmissionsHistoryView.tsx &amp;lt;/b&amp;gt; - Added new Table component. Updated text and button formatting.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/Submissions/SubmissionsTable/SubmissionsEntry.tsx &amp;lt;/b&amp;gt; - Added new Table component. Updated text and button formatting.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/pages/Submissions/SubmissionsTable/SubmissionsList.tsx &amp;lt;/b&amp;gt; - Added new Table component. Updated text and button formatting.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;/src/layout/Header.tsx &amp;lt;/b&amp;gt; - Removed the Assignments tab to add the Submissions tab under Manage.&lt;br /&gt;
&lt;br /&gt;
== Pull Request ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in this project through [https://github.com/expertiza/reimplementation-front-end/pull/93 this pull request].&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
The enhancements implemented in this project have greatly improved the UI consistency, usability, and maintainability of the Expertiza platform. By reworking outdated components and aligning them with modern design guidelines, we ensured a cleaner, more user-friendly experience across different user roles.&lt;br /&gt;
The following pull requests were central to our reimplementation work:&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/70&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/72&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/57&lt;br /&gt;
These PRs focused on restructuring table components, refining modal behavior, updating icons, enhancing accessibility, and ensuring overall alignment with the Expertiza design system. We successfully completed all assigned features and UI refinements while strictly adhering to the Expertiza design guidlines provided. This included updates to typography, spacing, component styling, and standardized interactions across the application.&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Enhancing TA UX: &amp;lt;/b&amp;gt; Improve user experience with editing and managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt; Backend Implementation/Integration of Submissions and Submissions History: &amp;lt;/b&amp;gt; Currently, the Submissions page uses mock data, as the backend is currently not developed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt; Implementation of Deleting TAs: &amp;lt;/b&amp;gt; While out of the scope of this project, the past project did not implement the deletion of TAs, so that feature is currently not available.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt; More Robust Logging: &amp;lt;/b&amp;gt; With more standardized logging, the debugging process could be streamlined, as useful information can be shown in the console.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/70&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/72&lt;br /&gt;
* https://github.com/expertiza/reimplementation-front-end/pull/57&lt;br /&gt;
* https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2461._UI_and_Backend_for_Courses&lt;br /&gt;
* https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&lt;br /&gt;
* https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2467._UI_for_View_Submissions&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Aryan Inguva &amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt; &lt;br /&gt;
* &amp;lt;b&amp;gt; Maya Mei &amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt; Shuba Shwetha Kalyanasundaram &amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164854</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164854"/>
		<updated>2025-04-23T00:12:43Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Design principles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Reusability: &amp;lt;/b&amp;gt; Promotes the reuse of modular table components and UI elements (like buttons, badges, or input fields) to reduce duplication and ensure uniform behavior throughout the application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Feedback &amp;amp; Visibility: &amp;lt;/b&amp;gt; Provides immediate feedback through hover states, alerts, and visual cues for actions like submission, deletion, or errors.&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164844</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164844"/>
		<updated>2025-04-23T00:01:52Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Design principles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Reusability: &amp;lt;/b&amp;gt; Promotes the reuse of modular table components and UI elements (like buttons, badges, or input fields) to reduce duplication and ensure uniform behavior throughout the application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Feedback &amp;amp; Visibility: &amp;lt;/b&amp;gt; Provides immediate feedback through hover states, alerts, and visual cues for actions like submission, deletion, or errors.&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
====Frontend====&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/App.tsx&amp;lt;/b&amp;gt; - Adding the new route and appropriate props.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Addition of API calls and appropriate state creation.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Removal of redundant sliders to edit permissions.&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/utils/interfaces.ts&amp;lt;/b&amp;gt; - Addition of IAssignmentParticipantResponse interface.&lt;br /&gt;
&lt;br /&gt;
====Backend====&lt;br /&gt;
*&amp;lt;b&amp;gt;app/controllers/api/v1/participants_controller.rb&amp;lt;/b&amp;gt; - Adding the participant role as part of authorization.&lt;br /&gt;
*&amp;lt;b&amp;gt;app/helper/participant_helper.rb&amp;lt;/b&amp;gt; - Adding participant to the permissions map which manages changes to permission due to change in role.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;State &amp;amp; architecture improvements&amp;lt;/b&amp;gt;: Leveraging React+TypeScript, Redux Toolkit, and a custom API hook for clean state management and scalable component communication.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164828</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164828"/>
		<updated>2025-04-22T23:20:49Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Relevant Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Implemented Changes ====&lt;br /&gt;
&lt;br /&gt;
1) App.tsx &lt;br /&gt;
* The path now correctly points to the new participants page as opposed to the older one while also passing the right props in the router.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-routes.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
2) interfaces.ts&lt;br /&gt;
* A new interface, IAssignmentParticipantResponse has been added to structure the response data in the interfaces.ts file. &lt;br /&gt;
[[File: E2540-interface.png | 400px]]&lt;br /&gt;
&lt;br /&gt;
3) AssignmentParticipants.tsx &lt;br /&gt;
* The appropriate fetch calls have been added to populate the participants table from the DB using the backend APIs namely fetchParticipants, fetchUsers, fetchAssignements. It is filtered by assignment due to how it can be accessed through the Assignments Table.&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-fetchcalls.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The participants state contains the following parameters which is stored and used while fetching, editing or deleting the table.&lt;br /&gt;
[[File: E2540-participantstate.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
* The code to using the static data has been replaced by API calls for add, edit and delete as seen below.&lt;br /&gt;
&lt;br /&gt;
Add&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-addparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
Edit - Users and Participants table can be updated&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-editparticipant.png | 250px]]&lt;br /&gt;
&lt;br /&gt;
Delete&lt;br /&gt;
&lt;br /&gt;
[[File: E2540-deleteparticipant.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
4) EditParticipantModal.tsx&lt;br /&gt;
* The permission sliders in the edit modal (seen in the below screenshot) which were a redundant feature has been removed as authorization role (Participant, Reader, Reviewer, Submitter, Mentor) automatically updates the permissions the user has. &lt;br /&gt;
[[File: E2540-sliders.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
5) participant_controller.rb&lt;br /&gt;
* The backend was changed to incorporate &amp;quot;participant&amp;quot; as a role in participants_controller.rb and participants_helper.rb to manage permissions.&lt;br /&gt;
[[File: E2540-backend.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* The TA role is to be added post merge of the TA feature.&lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;State &amp;amp; architecture improvements&amp;lt;/b&amp;gt;: Leveraging React+TypeScript, Redux Toolkit, and a custom API hook for clean state management and scalable component communication.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document:&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164802</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164802"/>
		<updated>2025-04-22T22:51:36Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Implemented Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
Update the URLs of the API calls to properly integrate with the backend. There also needs to be logic to handle getting participants by user or by assignment.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;State &amp;amp; architecture improvements&amp;lt;/b&amp;gt;: Leveraging React+TypeScript, Redux Toolkit, and a custom API hook for clean state management and scalable component communication.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;xii.-references&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164801</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164801"/>
		<updated>2025-04-22T22:47:34Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Implemented Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
===* Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
Update the URLs of the API calls to properly integrate with the backend. There also needs to be logic to handle getting participants by user or by assignment.&lt;br /&gt;
&lt;br /&gt;
===* Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===* Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;State &amp;amp; architecture improvements&amp;lt;/b&amp;gt;: Leveraging React+TypeScript, Redux Toolkit, and a custom API hook for clean state management and scalable component communication.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;xii.-references&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164800</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164800"/>
		<updated>2025-04-22T22:45:33Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Implemented Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
===* Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
Update the URLs of the API calls to properly integrate with the backend. There also needs to be logic to handle getting participants by user or by assignment.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Implemented changes ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;State &amp;amp; architecture improvements&amp;lt;/b&amp;gt;: Leveraging React+TypeScript, Redux Toolkit, and a custom API hook for clean state management and scalable component communication.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;xii.-references&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164799</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164799"/>
		<updated>2025-04-22T22:45:05Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
Update the URLs of the API calls to properly integrate with the backend. There also needs to be logic to handle getting participants by user or by assignment.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Implemented changes ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;State &amp;amp; architecture improvements&amp;lt;/b&amp;gt;: Leveraging React+TypeScript, Redux Toolkit, and a custom API hook for clean state management and scalable component communication.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;xii.-references&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164794</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164794"/>
		<updated>2025-04-22T22:42:05Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
Update the URLs of the API calls to properly integrate with the backend. There also needs to be logic to handle getting participants by user or by assignment.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Implemented changes ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* The frontend code requires refactoring to follow the design guidelines of expertiza. The structure of the code in the three files - AssignmentParticipants.tsx, ConfirmRemoveModal.tsx and EditParticipantModal.tsx must be changed such that the API calls are moved to the files which would handle add, edit and delete. Also the stylesheets (the .css files) must be moved to ensure it follows the pattern of the other features. &lt;br /&gt;
&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;State &amp;amp; architecture improvements&amp;lt;/b&amp;gt;: Leveraging React+TypeScript, Redux Toolkit, and a custom API hook for clean state management and scalable component communication.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;xii.-references&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164791</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164791"/>
		<updated>2025-04-22T22:36:20Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Relevant Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Design principles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Reusability: &amp;lt;/b&amp;gt; Promotes the reuse of modular table components and UI elements (like buttons, badges, or input fields) to reduce duplication and ensure uniform behavior throughout the application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Feedback &amp;amp; Visibility: &amp;lt;/b&amp;gt; Provides immediate feedback through hover states, alerts, and visual cues for actions like submission, deletion, or errors.&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
Update the URLs of the API calls to properly integrate with the backend. There also needs to be logic to handle getting participants by user or by assignment.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Implemented changes ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;State &amp;amp; architecture improvements&amp;lt;/b&amp;gt;: Leveraging React+TypeScript, Redux Toolkit, and a custom API hook for clean state management and scalable component communication.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki that we referred to:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;xii.-references&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164786</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164786"/>
		<updated>2025-04-22T22:28:44Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Update Frontend UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Design principles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Reusability: &amp;lt;/b&amp;gt; Promotes the reuse of modular table components and UI elements (like buttons, badges, or input fields) to reduce duplication and ensure uniform behavior throughout the application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Feedback &amp;amp; Visibility: &amp;lt;/b&amp;gt; Provides immediate feedback through hover states, alerts, and visual cues for actions like submission, deletion, or errors.&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
Update the URLs of the API calls to properly integrate with the backend. There also needs to be logic to handle getting participants by user or by assignment.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Implemented changes ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;State &amp;amp; architecture improvements&amp;lt;/b&amp;gt;: Leveraging React+TypeScript, Redux Toolkit, and a custom API hook for clean state management and scalable component communication.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;xii.-references&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164781</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164781"/>
		<updated>2025-04-22T22:27:49Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Update Frontend UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Design principles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Reusability: &amp;lt;/b&amp;gt; Promotes the reuse of modular table components and UI elements (like buttons, badges, or input fields) to reduce duplication and ensure uniform behavior throughout the application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Feedback &amp;amp; Visibility: &amp;lt;/b&amp;gt; Provides immediate feedback through hover states, alerts, and visual cues for actions like submission, deletion, or errors.&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
Update the URLs of the API calls to properly integrate with the backend. There also needs to be logic to handle getting participants by user or by assignment.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
==== Implemented changes ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;State &amp;amp; architecture improvements&amp;lt;/b&amp;gt;: Leveraging React+TypeScript, Redux Toolkit, and a custom API hook for clean state management and scalable component communication.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;xii.-references&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164765</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164765"/>
		<updated>2025-04-22T22:19:25Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Design principles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Reusability: &amp;lt;/b&amp;gt; Promotes the reuse of modular table components and UI elements (like buttons, badges, or input fields) to reduce duplication and ensure uniform behavior throughout the application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Feedback &amp;amp; Visibility: &amp;lt;/b&amp;gt; Provides immediate feedback through hover states, alerts, and visual cues for actions like submission, deletion, or errors.&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
Update the URLs of the API calls to properly integrate with the backend. There also needs to be logic to handle getting participants by user or by assignment.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 Before-remove-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
==== Implemented changes ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting were changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-participant-list.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to capitalize the first letter of the first word.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 after-add-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Save changes&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-edit-participant.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the screenshot below, the improper text and button formatting was changed according to the design guidelines, and the &amp;quot;Confirm&amp;quot; button was changed to red. The redundancy with the Cancel and X (close) buttons was also  removed.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 After-delete-modal.png |600px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red. The cancel button was removed to eliminate redundancy.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants. Shown in the demo video.&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions. Shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant. Shown in the demo video.&lt;br /&gt;
* Ensure the table has proper pagination. Shown in the demo video.&lt;br /&gt;
* Ensure the table text format has the correct font size and line height. As shown in the screenshot below, the table content has the proper font size, and the casing is correct.&lt;br /&gt;
[[File:Spring 2025 - E2540 Table-font-size-check.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
* Enforce CRUD permissions of participants in backend.&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
You can find the demo video going over the features [https://youtu.be/Zxt6-GaokJA here]&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
This project has successfully modernized and integrated the Assignment Participants page in Expertiza by:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Linking frontend to backend&amp;lt;/b&amp;gt;: Replacing hard‑coded data with robust API calls to the Rails participant_controller, ensuring live, per‑assignment participant data is fetched and rendered dynamically.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;UI alignment&amp;lt;/b&amp;gt;: Updating table layouts, buttons, modals, and pagination to match the new design guidelines, improving consistency, readability, and user feedback.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;State &amp;amp; architecture improvements&amp;lt;/b&amp;gt;: Leveraging React+TypeScript, Redux Toolkit, and a custom API hook for clean state management and scalable component communication.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;Testing &amp;amp; validation&amp;lt;/b&amp;gt;: Performing thorough manual integration and UI tests (as shown in the demo video) to confirm correct CRUD operations, styling, and iconography across all participant flows.&lt;br /&gt;
&lt;br /&gt;
These changes not only deliver a smoother, more reliable participant management experience aligned with Expertiza’s collaborative learning objectives, but also establish a clear foundation for future enhancements—such as enforcing backend permissions, adding automated test suites, and extending participant features.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;xii.-references&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164707</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164707"/>
		<updated>2025-04-22T18:33:00Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Design principles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Reusability: &amp;lt;/b&amp;gt; Promotes the reuse of modular table components and UI elements (like buttons, badges, or input fields) to reduce duplication and ensure uniform behavior throughout the application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Feedback &amp;amp; Visibility: &amp;lt;/b&amp;gt; Provides immediate feedback through hover states, alerts, and visual cues for actions like submission, deletion, or errors.&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
Update the URLs of the API calls to properly integrate with the backend. There also needs to be logic to handle getting participants by user or by assignment.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[ |900px|]]&lt;br /&gt;
&lt;br /&gt;
==== Implemented changes ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting are to be changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[ |900px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to normal case&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ |900px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, the is improper text and button formatting is changed according to the design guidelines, the &amp;quot;Save changes&amp;quot; button is changed to red. The redundancy with the Cancel and X (close) buttons is also  removed&lt;br /&gt;
&lt;br /&gt;
[ |900px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red, the cancel button is removed to eliminate redundancy&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, the is improper text and button formatting is changed according to the design guidelines, the &amp;quot;Confirm&amp;quot; button is changed to red. The redundancy with the Cancel and X (close) buttons is also  removed&lt;br /&gt;
&lt;br /&gt;
[[ |900px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red, the cancel button is removed to eliminate redundancy&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants&lt;br /&gt;
* Ensure role-based access to participants&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant&lt;br /&gt;
* Ensure the table text format has the correct font size and line height&lt;br /&gt;
* Ensure the table has proper pagination&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
Please find the demo video going over the features at []&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;xi.-links&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;xii.-references&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164706</id>
		<title>CSC/ECE 517 Spring 2025 - E2540 Integration of Assignment participant Frontend with participant controller Backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2540_Integration_of_Assignment_participant_Frontend_with_participant_controller_Backend&amp;diff=164706"/>
		<updated>2025-04-22T18:31:04Z</updated>

		<summary type="html">&lt;p&gt;Skalyan3: /* Technologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project developed with Ruby on Rails with the purpose of providing a platform for students to learn from one another through peer review.This project aims to fix the defects and improve the functionality in Expertiza of the Participants UI and integration. It will make the functionality smoother, more reliable, and align with Expertiza's collaborative learning objectives.&lt;br /&gt;
The participants tab is linked to the Assignments tab and contains a table of participants in an assignment. It allows the user to add, delete and edit participants as well. &lt;br /&gt;
&lt;br /&gt;
=== Project Goals ===&lt;br /&gt;
There are 2 main goals for this project - &lt;br /&gt;
&lt;br /&gt;
* Appropriately integrating the frontend to the backend which currently fetches static data and is not connected to the backend robustly.&lt;br /&gt;
* Changing up the UI to match the novel standards set by the new version using the design document. It will involve formatting and using the recommended guidelines to implement parts of the page such as tables and table filtering.&lt;br /&gt;
&lt;br /&gt;
== Sequence Diagram ==&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Sequence_diagram.png|400px|]]&lt;br /&gt;
&lt;br /&gt;
*This sequence diagram illustrates the complete interaction flow between the User, the UI Component, and the Backend Controller during the process of opening and displaying the Participants page for an assignment in the Expertiza system.&lt;br /&gt;
&lt;br /&gt;
*The flow begins when the user selects an assignment, prompting the UI to request participant data from the backend. The backend processes this request and responds with a structured JSON payload. Once received, the frontend dynamically renders the participants table using an improved layout, potentially including grouped columns, collapsible sections, or enhanced filters.&lt;br /&gt;
&lt;br /&gt;
*The diagram emphasizes how the frontend and backend collaborate to display live participant information in a modernized, React-based interface, replacing previously hardcoded or static displays.&lt;br /&gt;
&lt;br /&gt;
== Functional Requirements ==&lt;br /&gt;
&lt;br /&gt;
== Technical Design ==&lt;br /&gt;
&lt;br /&gt;
====1. Frontend ====&lt;br /&gt;
The application is developed using React with TypeScript, enforcing a strongly-typed, modular, and scalable architecture. The combination of TypeScript and React provides compile-time type checking and improved developer tooling such as autocompletion, interfaces, and error detection. This makes the codebase more maintainable and less prone to runtime errors.&lt;br /&gt;
&lt;br /&gt;
======Main Table Component: ======&lt;br /&gt;
* Serves as the central layout element for multiple modules like reviewer assignments, and user management.&lt;br /&gt;
* Dynamically renders rows and columns based on props and external data.&lt;br /&gt;
* Incorporates reusable logic like sorting, filtering, pagination, and responsive design.&lt;br /&gt;
&lt;br /&gt;
=====Row Components:=====&lt;br /&gt;
* Represent individual units of data such as one Assignment entry or one review entry.&lt;br /&gt;
* Contain contextual actions like Delete, Edit, Confirm, Submit.&lt;br /&gt;
* Includes modal triggers or dynamic tooltips.&lt;br /&gt;
&lt;br /&gt;
=====Helper Components:=====&lt;br /&gt;
* Used for encapsulating business logic or UI elements such as tooltips, alert banners, loaders, and tag renderers.&lt;br /&gt;
* Commonly uses components like dropdown selectors, role toggles, and conditional status displays.&lt;br /&gt;
&lt;br /&gt;
=====Modal Components:=====&lt;br /&gt;
* Used for confirming actions like deletion, submission, or role changes.&lt;br /&gt;
* Tied closely to global state (e.g., Redux or Context) to remain consistent across modules.&lt;br /&gt;
&lt;br /&gt;
====2. State Management====&lt;br /&gt;
State management in this application is handled using a layered strategy, combining React Hooks, Context API, Redux Toolkit, and a custom API integration hook. This ensures a clean separation of concerns, scalable logic handling, and seamless component communication across the app.&lt;br /&gt;
&lt;br /&gt;
* React Hooks: useState, useEffect, useMemo, useCallback - For managing and optimizing local component state.&lt;br /&gt;
&lt;br /&gt;
* React Context API: Centralized state sharing for cross-component communication (used for shared data like authentication and user role).&lt;br /&gt;
&lt;br /&gt;
* REdux Toolkit(with React-Redux): Handles global state logic such as authentication, alert messages and persistent settings.&lt;br /&gt;
&lt;br /&gt;
* API Integration: Custom useAPI hook manages asynchronous API requests, error handling and response processing. All backend communication is abstracted here for clean separation of concerns.&lt;br /&gt;
&lt;br /&gt;
==== 3. Styling and UI ====&lt;br /&gt;
* SCSS / CSS Modules: Used for modular and scoped styling which promotes maintainable and reusable style definitions.&lt;br /&gt;
&lt;br /&gt;
* Bootstrap / React-Bootstrap: Provides consistent components like Button, Row, Col, and Modal aligned with Expertiza’s design system&lt;br /&gt;
&lt;br /&gt;
* CSS-inJS: Not used directly but alternatives like inline styles and component based styling via props are utilized in some components.&lt;br /&gt;
&lt;br /&gt;
* Custom Styles: Additional custom classes are used for tooltips, warning messages from controls and icon replacements to match the UI guidelines.&lt;br /&gt;
&lt;br /&gt;
====4. Backend ====&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Design principles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Consistency: &amp;lt;/b&amp;gt; Ensures a uniform experience by maintaining consistent typography, color schemes, iconography, spacing, and component behavior across all views and tables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Readability: &amp;lt;/b&amp;gt; Enhances user comprehension through a clean, structured layout, appropriate font sizes, adequate white space, and proper alignment of content.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Simplicity: &amp;lt;/b&amp;gt; Reduces cognitive load by eliminating non-essential elements, minimizing the number of visible actions, and focusing user attention on primary content and controls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Reusability: &amp;lt;/b&amp;gt; Promotes the reuse of modular table components and UI elements (like buttons, badges, or input fields) to reduce duplication and ensure uniform behavior throughout the application.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Scalability: &amp;lt;/b&amp;gt; UI components are built in a modular and extensible way, allowing easy integration of additional features without breaking the existing design.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Feedback &amp;amp; Visibility: &amp;lt;/b&amp;gt; Provides immediate feedback through hover states, alerts, and visual cues for actions like submission, deletion, or errors.&lt;br /&gt;
&lt;br /&gt;
Must add relevant for Backend here&lt;br /&gt;
&lt;br /&gt;
== Technologies ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Frontend:&amp;lt;/b&amp;gt; React, TypeScript&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;State Management:&amp;lt;/b&amp;gt; React Hooks (useState, useEffect, useMemo, useCallback),  React Context API,  Redux Toolkit (with useDispatch, useSelector)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Styling and UI: &amp;lt;/b&amp;gt; CSS Modules / SCSS, Bootstrap / React Bootstrap&lt;br /&gt;
&lt;br /&gt;
Must add relevant for backend&lt;br /&gt;
&lt;br /&gt;
== Implemented Changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
The current implementation makes use of API calls to incorrect routes. This may be due to the frontend being implemented before the backend and wrong assumptions were made, or the backend's code has been updated without changing the frontend. In either case, the frontend needs to be properly integrated with the backend.&lt;br /&gt;
&lt;br /&gt;
[[File:E2540-before-ParticipantCode.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The screenshot shows the current API calls. Notice that one of the URLs is &amp;quot;participants/[type]/[id]&amp;quot;. This is intended to fetch the participants to put into the table. However, the closest URLs are either &amp;quot;participants/user/[id]&amp;quot; or &amp;quot;participants/assignment/[id]&amp;quot;. The URLs for applying CRUD to participants need to be updated to conform with the backend.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
Update the URLs of the API calls to properly integrate with the backend. There also needs to be logic to handle getting participants by user or by assignment.&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting have to be changed according to the new guidelines. Also pagination must be implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted must also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540_Participants_list_page.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; has to be changed according to the new design guidelines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add_participants.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 -Edit_partcipants.png |900px|]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, there is improper text and button formatting. There is also a redundancy with the Cancel and X (close) buttons which should be removed&lt;br /&gt;
&lt;br /&gt;
[[ |900px|]]&lt;br /&gt;
&lt;br /&gt;
==== Implemented changes ====&lt;br /&gt;
* &amp;lt;b&amp;gt;Participants list page&amp;lt;/b&amp;gt;&lt;br /&gt;
As seen in the below screenshot, the icon, button and text formatting are to be changed according to the new design guidelines. Pagination is implemented to ensure the component is only visible when the list of columns exceeds one full page. The new table component with the filter span adjusted is also be implemented.&lt;br /&gt;
&lt;br /&gt;
[[ |900px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added for pagination&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025- E2540 - Pagination.png|500px]]&lt;br /&gt;
&lt;br /&gt;
This code was added to update the table according to the design document&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Table.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Add participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot button color of the &amp;quot;Add user&amp;quot; is changed to Red according to the new design guidelines and camel case has been changed to normal case&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ |900px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Add user&amp;quot; button to red&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Add user.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Edit participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, the is improper text and button formatting is changed according to the design guidelines, the &amp;quot;Save changes&amp;quot; button is changed to red. The redundancy with the Cancel and X (close) buttons is also  removed&lt;br /&gt;
&lt;br /&gt;
[ |900px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Save changes&amp;quot; button to red, the cancel button is removed to eliminate redundancy&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 E2540 - Edit participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Delete participants&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As seen in the below screenshot, the is improper text and button formatting is changed according to the design guidelines, the &amp;quot;Confirm&amp;quot; button is changed to red. The redundancy with the Cancel and X (close) buttons is also  removed&lt;br /&gt;
&lt;br /&gt;
[[ |900px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Code snippets&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code was added to update the &amp;quot;Confirm&amp;quot; to red, the cancel button is removed to eliminate redundancy&lt;br /&gt;
&lt;br /&gt;
[[File:Spring 2025 - E2540 - Delete participant.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
==== Problem ====&lt;br /&gt;
&lt;br /&gt;
Most of the changes needed for this problem is for adding a new participant. In particular, there is not a dedicated form for creating a new participant, simply a button that fills in default information. The edit and remove forms need to also have some small formatting changes.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
The form for editing should be the same as for creating a participant, except that we change some text. Then, the edit/create form and the remove form has some minor text formatting changes, as well as removing some redundant buttons.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Tests ===&lt;br /&gt;
&lt;br /&gt;
The project will test different aspects of the frontend code in order to ensure the integration of the backend, as well as ensuring the proper formatting of the page.&lt;br /&gt;
&lt;br /&gt;
==== Frontend/Backend Integration Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the table shows participants&lt;br /&gt;
* Ensure role-based access to participants&lt;br /&gt;
* Ensure participants are properly updated/created with proper permissions&lt;br /&gt;
&lt;br /&gt;
==== UI Tests ====&lt;br /&gt;
&lt;br /&gt;
* Ensure the proper icon is used for editing a participant&lt;br /&gt;
* Ensure the proper icon is used for deleting a participant&lt;br /&gt;
* Ensure the table text format has the correct font size and line height&lt;br /&gt;
* Ensure the table has proper pagination&lt;br /&gt;
&lt;br /&gt;
== Future Scope ==&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&lt;br /&gt;
Please find the demo video going over the features at []&lt;br /&gt;
&lt;br /&gt;
== Pull Requests ==&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Frontend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
You can find the changes made in the Backend of this project project through [].&lt;br /&gt;
&lt;br /&gt;
== List of changes ==&lt;br /&gt;
&lt;br /&gt;
=== Manage Participant Frontend Integration ===&lt;br /&gt;
&lt;br /&gt;
=== Update Frontend UI ===&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;b&amp;gt;src/components/Table/Pagination.tsx&amp;lt;/b&amp;gt; - Updated pagination component to only be visible if there is more than one page&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/AssignmentParticipants.tsx&amp;lt;/b&amp;gt; - Updated icon, text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/EditParticipantModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ConfirmRemoveModal.tsx&amp;lt;/b&amp;gt; - Updated text and button formatting&lt;br /&gt;
*&amp;lt;b&amp;gt;/src/pages/AssignmentParticipants/ParticipantsTable.tsx&amp;lt;/b&amp;gt; - Added new Table component and updated icon, text and button formatting&lt;br /&gt;
&lt;br /&gt;
=== Add/Edit/Remove Participants ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;xi.-links&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
Pull Request that we worked on:&lt;br /&gt;
[https://github.com/expertiza/reimplementation-front-end/pull/79]&lt;br /&gt;
&lt;br /&gt;
Previous Wiki:  &lt;br /&gt;
[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2490.1_Improving_Assignment_Participants_Management_UI_in_Expertiza &amp;lt;u&amp;gt;Link&amp;lt;/u&amp;gt;]  &lt;br /&gt;
&lt;br /&gt;
Guidance on Using Service Objects in Rails:&lt;br /&gt;
[https://www.toptal.com/ruby-on-rails/rails-service-objects-tutorial Rails Service Objects Tutorial]&lt;br /&gt;
&lt;br /&gt;
Design Document&lt;br /&gt;
[https://github.com/AnvithaReddyGutha/reimplementation-front-end/blob/main/design_document.md]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;xii.-references&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Mentor ==&lt;br /&gt;
* &amp;lt;b&amp;gt; Anvitha Reddy Gutha &amp;lt;/b&amp;gt; &amp;lt;agutha@ncsu.edu&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Members ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Aryan Inguva&amp;lt;/b&amp;gt; &amp;lt;ainguva@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Maya Mei&amp;lt;/b&amp;gt; &amp;lt;gmei@ncsu.edu&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;Shuba Shwetha Kalyanasundaram&amp;lt;/b&amp;gt; &amp;lt;skalyan3@ncsu.edu&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skalyan3</name></author>
	</entry>
</feed>