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.
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:
ExportScenariotakes as its argument anamefor the custom scenario. It generates the JSON of the customized parameters and returns that as thedatafield along withfilenamethat the UI uses when saving the file.ImportScenariois given a string that the UI loads from the user-uploaded scenario file. It will create a new field (imported_scenario?) inrequest.sessionthat will serve as the fourth available scenario in thescenariosendpoint. When a new scenario is imported,imported_scenariowill be replaced by the new contents, so the user cannot have more than one imported scenario available to her.