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

[RHOAIENG-11326] Creating new pipeline from Create Run Page redirects to the pipeline detail page #3262

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

jpuzz0
Copy link
Contributor

@jpuzz0 jpuzz0 commented Sep 26, 2024

https://issues.redhat.com/browse/RHOAIENG-11326

Description

Add condition to pipeline import modal to only redirect when not located in the /create path associated with runs/schedules

Demo:
https://github.com/user-attachments/assets/28f10956-9b84-465e-8db6-bf9fda2d5f6d

How Has This Been Tested?

  1. Import a pipeline from the Pipelines list page and verify you're redirected to the pipeline version details page after creation
  2. Import a pipeline from the Create run page and verify you are not redirected to the pipeline version details page
  3. Repeat step 2 for the Create schedule page

Test Impact

No new tests added

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

Copy link
Member

@DaoDaoNoCode DaoDaoNoCode left a comment

Choose a reason for hiding this comment

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

This is a nice solution, but I do have another suggestion. I feel we could avoid inferring from the pathname, instead, we can pass isRedirectingToDetailsPage or something like this into the modal, and only when it's set to true, navigate to the details page... And we can default it to true and set it only to false when importing on the create run/schedules page...
Matching with the pathname is not always secure because if we change the pathname in the future, it's hard to find the issue here. This is OK for now, but just a suggestion.

@Gkrumbach07
Copy link
Member

/retest

@jpuzz0
Copy link
Contributor Author

jpuzz0 commented Sep 26, 2024

This is a nice solution, but I do have another suggestion. I feel we could avoid inferring from the pathname, instead, we can pass isRedirectingToDetailsPage or something like this into the modal, and only when it's set to true, navigate to the details page... And we can default it to true and set it only to false when importing on the create run/schedules page... Matching with the pathname is not always secure because if we change the pathname in the future, it's hard to find the issue here. This is OK for now, but just a suggestion.

That's fair, I don't mind either way, so I made the change to add a prop instead.

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.97%. Comparing base (a0d40fd) to head (0b7abcc).
Report is 10 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3262   +/-   ##
=======================================
  Coverage   84.96%   84.97%           
=======================================
  Files        1302     1302           
  Lines       29101    29106    +5     
  Branches     7828     7829    +1     
=======================================
+ Hits        24727    24733    +6     
+ Misses       4374     4373    -1     
Files with missing lines Coverage Δ
...tent/createRun/contentSections/PipelineSection.tsx 85.00% <ø> (ø)
.../pipelines/content/import/ImportPipelineButton.tsx 66.66% <100.00%> (+1.96%) ⬆️
...s/pipelines/content/import/PipelineImportModal.tsx 91.42% <100.00%> (+0.51%) ⬆️

... and 5 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 a0d40fd...0b7abcc. Read the comment docs.

Copy link
Member

@DaoDaoNoCode DaoDaoNoCode left a comment

Choose a reason for hiding this comment

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

Tested, works well
/lgtm

@Gkrumbach07
Copy link
Member

Gkrumbach07 commented Sep 27, 2024

@jpuzz0 we also should prevent navigation when importing from the empty states bc it is pretty much the same page anyway

@jpuzz0
Copy link
Contributor Author

jpuzz0 commented Sep 27, 2024

we also should prevent navigation when importing from the empty states bc it is pretty much the same page anyway

@Gkrumbach07 So inside of GlobalNoPipelines, prevent the redirect there? I'm not sure how this would be different from the redirect that we want from the pipelines table action. Maybe I'm missing something here though.

@Gkrumbach07
Copy link
Member

/approve

was mis reading what was changed

Copy link
Contributor

openshift-ci bot commented Sep 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DaoDaoNoCode, Gkrumbach07

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 250c555 into opendatahub-io:main Sep 27, 2024
8 checks passed
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.

3 participants