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

Convert task selection to quick search modal in pipeline builder #9583

Merged

Conversation

karthikjeeyar
Copy link
Contributor

@karthikjeeyar karthikjeeyar commented Jul 22, 2021

Fixes:

https://issues.redhat.com/browse/ODC-6133

Analysis / Root cause:

Convert the existing task selection dropdown to use the new quick search modal

Solution Description:

  1. Created a custom PipelineQuicksearchModal.
  2. Extended the quicksearch component to have some configurations like icon, modalPositionOffset and isLimitedList
  3. Added autoscroll when cycling through a big list of search results by pressing down arrow in the keyboard.
  4. Added temporary Delete decoarator (This will be changed in subsequent PR's based on the UX design).

Note: This PR contains only the Task and ClusterTask resources, tekton hub will be done in a separate PR.

Screen shots / Gifs for design review:

Pipeline_task_selection.mp4

test coverage report:

Updated task selection method in integration test in pipeline builder page pipelineBuilder-page.ts

Test setup:

Visit Pipeline builder page and click on Add Task node.

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

cc: @bgliwa01 @christianvogt @andrewballantyne

@openshift-ci openshift-ci bot added component/core Related to console core functionality component/pipelines Related to pipelines-plugin component/shared Related to console-shared kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated labels Jul 22, 2021
@karthikjeeyar
Copy link
Contributor Author

cc: @makambalaji Updated the pipeline e2e tests to use quick search modal instead of select dropdown.

@makambalaji
Copy link
Contributor

cc: @makambalaji Updated the pipeline e2e tests to use quick search modal instead of select dropdown.

Thanks @karthikjeeyar for the information

@openshift-ci openshift-ci bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. component/topology Related to topology labels Jul 27, 2021
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 27, 2021
Copy link
Contributor

@divyanshiGupta divyanshiGupta left a comment

Choose a reason for hiding this comment

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

Code looks good. Will try it locally and add lgtm if everything works fine.

@divyanshiGupta
Copy link
Contributor

Screenshot 2021-07-30 at 10 22 03 PM

@karthikjeeyar In your screen-recording I see the modal is in the centre but if you look at above screenshot it appears on top for me. In topology page the modal appears in the centre so for consistency I think we should keep it in centre in pipeline-builder page as well.

Also in topology quick-search modal we show the provided by label like this Red Hat, Inc i.e the first letter is in uppercase. We might want to do the same here.

I also noticed that when there are only five items to show as you can see in the above screenshot there is a weird gap shown after the last item. It's not a big issue but it looks weird. If this can be fixed with minimal effort we can do it in this PR.

@divyanshiGupta
Copy link
Contributor

Screen.Recording.2021-07-30.at.10.28.32.PM.mov

@karthikjeeyar I think we want to disable keyboard action for opening the modal as here we dont know where the user might want to add the task i.e they can add it parallelly or side-by-side and if they use the keyboard action to open the modal and add the task it gets added parallelly automatically which is something they might not want.

Copy link
Contributor

@divyanshiGupta divyanshiGupta left a comment

Choose a reason for hiding this comment

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

@karthikjeeyar I have added a few comments above. Apart from these the functionality works as expected.

@karthikjeeyar
Copy link
Contributor Author

@karthikjeeyar In your screen-recording I see the modal is in the centre but if you look at above screenshot it appears on top for me. In topology page the modal appears in the centre so for consistency I think we should keep it in centre in pipeline-builder page as well.

Initially I have added modalPositionOffset to be at the center of the screen, removed it based on Andrew's comment here.

Also in topology quick-search modal we show the provided by label like this Red Hat, Inc i.e the first letter is in uppercase. We might want to do the same here

In the designs we don't have this Provided by <providername> at all, it is showing because of the default topology quick search implementation, we have a separate story to match the modal content exactly with the final design.

@karthikjeeyar
Copy link
Contributor Author

@divyanshiGupta Added a prop to disable keyboard open and used it in pipelineQuicksearch modal

@divyanshiGupta
Copy link
Contributor

Screenshot 2021-07-30 at 10 22 03 PM

@karthikjeeyar In your screen-recording I see the modal is in the centre but if you look at above screenshot it appears on top for me. In topology page the modal appears in the centre so for consistency I think we should keep it in centre in pipeline-builder page as well.

Also in topology quick-search modal we show the provided by label like this Red Hat, Inc i.e the first letter is in uppercase. We might want to do the same here.

I also noticed that when there are only five items to show as you can see in the above screenshot there is a weird gap shown after the last item. It's not a big issue but it looks weird. If this can be fixed with minimal effort we can do it in this PR.

@bgliwa01 wdyt about this?

@karthikjeeyar
Copy link
Contributor Author

I also noticed that when there are only five items to show as you can see in the above screenshot there is a weird gap shown after the last item. It's not a big issue but it looks weird. If this can be fixed with minimal effort we can do it in this PR.

@divyanshiGupta Yes, there isn't a extra space needed here, when we are not showing the viewLinks at the bottom.
Updated the code
image

@divyanshiGupta
Copy link
Contributor

@karthikjeeyar I am getting i18n warnings for both TopologyQuickSearch and PipelineQuickSearch.

@karthikjeeyar
Copy link
Contributor Author

karthikjeeyar commented Aug 2, 2021

@karthikjeeyar I am getting i18n warnings for both TopologyQuickSearch and PipelineQuickSearch.

I am not seeing any i18n errors after building the code and re-bridging it. Frontend tests are also passing, so I request you to try build.sh once.

@divyanshiGupta
Copy link
Contributor

@karthikjeeyar In your screen-recording I see the modal is in the centre but if you look at above screenshot it appears on top for me. In topology page the modal appears in the centre so for consistency I think we should keep it in centre in pipeline-builder page as well.

Initially I have added modalPositionOffset to be at the center of the screen, removed it based on Andrew's comment here.

Also in topology quick-search modal we show the provided by label like this Red Hat, Inc i.e the first letter is in uppercase. We might want to do the same here

In the designs we don't have this Provided by <providername> at all, it is showing because of the default topology quick search implementation, we have a separate story to match the modal content exactly with the final design.

@karthikjeeyar I am adding lgtm to this PR since you mentioned we have another story for aligning with UX and the functionality works as expected. But it will be good if you can mention these points in the story so that we can follow up with UX and decide how do we handle these.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 2, 2021
@divyanshiGupta
Copy link
Contributor

/label qe-approved
/label px-approved
/label doc-approved

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 2, 2021

@divyanshiGupta: The label(s) /label doc-approved cannot be applied. These labels are supported: platform/aws, platform/azure, platform/baremetal, platform/google, platform/libvirt, platform/openstack, ga, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, px-approved, docs-approved, qe-approved, downstream-change-needed

In response to this:

/label qe-approved
/label px-approved
/label doc-approved

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/test-infra repository.

@openshift-ci openshift-ci bot added qe-approved Signifies that QE has signed off on this PR px-approved Signifies that Product Support has signed off on this PR labels Aug 2, 2021
@divyanshiGupta
Copy link
Contributor

/label docs-approved

@openshift-ci openshift-ci bot added the docs-approved Signifies that Docs has signed off on this PR label Aug 2, 2021
if (selectedItemId) {
const element = document.getElementById(selectedItemId);
if (element) {
element?.scrollIntoView({ block: 'nearest' });
Copy link
Member

Choose a reason for hiding this comment

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

nit: we can avoid ? or if condition?

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 3, 2021
@invincibleJai
Copy link
Member

/lgtm
/approve

verified the changes, works as expected

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 3, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 3, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: divyanshiGupta, invincibleJai, karthikjeeyar

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 3, 2021
@andrewballantyne
Copy link
Contributor

/retest

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci openshift-ci bot merged commit 8c7a7e6 into openshift:master Aug 3, 2021
@bgliwa01
Copy link

bgliwa01 commented Aug 9, 2021

The modal should work like the one in topology so that there is no dark background and it is centered on the screen that is not including the left navigation.

@andrewballantyne
Copy link
Contributor

The modal should work like the one in topology so that there is no dark background and it is centered on the screen that is not including the left navigation.

@karthikjeeyar please make the desired changes in your next PR.

@spadgett spadgett added this to the v4.9 milestone Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/pipelines Related to pipelines-plugin component/shared Related to console-shared component/topology Related to topology docs-approved Signifies that Docs has signed off on this PR kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants