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

Import feature : allow to import multiple stories ? #320

Open
robindemourat opened this issue Dec 17, 2019 · 1 comment
Open

Import feature : allow to import multiple stories ? #320

robindemourat opened this issue Dec 17, 2019 · 1 comment

Comments

@robindemourat
Copy link
Member

robindemourat commented Dec 17, 2019

When creating a story and clicking on "import an existing story", we could (quite easily I guess) allow to import multiple stories JSON files in one operation (instead of a single one currently).

This would allow to meet the possible need to "preload" example stories in a fonio instance as such :

  1. at the end of a semester, we archive and save with quinoa-bocal the best stories then download them as a bundle of JSON file
  2. we store them somewhere ex. on google drive
  3. next year, in their own instances, the teachers can import these stories in a single drag-and-drop before the course start

This would be a light and souple way to allow to display example stories to students.

@audreybaneyx I put this in the tool roadmap as one possible way to address our discussion of this morning !

@robindemourat
Copy link
Member Author

robindemourat commented Dec 19, 2019

Changes to do for that are more important than expected because of the possibility for a story to be duplicated. Right now in the redux state we store separately a newStory for the currently imported story, overrideImport, and overrideStoryMode properties. If a story is a duplicate (i.e. there is already a story in the same id in the instance):

  1. a first modal asks for an override decision (override, duplicate, or cancel)
  2. a second modal asks for a password (this step occurs even when the imported story is not a duplicate)
  3. then the story is possibly created on the server

This way of doing allows to handle one single story per import, but not several.

The workflow for that should be different, maybe roughly as following:

  1. after drop, we store each imported story in a single importedStories array in the HomeView store part, checking for each candidate if it is a duplicate and store that info in the store (it would look like that : importedStories: [{storyId: "id", storyIsDuplicate: true, storyData: {...}},...])
  2. we "unstack" the list of candidates one by one, doing steps 1, 2, and 3 one by one and displaying related modals if their state requires it. The server story creation success action should "filter out" the related story from the importedStories array - this mecanism happens as long as the importedStories array is not empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant