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

Bug 1866337: Changes placeholder to 'Search by node name/label' in install page #6746

Merged
merged 1 commit into from Sep 30, 2020

Conversation

vbnrh
Copy link
Contributor

@vbnrh vbnrh commented Sep 25, 2020

This PR add fixes to previous #6621. Now we can pass a resource name to display the placeholder appropriately and it will change the placeholder according to the type (Name, Label etc) selected

Signed-off-by: Vineet Badrinath vbadrina@redhat.com

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Sep 25, 2020
@openshift-ci-robot
Copy link
Contributor

@vbnrh: This pull request references Bugzilla bug 1866337, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1866337: Changes placeholder to 'Search by node name/label' in install page

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-robot openshift-ci-robot added the component/ceph Related to ceph-storage-plugin label Sep 25, 2020
@openshift-ci-robot openshift-ci-robot added the component/core Related to console core functionality label Sep 25, 2020
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

What bug are we fixing specifically? Is it just that the placeholder is wrong when "Label" is selected? If so, I'd just change the prop to nameFilterPlaceholder and only use it for "Name."

filterPlaceholder || (FilterType.NAME === filterType ? 'Search by name...' : 'app=frontend');
const [placeholder, setPlaceholder] = React.useState(
FilterType.NAME === filterType
? `Search by ${kind !== undefined ? kind.toLowerCase() : ''} name...`
Copy link
Member

Choose a reason for hiding this comment

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

I would just lowercase kind. It is awkward for longer names since the word boundaries are no longer apparent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The good reasons for using this approach and not just using nameFIlterPlaceholder :-

  1. We won't have to hardcode the resource ( Node ) and the type of filter (Name, Label)
  2. filter-toolbar being a generic component can accommodate multiple types of filter in the future. This could handle those scenarios too.
  3. We just can pass the type of resource by kind prop and let the filter automatically handle any resource types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would just lowercase kind. It is awkward for longer names since the word boundaries are no longer apparent.

Sorry i didn't get this point. Could you explain a bit more ?

Copy link
Member

Choose a reason for hiding this comment

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

You shouldn't just manipulate kind with toLowercase. Things like SecurityContextContraint become securitycontextconstraint which is hard to read. You would have to use the model display name.

Won't this change all the list pages instead of the one we want to change?

Copy link
Contributor Author

@vbnrh vbnrh Sep 29, 2020

Choose a reason for hiding this comment

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

Yes i understand your concern on readability in which case we may need to keep non lower cased name or pass a seaparate prop for the resourceName :)

Won't this change all the list pages instead of the one we want to change?

Yes that was the initial idea that if we are not passing the kind prop, it will just show 'Search by name' instead of 'Search by {kind} name'

@spadgett
Copy link
Member

Hi, we're only a few days away from code freeze for 4.6, and this change affects all list pages in the console. Can we go with a simpler fix like

Is it just that the placeholder is wrong when "Label" is selected? If so, I'd just change the prop to nameFilterPlaceholder and only use it for "Name."

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 28, 2020
frontend/public/components/filter-toolbar.tsx Outdated Show resolved Hide resolved
frontend/public/components/filter-toolbar.tsx Outdated Show resolved Hide resolved
frontend/public/components/filter-toolbar.tsx Outdated Show resolved Hide resolved
frontend/public/components/filter-toolbar.tsx Outdated Show resolved Hide resolved
Signed-off-by: Vineet Badrinath <vbadrina@redhat.com>
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: spadgett, vbnrh

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-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 29, 2020
@spadgett
Copy link
Member

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 30, 2020
@openshift-merge-robot openshift-merge-robot merged commit 794bd45 into openshift:master Sep 30, 2020
@openshift-ci-robot
Copy link
Contributor

@vbnrh: All pull requests linked via external trackers have merged:

Bugzilla bug 1866337 has been moved to the MODIFIED state.

In response to this:

Bug 1866337: Changes placeholder to 'Search by node name/label' in install page

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.

@spadgett spadgett added this to the v4.6 milestone Oct 2, 2020
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. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/ceph Related to ceph-storage-plugin component/core Related to console core functionality lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants