Skip to content

Commit

Permalink
Merge branch 'master' into issue-75338-ignore-intermediate-cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Oct 2, 2020
2 parents 899f8e1 + 2899e83 commit d412169
Show file tree
Hide file tree
Showing 75 changed files with 1,303 additions and 827 deletions.
12 changes: 6 additions & 6 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ NOTE:
[discrete]
=== src/plugins
[%header,cols=2*]
[%header,cols=2*]
|===
|Name
|Description
Expand Down Expand Up @@ -259,7 +259,7 @@ which will load the visualization's editor.
[discrete]
=== x-pack/plugins
[%header,cols=2*]
[%header,cols=2*]
|===
|Name
|Description
Expand Down Expand Up @@ -515,6 +515,10 @@ As a developer you can reuse and extend built-in alerts and actions UI functiona
in their infrastructure.
|{kib-repo}blob/{branch}/x-pack/plugins/drilldowns/url_drilldown/README.md[urlDrilldown]
|NOTE: This plugin contains implementation of URL drilldown. For drilldowns infrastructure code refer to ui_actions_enhanced plugin.
|{kib-repo}blob/{branch}/x-pack/plugins/watcher/README.md[watcher]
|This plugins adopts some conventions in addition to or in place of conventions in Kibana (at the time of the plugin's creation):
Expand All @@ -523,10 +527,6 @@ in their infrastructure.
|Contains HTTP endpoints and UiSettings that are slated for removal.
|{kib-repo}blob/{branch}/x-pack/plugins/drilldowns/url_drilldown/README.md[urlDrilldown]
|NOTE: This plugin contains implementation of URL drilldown. For drilldowns infrastructure code refer to ui_actions_enhanced plugin.
|===
include::{kibana-root}/src/plugins/dashboard/README.asciidoc[leveloffset=+1]
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-dev-utils/src/plugin_list/discover_plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { extractAsciidocInfo } from './extract_asciidoc_info';

export interface Plugin {
id: string;
relativeDir?: string;
relativeDir: string;
relativeReadmePath?: string;
readmeSnippet?: string;
readmeAsciidocAnchor?: string;
Expand Down
10 changes: 6 additions & 4 deletions packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ import { REPO_ROOT } from '@kbn/utils';

import { Plugins } from './discover_plugins';

const sortPlugins = (plugins: Plugins) => plugins.sort((a, b) => a.id.localeCompare(b.id));

function* printPlugins(plugins: Plugins, includes: string[]) {
for (const plugin of plugins) {
const path = plugin.relativeReadmePath || plugin.relativeDir;
for (const plugin of sortPlugins(plugins)) {
const path = normalizePath(plugin.relativeReadmePath || plugin.relativeDir);
yield '';

if (plugin.readmeAsciidocAnchor) {
Expand Down Expand Up @@ -67,7 +69,7 @@ NOTE:
[discrete]
=== src/plugins
[%header,cols=2*]
[%header,cols=2*]
|===
|Name
|Description
Expand All @@ -79,7 +81,7 @@ ${Array.from(printPlugins(ossPlugins, includes)).join('\n')}
[discrete]
=== x-pack/plugins
[%header,cols=2*]
[%header,cols=2*]
|===
|Name
|Description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ export function getTopNavConfig(
];
case ViewMode.EDIT:
return [
getCreateNewConfig(actions[TopNavIds.VISUALIZE]),
getSaveConfig(actions[TopNavIds.SAVE]),
getViewConfig(actions[TopNavIds.EXIT_EDIT_MODE]),
getAddConfig(actions[TopNavIds.ADD_EXISTING]),
getOptionsConfig(actions[TopNavIds.OPTIONS]),
getShareConfig(actions[TopNavIds.SHARE]),
getAddConfig(actions[TopNavIds.ADD_EXISTING]),
getViewConfig(actions[TopNavIds.EXIT_EDIT_MODE]),
getSaveConfig(actions[TopNavIds.SAVE]),
getCreateNewConfig(actions[TopNavIds.VISUALIZE]),
];
default:
return [];
Expand All @@ -79,7 +79,9 @@ function getFullScreenConfig(action: NavAction) {
*/
function getEditConfig(action: NavAction) {
return {
emphasize: true,
id: 'edit',
iconType: 'pencil',
label: i18n.translate('dashboard.topNave.editButtonAriaLabel', {
defaultMessage: 'edit',
}),
Expand Down Expand Up @@ -168,7 +170,7 @@ function getAddConfig(action: NavAction) {
function getCreateNewConfig(action: NavAction) {
return {
emphasize: true,
iconType: 'plusInCircle',
iconType: 'plusInCircleFilled',
id: 'addNew',
label: i18n.translate('dashboard.topNave.addNewButtonAriaLabel', {
defaultMessage: 'Create new',
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/plugins/navigation/public/top_nav_menu/_index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.kbnTopNavMenu {
margin-right: $euiSizeXS;
}

.kbnTopNavMenu > * > * {
// TEMP fix to adjust spacing between EuiHeaderList__list items
margin: 0 $euiSizeXS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function TopNavMenuItem(props: TopNavMenuData) {
};

const btn = props.emphasize ? (
<EuiButton size="s" fill {...commonButtonProps}>
<EuiButton size="s" {...commonButtonProps}>
{upperFirst(props.label || props.id!)}
</EuiButton>
) : (
Expand Down
185 changes: 93 additions & 92 deletions src/plugins/visualize/public/application/utils/get_top_nav_config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,54 +175,61 @@ export const getTopNavConfig = (
};

const topNavMenu: TopNavMenuData[] = [
...(originatingApp && ((savedVis && savedVis.id) || embeddableId)
? [
{
id: 'saveAndReturn',
label: i18n.translate('visualize.topNavMenu.saveAndReturnVisualizationButtonLabel', {
defaultMessage: 'Save and return',
}),
emphasize: true,
iconType: 'check',
description: i18n.translate(
'visualize.topNavMenu.saveAndReturnVisualizationButtonAriaLabel',
{
defaultMessage: 'Finish editing visualization and return to the last app',
}
),
testId: 'visualizesaveAndReturnButton',
disableButton: hasUnappliedChanges,
tooltip() {
if (hasUnappliedChanges) {
return i18n.translate(
'visualize.topNavMenu.saveAndReturnVisualizationDisabledButtonTooltip',
{
defaultMessage: 'Apply or Discard your changes before finishing',
}
);
}
},
run: async () => {
const saveOptions = {
confirmOverwrite: false,
returnToOrigin: true,
};
if (
originatingApp === 'dashboards' &&
dashboard.dashboardFeatureFlagConfig.allowByValueEmbeddables &&
!savedVis
) {
return createVisReference();
}
return doSave(saveOptions);
{
id: 'inspector',
label: i18n.translate('visualize.topNavMenu.openInspectorButtonLabel', {
defaultMessage: 'inspect',
}),
description: i18n.translate('visualize.topNavMenu.openInspectorButtonAriaLabel', {
defaultMessage: 'Open Inspector for visualization',
}),
testId: 'openInspectorButton',
disableButton() {
return !embeddableHandler.hasInspector || !embeddableHandler.hasInspector();
},
run: openInspector,
tooltip() {
if (!embeddableHandler.hasInspector || !embeddableHandler.hasInspector()) {
return i18n.translate('visualize.topNavMenu.openInspectorDisabledButtonTooltip', {
defaultMessage: `This visualization doesn't support any inspectors.`,
});
}
},
},
{
id: 'share',
label: i18n.translate('visualize.topNavMenu.shareVisualizationButtonLabel', {
defaultMessage: 'share',
}),
description: i18n.translate('visualize.topNavMenu.shareVisualizationButtonAriaLabel', {
defaultMessage: 'Share Visualization',
}),
testId: 'shareTopNavButton',
run: (anchorElement) => {
if (share && !embeddableId) {
// TODO: support sharing in by-value mode
share.toggleShareContextMenu({
anchorElement,
allowEmbed: true,
allowShortUrl: visualizeCapabilities.createShortUrl,
shareableUrl: unhashUrl(window.location.href),
objectId: savedVis?.id,
objectType: 'visualization',
sharingData: {
title: savedVis?.title,
},
},
]
: []),
isDirty: hasUnappliedChanges || hasUnsavedChanges,
});
}
},
// disable the Share button if no action specified
disableButton: !share || !!embeddableId,
},
...(visualizeCapabilities.save && !embeddableId
? [
{
id: 'save',
iconType: savedVis?.id && originatingApp ? undefined : 'save',
label:
savedVis?.id && originatingApp
? i18n.translate('visualize.topNavMenu.saveVisualizationAsButtonLabel', {
Expand Down Expand Up @@ -303,56 +310,50 @@ export const getTopNavConfig = (
},
]
: []),
{
id: 'share',
label: i18n.translate('visualize.topNavMenu.shareVisualizationButtonLabel', {
defaultMessage: 'share',
}),
description: i18n.translate('visualize.topNavMenu.shareVisualizationButtonAriaLabel', {
defaultMessage: 'Share Visualization',
}),
testId: 'shareTopNavButton',
run: (anchorElement) => {
if (share && !embeddableId) {
// TODO: support sharing in by-value mode
share.toggleShareContextMenu({
anchorElement,
allowEmbed: true,
allowShortUrl: visualizeCapabilities.createShortUrl,
shareableUrl: unhashUrl(window.location.href),
objectId: savedVis?.id,
objectType: 'visualization',
sharingData: {
title: savedVis?.title,
...(originatingApp && ((savedVis && savedVis.id) || embeddableId)
? [
{
id: 'saveAndReturn',
label: i18n.translate('visualize.topNavMenu.saveAndReturnVisualizationButtonLabel', {
defaultMessage: 'Save and return',
}),
emphasize: true,
iconType: 'checkInCircleFilled',
description: i18n.translate(
'visualize.topNavMenu.saveAndReturnVisualizationButtonAriaLabel',
{
defaultMessage: 'Finish editing visualization and return to the last app',
}
),
testId: 'visualizesaveAndReturnButton',
disableButton: hasUnappliedChanges,
tooltip() {
if (hasUnappliedChanges) {
return i18n.translate(
'visualize.topNavMenu.saveAndReturnVisualizationDisabledButtonTooltip',
{
defaultMessage: 'Apply or Discard your changes before finishing',
}
);
}
},
isDirty: hasUnappliedChanges || hasUnsavedChanges,
});
}
},
// disable the Share button if no action specified
disableButton: !share || !!embeddableId,
},
{
id: 'inspector',
label: i18n.translate('visualize.topNavMenu.openInspectorButtonLabel', {
defaultMessage: 'inspect',
}),
description: i18n.translate('visualize.topNavMenu.openInspectorButtonAriaLabel', {
defaultMessage: 'Open Inspector for visualization',
}),
testId: 'openInspectorButton',
disableButton() {
return !embeddableHandler.hasInspector || !embeddableHandler.hasInspector();
},
run: openInspector,
tooltip() {
if (!embeddableHandler.hasInspector || !embeddableHandler.hasInspector()) {
return i18n.translate('visualize.topNavMenu.openInspectorDisabledButtonTooltip', {
defaultMessage: `This visualization doesn't support any inspectors.`,
});
}
},
},
run: async () => {
const saveOptions = {
confirmOverwrite: false,
returnToOrigin: true,
};
if (
originatingApp === 'dashboards' &&
dashboard.dashboardFeatureFlagConfig.allowByValueEmbeddables &&
!savedVis
) {
return createVisReference();
}
return doSave(saveOptions);
},
},
]
: []),
];

return topNavMenu;
Expand Down
1 change: 0 additions & 1 deletion x-pack/.telemetryrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"output": "plugins/telemetry_collection_xpack/schema/xpack_plugins.json",
"root": "plugins/",
"exclude": [
"plugins/alerts/server/usage/alerts_usage_collector.ts",
"plugins/apm/server/lib/apm_telemetry/index.ts"
]
}
Loading

0 comments on commit d412169

Please sign in to comment.