-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Dashboard] Implement custom title for panels. #5607
Conversation
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'. |
I like the functionality here, there's a few things that would need to change to get it merge-able:
|
This pull covers your "Also requested" not the "covered by update" |
@rashidkpc I think also in editing the title just clicking on it, but I was afraid that the normal user does not find the feature. But adding a hover with an icon is a good idea. Is there some sample UI in KIbana I can use as reference? I will try to fix the other issues in order to get a merge-able PR. Thanks! |
Nothing currently, but we're moving in that direction. I'd say any time someone hovers the title bar of the panel, show the icon. |
Ok, I will play with the idea of showing the icon in hover case. It is the most effective UI. Also, I was thinking in just changing the full title with the edit input when in editing mode. So the title gets editable. Time to play :) |
…title editing. Improve hover ux.
@rashidkpc I have implemented your suggestions. Time to wait now for your review to iterate over the PR. |
… narrower panels.
jenkins, test it |
<span ng-if="panel.customTitle">{{panel.customTitle}}</span> | ||
<span ng-hide="panel.customTitle">{{savedObj.title}}</span> | ||
</a> | ||
<input size="10" ng-if="showFormTitle" text="title" ng-model="panel.customTitle" ng-show="chrome.getVisible() && editUrl"> |
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.
- This needs the proper bootstrap form classes added to it. See examples in the query bar.
- Requires editUrl in order to be shown?
- Just call it title instead of customTitle
- Don't set size=10, use css to control the input width. See bootstrap way of doing this.
- The ng-click shouldn't fire if !chrome.getVisible()
I don't like the syncing back and forth of $scope.panel and $scope.uiState here, it would be more graceful to persist uiState on the dashboard. Thoughts @w33ble? |
Proper bootstrap form classes added. Remove not needed editUrl. Use title as param name. Remove arrow syntax.
@rashidkpc new version uploaded fixing some of your review comments. Some doubts/issues:
|
The syncing itself isn't toublesome - it's cumbersome, sure, but that's pretty much what needs to happen. Ideally though, this code should never set |
@rashidkpc I think this version follows better Kibana style. Just pending fix the title of the panel so it uses the custom title. And next step should be adding the tests for this new feature? |
@acs Visually this looks good now! Tests would seal the deal! |
@rashidkpc great! I have created tests in the past for the custom label feature. But this one includes more logic. I should include Selenium tests for the GUI? Also, with mocha tests for the backend functionality. Any clues will be greatly appreciated. I will start working on tests asap. |
Selenium tests would be neccesary for a change of this nature, yes. I also noticed with the last merge this changes all of the ES6 code back to ES5, everything here should be ES6. |
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'. |
Going to un-assign this for now, @acs if you make any updates please |
@rashidkpc really busy working in our full retrieval and analytics platform. But creating these tests is on my high priority list. As soon as I have results, I will ping you in this ticket. My slot time for working on this should be next week probably. |
@rashidkpc I have started to work in creating the Selenium testing. I am following https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#running-browser-automation-tests Any special recommendation if needed is welcomed. |
@rashidkpc just getting familiar with intern, I can not see the tests for the dashboard (the custom title is something specific of the dashboards). https://github.com/elastic/kibana/tree/master/test/functional/apps Dashboard app does not have tests? |
It does not currently have selenium tests, correct, we're working on it. @LeeDr any idea how that looks right now? |
I have a dashboard_page.js that should be on a PR soon. Right now it only has a couple of methods like getting the titles of the visualizations on a dashboard. And I have some tests that include dashboards but they're integration tests with beats products so they're a little farther out. In any case, I'd be happy to help you with these tests. |
@LeeDr great news! The tests should be fairly simple. Fill the input text with some title sample, and then interact with the three buttons and check the results. What are the best approach to implement them? Start from your PR and implement using it? |
Currently, the visualize tests all clean up before and after themselves, so there's no saved visualizations to add to a dashboard. I'm going to submit a PR soon (today or tomorrow I hope) that changes the visualize tests to start with an empty kibana index but leave all the visualization there when done. And I have a new Dashboard suite that adds all those visualizations to a dashboard, saves it, loads it, etc. I'll mention you @acs on that PR so you'll see it. You can tack your tests onto that new dashboard test. |
@LeeDr cool! |
@rashidkpc So, until there are tests for the Dashboard in Kibana, this PR is blocked? Maybe we can add unit testing, merge the PR and add the tests once the Dashboard tests are ready for production? Just to plan my mind and my work :) I am ok with both plans. |
jenkins, test it |
@LeeDr how are we looking on minimal Dashboard tests? |
@rashidkpc I created #6576 for initial Dashboard tests. What I've done so far in that PR is to change the viz tests to leave the saved visualizations by not reloading the empty .kibana index at the start of each test (which does save some test time). And then the Dashboard tests depend on those saved viz being there (not the most desired approach). So that's why there's no Review label on that PR yet. I'll try to rework it ASAP. |
I'm not a fan of this implementation. IMO, this should be it's own directive. That simply takes an ng model and changes the necessary variable. that would remove the need for integration tests on dashboard which is the hold up for this, and make it so we can use it everywhere, and there are a few places i could imagine this would be useful. I'm going to take a crack at this. |
Closed in favor of the above PR |
Fix #3393