Skip to content

Conversation

@odeimaiz
Copy link
Member

@odeimaiz odeimaiz commented Sep 24, 2025

What do these changes do?

This PR implements Function Creation validation logic to require both inputs AND outputs to be exposed. It also updates the isPotentialFunction to expect both, input(s) AND output(s). If the project is not "Funcionable" instead of hiding the button, it's now disabled and it shows a tooltip explaining why it's disabled.

FunctionChecks

Related issue/s

How to test

Dev-ops

@odeimaiz odeimaiz self-assigned this Sep 24, 2025
@odeimaiz odeimaiz changed the title isPotentialFunction 🎨 [Frontend] Create Function: Do not allow registering functions without exposing 1 input or 1 output Sep 24, 2025
@odeimaiz odeimaiz changed the title 🎨 [Frontend] Create Function: Do not allow registering functions without exposing 1 input or 1 output 🎨 [Frontend] Create Function: Do not allow registering functions without exposing 1 input AND 1 output Sep 24, 2025
@odeimaiz odeimaiz marked this pull request as ready for review September 24, 2025 08:07
@odeimaiz odeimaiz requested a review from Copilot September 24, 2025 08:07
@odeimaiz odeimaiz added t:enhancement Improvement or request on an existing feature a:frontend issue affecting the front-end (area group) labels Sep 24, 2025
@odeimaiz odeimaiz added this to the Cheops milestone Sep 24, 2025
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

Refactors the function creation validation logic to require both inputs AND outputs instead of inputs OR outputs, with improved UI feedback for disabled states.

  • Moved isPotentialFunction from osparc.study.Utils to osparc.study.CreateFunction with updated logic requiring both parameters and probes
  • Added validation in __createFunction to check for exposed inputs and outputs before proceeding
  • Created reusable tooltip utility for disabled widgets to improve user experience

Reviewed Changes

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

Show a summary per file
File Description
services/static-webserver/client/source/class/osparc/utils/Utils.js Added toolTipTextOnDisabledWidget utility function for consistent tooltip handling
services/static-webserver/client/source/class/osparc/study/Utils.js Removed isPotentialFunction method (moved to CreateFunction class)
services/static-webserver/client/source/class/osparc/study/CreateFunction.js Added static methods including updated isPotentialFunction logic and validation functions
services/static-webserver/client/source/class/osparc/form/renderer/PropForm.js Refactored to use new tooltip utility function
services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js Updated to use new isPotentialFunction location and added disabled state handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@wvangeit wvangeit left a comment

Choose a reason for hiding this comment

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

Thanks @odeimaiz

@odeimaiz odeimaiz enabled auto-merge (squash) September 24, 2025 08:24
@mergify
Copy link
Contributor

mergify bot commented Sep 24, 2025

🧪 CI Insights

Here's what we observed from your CI run for 662401f.

🟢 All jobs passed!

But CI Insights is watching 👀

@sonarqubecloud
Copy link

@sonarqubecloud
Copy link

Please retry analysis of this Pull-Request directly on SonarQube Cloud

@odeimaiz odeimaiz merged commit d77067a into ITISFoundation:master Sep 24, 2025
58 checks passed
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Sep 24, 2025
65 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:frontend issue affecting the front-end (area group) t:enhancement Improvement or request on an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not allow registering of functions without at least exposing 1 input and 1 output

4 participants