Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

add local stroge backup #123

Closed
wants to merge 1 commit into from

Conversation

harunurhan
Copy link
Collaborator

@harunurhan harunurhan commented Mar 24, 2017

  • Fixes Save JSON state in local storage #120. Saves current version of data before window/tab is
    closed by the its url from where it was fetched earlier. And check
    before fetching a data if it exists on local stroge. Finally clear the
    data if it is save successfully.

  • Refactors api.service.

Some discussion

  • Actually clearing doesn't help much since even you don't touch the record after saving remotely, it will be saved locally on window unload. It only works when you open this saved record again in another tab without closing. I'd like to know if we should keep the copy of last remotely saved data and compare it with the current one on window unload before saving the current one to local storage.

  • Although it's not in the PR yet but I think we should ask if user wants to load local copy or remote when local copy exists. For this one @StellaCh might help to figure out if we want to load local by default and have a reload button for re-fetch or ask to save locally when closing the tab or ask to load local save on the start

* Fixes inspirehep#120. Saves current version of data before window/tab is
closed by the its url from where it was fetched earlier. And check
before fetching a data if it exists on local stroge. Finally clear the
data if it is save successfully.

* Refactors api.service.
@StellaCh
Copy link
Contributor

Regarding the last bullet point:
After discussing it with Annette/Kirsten/Micha, 2 requirements came out:

  1. When we close a window with unsaved changes, we should get an alert: "You have unsaved changes. Do you want to save them first?" with the options: Save/Discard.
  2. In case of a network problem, by default we should load the changes saved locally using the same UI as the merger (where the user accepts/rejects the changes). This enables us to handle cases like when the record gets extra updates while we are not on the editor.

@harunurhan
Copy link
Collaborator Author

@StellaCh for the first one I created this #126

For the second one, it's more complicated and blocked by the merger-ui but we can track it via existing one which I updated #120

@harunurhan
Copy link
Collaborator Author

This is not needed at the moment.

@harunurhan harunurhan closed this Mar 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save JSON state in local storage
2 participants