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

Adding table_info component #11778

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented May 13, 2017

This PR adds a table-info component, intended to be used inside a kuiControlledTable container, like so:

<div class="kuiControlledTable">
  <table-info>Loading all the things&hellip;</table-info>
</div>

Screenshot

screen shot 2017-05-16 at 7 07 56 pm

Visit http://localhost:5601/app/kibana#/testbed to see it in action.

@ycombinator
Copy link
Contributor Author

ycombinator commented May 13, 2017

@cjcenizal When you see this component in action on http://localhost:5601/app/kibana#/testbed , you'll notice that there is no top border shown. Is there some way to fix this?

EDIT: If it helps, kuiNoItems doesn't seem to have this issue and it is also intended to be used inside a kuiControlledTable container.

Copy link
Contributor

@BigFunger BigFunger left a comment

Choose a reason for hiding this comment

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

LGTM

@BigFunger
Copy link
Contributor

(with the exception of the failing build)

@lukasolson
Copy link
Member

i want all the gifs please

@BigFunger
Copy link
Contributor

Won't somebody (@ycombinator) please just give @lukasolson the gifs!?

@ycombinator
Copy link
Contributor Author

GIFs are coming, just working on other stuff (fixing the build) at the moment.

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Looks good in the browser! I had one small suggestion.

@@ -5,6 +5,10 @@
you need to demonstate your functionality. Nothing need be preserved. -->
<!-- CONTENT START -->

<div class="kuiControlledTable">
<loading-results results-name="all the things"></loading-results>
Copy link
Contributor

Choose a reason for hiding this comment

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

In my experience, there's little benefit to tightly controlling a component's input like this, because unanticipated edge cases tend to pop up. For example, internationalization becomes more difficult because you typically need to translate entire phrases instead of substrings of a phrase. How about we change this interface to be a little more compositional:

<loading-results>
  Loading all the things&hellip;
</loading-results>

This will mirror how I'd implement this component in React.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point about how the current design doesn't play well with internationalization. I like the approach you are proposing but it then begs the question: should loading-results and no-items really be a single component, something like items-message or something else (naming is hard!)?

Copy link
Contributor

Choose a reason for hiding this comment

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

You're absolutely right... we should combine these into a single component. Not sure why I made it two in the first place! How about kuiTableInfo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, just so I'm clear, I'm going to do the following as part of this PR:

  • rename this directive from loadingResults to tableInfo,
  • rename the kuiLoadingItems class in the UI Framework to kuiTableInfo,
  • get rid of the kuiNoItems class in the UI Framework,
  • update all usages affected by the above changes

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

template: template,
scope: {
resultsName: '@',
},
Copy link
Contributor

Choose a reason for hiding this comment

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

To implement my suggestion, we'd have to add transclude: true in here somewhere.

@cjcenizal
Copy link
Contributor

@ycombinator In terms of the missing top border, that's technically correct since the top border is deliberately missing in the UI Framework. This is to make this component play nicely with the ToolBar component. I'd like to deprecate the ToolBar component and add a top border to LoadingResults and NoItems in the future. Where are you seeing kuiNoItems with a top border?

@cjcenizal cjcenizal added the Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins. label May 16, 2017
@ycombinator ycombinator changed the title Adding loading_results component Adding table_info component May 17, 2017
@ycombinator
Copy link
Contributor Author

@cjcenizal I've made the changes you requested. Can you take another gander at this PR, please? Thanks!

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Nice! One minor change, then LGTM.

@@ -2239,7 +2239,7 @@ body {
.kuiModalFooter > * + * {
margin-left: 5px; }

.kuiNoItems {
.kuiTableInfo {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you may have done a find/replace to change these, but this is a generated filed. So we'll need to update ui_framework/components/index.scss to remove the original component imports and add the new component import. We just need to change lines 21 through 53 to be this:

// Components
@import "action_item/index";
@import "badge/index";
@import "bar/index";
@import "button/index";
@import "card/index";
@import "collapse_button/index";
@import "column/index";
@import "event/index";
@import "form/index";
@import "form_layout/index";
@import "gallery/index";
@import "header_bar/index";
@import "icon/index";
@import "info_panel/index";
@import "link/index";
@import "local_nav/index";
@import "menu/index";
@import "menu_button/index";
@import "micro_button/index";
@import "modal/index";
@import "notice/index";
@import "panel/index";
@import "prompt_for_items/index";
@import "status_text/index";
@import "table/index";
@import "table_info/index";
@import "tabs/index";
@import "toggle_button/index";
@import "tool_bar/index";
@import "typography/index";
@import "vertical_rhythm/index";
@import "view/index";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ugh, good catch! Will fix.

@ycombinator
Copy link
Contributor Author

@cjcenizal I fixed the imports and regenerated the CSS. Please take another look when you have a chance. Thanks!

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

LGTM!

@ycombinator
Copy link
Contributor Author

jenkins, test this

@ycombinator ycombinator force-pushed the promote-components-to-oss/loading-results branch from 58e3b08 to aeca54d Compare May 19, 2017 15:42
@ycombinator ycombinator merged commit d125835 into elastic:master May 19, 2017
@ycombinator ycombinator deleted the promote-components-to-oss/loading-results branch May 19, 2017 17:44
ycombinator added a commit that referenced this pull request May 19, 2017
* Adding loading-results component

* Adding example usage on testbed

* Fixing module name

* Adding kuiControlledTable container

* Replacing kuiNoItems and kuiLoadingResults with kuiTableInfo

* Making directive compositional

* Fixing imports

* Re-generating fixed CSS
@ycombinator
Copy link
Contributor Author

Backported to:

snide pushed a commit to snide/kibana that referenced this pull request May 30, 2017
* Adding loading-results component

* Adding example usage on testbed

* Fixing module name

* Adding kuiControlledTable container

* Replacing kuiNoItems and kuiLoadingResults with kuiTableInfo

* Making directive compositional

* Fixing imports

* Re-generating fixed CSS
snide pushed a commit to snide/kibana that referenced this pull request Jun 2, 2017
* Adding loading-results component

* Adding example usage on testbed

* Fixing module name

* Adding kuiControlledTable container

* Replacing kuiNoItems and kuiLoadingResults with kuiTableInfo

* Making directive compositional

* Fixing imports

* Re-generating fixed CSS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:enhancement review Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins. v5.5.0 v6.0.0-alpha2 v6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants