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

Allow users to import and export scenarios #6

Open
juyrjola opened this issue Jul 20, 2021 · 0 comments
Open

Allow users to import and export scenarios #6

juyrjola opened this issue Jul 20, 2021 · 0 comments
Assignees
Labels

Comments

@juyrjola
Copy link
Member

juyrjola commented Jul 20, 2021

We should allow users to import and export the custom scenarios they have made. Let's do this by generating a (JSON) file in the backend that we download to the user's computer. A couple of new mutations will be needed:

  • ExportScenario takes as its argument a name for the custom scenario. It generates the JSON of the customized parameters and returns that as the data field along with filename that the UI uses when saving the file.
  • ImportScenario is given a string that the UI loads from the user-uploaded scenario file. It will create a new field (imported_scenario?) in request.session that will serve as the fourth available scenario in the scenarios endpoint. When a new scenario is imported, imported_scenario will be replaced by the new contents, so the user cannot have more than one imported scenario available to her.
@bbliem bbliem self-assigned this Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants