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

Conditionally render modals #3308

Conversation

jeff-phillips-18
Copy link
Contributor

@jeff-phillips-18 jeff-phillips-18 commented Oct 7, 2024

Closes RHOAIENG-12117

Description

Adds an eslint rule to not allow rendering modals that are not visible. Updates remaining modal usages to only render modals that are open.

How Has This Been Tested?

Run thru the UI and check that then modals are shown only when they should be shown.

  • In the UI, add ?devFeatureFlags to the URL

    • in the top banner, click the overridden link
    • verify the Feature flags modal is shown
  • From the Model Registry page

    • Select a model with versions
    • From the mode versions page, select a model version
    • Select Edit labels
    • Click the Add label label
    • Verify the Add label modal is shown
  • From the Setting -> Accelerator profiles page

    • Click the Enable switch for an enabled profile
    • verify the Disable accelerator profile modal is shown
  • From the Setting -> Accelerator profiles page

    • Select the kebab for an acceerator profile and select Edit
    • From the Edit accelerator profile page, click the Add toleration button
    • verify the Add toleration modal is shown
    • For a toleration select the kebab and then Edit
    • verify the Edit toleration modal is shown
  • From the Settings -> Notebook images page

    • Click Import new image
    • Verify the Import notebook image modal is shown
  • From the Settings -> Notebook images page

    • Click a kebab from a notebook image and select Edit
    • Verify the Update notebook image modal is shown
  • From the Settings -> Connection types page

    • Select Create connection type
    • From the Create connection type page, select Add section heading
    • verify the Add section heading modal is shown
  • From the Settings -> Connection types page

    • Select Create connection type
    • From the Create connection type page, select Add field
    • verify the Add field modal is shown
  • With a notebook server running, go to the Data Science Projects page

    • Select Launch standalone notebook server
    • Select Stop notebook server
    • Verify the Stop server modal is shown
  • From the Settings -> Storage classes page

    • Select the kebab for a storage class, and select Edit
    • Verify the Edit storage class details modal is shown.
  • From the Model Serving page

    • For a project with ModelMesh enabled, select the kebab for an existing model and select Edit
    • verify the Edit model modal is shown
  • On a cluster with no model registries (shared Model Serving cluster), from the Model registry settings page

    • Click the Create model registry button
    • verify the Create model registry modal is shown
  • On a cluster with model registries (shared Model Registry cluster), from the Model registry settings page

    • For an existing model registry, select the kebab menu then View database configuration
    • verify the View database configuration modal is shown
  • On a cluster with model registries (shared Model Registry cluster), from the Model registry settings page

    • For an existing model registry, select the kebab menu then Delete model registry
    • verify the Delete model registry? modal is shown
  • On a cluster with model registries (shared Model Registry cluster), from the Model registry settings page

    • Click the Create model registry button
    • verify the Create model registry modal is shown
  • For a project with model serving type not selected, navigate to the project details page and chose the Models tab

    • Select Deploy model from the Single-model serving platform card
    • verify the Deploy model modal is shown
  • For a project with model serving type not selected, navigate to the project details page and chose the Models tab

    • Select Add model server from the Multi-model serving platform card
    • verify the Add model server modal is shown

Test Impact

Current tests already test these modals.

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)

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress This PR is in WIP state label Oct 7, 2024
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 81.35593% with 22 lines in your changes missing coverage. Please review.

Project coverage is 84.75%. Comparing base (25c0564) to head (dcf71cc).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
.../notebookController/screens/server/SpawnerPage.tsx 9.09% 10 Missing ⚠️
.../components/EditableLabelsDescriptionListGroup.tsx 28.57% 5 Missing ⚠️
...src/pages/projects/notebook/StartNotebookModal.tsx 0.00% 3 Missing ⚠️
...tend/src/pages/projects/pvc/AddNotebookStorage.tsx 66.66% 3 Missing ⚠️
...ebookController/screens/server/StopServerModal.tsx 80.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3308      +/-   ##
==========================================
- Coverage   84.77%   84.75%   -0.02%     
==========================================
  Files        1309     1309              
  Lines       29292    29330      +38     
  Branches     7955     8005      +50     
==========================================
+ Hits        24831    24858      +27     
- Misses       4461     4472      +11     
Files with missing lines Coverage Δ
frontend/src/app/DevFeatureFlagsBanner.tsx 100.00% <100.00%> (ø)
...BYONImages/BYONImageModal/ManageBYONImageModal.tsx 92.95% <100.00%> (-0.38%) ⬇️
frontend/src/pages/BYONImages/BYONImagesTable.tsx 93.18% <100.00%> (+0.32%) ⬆️
...end/src/pages/BYONImages/ImportBYONImageButton.tsx 100.00% <100.00%> (ø)
...es/screens/list/AcceleratorProfileEnableToggle.tsx 81.25% <100.00%> (+1.25%) ⬆️
...es/screens/list/DisableAcceleratorProfileModal.tsx 100.00% <ø> (ø)
...age/ManageAcceleratorProfileTolerationsSection.tsx 100.00% <100.00%> (ø)
...reens/manage/tolerations/ManageTolerationModal.tsx 91.66% <ø> (-0.34%) ⬇️
...es/screens/manage/tolerations/TolerationsTable.tsx 100.00% <100.00%> (ø)
...kController/screens/admin/NotebookAdminControl.tsx 100.00% <100.00%> (ø)
... and 18 more

... and 23 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 c8d7822...dcf71cc. Read the comment docs.

@jenny-s51 jenny-s51 self-requested a review October 9, 2024 19:59
@jeff-phillips-18 jeff-phillips-18 changed the title [WIP] Conditionally render modals Conditionally render modals Oct 9, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress This PR is in WIP state label Oct 9, 2024
@christianvogt
Copy link
Contributor

/lgtm
/approve

Copy link
Contributor

openshift-ci bot commented Oct 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt

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 030dcb0 into opendatahub-io:main Oct 10, 2024
8 checks passed
@jeff-phillips-18 jeff-phillips-18 deleted the conditionally-render-modals branch October 11, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants