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
EUIify dashboard options top nav #21510
Conversation
nreese
commented
Jul 31, 2018
💚 Build Succeeded |
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.
LTGM. I added a code cleanup comment, but it's not important. Also pulled this down and ran it. Seems to work fine, and looks great!
hidePanelTitles, | ||
onHidePanelTitlesChange, | ||
}) { | ||
if (isOpen) { |
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 consider renaming showOptionsPopover
to toggleOptionsPopover
? If I'm reading this line correctly. It sometimes shows, sometimes hides, depending on the value of isOpen.
Also, you might just make this function body something like this, for consistency:
export function toggleOptionsPopover(props) {
if (isOpen) {
closeOptionsPopover();
} else {
openOptionsPopover(props);
}
}
shrugs Not important.
EuiSwitch, | ||
} from '@elastic/eui'; | ||
|
||
export class OptionsMenu extends Component { |
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.
Any chance you can change this file to tsx? Since it has no imports, I think it should be straightforward (assuming eui has the imported types defined... if it doesn't, then forget it).
You can use https://github.com/elastic/kibana/pull/21740/files#diff-15359b57331d6e7ede80dbc9fc90396c as a reference - I think it's a very similar conversion.
.euiPopover__anchor { | ||
height: 100%; | ||
} | ||
} |
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.
cc @cchaos - here are some LESS changes that will probably go in before your LESS to SASS conversion. Any objections? Hopefully not to difficult to merge?
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.
Yeah that will be fine. I'll be able to handle the rebase.
isOpen = false; | ||
}; | ||
|
||
export function showOptionsPopover({ |
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.
if you convert the other file to typescript, this one should be relatively easy to convert too, since that other file is the only import.
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.
Ideally I'd love to see the new files that have no dependencies converted to typescript, but other than that, LGTM. Pulled the code and tested to see if URL modifications were reflected (they were - though you had to close and open the panel to see the modifications - I think that's fine).
Updating some of the options is slow, but compared with master and it seems to be the same, if the dashboard has a lot of heavy visualizations on it.
tl;dr; LGTM!
I think I will leave typescripting for another PR to limit the scope of this PR. Typescripting core APIs is really helpful. However, I feel that typescripting everything has limited benefits and even makes things more confusing. Edge components like these should be simple and as close to pure javascript as possible. React already provides type checking via PropTypes that is simple and has a wider breadth of audience. That seems like a good enough solution for the moment. |
💚 Build Succeeded |
* trying new EuiWrappingPopover * allow button press to close popover * fix button styling * start options panel with darkTheme option * add other options * remove old options html * get dashboar state functional test working