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

Make array and table fields indexable #102

Merged
merged 13 commits into from
Jul 29, 2022
Merged

Make array and table fields indexable #102

merged 13 commits into from
Jul 29, 2022

Conversation

sverhoeven
Copy link
Member

@sverhoeven sverhoeven commented Jul 22, 2022

Fixes #57
Refs #43

By adding ui:indexable:true to uiSchema you can have index in an array sub form and table sub form.

TODO:

  • add index to table field
  • add index to array field
  • generate catalog index with indexable:true in uiSchema
    • for schema props with maxItemsFrom: molecules config
    • molecules parameter
    • for schema props wtih type:'array' dont care about order here so no index is needed either.

Out of scope

To test

  1. In haddock3 download app,
    1. yarn dev
    2. goto http://localhost:3000
    3. configure global parameters
      1. upload molecules
      2. should have a index (0, 1) in front each file name
    4. add mdref node from refinement category
      1. configure node
      2. expand molecule sub form
      3. Add several mol_shape rows
      4. In front of each row there should be an index.
    5. the haddock3 apps do not have a indexable table because all tables in the haddock3 catalogs do not care about order
  2. In kitchen sink app,
    1. yarn dev
    2. goto http://localhost:3002
    3. add node in indexable category and configure
    4. both table and array node should have 0,1,2,3 after several rows have been added
  3. In storybook of form package
    1. yarn storybook
    2. goto http://localhost:6003
    3. Open stories in Array folder and the last story in TableField folder.

as array it looks like
localhost_3002_ (1)
and as table
localhost_3002_ (2)

Due to changes in haddock3 this PR also contains the global preprocess parameter.

Needed import react in each table component for vitest to work
…erstands indexable ui option

Rename ui option from indexedColumn to indexable to be more inline with other array ui options like orderable, addable, removeable

Use getUiOptions to deal with ui:indexable and ui:options:{indexable}

Also in table header render key if title is not set.
…bootstrap/Col' is not supported resolving ES modules imported from .../workflow-builder/packages/form/dist/index.js

Did you mean to import react-bootstrap/cjs/Col.js?
@netlify
Copy link

netlify bot commented Jul 22, 2022

Deploy Preview for wonderful-noether-53a9e8 ready!

Name Link
🔨 Latest commit 422b18c
🔍 Latest deploy log https://app.netlify.com/sites/wonderful-noether-53a9e8/deploys/62de9ad30e8f4900086a45d6
😎 Deploy Preview https://deploy-preview-102--wonderful-noether-53a9e8.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@sverhoeven sverhoeven marked this pull request as draft July 22, 2022 12:15
@sverhoeven sverhoeven marked this pull request as ready for review July 25, 2022 10:42
@sverhoeven sverhoeven mentioned this pull request Jul 25, 2022
2 tasks
@sverhoeven sverhoeven requested a review from bvreede July 26, 2022 07:37
Copy link
Contributor

@bvreede bvreede left a comment

Choose a reason for hiding this comment

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

Looking forward to #104 :)

@sverhoeven sverhoeven merged commit 73064be into main Jul 29, 2022
@sverhoeven sverhoeven deleted the table-index-57 branch July 29, 2022 08:57
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.

Array index in form
2 participants