-
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
Visualize LESS to SASS #22679
Visualize LESS to SASS #22679
Conversation
- Moves styles closer to their actual components in `public/vis/…` (agg stuff did not get naming updates) - Also fixes responsive layout to actually show the visualization - Updated to `<icon/>` EUI usage where possible
@cchaos, about your caveat. Are you saying that all custom visualization plugins will now throw a console warning? |
@trevan Only if you are supplying the |
💔 Build Failed |
FYI: I found an issue with reporting, I am looking into it. |
🤞 That last commit should fix reporting and x-pack tests |
💔 Build Failed |
@cchaos, I just went through all of the "known plugins" and the majority of them use the "fa-icon". So it looks like this error will be very common for users that have custom plugins. |
cc @walterra I also tagged you as a reviewer, since it touches some ML code |
// SASSTODO: Is this even an element anymore, or should it be .visualize? | ||
/* 1. Without setting this to 0 you will run into a bug where the filter bar modal is hidden under | ||
a tilemap in an iframe: https://github.com/elastic/kibana/issues/16457 */ | ||
> visualize { |
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.
As you mentioned above, this should actually be .visualize
and got broken in some of the Angular refactoring. I will already fix this on master so we can pull the fix in 6.4.[1|2].
I would suggest a different solution for the old icon classes. Let's introduce a Edit: I opened a PR against your repo to introduce that setting. |
# Conflicts: # src/core_plugins/kibana/public/visualize/editor/styles/_editor.less
Introduce legacyIcon
💔 Build Failed |
💔 Build Failed |
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.
I did a code run through of this on Tuesday night and everything looks pretty good to me. I haven't had time to do a full browser test, but as long as Viz has that covered this looks good.
/** | ||
* 1. Hack in some padding for these panels. | ||
*/ | ||
.visWizard__list--paginated--selectable, |
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.
would this just be --paginatedSelectable
?
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.
I did it like this because they wording makes them seem like separate modifiers. It's 'paginate' and it's 'selectable'.
@timroes Any thoughts on that second question about the |
# Conflicts: # src/core_plugins/input_control_vis/public/register_vis.js
💔 Build Failed |
It looks like this PR is regularly hitting what was otherwise a rare flaky test. Is this by any chance adding (more) animation to the display of the report printing pane? That's the source of the bug. Nathan's getting rid of the report printing pane altogether and instead going with a flyout, so the bug should disappear. @cchaos if you want, I can Zoom today, and we can fix this failing test (by introducing a delay to our test), and then we can make a note to rip the hacky fix out once Nathan's PR is merged. |
Thanks @chrisdavies for keeping up with this. I did not introduce more or longer animations. I'd love your help if you have time. |
Looking at the difference between the baseline, master's session, and my local session pdf's, we determined that the baseline is currently wrong and that I altered the styles just slightly enough (probably some padding pixel value somewhere) that my version was just passed the allowed variance threshold while master's didn't. So this PR now also updates the baseline PDF for the "Visualize" reporting test. |
💚 Build Succeeded |
Tests are passing!! @elastic/kibana-visualizations, can I get a review, please :)? |
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.
@cchaos please see the comment in the code, noticed a class didn't pick up any styles.
@@ -10,7 +10,7 @@ <h3 class="kuiTitle kuiVerticalRhythm">From a New Search, Select Index</h3> | |||
list="indexPatterns" | |||
list-property="attributes.title" | |||
user-make-url="withIndexPatternUrl" | |||
class="wizard-row visualizeWizardPaginatedSelectableList kuiVerticalRhythm" | |||
class="wizard-row visWizard__paginatedSelectableList kuiVerticalRhythm" |
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.
Checked this in browser and it's not picking up any styles, is this supposed to be visWizard__list--paginated--selectable
? (On the other hand, the visWizard__savedObjectFinder
further down correctly picks up padding: 8px;
)
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.
Ahh yeah, it looks like I renamed it twice and the second time it didn't change in ML. Really good catch, thanks! I'll update that classname.
💚 Build Succeeded |
@cchaos Sorry I was out a couple of days, and haven't seen the 2nd question the first time. I think that is unneeded and dead code. I created a PR to remove it: #23180 so we don't need to mix this into this PR. I try to get this merged quickly, so you can rebase on it, and don't need to worry about any nesting-indicator LESS/SASS anymore. |
@cchaos Latest ML changes LGTM! |
@cchaos Merged the PR, you can now merge with master. |
# Conflicts: # src/core_plugins/kibana/public/visualize/editor/styles/_editor.less # src/ui/public/styles/variables/for-theme.less
💚 Build Succeeded |
💔 Build Failed |
This PR removes the LESS files inside
/src/core_plugins/kibana/public/visualize
and replaces them with Sass.Process taken
/src/core_plugins/kibana/public/visualize
folder now includes a manifest_index.scss
which is imported bysrc/core_plugins/kibana/public/index.scss
.styling_constants.scss
is imported in the mainpublic/index.scss
file, it has access to all the functions, mixins and variables from EUI._index.scss
and_component_names.scss
files next to the components or views they live next to.vis
was added to all selectors to namespace them and avoid conflicts./src/core_plugins/kibana/public/visualize
actually had their html counterparts in/src/ui/public/vis
so they were moved there.src/ui/public/vis/editors/default/_agg.scss
alone, to be updated when the rest of the folder does.visualize/_index
file to start. (cc @snide)Enhancements
1. Fixed the responsive layout to actually show the visualization on small screens
By changing the flex-direction, the chart now shows below the editing panel (sidebar).
2. Updated the chart type images to use the newly created EUI icons
I only saw to places where these were displayed:
a. Chart type selector in the wizard
b. Listing of all saved charts
Let me know if there are other known places, and I'll be sure to update the
<icon/>
implementation.Quick caveat
It uses the
<icon />
angular implementation for EuiIcon, but I didn't remove theng-class
for backwards compatibility for plugins. This means, however, that thetype
andng-class
can be supplied for non-EuiIcon allowed strings and therefore, the old way will now throw a console warning aboutEuiIcon
not being supplied a validtype
.My thoughts are that this is ok, and possibly a very rare case.
Questions
<visualize />
element anywhere, though there are CSS selectors for it. Is this an outdated selector?nesting-indicator
which is also targeted via tests, but can't find where/how/if it's actually implemented@elastic/kibana-visualizations Please add a team member to do a review.
Dev Docs
Visualization icons
The
icon
property when registering a visualization type that accepts a class name (e.g. to set a font awesome icon) has been renamed tolegacyIcon
and will be removed in 7.0.0.The
icon
property now expects a valid EUI icon type. Alternatively to using an EUI icon, you can use theimage
property instead, which will be set to thesrc
attribute of animg
. Thus you can also use theimage
property to set any image as a data URI (e.g. by importing it via Webpack).