sashuk / watsonc

WatsonC Vidi extension
0 stars 2 forks source link

Single plots should be stored in key/value store #22

Closed mapcentia closed 5 years ago

mapcentia commented 5 years ago

Currently, the user has to create a snap-shot if plots have to be saved for later use. But this is not flexible enough. We need plots to persist by storing them in the key/value store. So when a plot is created or altered (adding/removing time series) the plot config should be stored. When Add New (see https://github.com/sashuk/watsonc/issues/21) is used, the user can either create a new plot or choose from the stored ones:

image

mapcentia commented 5 years ago

Single plots should be stored in key/value store

sashuk commented 5 years ago

@mapcentia Am I correct that now there is no need to carry plot data in state snapshots? The plotId will correspond to the plot in key-value storage, where all the data will be stored as well, so the state snapshot will keep only plot identifiers.

Also, is it correct that when the single plot is created, it can be selected from any of the plots stored before, so any plot basically belongs to any user, so any plot can be managed by any user? Or some kind of access-policy should be implemented (for example, only creator of the plot can update/delete it)?

mapcentia commented 5 years ago

@sashuk Yes, you're correct about the first one.

Users are always signed in this application. We have a 3. party dashboard where users sign in using the Vidi API and when the users are redirected to Vidi, where a session is started. So we must use the Vidi session to manage plots

sashuk commented 5 years ago

@mapcentia Thank you for the clarification!

sashuk commented 5 years ago

@mapcentia Implemented in https://github.com/sashuk/watsonc/commit/839e01e485e7726f1e1d623a320ec1a142d4b5fa

For reference: https://vidi.alexshumilov.ru/app/jupiter/chemicals/?state=state_snapshot_90b759e0-60f5-11e9-9477-194904768108&tmpl=watsonc.tmpl

What is stored in state snapshot:

dehydratedplot