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 1835348: Replace hideNameFilter with hideToolbar #5481

Merged
merged 1 commit into from May 20, 2020

Conversation

bipuladh
Copy link
Contributor

@bipuladh bipuladh commented May 18, 2020

  • hideNameFilter and hideLabelFilter should stop label and name chips from being rendered.
    Before:
    Screenshot from 2020-05-18 21-14-49
    After:
    Screenshot from 2020-05-18 21-12-05
    cc @zherman0
    /assign @spadgett

@bipuladh bipuladh changed the title Hide name and filter from the data toolbar when hide props are passed Bug 1835348: Hide name and filter from the data toolbar when hide props are passed May 18, 2020
@openshift-ci-robot
Copy link
Contributor

@bipuladh: This pull request references Bugzilla bug 1835348, 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.5.0) matches configured target release for branch (4.5.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 1835348: Hide name and filter from the data toolbar when hide props are passed

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 bugzilla/severity-low Referenced Bugzilla bug's severity is low 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 May 18, 2020
@bipuladh
Copy link
Contributor Author

/retest

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.

I wonder if the prop should be hideToolbar instead of hideNameFilter and we hide the entire data toolbar? It seems to only be used by search and image manifest vuln

deleteChip={(filter, chip: string) =>
updateLabelFilter(_.difference(labelFilters, [chip]))
}
categoryName="Label"
>
<DataToolbarFilter
chips={nameFilter && nameFilter.length > 0 ? [nameFilter] : []}
chips={nameFilter && !hideNameFilter && nameFilter.length > 0 ? [nameFilter] : []}
Copy link
Member

@spadgett spadgett May 18, 2020

Choose a reason for hiding this comment

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

Suggested change
chips={nameFilter && !hideNameFilter && nameFilter.length > 0 ? [nameFilter] : []}
chips={nameFilter?.length && !hideNameFilter ? [nameFilter] : []}

@bipuladh
Copy link
Contributor Author

I wonder if the prop should be hideToolbar instead of hideNameFilter and we hide the entire data toolbar? It seems to only be used by search and image manifest vuln

That makes sense. When I would pass hideToolbar all the labels, name and all the row filters would hide.
hideNameFilter was added to hide names on the search page with the assumption that row filters would be required there. This prop would encroach on #5346.

@openshift-ci-robot openshift-ci-robot added the component/dev-console Related to dev-console label May 18, 2020
@bipuladh bipuladh requested a review from spadgett May 18, 2020 17:29
@bipuladh bipuladh changed the title Bug 1835348: Hide name and filter from the data toolbar when hide props are passed Bug 1835348: Replace hidNameFilter with hideToolbar May 18, 2020
@bipuladh
Copy link
Contributor Author

Screenshot from 2020-05-18 22-53-11
Tested on Search Page.

@zherman0
Copy link
Member

@bipuladh - do you think your PR is going to make tmy PR5346 obsolete? I would love to just have the one hideToolBar property if it will hide the filter row as well.

data-test-id="filter-dropdown-toggle"
onToggle={() => setOpen(!isOpen)}
iconComponent={CaretDownIcon}
!hideToolbar && (
Copy link
Member

Choose a reason for hiding this comment

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

I like this, nice and clean and simple to hide all the toolbar

)}
{!hideNameFilter && (
<DataToolbarFilter
chips={nameFilter?.length > 0 ? [nameFilter] : []}
Copy link
Member

Choose a reason for hiding this comment

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

I'd do this so I don't have think about what undefined > 0 evaluates to. (I'm assuming it's false, but I shouldn't need to consider that :)

Suggested change
chips={nameFilter?.length > 0 ? [nameFilter] : []}
chips={nameFilter?.length ? [nameFilter] : []}

frontend/public/components/filter-toolbar.tsx Show resolved Hide resolved
@spadgett spadgett changed the title Bug 1835348: Replace hidNameFilter with hideToolbar Bug 1835348: Replace hideNameFilter with hideToolbar May 18, 2020
@spadgett
Copy link
Member

@bipuladh - do you think your PR is going to make tmy PR5346 obsolete? I would love to just have the one hideToolBar property if it will hide the filter row as well.

@zherman0 Yeah, looks like this would supersede #5346.

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.

/approve
/lgtm

@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 May 19, 2020
@openshift-bot
Copy link
Contributor

/retest

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

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bipuladh, jcaianirh, spadgett

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-bot
Copy link
Contributor

/retest

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

4 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-merge-robot openshift-merge-robot merged commit f6e52eb into openshift:master May 20, 2020
@openshift-ci-robot
Copy link
Contributor

@bipuladh: All pull requests linked via external trackers have merged: openshift/console#5481. Bugzilla bug 1835348 has been moved to the MODIFIED state.

In response to this:

Bug 1835348: Replace hideNameFilter with hideToolbar

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.

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-low Referenced Bugzilla bug's severity is low 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/core Related to console core functionality component/dev-console Related to dev-console 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

7 participants