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

CSV Upload Utility #1676

Open
simon-leech opened this issue Nov 4, 2024 · 1 comment · May be fixed by #1642
Open

CSV Upload Utility #1676

simon-leech opened this issue Nov 4, 2024 · 1 comment · May be fixed by #1642
Assignees
Labels
Feature New feature requests or changes to the behaviour or look of existing application features. RFC Request for Comment or Change.

Comments

@simon-leech
Copy link
Contributor

Description

We have lots of client plugins that copy-paste CSV Upload functionality into them before then running extra functionality after these.

Requirements

  1. Create a CSV Upload Utility that takes a file path, and params.
    The Utility will return a success true or false flag, and also an message that can be displayed on the front-end.
    The Utility will take a query and also an updateQuery that is ran after the importing is done (to create a geometry for example).

  2. CSV Upload Layer Plugin
    A plugin that returns a button that opens a dialog that handles CSV Uploading, and layer reloading once completed.

  3. CSV Upload Entry Plugin
    A plugin that returns a button that opens a dialog that handles CSV Uploading, and the infoj reloading once completed.

Type of Issue

Please delete options that are not relevant, and select all options that apply.

  • ✅ New Feature
@simon-leech simon-leech self-assigned this Nov 4, 2024
@simon-leech simon-leech added Feature New feature requests or changes to the behaviour or look of existing application features. v4.13.0 labels Nov 4, 2024
@simon-leech simon-leech linked a pull request Nov 4, 2024 that will close this issue
@simon-leech simon-leech linked a pull request Nov 5, 2024 that will close this issue
@dbauszus-glx dbauszus-glx changed the title CSV Upload Utility and Plugins CSV Upload Utility Nov 7, 2024
@dbauszus-glx dbauszus-glx added the RFC Request for Comment or Change. label Nov 7, 2024
@dbauszus-glx
Copy link
Member

We have a csvDownload utility which is poorly test and documented. This should be done first. The csvDownload utility creates a csv text file from a query response.

The csvUpload should work in a similar fashion with comparable parameter. The core functionality of the csv upload is to create a POST request with the body being a stringified array.

The csvUpload utility should not be confused with an array insert into table XYZ module. The csvUpload should work with any query that receives the POST request body.

eg.

"select_body": {
  "template": "SELECT %{body}",
  "value_only": true
},

The query for the csvUpload utility should not be reequired to be a module dependent on arr property in the body which is substituted with a string in the render method of the query.

The body should be substituted in the database as the restricted template variable %{body}.

The csvUpload utility should handle a payload size property to handle how the csv array is split before being sent in multiple requests.

It must be possible to control whether requests should be sent async.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature requests or changes to the behaviour or look of existing application features. RFC Request for Comment or Change.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants