Skip to content

Update OGA App to use NPM published libraries @jsonforms/core#180

Merged
mushrafmim merged 1 commit intoOpenNSW:mainfrom
ginaxu1:oga-app-refactor
Feb 25, 2026
Merged

Update OGA App to use NPM published libraries @jsonforms/core#180
mushrafmim merged 1 commit intoOpenNSW:mainfrom
ginaxu1:oga-app-refactor

Conversation

@ginaxu1
Copy link
Contributor

@ginaxu1 ginaxu1 commented Feb 25, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ginaxu1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request modernizes the OGA App's form handling by migrating from a custom-built JSON form solution to the @jsonforms ecosystem. This change streamlines form rendering and validation, reducing the maintenance burden and improving consistency. Additionally, a minor but important fix was applied to the backend's JSONB scanning logic to ensure proper data deserialization.

Highlights

  • Frontend Form Library Migration: The OGA App's custom JSON form implementation has been replaced with the @jsonforms/react and @jsonforms/core NPM libraries, along with @opennsw/jsonforms-renderers for UI rendering. This significantly reduces custom code and leverages a well-established open-source solution for form generation from JSON Schema.
  • Backend JSONB Handling Improvement: The JSONB type's Scan method in oga/internal/store.go was updated to correctly handle both []byte and string input types during unmarshalling, improving robustness when reading JSON data from the database.
  • Simplified Workflow Detail Screen: The WorkflowDetailScreen component was refactored to integrate the new @jsonforms/react component, removing the custom useJsonForm hook and associated form rendering logic, leading to a cleaner and more maintainable component.
Changelog
  • oga/internal/store.go
    • Updated the Scan method for the JSONB type to support unmarshalling from both []byte and string values.
  • portals/apps/oga-app/package.json
    • Added new dependencies: @jsonforms/core, @jsonforms/react, and @opennsw/jsonforms-renderers.
  • portals/apps/oga-app/src/api.ts
    • Updated import paths for JsonSchema and UISchemaElement to reference @jsonforms/core.
  • portals/apps/oga-app/src/components/JsonForm/JsonForm.tsx
    • Removed the custom JsonForm component and its internal rendering logic.
  • portals/apps/oga-app/src/components/JsonForm/fields/CheckboxField.tsx
    • Removed the custom CheckboxField component.
  • portals/apps/oga-app/src/components/JsonForm/fields/FieldWrapper.tsx
    • Removed the custom FieldWrapper component.
  • portals/apps/oga-app/src/components/JsonForm/fields/FileField.tsx
    • Removed the custom FileField component.
  • portals/apps/oga-app/src/components/JsonForm/fields/NumberField.tsx
    • Removed the custom NumberField component.
  • portals/apps/oga-app/src/components/JsonForm/fields/SelectField.tsx
    • Removed the custom SelectField component.
  • portals/apps/oga-app/src/components/JsonForm/fields/TextField.tsx
    • Removed the custom TextField component.
  • portals/apps/oga-app/src/components/JsonForm/fields/TextareaField.tsx
    • Removed the custom TextareaField component.
  • portals/apps/oga-app/src/components/JsonForm/fields/index.ts
    • Removed exports for custom field components.
  • portals/apps/oga-app/src/components/JsonForm/index.ts
    • Removed exports for the custom JsonForm component and useJsonForm hook, along with their types.
  • portals/apps/oga-app/src/components/JsonForm/sampleData.ts
    • Removed the custom sample data utility for the old form implementation.
  • portals/apps/oga-app/src/components/JsonForm/schemaToZod.ts
    • Removed the custom schema-to-Zod conversion and validation logic.
  • portals/apps/oga-app/src/components/JsonForm/types.ts
    • Removed custom types related to the old JSON form implementation.
  • portals/apps/oga-app/src/components/JsonForm/useJsonForm.ts
    • Removed the custom useJsonForm hook.
  • portals/apps/oga-app/src/screens/WorkflowDetailScreen.tsx
    • Updated imports to use @jsonforms/react and @opennsw/jsonforms-renderers.
    • Replaced the custom useJsonForm hook with local state management for form data and errors.
    • Refactored the form rendering to use the JsonForms component.
    • Adjusted button icons and spinner usage for consistency.
  • portals/pnpm-lock.yaml
    • Updated the pnpm lockfile to reflect the new @jsonforms and @opennsw/jsonforms-renderers dependencies.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

gemini-code-assist[bot]

This comment was marked as duplicate.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a significant improvement, replacing the custom JSON form implementation with the standard @jsonforms library. This greatly reduces the amount of custom code to maintain and aligns the application with industry standards. The integration in WorkflowDetailScreen.tsx is well-executed, and the backend change in oga/internal/store.go to handle different data types for JSONB scanning is a solid enhancement for robustness. I've added a couple of suggestions to further improve type safety in the new implementation.

Copy link
Contributor

@sthanikan2000 sthanikan2000 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@mushrafmim mushrafmim left a comment

Choose a reason for hiding this comment

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

LGTM

@mushrafmim mushrafmim merged commit c64f155 into OpenNSW:main Feb 25, 2026
2 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.

3 participants