Skip to content

Prajwal fix resume upload requirement and label consistency across job roles - #5660

Open
PrajwalpGM256 wants to merge 2 commits into
developmentfrom
Prajwal_fix_resume_upload_label_validation
Open

PrajwalpGM256 wants to merge 2 commits into
developmentfrom
Prajwal_fix_resume_upload_label_validation

Conversation

@PrajwalpGM256

@PrajwalpGM256 PrajwalpGM256 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes # 53 (bug list priority medium) — Jobs Component: Resume Upload Requirement & Label Inconsistencies Across Job Roles

On /job-application, the resume upload was only required when a role's form template happened to contain a required "resume" question. As a result, the default role ("APPLIED THROUGH SITE - SEEKING SOFTWARE POSITION") showed "Upload Resume (optional)" and allowed submission without a resume, while other roles required it and the label text varied by role.

This PR makes the resume mandatory for every role and uses a single "Upload Resume *" label, matching the other required fields.

Related PRS (if any):

None — frontend only.

Main changes explained:

  • Update JobApplicationForm.jsx:
    • Remove formRequiresResumeUpload; resume is now always required in submit validation.
    • Use a single Upload Resume label with the shared required asterisk (removes the "(optional)" variant).
    • Export collectMissingRequiredFields for unit testing.
  • Update jobApplicationQuestionUtils.js:
    • Move isResumeQuestion here so it's shared with isJobApplicationFileUploadQuestion (previously duplicated regex).
    • Fix the regex: \b is ASCII-only in JS, so "résumé" never matched. Now uses Unicode-aware boundaries.
  • Create __tests__/jobApplicationResumeRequirement.test.js:
    • Resume is reported missing for templates without a resume question (the WBS 4.2.1/User management grid and search  #53 regression) and cleared once a file is attached.
    • isResumeQuestion matches Resume / Résumé / CV / Curriculum Vitae and ignores partial words ("Resumes", "cvs").

How to test:

  1. check into current branch
  2. use Node 22 (see .nvmrc), run "npm install", then "npm run start:local"
  3. Clear site data/cache
  4. go to /job-application (no login needed)
  5. With the default role ("APPLIED THROUGH SITE - SEEKING SOFTWARE POSITION") selected, verify the label reads "Upload Resume *". Submit without a file: submission is blocked (the browser shows "Please select a file." or the missing-fields toast lists "Resume")
  6. Switch to a few other roles in the dropdown and verify the same label and the same blocking behavior
  7. Attach a PDF over 5 MB: "File too large, max 5 MB." appears under the field and the file is not kept
  8. Attach a PDF/DOCX under 5 MB → submit succeeds; click "Remove" → submit is blocked again
  9. Run npx vitest run src/components/Collaboration — all tests pass
  10. verify this new feature works in dark mode

Screenshots or videos of changes:

Before:

image image

After:

image image

Note:

  • Product decision: the ticket allowed either "mandatory for all roles" or "governed per role by the Job Form Builder". This PR goes with mandatory for all roles. Please flag if the default role is meant to stay optional.
  • Out of scope, filed separately: in dark mode all required-field asterisks render white, because public/index.css sets body.dark-mode * { color: #fff !important }. This is pre-existing and affects every required field.
  • Testing tip: submitting twice with the same applicant name on the same form returns a 500. The dev DB has a stale unique index formId_1_respondent_1 on jobapplications. This is unrelated to this PR; use a different name per test submission.

Fixes bug #53

Fix: resume upload is now required for every role with one 'Upload Resume *' label; previously the default 'Seeking Software Position' role allowed submitting without a resume and labels varied by role.

Refactor: moved isResumeQuestion to jobApplicationQuestionUtils and fixed its ASCII-only regex so 'résumé' is matched.

Tests: added unit tests for the resume requirement and resume question detection.
Copilot AI balanced review requested due to automatic review settings October 15, 2026 07:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@netlify

netlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 2e6a17a
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6adbebf47c1ad8363eb3f009
😎 Deploy Preview https://deploy-preview-5660--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@PrajwalpGM256 PrajwalpGM256 added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Oct 15, 2026
AlekyaJogini
AlekyaJogini previously approved these changes Oct 16, 2026

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

Reviewed by Alekya.

How I tested
Checked out the PR branch (commit b5b9a93, 3 files) on Node 20.19.4 with the backend on development. Ran npx vitest run src/components/Collaboration. Opened /job-application logged out in an Incognito window (light mode) and logged in as my Admin test account (dark mode). I did not submit an application.

Verified working

  • 10 test files, 112 tests pass.
  • Logged out, the resume field reads "Upload Resume *" with no "(optional)".
Image
  • With the software position's questions loaded the label is the same. Choosing a PDF shows the file name, size, a Remove button and a "Resume selected" toast and Remove clears it back to "No file selected".
Image Image
  • The label and file controls are readable in dark mode. The white asterisk is the pre-existing dark-mode issue mentioned in the description.

Issues found
None.

Not tested

  • Every role in the dropdown (I checked no position and the software position)
  • A successful submission with a resume attached

snehitakandula
snehitakandula previously approved these changes Oct 17, 2026

@snehitakandula snehitakandula left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed on this PR's branch (pr-5660) at commit b5b9a93, frontend only, with backend on development. Tested /job-application as Admin in light mode. I didn't submit an application with a file.

Verified:

  1. Default role: the resume field reads "Upload Resume *", with no "(optional)".
  2. Submission is blocked without a resume (not covered in the earlier review). On another role with its own questions loaded ("1. Phone / WhatsApp", "2. City & Timezone"), clicking Submit with no file is stopped at the resume field, and the label is the same "Upload Resume *".
  3. No merge conflicts with development, even though this form file is also changed in #5651 and #5653.

Minor (non-blocking): after clicking Submit without a resume, the browser's native "Please select a file." bubble appears on the file input and stops the submission, so the missing-fields toast listing "Resume" (step 5 of the test steps) doesn't appear. The submission is still prevented, but the test step may need updating, or the native required attribute could be removed so the custom toast handles it.

Screenshots:

*"Upload Resume " on the default role:
Image

Submit blocked without a resume ("Please select a file."):

Image

Approving.

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

Reviewed by Aadit Trivedi.

The branch has a merge conflict with development in src/components/Collaboration/JobApplicationForm/JobApplicationForm.jsx (checked with git merge-tree). That file was recently changed on development, including the email validation work from #5649, and #5651 and #5653 also change it.

Required action
Please update the branch with development and resolve the conflict, keeping the newer email validation and form behavior. I'll review the resume requirement changes once it's updated.

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

I have reviewed your PR locally (b5b9a93, backend on development). The resume requirement works as described, but the branch needs to be updated with development.

  1. /job-application: all 36 positions show "Upload Resume *", including SEEKING SOFTWARE POSITION.
  2. Submitting with no file lists Resume in the missing-fields toast and nothing is sent. With a PDF attached, Resume drops off the list. After Remove it is listed again.
  3. Readable in dark and light mode. npx vitest run src/components/Collaboration: 112/112 pass.

Needs changes:

  1. Merge conflicts with development in JobApplicationForm.jsx and jobApplicationQuestionUtils.js. Development has since added getUploadSizeError / MAX_UPLOAD_BYTES (5 MB limit) and passes optional, required and error={resumeFileError} to the resume upload. The resolved version needs to keep the 5 MB check and error message while making the resume always required.
Image Image

…sume_upload_label_validation

# Conflicts:
#	src/components/Collaboration/JobApplicationForm/JobApplicationForm.jsx
#	src/components/Collaboration/JobApplicationForm/jobApplicationQuestionUtils.js
@sonarqubecloud

Copy link
Copy Markdown

@PrajwalpGM256

Copy link
Copy Markdown
Contributor Author

@AaditTrivedi @rahulrubugunday merged development and resolved the conflicts in JobApplicationForm.jsx and jobApplicationQuestionUtils.js.

Retested on Node 22: "Upload Resume *" on all roles, a file over 5 MB shows "File too large, max 5 MB.", and submit is blocked without a resume. npx vitest run src/components/Collaboration: 141/141 pass.

image image image

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

Reviewed PR #5660 locally on commit 2e6a17a (Node 22, macOS, backend on development).

Verified Working:

  1. Unit Tests: Ran npx vitest run src/components/Collaboration — all tests pass.
  2. Label & Required Consistency: Navigated to /job-application; confirmed the resume field consistently displays Upload Resume * (with no (optional)) across both the default role and custom roles.
  3. File Size Limit: Uploading a file exceeding 5 MB displays the inline error File too large, max 5 MB. and rejects the selection.
  4. Validation Enforcement: Attempting to submit without a resume is successfully blocked.
  5. Valid Attachment & Removal: Attaching a valid file under 5 MB updates the state correctly, and the Remove action clears it back to required.

No issues found.

Image

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

Reviewed PR #5660 locally on commit b5b9a9319. Verified that resume uploads are mandatory across different job roles and that submission is blocked without a resume. Tested uploading and removing a resume, checked for duplicate resume questions, and confirmed that the form works correctly in both light and dark modes. All 16 unit tests passed, and the functionality worked as expected. Screenshots are attached for reference.

Image Image Image Image

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

Reviewed commit 2e6a17a. The resume is now required independently of each role’s question template, and the upload label is consistent. I checked all three changed files and confirmed the merge retains the 5 MB size validation and existing email validation. In a logged-out local run, SEEKING SOFTWARE POSITION, GENERAL, and DATA ANALYST APPLICATION each showed “Upload Resume *”; the empty file input was marked required and invalid. npx vitest run src/components/Collaboration passed 141/141 tests, including the new resume tests and upload-size tests. No blocking issues found.

PR 5660 testing

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

Reviewed PR #5660 locally on commit (b5b9a9319)]

I verified that the Upload Resume * label appears consistently across job roles, including City Center Geodesic Dome Autodesk Inventor Simulations, and that submitting without a resume triggers the required-file validation.

I also confirmed that a valid PDF/DOCX under 5 MB is accepted and the Remove option is available. The over-5-MB rejection, successful submission, and validation after removing a resume were not fully tested.

I checked the form in dark mode and ran npx vitest run src/components/Collaboration. All 141 tests passed across 13 test files.

The functionality tested is working as expected. No issues found.

Image Image Image Image

This branch has not been deployed

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

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants