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

EUIify dashboard options top nav #21510

Merged
merged 8 commits into from Aug 7, 2018
Merged

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Jul 31, 2018

screen shot 2018-07-31 at 2 54 44 pm

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@chrisdavies chrisdavies left a 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) {
Copy link
Contributor

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

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%;
}
}
Copy link
Contributor

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?

Copy link
Contributor

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({
Copy link
Contributor

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.

Copy link
Contributor

@stacey-gammon stacey-gammon left a 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!

@nreese
Copy link
Contributor Author

nreese commented Aug 7, 2018

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.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@nreese nreese merged commit 5fc22e1 into elastic:master Aug 7, 2018
nreese added a commit to nreese/kibana that referenced this pull request Aug 7, 2018
* 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
nreese added a commit that referenced this pull request Aug 7, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Dashboard Dashboard related features v6.5.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants