Skip to content

Conversation

@odeimaiz
Copy link
Member

@odeimaiz odeimaiz commented Jun 12, 2025

What do these changes do?

If somehow the backend returns an error on the project/services call, this PR makes the frontend handle that situation in a better way: the card gets blocked, but some actions (not related to services) are still available.

UnknownServices

Related issue/s

How to test

Dev-ops

@odeimaiz odeimaiz self-assigned this Jun 12, 2025
@odeimaiz odeimaiz changed the title handle errored /services 🎨🐛 [Frontend] Handle errored/missing project/services Jun 12, 2025
@odeimaiz odeimaiz added this to the Engage milestone Jun 12, 2025
@odeimaiz odeimaiz added t:enhancement Improvement or request on an existing feature bug buggy, it does not work as expected a:frontend issue affecting the front-end (area group) labels Jun 12, 2025
@odeimaiz odeimaiz marked this pull request as ready for review June 12, 2025 13:39
@odeimaiz odeimaiz requested a review from Copilot June 12, 2025 13:44
Copy link
Contributor

Copilot AI left a 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 improves the frontend handling of cases where the backend returns an error or missing data for the project/services call, ensuring that the study card is blocked appropriately while still allowing other actions.

  • In osparc/study/Utils.js, the logic in __getBlockedState now explicitly checks for null services.
  • In osparc/dashboard/CardBase.js, updates include making the services property nullable and enhancing error handling and UI blocking for unknown or inaccessible services.
  • Minor UI adjustments were made in DataBrowser.js and logical fixes in ResourceDetails.js.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
services/static-webserver/client/source/class/osparc/study/Utils.js Updated service check in __getBlockedState to explicitly handle null.
services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js Inverted condition to control template page creation.
services/static-webserver/client/source/class/osparc/dashboard/DataBrowser.js Added a paddingBottom property on TreeFolderView for improved layout.
services/static-webserver/client/source/class/osparc/dashboard/CardBase.js Modified services attribute to be nullable and refactored service error handling UI.
Comments suppressed due to low confidence (3)

services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js:807

  • The condition was inverted from the previous logic; please confirm that returning null when templates are not shown is the intended behavior.
!osparc.product.Utils.showTemplates()

services/static-webserver/client/source/class/osparc/dashboard/DataBrowser.js:46

  • [nitpick] Consider adding a code comment explaining the reason for setting a custom paddingBottom for TreeFolderView to aid future maintainability.
control = new osparc.file.TreeFolderView().set({ paddingBottom: 15, });

services/static-webserver/client/source/class/osparc/dashboard/CardBase.js:726

  • Calling unknownServices unconditionally will block the card; please confirm that this behavior is the intended UX for cases with missing services.
unknownServices();

@odeimaiz odeimaiz changed the title 🎨🐛 [Frontend] Handle errored/missing project/services 🎨🐛 [Frontend] Handle error on project/services Jun 12, 2025
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

thanks!
Would it be possible to selectively refresh the card?

@odeimaiz
Copy link
Member Author

thanks! Would it be possible to selectively refresh the card?

What do you mean?

@odeimaiz odeimaiz added the 🤖-automerge marks PR as ready to be merged for Mergify label Jun 12, 2025
@odeimaiz
Copy link
Member Author

@Mergifyio queue

@mergify
Copy link
Contributor

mergify bot commented Jun 12, 2025

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 3148d13

@sanderegg
Copy link
Member

thanks! Would it be possible to selectively refresh the card?

What do you mean?

I mean if I have a broken card, that instead of pressing F5 and reloading everything, I can right click on the card (or the ...) and click a refresh there only.

@sonarqubecloud
Copy link

@mergify mergify bot merged commit 3148d13 into ITISFoundation:master Jun 12, 2025
58 of 59 checks passed
@odeimaiz odeimaiz deleted the enh/handle-non-existing-services branch June 12, 2025 15:11
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Aug 5, 2025
88 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify a:frontend issue affecting the front-end (area group) bug buggy, it does not work as expected t:enhancement Improvement or request on an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants