Skip to content

G1 - HR Module#228

Open
nkg05official wants to merge 18 commits into
FusionIIIT:hr-eis-v1from
nkg05official:hr-eis-v1
Open

G1 - HR Module#228
nkg05official wants to merge 18 commits into
FusionIIIT:hr-eis-v1from
nkg05official:hr-eis-v1

Conversation

@nkg05official

Copy link
Copy Markdown

G1 - HR Module

Copilot AI review requested due to automatic review settings May 9, 2026 06:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@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.

Code Review — G1 HR Module (Frontend)

The refactor is meaningful — useFetchData hook reduces boilerplate across pages, the services/api.js centralisation is the right move, and SubstituteNomination/SubstituteInbox add genuinely new functionality. Critical blocker: the entire venv/ directory (1,099 Python files) is committed — this must be removed before merge. Other issues inline.

} finally {
setLoading(false);
}
};

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.

ESLint exhaustive-deps warning on deps. Passing the deps array as a direct variable to useEffect triggers the react-hooks/exhaustive-deps rule because ESLint cannot statically analyse it. This is a known pattern trade-off — if you keep it, add // eslint-disable-next-line react-hooks/exhaustive-deps above the useEffect to make the suppression explicit, or document the requirement that callers must memoize their deps argument.

Comment thread src/routes/hr/index.jsx
export const handle_leave_academic_responsibility = `${host}/hr2/api/handle_leave_academic_responsibility`;
export const handle_leave_administrative_responsibility = `${host}/hr2/api/handle_leave_administrative_responsibility`;
export const download_leave_form_pdf = `${host}/hr2/api/download_leave_form_pdf`;
export const download_leave_form_pdf = (formId) =>

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.

download_leave_form_pdf changed from a string constant to a function — breaking change for existing callers. Any component that previously used it as a URL string (e.g. href={download_leave_form_pdf}) will now render function (formId) {...} as the href. Audit all existing usages across the module before merging this change.

Comment thread src/App.jsx
<Layout>
<HR />
</Layout>
}

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.

/hr/* route has no RequireAuth guard. All other protected routes in this file (dashboard, academics, profile, examination, etc.) are wrapped in <RequireAuth>. The HR route is not. An unauthenticated user who navigates directly to /hr will hit the HR module instead of being redirected to login.

role &&
(facultyRoles.includes(role) || role.toLowerCase().includes("faculty"));

const filterModules = Modules.filter((module) => {

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.

HR sidebar item is only shown for faculty roles — students and others cannot access it at all. The filter shows the HR module only when isFaculty is true. If students or admin staff also need HR access (e.g. leave forms), this gates them out entirely. Verify the intended access matrix and either expand the condition or document that HR is faculty-only.

@@ -0,0 +1,565 @@
// src/Modules/HR/services/hrApi.js

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.

File header comment says src/Modules/HR/services/hrApi.js but the actual filename is api.js. Update the comment to match, or rename the file — stale path comments in the header cause confusion when searching the codebase.

@vikrantwiz02

Copy link
Copy Markdown
Member

Critical: venv/ directory committed (1,099 files, ~210k lines of diff). The entire Python virtual environment is tracked in this repo. This:

  • Bloats the repo permanently (virtual envs are OS/Python-version specific)
  • Adds binary .exe files to a frontend JS repo
  • Makes the actual 105 source-file changes nearly impossible to review

Fix:

git rm -r --cached venv/
echo 'venv/' >> .gitignore
git add .gitignore
git commit -m "Remove committed venv, add to gitignore"
git push

Also: src/Modules/HR.zip is committed. Binary archive inside src/ provides no value — the source is already in src/Modules/HR/. Remove it.

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.

5 participants