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

Table component for DataStore (CKAN) API #1053

Closed
1 task
anuveyatsu opened this issue Nov 17, 2023 · 1 comment · Fixed by #1083
Closed
1 task

Table component for DataStore (CKAN) API #1053

anuveyatsu opened this issue Nov 17, 2023 · 1 comment · Fixed by #1083
Assignees

Comments

@anuveyatsu
Copy link
Member

anuveyatsu commented Nov 17, 2023

Acceptance criteria

  • We can have preview component that works with DataStore API.

Notes

Using FlatUiTable component

Current FlatUiTable component works well with CSV data - https://storybook.portaljs.org/?path=/docs/components-flatuitable--docs where data can be provided as raw CSV text, a list of lists (basically JS object) or URL to CSV data file.

Now, we'd like to add support for DataStore API (in particular datastore_search) so that data from CKAN's DataStore can be rendered using FlatUiTable component. There are 2 options:

  1. Extend current component and support DataStore API. This could be simple to implement, e.g., another if/else statement etc. in https://github.com/datopian/portaljs/blob/main/packages/components/src/components/FlatUiTable.tsx#L84-L88
  2. Create a new component that works with DataStore API. This could mean a clean and simple components without complex logic.

Question if doing option 2: where would you put a FlatUiTable component that works with DataStore (CKAN)? I can see that we have multiple places for components: https://github.com/datopian/portaljs/tree/main/packages (i.e., ckan vs components directory).

One important note is how we handle filtering data? Currently FlatUiTable only filters in browser but we want to fetch DataStore API instead 🤔 this is how we are just passing data object to Grid comonent - https://github.com/datopian/portaljs/blob/main/packages/components/src/components/FlatUiTable.tsx#L80

From @demenech - https://github.com/githubocto/flat-ui/blob/main/src/components/grid.tsx#L37 the table by default does not support the events that we'd need. it has the filters, sort, data and etc
but not sure if that suffices (e.g. no way to detect the scroll has reached the end).

Using Table component

See the current component in storybook - https://storybook.portaljs.org/?path=/docs/components-table--docs

Existing DataExplorer

For Graphql:

For DataStore endpoint:

Brand new component

TODO

@anuveyatsu anuveyatsu changed the title FlatUiTable component for DataStore (CKAN) API Table component for DataStore (CKAN) API Nov 17, 2023
@Gutts-n
Copy link
Contributor

Gutts-n commented Jan 26, 2024

@anuveyatsu will we have sorting, search, and pagination for use with the datastore-api? Will we call directly the data-api or will we use the graphql API as the data explorer component?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants