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

Save CSV To Specific Directory #40

Open
braughtg opened this issue Aug 27, 2024 · 3 comments
Open

Save CSV To Specific Directory #40

braughtg opened this issue Aug 27, 2024 · 3 comments
Labels
enhancement New feature or request UI/UX User Interface / User Experience Improvement

Comments

@braughtg
Copy link
Member

Current Functionality

currentFunc
clicking the export button simply saves the file in the user's downloads folder.

Desired Functionality

An enhancement of this feature would be allowing users to decide where they want the csv file to be saved on their system. They would click the export button but instead of the file automatically saving into their downloads folder, a file explorer window would open up and allow the user to pick which directory they would like to save the csv file in.

desiredFunc
here's a quick example using Microsoft Word.

The CSV function is located inside of the CustomTableComponent.js file. Altering this file means the contributor should also add an additional test into the CustomTableComponent.spec.comp.js file if possible (or opening another issue so somebody else can do it) to make sure that the file has full coverage of the component's functionality.

Good place to start: here


Original issue by braughtg
Thursday Aug 17, 2023 at 19:17 GMT

@braughtg braughtg added enhancement New feature or request UI/UX User Interface / User Experience Improvement labels Aug 27, 2024
@braughtg
Copy link
Member Author

For anyone seeking to resolve this issue, there are some pretty conflicting responses on whether or not saving to a specific directory is possible. [This] StackOverFlow forum has many users noting that it's impossible because it would pose a serious security threat to users. However, [this] website has an example of saving a file to a specific directory location. It's incompatible with Firefox though, and I wasn't able to make it work on Google Chrome or Edge as it suggests you use. It mentions using the [File System Access] but this might involve incorporating this project into our own which might be undesirable. There seems to be a much newer, and more maintained, project that could be a helpful resource. The [File System Standard] seeks to,

define[s] an API that makes it possible for websites to get access to a file system directory without having to first prompt the user for access. This enables use cases where a website wants to save data to disk before a user has picked a location to save to, without forcing the website to use a completely different storage mechanism with a different API for such files.

This project's GitHub repo can be found [here] but this could also mean incorporating something into the project that might be undesirable for functionality that's more of a leisure than a necessity.

Additional resources:
Note, the goal is to save a file to the system with a file explorer that allows the user to specify where in the system they want to save the file.

  1. StackOverFlow forum post that details how to open the file explorer using JQuery [link]
  2. Codepen demonstrating how to open the file explorer [link]

Comment by FutzMonitor
Tuesday Feb 21, 2023 at 15:00 GMT

@braughtg
Copy link
Member Author

If this was an implemented feature, would it be worthwhile to add another issue allowing admins to configure whether the CSV is downloaded straight to the downloads folder or a specified directory?

I think so since it would be nice to switch between the two. This would necessitate more updates to the CustomTable, UI, and both their testing files.


Comment by FutzMonitor
Friday Mar 03, 2023 at 16:52 GMT

@braughtg
Copy link
Member Author

If this was an implemented feature, would it be worthwhile to add another issue allowing admins to configure whether the CSV is downloaded straight to the downloads folder or a specified directory?

Possibly a simpler solution would be to have the "Save As" dialog that would open default either to Downloads, or preferably just to the last location that the user had used. That's still 2 clicks instead of 1 to get something into downloads if that is where you always put it. But I am hesitant to make more configuration options than we really really need.

That said, when someone works on this issue we can revisit this point.


Comment by braughtg
Friday Mar 03, 2023 at 19:54 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request UI/UX User Interface / User Experience Improvement
Projects
None yet
Development

No branches or pull requests

1 participant