Skip to content

Allow users to import and export scenarios #6

Description

@juyrjola

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions