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
Disable toolbar dropdown if no item in the group is enabled. #357
Conversation
@@ -52,6 +52,12 @@ export class ToolbarListController implements IToolbarListBindings { | |||
this.toolbarList.items && | |||
this.toolbarList.items.filter((item: IToolbarItem) => !item.hidden).length > 0; | |||
} | |||
|
|||
private isToolbarEnabled(): boolean { | |||
return this.toolbarList && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add && this.toolbarList.enabled
to move the whole condition here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that sounds better, plus use some
so we don't have to iterate over the whole array.
private isToolbarEnabled(): boolean {
return this.toolbarList &&
this.toolbarList.enabled &&
this.toolbarList.items &&
this.toolbarList.items.some((item: IToolbarItem) => item.enabled)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I c-n-ped your method above. So fixing both methods to use some
.
@miq-bot add_label blocker |
@himdel, @karelhala : please, re-review. Thx! |
Checked commits f224062~...1fbfd1d with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
LGTM :) |
Disable toolbar dropdown if no item in the group is enabled. (cherry picked from commit af0d121) https://bugzilla.redhat.com/show_bug.cgi?id=1633727
Hammer backport details:
|
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1633727