Skip to content

Commit

Permalink
Condence context menus (#7057) (#7286)
Browse files Browse the repository at this point in the history
* Condense share context menu



* Condense console editor actions context menu



* Condense filter bar context menus



* Condense discover table options context menu



* Condense new panel creation context menus



* Condense index pattern creation button's menu



* Condense index pattern creation wizard's pagination context menu



* Condense inspect flyout's view selection context menu



* Condense inspect flyout's download options context menu



* Condense inspect flyout's request selection context menu



* Condense panel-adding flyout's filter menus



* Condense group adding context menu in visualization editor



---------


(cherry picked from commit f1be0d6)

Signed-off-by: Miki <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 1b8c801 commit 747b358
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export class ConsoleMenu extends Component<Props, State> {
panelPaddingSize="none"
anchorPosition="downLeft"
>
<EuiContextMenuPanel items={items} />
<EuiContextMenuPanel items={items} size="s" />
</EuiPopover>
</span>
);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data/public/ui/filter_bar/filter_item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export function FilterItem(props: Props) {
anchorPosition="downLeft"
panelPaddingSize="none"
>
<EuiContextMenu initialPanelId={0} panels={getPanels()} />
<EuiContextMenu initialPanelId={0} panels={getPanels()} size="s" />
</EuiPopover>
);
}
4 changes: 2 additions & 2 deletions src/plugins/data/public/ui/filter_bar/filter_options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ class FilterOptionsUI extends Component<Props, State> {
panelPaddingSize="none"
repositionOnScroll
>
<EuiPopoverTitle>
<EuiPopoverTitle paddingSize="s">
<FormattedMessage
id="data.filter.searchBar.changeAllFiltersTitle"
defaultMessage="Change all filters"
/>
</EuiPopoverTitle>
<EuiContextMenu initialPanelId={0} panels={[panelTree]} />
<EuiContextMenu initialPanelId={0} panels={[panelTree]} size="s" />
</EuiPopover>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export default function DiscoverCanvas({ setHeaderActionMenu, history }: ViewPro
>
<EuiContextMenu
initialPanelId={0}
size="s"
panels={[
{
id: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function SavedObjectFinderCreateNew({ menuItems }: Props) {
panelPaddingSize="none"
anchorPosition="downRight"
>
<EuiContextMenuPanel items={menuItems} />
<EuiContextMenuPanel items={menuItems} size="s" />
</EuiPopover>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,15 @@ export class CreateButton extends Component<Props, State> {
anchorPosition="downLeft"
>
<EuiContextMenuPanel
size="s"
items={options.map((option) => {
return (
<EuiContextMenuItem
key={option.text}
onClick={option.onClick}
data-test-subj={option.testSubj}
>
<EuiDescriptionList style={{ whiteSpace: 'nowrap' }}>
<EuiDescriptionList style={{ whiteSpace: 'nowrap' }} compressed={true}>
<EuiDescriptionListTitle>
{option.text}
{option.isBeta ? <Fragment> {this.renderBetaBadge()}</Fragment> : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class IndicesList extends React.Component<IndicesListProps, IndicesListSt
closePopover={this.closePerPageControl}
panelPaddingSize="none"
>
<EuiContextMenuPanel items={items} />
<EuiContextMenuPanel items={items} size="s" />
</EuiPopover>
</EuiFlexItem>
{paginationControls}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/inspector/public/ui/inspector_view_chooser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class InspectorViewChooser extends Component<Props, State> {
anchorPosition="downRight"
repositionOnScroll
>
<EuiContextMenuPanel items={views.map(this.renderView)} />
<EuiContextMenuPanel items={views.map(this.renderView)} size="s" />
</EuiPopover>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class DataDownloadOptions extends Component<DataDownloadOptionsProps, DataDownlo
panelPaddingSize="none"
repositionOnScroll
>
<EuiContextMenuPanel className="eui-textNoWrap" items={items} />
<EuiContextMenuPanel className="eui-textNoWrap" items={items} size="s" />
</EuiPopover>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export class RequestSelector extends Component<RequestSelectorProps, RequestSele
<EuiContextMenuPanel
items={this.props.requests.map(this.renderRequestDropdownItem)}
data-test-subj="inspectorRequestChooserMenuPanel"
size="s"
/>
</EuiPopover>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ class SavedObjectFinderUi extends React.Component<
<EuiContextMenuPanel
watchedItemProps={['icon', 'disabled']}
items={this.getSortOptions()}
size="s"
/>
</EuiPopover>
{this.props.showFilter && (
Expand Down Expand Up @@ -456,6 +457,7 @@ class SavedObjectFinderUi extends React.Component<
>
<EuiContextMenuPanel
watchedItemProps={['icon', 'disabled']}
size="s"
items={this.props.savedObjectMetaData.map((metaData) => (
<EuiContextMenuItem
key={metaData.type}
Expand Down
1 change: 1 addition & 0 deletions src/plugins/share/public/components/share_context_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class ShareContextMenu extends Component<Props> {
initialPanelId={initialPanelId}
panels={panels}
data-test-subj="shareContextMenu"
size="s"
/>
</I18nProvider>
);
Expand Down
25 changes: 14 additions & 11 deletions src/plugins/share/public/components/url_panel_content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
EuiFlexItem,
EuiForm,
EuiFormRow,
EuiText,
EuiIconTip,
EuiLoadingSpinner,
EuiRadioGroup,
Expand Down Expand Up @@ -135,17 +136,19 @@ export class UrlPanelContent extends Component<Props, State> {
data-test-subj="copyShareUrlButton"
size="s"
>
{this.props.isEmbedded ? (
<FormattedMessage
id="share.urlPanel.copyIframeCodeButtonLabel"
defaultMessage="Copy iFrame code"
/>
) : (
<FormattedMessage
id="share.urlPanel.copyLinkButtonLabel"
defaultMessage="Copy link"
/>
)}
<EuiText size="s">
{this.props.isEmbedded ? (
<FormattedMessage
id="share.urlPanel.copyIframeCodeButtonLabel"
defaultMessage="Copy iFrame code"
/>
) : (
<FormattedMessage
id="share.urlPanel.copyLinkButtonLabel"
defaultMessage="Copy link"
/>
)}
</EuiText>
</EuiButton>
)}
</EuiCopy>
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/vis_default_editor/public/components/agg_add.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function DefaultEditorAggAdd({
repositionOnScroll={true}
closePopover={() => setIsPopoverOpen(false)}
>
<EuiPopoverTitle>
<EuiPopoverTitle paddingSize="s">
{(groupName !== AggGroupNames.Buckets || !stats.count) && (
<FormattedMessage
id="visDefaultEditor.aggAdd.addGroupButtonLabel"
Expand All @@ -116,6 +116,7 @@ function DefaultEditorAggAdd({
)}
</EuiPopoverTitle>
<EuiContextMenuPanel
size="s"
items={schemas.map((schema) => (
<EuiContextMenuItem
key={`${schema.name}_${schema.title}`}
Expand Down

0 comments on commit 747b358

Please sign in to comment.