gbv / cocoda

A web-based tool for creating mappings between knowledge organization systems.
https://coli-conc.gbv.de/cocoda/
MIT License
39 stars 5 forks source link

Preserve the current state of the application #36

Closed stefandesu closed 6 years ago

stefandesu commented 6 years ago

Client-side (in-browser) storage could be used to preserve the current state of the application even after refreshing the site or restarting the browser. See https://vuejs.org/v2/cookbook/client-side-storage.html.

nichtich commented 6 years ago

The current state could also be stored in the fragment identifier as part of the URL (https://coli-conc.gbv.de/cocoda/#hercomesthestate), see shared state and routing in vue. Client side storage could also be used for caching and as private backend to store mappings - but that's another issue. The question of this issue is:

What is part of the "current state of the application"?

stefandesu commented 6 years ago

We should use Vue Router for this. It would make sense to use URL query parameters for the selected schemes/concepts and the current mapping. Here is a relevant tutorial: How to make content dynamic via URL query parameters in Vue.

stefandesu commented 6 years ago

Selected concept schemes and concepts are now added as URL parameters (schemeLeft, conceptLeft, schemeRight, conceptRight). Leaving this issue open for further discussion and ideas.

stefandesu commented 6 years ago

The current mapping in MappingEditor should be part of the URL parameters as well.

stefandesu commented 6 years ago

The current mapping is now part of the URL parameters, although with a few caveats:

All of these except for the last point will be fixed later. I'm not sure if it's possible to actually fix the last point without encoding the whole mapping object. I'll think about it.

stefandesu commented 6 years ago
  1. To fix all the caveats in the previous comment, we should encode the whole mapping object and put that into the URL parameter. Only thing is that we need to filter out all concept/scheme properties except for uri.
  2. Today's commits feature settings in local storage. Part of this is also saving the sizes and minimized status for each component. This means that we basically achieved to preserve the full state of the application, although some of it is in the URL params (selected schemes and concepts, current mapping), and some of it in local storage (component sizes and minimized status).

Because of all this, I will (finally) close this issue. Number 1 will be implemented in the next few days.