Skip to content

Aakash - Jobs Component: show the upload size limit on the job application form - #5674

Merged
one-community merged 1 commit into
developmentfrom
Aakash-upload-limit-message-job-application
Oct 23, 2026
Merged

one-community merged 1 commit into
developmentfrom
Aakash-upload-limit-message-job-application

Conversation

@vidiyala99

@vidiyala99 vidiyala99 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

Bug 60 (Jobs Component - Server-Side Upload Limits on Job Application Submit), frontend part: the server now refuses files over 5 MB. This shows the same limit on the application form before the applicant submits, instead of a failure after the upload.

Fixes # Bug 60 (Jobs Component - Server-Side Upload Limits on Job Application Submit)

Related PRS (if any):

This frontend PR is related to the backend PR OneCommunityGlobal/HGNRest#2412, which enforces the limits. The frontend works without it, it just shows the message early.

Main changes explained:

  • Update src/components/Collaboration/JobApplicationForm/jobApplicationQuestionUtils.js: add MAX_UPLOAD_BYTES (5 MB) and getUploadSizeError.
  • Update src/components/Collaboration/JobApplicationForm/JobApplicationForm.jsx: the resume and question file pickers refuse a file over 5 MB, clear the input and show "File too large, max 5 MB." under the field (role="alert", aria-invalid, aria-describedby). The message clears when the file is removed, replaced with a valid one, or the form is reset. It reuses the form's existing .fieldError style, so no CSS changed.
  • Tests: src/components/Collaboration/__tests__/JobApplicationForm.uploadSizeLimit.test.jsx.

How to test:

  1. check into current branch
  2. do npm install and npm run start:local
  3. Go to /job-application, pick a role, and choose a resume larger than 5 MB: the message shows under the field and the file is not kept.
  4. Choose a small PDF: no message, upload works as before.
  5. npx vitest run src/components/Collaboration (11 files, 104 tests pass)

Screenshots or videos of changes:

A resume over 5 MB (light, desktop): the message shows under the field and the file is not kept.

fe1072-resume-toolarge-light-desktop

Same case in dark mode on a phone:

fe1072-resume-toolarge-dark-phone

A small valid PDF (dark, desktop): no message, the file is kept.

fe1072-resume-valid-dark-desktop

Note:

  • npm run lint:css reports 569 errors on this repo with and without this change; no CSS file was touched.

Reject resume and per-question attachments over 5 MB on selection, matching the new server limit, and show an inline 'File too large, max 5 MB.' error under the file field using the existing fieldError style (dark mode already covered). Adds a Vitest test.
@netlify

netlify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit a2ef7f9
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6ad6948ebf85e60b01467cfd
😎 Deploy Preview https://deploy-preview-5674--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.

@sonarqubecloud

Copy link
Copy Markdown

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

Approved

Reviewed against Bug #60 (frontend half) with related BE #2412.

Verified

  • Resume and question-file pickers reject files over 5 MB before submit
  • Inline error: "File too large, max 5 MB." (role="alert", clears on remove/replace/reset)
  • Small valid PDFs still work as before
  • Cap matches the server limit in #2412 (MAX_UPLOAD_BYTES / 5 MB)
  • Focused tests added for the size-limit behavior

Notes (non-blocking)

  • Pair/merge with HGNRest #2412 so browser checks and server enforcement stay in sync
  • After this lands, #5660 (Bug #53 – resume required/labels) should rebase onto development — both touch JobApplicationForm.jsx

LGTM for the FE size-limit UX. Approving.

@one-community

Copy link
Copy Markdown
Member

Thank you all, merging!

@one-community
one-community merged commit 9b44b71 into development Oct 23, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants