Skip to content

G2-MMS: Update central mess frontend UI to match G2-MMS backend workf…#230

Open
Zapper9982 wants to merge 1 commit into
FusionIIIT:mainfrom
Zapper9982:main
Open

G2-MMS: Update central mess frontend UI to match G2-MMS backend workf…#230
Zapper9982 wants to merge 1 commit into
FusionIIIT:mainfrom
Zapper9982:main

Conversation

@Zapper9982

Copy link
Copy Markdown

Issue that this pull request solves

Closes: N/A

Proposed changes

Brief description of what is fixed or changed

This PR updates the Central Mess frontend UI to align with the new G2-MMS backend workflows.

Key changes include:

  • Added updated dashboard layout for Central Mess users.
  • Added frontend screens for menu polls and student voting.
  • Added mess announcements UI for viewing and managing announcements.
  • Added warden decision desk for escalated mess requests.
  • Added vacation survey UI for collecting student food preferences.
  • Updated registration, deregistration, rebate, special food, payment, menu, feedback, and bill views.
  • Updated routes and API integrations to use the new backend endpoints.
  • Improved UI consistency across student, caretaker, and warden mess workflows.
  • Updated sidebar navigation for the new mess module screens.

Types of changes

Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (please describe):

Checklist

Put an x in the boxes that apply

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have created new branch for this pull request
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • My changes does not break the current system and it passes all the current test cases.

Screenshots

Please attach screenshots of the updated Central Mess frontend screens, especially:

  • Student dashboard
  • Caretaker dashboard
  • Warden dashboard
  • Menu polls
  • Announcements
  • Warden decision desk
  • Vacation survey

Other information

This frontend PR depends on the corresponding G2-MMS backend API changes being merged/deployed.

@vikrantwiz02 vikrantwiz02 self-requested a review May 27, 2026 21:38

@vikrantwiz02 vikrantwiz02 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Critical

  • Auth token is never null-checked before use — every component reads localStorage.getItem('authToken') and immediately interpolates it into the Authorization header (Token ${token}). When no token is present this sends Authorization: Token null to the backend, which will fail silently on the client. Check for a missing token and redirect or surface an error before making any request.

  • 18+ components each read the auth token independently from localStorage — there is no centralized axios interceptor. Any change to the token key name or storage strategy requires updating every component. This is a maintenance and consistency risk; a single request interceptor should attach the header globally.

Should Not Be Committed

  • VacationSurvey.jsx (551 lines) is unreachable — both StudentVacationSurvey and CaretakerVacationSurvey are commented out in every import location (StudentIndex.jsx, CaretakerIndex.jsx). The component ships with this PR but can never be rendered. Either wire it up or remove it.

  • src/Modules/FileTracking/components/Archive.jsx — changed a single icon (FolderNotchFolder) in a file entirely unrelated to the Central Mess module. This unrelated modification should not be part of this PR.

Minor

  • The commented-out // import { StudentVacationSurvey } and // component: <StudentVacationSurvey /> lines indicate work-in-progress code that should either be completed or removed before merge.


const getHeaders = () => {
const token = localStorage.getItem("authToken");
return { Authorization: `Token ${token}` };

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

localStorage.getItem('authToken') returns null when the user is not authenticated. This function passes null directly into the header string, sending Authorization: Token null to the backend. Add a null check:

const getHeaders = () => {
  const token = localStorage.getItem('authToken');
  if (!token) throw new Error('Not authenticated');
  return { Authorization: `Token ${token}` };
};

@@ -0,0 +1,551 @@
import React, { useEffect, useState } from "react";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This 551-line component is never imported anywhere in the navigation tree — the imports are commented out in both StudentIndex.jsx and CaretakerIndex.jsx. Shipping dead components adds bundle weight and creates confusion. Complete the wiring or remove this file before merging.

FileText,
FolderNotch,
Folder,
} from "@phosphor-icons/react";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This icon rename (FolderNotchFolder) is unrelated to the Central Mess module. Changes to FileTracking should go through a separate PR targeting that module.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants