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

Export data as CSV #2604

Closed
RubberDuckDestroyer opened this issue Mar 29, 2020 · 6 comments
Closed

Export data as CSV #2604

RubberDuckDestroyer opened this issue Mar 29, 2020 · 6 comments

Comments

@RubberDuckDestroyer
Copy link

Feature request

A button that exports data as csv

Describe the solution you'd like

Hi I am working on a project where I need to export my data generated as a CSV. Say I add filters on user data where user address contains 'xyz', I'd like to have a button that would download the filtered/generated user data as CSV for me.

I see that this feature is available in keystone v4. Is there an estimate on when this will be added in v5?

Describe alternatives you've considered

Right now I'm doing everything off AWS Lambda and seperate APIs for exporting my data.

@jesstelford
Copy link
Contributor

@MadeByMike would this be a good usecase for custom elements in the Admin UI?

@molomby
Copy link
Member

molomby commented Apr 2, 2020

There are a few sides to this:

  • Hooking into the Admin UI to add a button (or similar) to trigger a server side action. This is captured by Custom Actions #1452) I think.
  • Creating the exported itself and issues around that (ie. should it be async, how does it interface with the DB adapter, etc.). Issue Bulk data exports #310 talks about this.
  • How the resultant file is stored/transferred

We're working pretty actively on the first point but the backend parts of the problem are largely in the hands of project developers.

You should probably look to add a custom endpoint into the express app Keystone provides. Checkout the configureExpress hook. From there, you should be able to create an endpoint that has access to..

  • Keystone session info, via. req.user, req.authedListKey and req.audience
  • The GraphQL server, via keystone.executeQuery()
  • DB adapter, via keystone.adapters

Accessing your data through keystone.executeQuery() will means transformations, etc. applied by the field types will occur, relationships can be resolved, etc. It also lets you apply list and field permissions if you want. Talking directly to the DB adapter will be faster, which might be important depending on how much data you're pulling out.

@gautamsi
Copy link
Member

gautamsi commented Apr 2, 2020

given there is support for admin ui hooks for items pages view and further being finalised this can be reality soon.

some work already done in #1739 which was closed in favour of #2469 and other split PRs

@RubberDuckDestroyer
Copy link
Author

RubberDuckDestroyer commented May 28, 2020

Hi, is there any update on this becoming a reality in keystone v5?
EDIT: I see there's progress on adminUI hooks, so is there any kind of estimate for this?

@stale
Copy link

stale bot commented Sep 25, 2020

It looks like there hasn't been any activity here in over 6 months. Sorry about that! We've flagged this issue for special attention. It wil be manually reviewed by maintainers, not automatically closed. If you have any additional information please leave us a comment. It really helps! Thank you for you contribution. :)

@stale stale bot added the needs-review label Sep 25, 2020
@bladey
Copy link
Contributor

bladey commented Apr 8, 2021

Keystone 5 has officially moved into active maintenance mode as we push towards the next major new version Keystone Next, you can find out more information about this transition here.

In an effort to sustain the project going forward, we're cleaning up and closing old issues such as this one. If you feel this issue is still relevant for Keystone Next, please let us know.

@bladey bladey closed this as completed Apr 8, 2021
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

No branches or pull requests

5 participants