Skip to content

Store last seen workspaces in local storage#208

Merged
MarcelGeo merged 3 commits into
developfrom
gh#2229-last-seen-workspaces
Apr 8, 2024
Merged

Store last seen workspaces in local storage#208
MarcelGeo merged 3 commits into
developfrom
gh#2229-last-seen-workspaces

Conversation

@MarcelGeo
Copy link
Copy Markdown
Collaborator

@MarcelGeo MarcelGeo commented Apr 5, 2024

Details

Reaction to ticket https://github.com/MerginMaps/server-private/issues/2229

🔨
Store last seen workspace(s) in local storage instead of cookies. This PR is mostly only refactor, but following improvements are coming:

  • local storage is more robust than cookies
  • currentWorkspace cookies will not be sending in every request on API 🥇
  • there is not need to handle expiring of cookies
  • last workspace will be array instead key value (used for showing last seen workspace to user)

➕ New feature:

  • We can now use Proxy based storing to local storage with ability to set value and sync it with localStorage. In case of array value in Proxy, use spread operator (push/pop ... are not reactive). This is experimental feature.
const storage = createStorage('name-of-key', 0)

storage.value = 1

- logic for storing data in local storage based on javascript Proxy (experimental)

Cleanup:
- some unnecessary functions from stores

Refactor:
- unify APp.vue for CE

Fix:
- missing import of error utils in project sharing
@MarcelGeo MarcelGeo requested a review from varmar05 April 5, 2024 11:51
@MarcelGeo MarcelGeo changed the base branch from master to develop April 5, 2024 11:53
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 5, 2024

Pull Request Test Coverage Report for Build 8596505426

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 94.023%

Totals Coverage Status
Change from base Build 8518985643: 0.0%
Covered Lines: 5616
Relevant Lines: 5973

💛 - Coveralls

Copy link
Copy Markdown
Collaborator

@varmar05 varmar05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one, looking good.

Comment thread web-app/packages/lib/src/modules/user/store.ts Outdated
Comment thread web-app/packages/lib/src/modules/user/store.ts Outdated
@MarcelGeo
Copy link
Copy Markdown
Collaborator Author

@varmar05 Just wondering, do we need this function in community edition with one workspace?

@varmar05
Copy link
Copy Markdown
Collaborator

varmar05 commented Apr 8, 2024

@varmar05 Just wondering, do we need this function in community edition with one workspace?

We don't, if you can port it easily to EE/cloud, it would be good. Nevertheless backend APIs are available also for CE.

@MarcelGeo
Copy link
Copy Markdown
Collaborator Author

@varmar05 Just wondering, do we need this function in community edition with one workspace?

We don't, if you can port it easily to EE/cloud, it would be good. Nevertheless backend APIs are available also for CE.

We need to investigate potential solutions for porting specific store functions across different environments. It should be useful for error handling of specific cases in EE/Cloud. setWorkspace should be also ported with with option for storing of ws. I think this is not scope of this PR.

@MarcelGeo MarcelGeo merged commit c6bae0d into develop Apr 8, 2024
@MarcelGeo MarcelGeo deleted the gh#2229-last-seen-workspaces branch April 8, 2024 11:55
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

Successfully merging this pull request may close these issues.

3 participants