Skip to content

Commit

Permalink
Merge branch 'master' into np/history-wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Feb 24, 2020
2 parents cedf596 + 581f1bd commit ed6eadb
Show file tree
Hide file tree
Showing 35 changed files with 1,073 additions and 353 deletions.
206 changes: 0 additions & 206 deletions packages/kbn-optimizer/src/optimizer/cache_keys.test.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const DashboardConstants = {
CREATE_NEW_DASHBOARD_URL: '/dashboard',
ADD_EMBEDDABLE_ID: 'addEmbeddableId',
ADD_EMBEDDABLE_TYPE: 'addEmbeddableType',
DASHBOARDS_ID: 'dashboards',
DASHBOARD_ID: 'dashboard',
};

export function createDashboardEditUrl(id: string) {
Expand Down
15 changes: 11 additions & 4 deletions src/legacy/core_plugins/kibana/public/dashboard/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ export class DashboardPlugin implements Plugin {
);
const { appMounted, appUnMounted, stop: stopUrlTracker } = createKbnUrlTracker({
baseUrl: core.http.basePath.prepend('/app/kibana'),
defaultSubUrl: '#/dashboards',
defaultSubUrl: `#${DashboardConstants.LANDING_PAGE_PATH}`,
shouldTrackUrlUpdate: pathname => {
const targetAppName = pathname.split('/')[1];
return (
targetAppName === DashboardConstants.DASHBOARDS_ID ||
targetAppName === DashboardConstants.DASHBOARD_ID
);
},
storageKey: 'lastUrl:dashboard',
navLinkUpdater$: this.appStateUpdater,
toastNotifications: core.notifications.toasts,
Expand Down Expand Up @@ -150,15 +157,15 @@ export class DashboardPlugin implements Plugin {
};
kibanaLegacy.registerLegacyApp({
...app,
id: 'dashboard',
id: DashboardConstants.DASHBOARD_ID,
// only register the updater in once app, otherwise all updates would happen twice
updater$: this.appStateUpdater.asObservable(),
navLinkId: 'kibana:dashboard',
});
kibanaLegacy.registerLegacyApp({ ...app, id: 'dashboards' });
kibanaLegacy.registerLegacyApp({ ...app, id: DashboardConstants.DASHBOARDS_ID });

home.featureCatalogue.register({
id: 'dashboard',
id: DashboardConstants.DASHBOARD_ID,
title: i18n.translate('kbn.dashboard.featureCatalogue.dashboardTitle', {
defaultMessage: 'Dashboard',
}),
Expand Down
53 changes: 53 additions & 0 deletions src/plugins/expressions/common/ast/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
* under the License.
*/

import { ExpressionValue, ExpressionValueError } from '../expression_types';
import { ExpressionFunction } from '../../public';

export type ExpressionAstNode =
| ExpressionAstExpression
| ExpressionAstFunction
Expand All @@ -31,6 +34,56 @@ export interface ExpressionAstFunction {
type: 'function';
function: string;
arguments: Record<string, ExpressionAstArgument[]>;

/**
* Debug information added to each function when expression is executed in *debug mode*.
*/
debug?: ExpressionAstFunctionDebug;
}

export interface ExpressionAstFunctionDebug {
/**
* True if function successfully returned output, false if function threw.
*/
success: boolean;

/**
* Reference to the expression function this AST node represents.
*/
fn: ExpressionFunction;

/**
* Input that expression function received as its first argument.
*/
input: ExpressionValue;

/**
* Map of resolved arguments expression function received as its second argument.
*/
args: Record<string, ExpressionValue>;

/**
* Result returned by the expression function. Including an error result
* if it was returned by the function (not thrown).
*/
output?: ExpressionValue;

/**
* Error that function threw normalized to `ExpressionValueError`.
*/
error?: ExpressionValueError;

/**
* Raw error that was thrown by the function, if any.
*/
rawError?: any | Error;

/**
* Time in milliseconds it took to execute the function. Duration can be
* `undefined` if error happened during argument resolution, because function
* timing starts after the arguments have been resolved.
*/
duration: number | undefined;
}

export type ExpressionAstArgument = string | boolean | number | ExpressionAstExpression;
Loading

0 comments on commit ed6eadb

Please sign in to comment.