Collect an APAAR ID at first login, and show the upload preview's real values - #294
Merged
vikrantwiz02 merged 1 commit intoAug 19, 2026
Conversation
…l values The first-login profile popup gains a required APAAR ID: digits only, capped and validated at twelve, prefilled from the record like the other fields, and sent with the rest of the form. It also joins the shared column definitions, so the admin student list and the upload preview can show it and the save transform keeps it -- without an entry there, an uploaded APAAR value would be dropped on its way to the server. The upload preview showed an empty badge, blank names and "N/A" for every row. Uploaded rows keep the spreadsheet's own headings, while the table read camelCase properties that no payload carries; the row count and the branch tally looked right only because that code already tried four spellings. The cells now read through the shared column definitions, which know every spelling, so a preview of 554 students shows roll numbers, names, parents, addresses and emails instead of placeholders. Saving from that preview was impossible for a different reason: the prerequisite check posted without an Authorization header, so it always came back 403, and because that error is JSON the "not JSON, fall back" branch never ran -- the code then read missing_batches off an error body and threw, aborting before the save. It now sends the token, falls back whenever the response is not ok, and tolerates a missing field. Also: a Badge inside a Text put a div inside a p on the allocation summary, which React warned about on every render.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend counterpart: FusionIIIT/Fusion#1959, which adds the column and enforces it server-side. Needs that migration deployed first.
APAAR ID at first login
The first-login profile popup gains a required APAAR ID beside Aadhaar: digits only, capped and validated at twelve, prefilled from the record like every other field, and included in the submit payload.
It also joins the shared column definitions, so the admin student list and the upload preview can show it — and, importantly, so the save transform keeps it.
transformDataForDatabaseiteratesSTUDENT_FIELDS_CONFIG; without an entry there an uploaded APAAR value would be silently dropped on its way to the server.The upload preview showed nothing
Every row rendered an empty badge, blank names and "N/A". Uploaded rows keep the spreadsheet's own headings (
Institute Roll Number,Name,Father's Name,Full Address) while the table readstudent.rollNumber,student.name,student.fname,student.address. The row count and branch tally looked right only because that code already tried four spellings.The cells now read through the shared
getStudentFieldValue+STUDENT_TABLE_COLUMNS, which already list every spelling, so a 554-student preview shows real roll numbers, names, parents, addresses and institute emails. Branch Code falls back to the discipline column. Nine cases pin the mapping against a row captured verbatim fromprocess_excel_upload.Saving from that preview was impossible
validateBatchPrerequisitesposted with only aContent-Typeheader — no token — so the gated endpoint always answered 403:403 You do not have permission…200 can_upload=True, existing=5, missing=0Worse, the fallback only triggered when the response wasn't JSON, and that 403 is JSON — so the error body was read as batch data,
data.can_upload_studentscame backundefined, anddata.missing_batches.slice(0, 5)threw, aborting before the save. It now sends the token, falls back whenever the response is notok, and readsmissing_batches ?? [].Also
A
Badgeinside aTexton the allocation summary put a<div>inside a<p>, which React warned about on every render; that line renders as<Text component="div">now — same appearance, valid HTML, clean console.Checks
417 tests pass (up from 408),
lint:strictclean, build clean.