Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement form page for CrudModule #198

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

brunomous
Copy link
Contributor

@brunomous brunomous commented Sep 4, 2024

Implement new page as container variation for the CrudModule. To use the page, the prop formContainerVariation should be passed with page as value, and the following routes should be added to the Router instance on the child project, with isFormPage prop as true:

<Resource
  id="/user/new"
  name="Create User"
  showDrawerItem={false}
  module={{
    createFormProps: {
      formSchema: userModule.createFormProps?.formSchema,
      formUiSchema: userModule.createFormProps?.formUiSchema,
    },
  }}
  isFormPage
/>

<Resource
  id="/user/edit/:id"
  name="Edit User"
  showDrawerItem={false}
  module={{
    editFormProps: {
      formSchema: userModule.editFormProps?.formSchema,
      formUiSchema: userModule.editFormProps?.formUiSchema,
    },
  }}
  isFormPage
/>

<Resource
  id="/user/details/:id"
  name="View User"
  showDrawerItem={false}
  module={{
    detailsFormProps: {
      formSchema: userModule.detailsFormProps?.formSchema,
      formUiSchema: userModule.detailsFormProps?.formUiSchema,
    },
  }}
  isFormPage
/>

The /{resource}/new, /{resource}/edit/:id and /{resource}/details/:id are required for the workflow to perform correctly.

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.

1 participant