Skip to content

Conversation

@jennifer-bowser
Copy link

@jennifer-bowser jennifer-bowser commented Apr 14, 2025

Creates a form to allow users to submit requests for new standards. The form has no submit logic yet; this will be implemented in a future ticket. Relatedly, the new "Contribute A Standard" page containing this form has also not been hooked up to the UI yet.

Testing

For testing purposes I just temporarily hooked up the "Contribute A Standard" page by doing the following:

  1. In apps/portals/b2ai.standards/src/config/navbarConfig.ts, find the "Contribute A Standard" entry > comment out the path property and replace it with the following:
    // path: 'https://github.com/bridge2ai/b2ai-standards-registry/tree/main?tab=readme-ov-file#submitting-a-new-standard',
    path: '/ContributeAStandard'
  2. In apps/portals/b2ai.standards/src/config/routesConfig.ts, find the children property > add a new entry like so:
    const routes: RouteObject[] = [
      {
        path: '/',
        element: <App />,
        children: [
          ...sharedRoutes,
          // etc.
          {
              path: 'ContributeAStandard',
              element: <ContributeAStandardPage />,
          }
      
        ],
      },
    ]

[id: string]: boolean
}

export default function Form({ fields, onSubmit }: FormProps) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

In some components [1], [2], we have been using react-jsonschema-form, which is really similar to what you have built here. You could just construct the schema (and maybe a uiSchema) and pass it in to the JsonSchemaForm component (it was recently refactored so you might have to synchronize with main to use the component).

Do you think using this existing pattern might help us accomplish the same/similar UI with less code? It is possible that your solution handles some trivial case that is not easy/possible in RJSF.

I'm sorry that we didn't identify this and point out this option to you earlier!!

[1] CreateOrUpdateDoiModal
image

[2] SchemaDrivenAnnotationEditor
image

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, I'll take a look and see if I can use the JsonSchemaForm instead!

Copy link
Author

Choose a reason for hiding this comment

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

@nickgros Update: I see what you mean, JsonSchemaForm was a great fit for this! I've finished the refactor and am ready for re-review.

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