-
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
[Canvas] Feat: static tags for elements #28779
Conversation
Pinging @elastic/kibana-canvas |
💔 Build Failed |
💔 Build Failed |
One thing I've learned about tags is that less is more. I think we could cull the list a little (tags like "line", "point" and "bar" can probably go, likely others too). |
Yeah, I went a little overboard with the tags. Would it be helpful to differentiate between |
I think chart is enough, the others are already names of visualizations. I suspect users trying to filter with tags are more concerned with separating data and not data elements, and the Shoot for the least amount of tags here, we can always add more later, but it's hard to remove them. And the more tags we have, the less useful they become. |
+1 on the small set of tags. Chart, text, graphic, and progress probably cover a lot and leave us with 1 per asset in most, if not all, cases. This is looking great, I'll give it a spin locally. |
@w33ble @ryankeairns I trimmed down the list of tags and updated the screenshots in the description ^ |
Looking a lot better. One question; isn't a |
💔 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.
Looking good, one small change regarding the card layout for badges.
<br /> | ||
<TagList tags={tags} tagType={tagType} /> | ||
</Fragment> | ||
} |
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.
We can make the badges appear in the same place (bottom) of each card to tidy things up layout-wise. Just use the footer
prop on EuiCard like so:
...
description={
<Fragment>
{help}
</Fragment>
}
footer={
<TagList tags={tags} tagType={tagType} />
}
...
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.
One additional minor UI nitpick. The close icon overlaps the Tag selector just a bit (see below). A quick fix would be to give the |
@ryankeairns 1 pixel makes a big difference |
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.
Thanks for making those changes, it's so close :) In the component and in the scss file modal is misspelled as model (e.g. canvasElements__modelHeader
). Other than that, this looks good!
💔 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.
This is looking good. I like that you can use tag:whatever
in the search bar, nice touch!
type: PropTypes.string.isRequired, | ||
}; | ||
|
||
Tag.defaultProps = { |
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.
nit: you don't need to add default props when the propType is marked as required
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.
@w33ble It should actually be Should I rename that field from |
9f74380
to
391f3f7
Compare
Nope, it's still a bug, but that's not it. On master, I can't even put a
|
💚 Build Succeeded |
💔 Build Failed |
💚 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.
Great work Catherine, fantastic PR 🎉
Super minor things, maybe to circle back to in some future PR:
- the
report
tag is now yielding the empty set - 'graphic
and
report` have identical-looking colors - depending on the element count, a vertical scrollbar comes and goes, changing the width of the container
Currently, selecting multiple tags forms an intersection rather than a union of the elements - you have my vote here, despite that 1) there are few tags, and 2) they don't hugely overlap, so a union might work slightly better right now. On the other hand, when we eventually have more numerous, orthogonal tabs, a selection like timeline
&area
&ohlc
&annotated
would let a user select only those elements (from possibly many! idea of Canvas is eg. render plugins and clients may roll a big roster) that are timeline visualizers that can render areas OHLC bars and support user annotations. So, imo good future-proof choice there!
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.
@monfera That's bc |
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.
LGTM. A couple of minor things:
- perhaps we should remove 'presentation' from the dropdown since there aren't any elements using that tag
- something to keep an ear open for - do people expecting selecting multiple tags to be an "OR" situation as opposed to an "AND". Currently, it if you select multiple tags it only shows elements that have all those tags. I expected it to show all elements with either tag, but this feels like a 50/50 so we can just ship and see what feedback we get.
@ryankeairns @monfera @shaunmcgough Thanks for the feedback! I chose to "AND" the tags filters, but that's the behavior I expected and what I saw on github, but it may not be expected for other users. If we get complaints about the behavior, we can always switch to "OR" or maybe someone let the user choose "OR" or "AND". RE: the list of tags in the filter, the tag list is populated with the entire tag registry which registers element and workpad template tags. We can consider filtering the list of tags with the tags that exist in the object they're filtering. |
💔 Build Failed |
…lates Added tag filtering to element selection modal Added tags to elements Removed unused tags Fixed spacing in element card Pruned out extraneous tags Added padding to element types modal header. Moved tags to EuiCard footer Fixed typo Fixed prop types Replaced progress with proportion tag. Updated tags Fixed search bar behavior in element picker and workpad templates Added type definitions to Registry in @kbn/interpreter Typescriptified tags Renamed 'tags' field to 'tag' in EuiSearchBar filter config Fixed import paths Added tags filter to ElementTypes Converted tag component Added stories for Tag and TagList components
💚 Build Succeeded |
* Extract Tags component and tag filter config object from workpad templates Added tag filtering to element selection modal Added tags to element Added type definitions to Registry in @kbn/interpreter Added stories for Tag and TagList components Changed graphic tag color
* Extract Tags component and tag filter config object from workpad templates Added tag filtering to element selection modal Added tags to element Added type definitions to Registry in @kbn/interpreter Added stories for Tag and TagList components Changed graphic tag color
Phase 1 of #25532.
Closes #23172.
This adds static tags to Canvas element plugins (not custom elements yet...) and makes the element selection filterable by tags.
Tag
andTagList
componentsElementCard
andElementGrid
@kbn/interpreter/Registry
Note: I added type definition files to
Registry
in the@kbn/interpreter
package and typescriptified all the tag related files so CI would stop failing. Since I made changes to a package, you'll want to runyarn kbn bootstrap
while checked out in this branch.Tags added:
chart
for the plot/pie/progress elementsfilter
graphic
for image and shape elementsproportion
for elements that compare a part to a whole (pie, progress, reveal image, and repeat image)text