-
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
Add a feature for custom panel titles #14831
Add a feature for custom panel titles #14831
Conversation
Is it possible to blank the title? |
@trevan - yep, you just delete all the text. I wonder if we could make this a little clearer though. maybe an X button, or when you delete all the text, use placeholder text that says When there is no title the panel header hides in view mode, to give more space to the visualization underneath, and the actions menu shows up on hover. This is causing it to overlay the legend toggle a little bit but I think it won't be as bad once #14811 is submitted, which adds some padding. |
} | ||
return ( | ||
<div | ||
data-test-subj="dashboardPanelTitleInputMenuItem" |
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.
You can add style={{ padding: 16 }}
to this container to fix the padding for now. @snide Any ideas for a component which can do this for us?
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've thought of making a padding size="m"
component similar to spacer. Unfortunately with the way context / popovers can be different it's not easy to come up with a one size fits all solution.
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.
Worst-case scenario, how about a borderless, shadowless Panel?
@stacey-gammon I hadn't thought about background coloring. Do you think we could maybe dedicate a couple hours to pair through this stuff. I really don't have the knowledge of depth of configuration that some of these panels can get in, and all of its fixable (for example, putting the padding on the viz itself so the coloring can be flush) but I'll likely run into this stuff a lot without a suped up dash to test locally. Is there a premade set of saved objects you use? |
Yea, lets sync tomorrow @snide.. Time series visual builder can have background color, and maps, are the only two I'm aware of that might look silly like that. |
8f9ada1
to
8fa3efc
Compare
@snide - I think I fixed up all the padding. Pushing it into the visualization restores the padding but keeps the colors flush to the edge of the panel. Except for tile maps which I had to override... and some reason region maps don't need it? That was strange (cc @thomasneirynck). Anyway, seems to be doing what we want now, though I made the padding 8px instead of 16px. Still helps with the expand toggle. |
@stacey-gammon awesome, thank you! looks great. |
Ah, good call @nreese, should be fixed now: |
@@ -26,6 +29,7 @@ function getProps(props = {}) { | |||
|
|||
beforeAll(() => { | |||
store.dispatch(updateViewMode(DashboardViewMode.EDIT)); | |||
store.dispatch(setPanels([{ panelIndex: 'foo1' }])); |
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.
What is this doing? Why foo1
?
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.
it's setting up redux so that the dashboard will be rendered with a single panel with a panel id/index of foo1
. foo1
could be anything as long as it matches the defaultTestProps panel above. Without this call it'll break because you will be passing in props that say render panel foo1
but that panel won't exist in the store, so I'll get an error like Cannot read property 'title' of undefined
.
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.
sorry, I did not see this was a test file. Disregard the questions
]; | ||
if (!this.props.isExpanded) { | ||
items.push(<DeleteMenuItem key="3" onDeletePanel={this.onDeletePanel} />); | ||
mainPanelMenuItems.push({ | ||
name: 'Delete visualization', |
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.
Delete visualization
is a little ambiguous. Does it delete the visualization from the dashboard or delete the visualization from kibana entirely? Maybe keep the old text Delete from dashboard
?
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.
Good catch, this name change wasn't intentional. I'll put back the old variation!
Looks like the popover component has the ability to set that by using withTitle, but I'm not totally sure what the title should be for the main panel - |
Maybe label the top menu I think it makes sense to leave the secondary menu labeled as |
How about naming the first panel "Options" and the second panel "Customize panel"? That makes more sense to me since the first panel has a bunch of somewhat-disconnected choices, so an ambiguous term like "Options" applies, whereas the second panel has a more specific purpose (to customize appearance). |
@nreese can you try refreshing the browser or restarting kibana? Maybe you switched branches and it didn't pick up the updated style sheet? Should still have the padding on it. |
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.
server restart fixed everything and the padding is there.
lgtm
Failed on #14920 jenkins, test this |
e5fb671
to
54cf0cc
Compare
- add enter on close functionality - make reset title a link instead of a button - Push css to visualizations instead of the panel. This means background colors will be flush to the panel. Override for tile maps which apparently need it (yet region maps don’t for some reason??)
54cf0cc
to
80d33d2
Compare
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
* Add a feature for custom panel titles * Add tests and put back data-test-subjs * sync with master and add padding to form * UI/UX cleanup - add enter on close functionality - make reset title a link instead of a button - Push css to visualizations instead of the panel. This means background colors will be flush to the panel. Override for tile maps which apparently need it (yet region maps don’t for some reason??) * Fix refactor miss from merge * whoops, put block display back to make link fall to bottom * Undo accidental delete visualization name change * Color top pop over arrow correctly * Use naming Options and Customize Panel * update jest snapshot * Use custom panels for data-title attributes
* Add a feature for custom panel titles * Add tests and put back data-test-subjs * sync with master and add padding to form * UI/UX cleanup - add enter on close functionality - make reset title a link instead of a button - Push css to visualizations instead of the panel. This means background colors will be flush to the panel. Override for tile maps which apparently need it (yet region maps don’t for some reason??) * Fix refactor miss from merge * whoops, put block display back to make link fall to bottom * Undo accidental delete visualization name change * Color top pop over arrow correctly * Use naming Options and Customize Panel * update jest snapshot * Use custom panels for data-title attributes
Release note: Introduces the ability to specify custom titles, or remove the title entirely, for individual dashboard panels. Just hit the reset link to restore the title to it's original value.
Screenshots:
With no customization:
Customization process:
With customized, or removed, titles: