-
Notifications
You must be signed in to change notification settings - Fork 70
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
feat(workspace): Created reusable ScopedStorage #13920
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
solution/studio/designer
Issues related to the Altinn Studio Designer solution.
frontend
labels
Oct 25, 2024
framitdavid
changed the title
feat(pure-functions): Created a class to handle
feat(pure-functions): Created reusable ScopedStorage
Oct 25, 2024
framitdavid
changed the title
feat(pure-functions): Created reusable ScopedStorage
feat(workspace): Created reusable ScopedStorage
Oct 25, 2024
framitdavid
added
team/studio-core
skip-releasenotes
Issues that do not make sense to list in our release notes
labels
Oct 25, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13920 +/- ##
=======================================
Coverage 95.28% 95.28%
=======================================
Files 1649 1651 +2
Lines 21981 22008 +27
Branches 2587 2590 +3
=======================================
+ Hits 20944 20971 +27
Misses 790 790
Partials 247 247 ☔ View full report in Codecov by Sentry. |
wrt95
approved these changes
Oct 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brilliant! 👏 Great work 🚀
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
frontend
skip-manual-testing
PRs that do not need to be tested manually
skip-releasenotes
Issues that do not make sense to list in our release notes
solution/studio/designer
Issues related to the Altinn Studio Designer solution.
team/studio-core
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces
ScopedStorageImpl
, a class designed to manage storage records under a specific key. While it provides scoped access similar to browser storage, it is not restricted to browser environments. Instead, this implementation leverages dependency inversion by taking a ScopedStorage interface as a dependency, allowing the flexibility to replace the storage mechanism as needed. This approach enables the use of alternative storage backends, such as remote storage solutions, without requiring significant codebase refactoring.Through dependency inversion,
ScopedStorageImpl
becomes adaptable and scalable, facilitating future storage migrations by simply switching the underlying ScopedStorage dependency. The primary methods, setItem, getItem, and removeItem, support JSON-encoded data management, whileparseStorageData
ensures type safety and includes error handling for invalid JSON inputs, usingconsole.error
. This design promotes cleaner code organization and enhances scalability by keeping storage dependencies flexible and maintainable.Related Issue(s)
Verification