Skip to content

fix(ui): resolve intake uploads and shared document widgets - #204

Closed
asmitonweb wants to merge 2 commits into
OpenG2P:1.2from
asmitonweb:fix/1.2-intake-document-handling
Closed

asmitonweb wants to merge 2 commits into
OpenG2P:1.2from
asmitonweb:fix/1.2-intake-document-handling

Conversation

@asmitonweb

@asmitonweb asmitonweb commented Oct 21, 2026 •

Copy link
Copy Markdown

Intake currently uploads only _direct_file entries and does not replace file values with their uploaded document IDs. Profile photos can be omitted, and incomplete upload responses can be followed by a section save. File references in read-only tables also render as IDs/objects rather than usable document links.

This change moves the generic behavior needed by downstream registry overlays into the 1.2 staff UI and widget sources:

  • Resolve profile/direct uploads before saving, attach IDs to configured fields and preserve each table file's row association, including same-name files. Reject incomplete/invalid upload results and ambiguous targets without mutating the retry payload.
  • Retain existing document links on a subsequent save, and omit replaced/cleared links. This follows the existing save API's replacement semantics.
  • Clear both configured photo paths. Preserve explicit file clears and offer opt-in clearFileWhenHidden for dialog file fields.
  • Show filenames and document links in file widgets and table/dialog cells. Use the existing host request handler and authenticated document route, refresh signed URLs on open, restrict stored URLs to HTTP(S), and detach the new tab's opener/referrer. Failed lookups close the reserved tab and show an error.
  • Add showInfo/showMetadata header options and preserve existing uppercase acronyms such as GC/EC in generated titles.

No Farmer field names, derived certificate flags, compiled-bundle patches, backend API changes or deployment pins are introduced. Background layout remains separate in #203.

Validation:

  • ui/ui-widgets: npm test (16 passing), npm run type-check, npm run build.
  • Strict standalone TypeScript check of the intake document helper; targeted ESLint of the new document components/utilities; git diff --check.
  • Local Firefox component harness ran the actual widget sources against an HTTP document fixture: photo upload/delete, configured header visibility, form/table filenames, Enter activation with a fresh URL and no opener/referrer, explicit/conditional file clears, replacement file selection, and 403/unsafe-URL failures. No browser page errors. This establishes component behavior against a fixture, not authenticated backend approval/register acceptance or a full portal visual check.
  • Fork UI CI passed at commit 7934c93: widget install/type-check/all 16 tests/build and the full staff UI install/Next.js production build. The existing notification dependency remains unchanged. Local staff UI installation is still restricted by the workstation's EALLOWREMOTE policy; the GitHub build completed independently.
  • Upstream UI CI is action_required on commit 7934c93; fork PR workflows require maintainer approval upstream.

CI follow-up: the initial fork Build & Publish run failed workflow validation before starting jobs because the reusable image/chart jobs request packages: write and the caller inherited read-only defaults. The caller now explicitly grants contents: read / packages: write. Publishing is gated to non-fork repositories, while UI CI runs build-only checks on fork pushes with contents: read. Actionlint passed for both changed workflows. No repository-wide permission setting or publishing credential was changed.

Release/integration: the existing widgets publication workflow on 1.2 publishes the package, updates the exact staff UI dependency pin and dispatches Build & Publish. Downstream overlays must remain until the resulting shared image and required metadata options pass intake-to-register acceptance. This PR does not remove a Farmer image or change its Registry Platform version.

Implementation and acceptance notes: ui/INTAKE_DOCUMENTS.md.

@faizmagic

Copy link
Copy Markdown

@shibu-narayanan , can you please review the PR and see if it can be merged.

CC: @asmitonweb

@asmitonweb asmitonweb closed this Oct 23, 2026
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