-
Notifications
You must be signed in to change notification settings - Fork 32
♻️🎨 [Frontend] Study Store #8087
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
Conversation
…into enh/study-store
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.
Pull Request Overview
This PR centralizes all study-related API interactions into a singleton osparc.store.Study, replacing ad-hoc osparc.data.Resources.fetch("studies", …) calls in UI components with calls to Study.getInstance(), and adds a suite of new store methods for pagination, trash/untrash, moving, tagging, collaborators, and node operations.
- Replaced direct resource fetches across many components with
osparc.store.Study.getInstance()calls - Converted
osparc.store.Studyto a singleton and added new methods (getPage, trashStudy, moveStudyToWorkspace, addTag, removeCollaborator, etc.) - Removed duplicated static methods from the generic
Store.jsin favor of the specializedStudystore
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| services/static-webserver/client/source/class/osparc/study/StudyOptions.js | Switched name, wallet and fetch calls to Study.getInstance() |
| services/static-webserver/client/source/class/osparc/study/NodePricingUnits.js | Updated pricing-unit fetch/update to use Study singleton |
| services/static-webserver/client/source/class/osparc/study/CreateFunction.js | Replaced metadata PATCH fetch with store.updateMetadata |
| services/static-webserver/client/source/class/osparc/study/BillingSettings.js | Centralized wallet selection via Study singleton |
| services/static-webserver/client/source/class/osparc/store/Templates.js | Delegated template fetching to Study.getInstance().getOne |
| services/static-webserver/client/source/class/osparc/store/Study.js | Converted to a singleton, added CRUD, pagination, tag, collaborator APIs |
| services/static-webserver/client/source/class/osparc/store/Store.js | Removed study‐specific static methods now in Study store |
| services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js | Replaced fetch calls (getPage, getOne, delete, patch) with store calls |
| services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserBase.js | Moved delete, untrash, patch, pricing workflows into Study singleton |
Comments suppressed due to low confidence (2)
services/static-webserver/client/source/class/osparc/store/Study.js:110
- The
updateMetadatamethod does not return the fetch promise, preventing callers from waiting on or handling errors. Addreturnbefore the fetch call to enable proper chaining.
osparc.data.Resources.fetch("studies", "updateMetadata", params)
services/static-webserver/client/source/class/osparc/store/Study.js:26
- New pagination methods (
getPage,getPageTrashed,getPageSearch) were added without accompanying unit or integration tests. Consider adding tests to ensure correct behavior and catch any regressions.
getPage: function(params, options) {
services/static-webserver/client/source/class/osparc/study/BillingSettings.js
Show resolved
Hide resolved
giancarloromeo
left a comment
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.
Thanks
matusdrobuliak66
left a comment
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.
👍
GitHK
left a comment
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.
👍
|
@mergify queue |
🟠 Waiting for conditions to match
|
|
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
sanderegg
left a comment
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.
nice!
|
@mergify queue |
🟠 Waiting for conditions to match
|
…into enh/study-store
|



What do these changes do?
In order to get ready for the coming "multiple users access the same study at the same time" feature, this PR centralizes most of the study related calls in the Study Store.
The idea is to have the Study model managed in the Store while it's able to listen to changes pushed from the backend (other users).
Related issue/s
How to test
Dev-ops