Skip to content
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: modify behaviours for the enable button for NIM. #3558

Conversation

yzhao583
Copy link
Contributor

@yzhao583 yzhao583 commented Dec 9, 2024

Jira: https://issues.redhat.com/browse/NVPE-37
Jira: https://issues.redhat.com/browse/NVPE-72

Description

  • Show Skeleton when visibility of the enable button is determined.
  • Disable the submit button if the API key is not provided by user.
  • Hide the link to remove the NIM app from the enabled apps page when NIM is disabled.
  • Hide the enable button after NIM app is enabled.
image image image

How Has This Been Tested?

  • Tested locally.

Test Impact

  • Go to the Explore page, select the NVIDIA NIM tile, and should see the Skeletonwhen loading. If NIM is enabled, the Enable button should be hidden, if NIM is disabled but can be enabled, the Enable button should be displayed, if NIM cannot be enabled, the Enable button should be displayed but the button should be disabled, hover the button, the tooltip should be displayed.
  • Click the Enable button, and the modal to enable NIM should be displayed. If no API key is provided, the Submit button should be disabled, otherwise, it should be enabled.
  • Provide API key, and click the Submit button. If validation success, the modal should be closed and the Enable button on the Explore page should be hidden.
  • Disable NIM and go to the Enable page -> click the disable on the top-right corner of the NIM tile, the link to remove NIM from this page should NOT be seen.

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@openshift-ci openshift-ci bot added the needs-ok-to-test The openshift bot needs to label PRs from non members to avoid strain on the CI label Dec 9, 2024
Copy link
Contributor

openshift-ci bot commented Dec 9, 2024

Hi @yzhao583. Thanks for your PR.

I'm waiting for a opendatahub-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@yzhao583 yzhao583 force-pushed the NVPE-37-fix-the-enable-button-loading-issue branch from 39448bd to 97e4f94 Compare December 9, 2024 05:22
@yzhao583 yzhao583 force-pushed the NVPE-37-fix-the-enable-button-loading-issue branch 2 times, most recently from 1bed0fd to 7043b7e Compare December 9, 2024 05:49
@andrewballantyne
Copy link
Member

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test The openshift bot needs `ok-to-test` to allow non member PRs to run the tests. and removed needs-ok-to-test The openshift bot needs to label PRs from non members to avoid strain on the CI labels Dec 9, 2024
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 18.75000% with 52 lines in your changes missing coverage. Please review.

Project coverage is 85.75%. Comparing base (3ea00fd) to head (d1e042e).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
frontend/src/utilities/useEnableApplication.tsx 5.26% 36 Missing ⚠️
frontend/src/components/OdhAppCard.tsx 0.00% 5 Missing ⚠️
...ntend/src/pages/exploreApplication/EnableModal.tsx 37.50% 5 Missing ⚠️
...d/src/pages/exploreApplication/GetStartedPanel.tsx 28.57% 5 Missing ⚠️
...nd/src/utilities/useWatchIntegrationComponents.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3558      +/-   ##
==========================================
- Coverage   85.82%   85.75%   -0.08%     
==========================================
  Files        1419     1419              
  Lines       32644    32678      +34     
  Branches     9167     9192      +25     
==========================================
+ Hits        28018    28022       +4     
- Misses       4626     4656      +30     
Files with missing lines Coverage Δ
...pages/exploreApplication/useIntegratedAppStatus.ts 88.88% <100.00%> (+1.38%) ⬆️
frontend/src/types.ts 100.00% <100.00%> (ø)
...nd/src/utilities/useWatchIntegrationComponents.tsx 37.73% <0.00%> (ø)
frontend/src/components/OdhAppCard.tsx 61.90% <0.00%> (-2.03%) ⬇️
...ntend/src/pages/exploreApplication/EnableModal.tsx 33.92% <37.50%> (+1.85%) ⬆️
...d/src/pages/exploreApplication/GetStartedPanel.tsx 62.06% <28.57%> (-2.22%) ⬇️
frontend/src/utilities/useEnableApplication.tsx 24.34% <5.26%> (-3.92%) ⬇️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ea00fd...d1e042e. Read the comment docs.

@emilys314
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot removed the lgtm label Dec 19, 2024
frontend/src/components/OdhAppCard.tsx Show resolved Hide resolved
frontend/src/types.ts Outdated Show resolved Hide resolved
@yzhao583 yzhao583 requested review from swati-kale and TomerFi January 8, 2025 07:09
@emilys314
Copy link
Contributor

It looks like there is a typescript error with the most recent rebasing to include Olga's pr in frontend/src/__tests__/cypress/cypress/utils/nimUtils.ts

I think we may want to make the properties variablesValidationStatus and variablesValidationTimestamp optional in type IntegrationAppStatus in frontend/src/types.ts

@yzhao583
Copy link
Contributor Author

yzhao583 commented Jan 9, 2025

@emilys314 I changed variablesValidationTimestamp and variablesValidationStatus to optional

Copy link
Contributor

@emilys314 emilys314 left a comment

Choose a reason for hiding this comment

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

Also make sure to run the linter / formatter

frontend/src/utilities/useEnableApplication.tsx Outdated Show resolved Hide resolved
backend/src/routes/api/integrations/nim/index.ts Outdated Show resolved Hide resolved
@emilys314
Copy link
Contributor

Okay I just tested it again and everything seems to be working

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm label Jan 13, 2025
Copy link
Contributor

openshift-ci bot commented Jan 13, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: emilys314

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 8d9b80a into opendatahub-io:main Jan 13, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test The openshift bot needs `ok-to-test` to allow non member PRs to run the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants