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

Store user data on account so it's available across different browsers #1744

Open
404-html opened this issue Jul 10, 2021 · 5 comments
Open
Labels
bounty:$100 Bounty applies for fixing this issue (Parse Bounty Program) type:feature New feature or improvement of existing feature

Comments

@404-html
Copy link
Member

Currently user preferences like columns order, visibility, height are stored in Local Storage.
When accessing dashboard from other machine all those changes are not preserved.
It would be nice to have all those customizations available across different browsers/devices.

@mtrezza
Copy link
Member

mtrezza commented Jul 10, 2021

Thanks for suggesting.

Storing user-specific settings in Parse Server seems like a useful feature. Do you want to explore how this could be done conceptually?

Alternatively, it is already possible to pre-set some settings in the Parse Dashboard config file.

@404-html
Copy link
Member Author

I think database seems to be the best place to store this data. Could the mechanism for storing and reading schemas be used?
Here's how I see it:

  • The mechanism would take Parse Dashboard user settings stored in Local Storage and save them to the database;
  • On next start it would read settings from the database with fallback to Local Storage;
  • Each user settings change would update settings object in database and Local Storage;

At this stage I have following concerns:

  1. Is option to give specific instance of Parse Dashboard a priority needed? Let's say I prefer settings from browser A, but after updating dashboard I open browser B first. Browser A will now lose my preferred settings (overwrite by browser B settings);
  2. Is saving settings to Local Storage still needed? If not maybe it's just a matter of changing target/source in settings logic (from Local Storage to DB). With one addition to move settings on first run;
  3. Are there any limitations due to the fact that Parse Server supports different databases?

@mtrezza
Copy link
Member

mtrezza commented Jul 10, 2021

ad 1)
Should settings be saved on-demand (click on Save dashboard settings) or automatically? If on-demand, then you can simply ignore this issue for now. Later on, if you want to refine the feature, you could display a warning dialog when trying to save settings but the settings on the server are newer than the settings cached in the browser.

ad 2)
Yes, local browser settings are the cached settings. I would only fetch the settings from server once on dashboard launch, then store in local cache. If settings are changed locally, they can be changed in cache only, and on click of the Save dashboard settings button they would be updated server side.

ad 3)
I don't think so. The database adapters should take care of this for you. Saving documents to internal collections is already a feature of Parse Server, see for example the _Idempotency collection.

@404-html
Copy link
Member Author

404-html commented Aug 24, 2021

An easy way to import and export LocalStorage:
To export:

const export = JSON.stringify(localStorage);

To import:

Object.assign(localStorage,JSON.parse(import));

I found that here.

@mtrezza
Copy link
Member

mtrezza commented Aug 24, 2021

We are gathering the pieces!

What could a most basic version of this look like, so we get a first version implemented?

Maybe we could focus on a single setting to store in the DB, future PRs can then build on top of that. For example, we could store only the column preferences (visibility and order). The tasks would probably be:

  • Add dashboard PR
    • Add button to manually save settings to DB (instead of anything automatically)
    • Add one-time preferences loading routine on dashboard start-up
  • Add parse server PR
    • Add new internal class _Dashboard, see _Idempotency as an example
    • Add endpoints to get / post dashboard preferences

@mtrezza mtrezza added the bounty:$50 Bounty applies for fixing this issue (Parse Bounty Program) label Oct 6, 2021
@mtrezza mtrezza added bounty:$100 Bounty applies for fixing this issue (Parse Bounty Program) and removed bounty:$50 Bounty applies for fixing this issue (Parse Bounty Program) labels Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty:$100 Bounty applies for fixing this issue (Parse Bounty Program) type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

2 participants