Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-68871
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jun 27, 2020
2 parents 1e1113a + 8d1ae01 commit 21597fe
Show file tree
Hide file tree
Showing 395 changed files with 13,671 additions and 5,745 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ target
/x-pack/plugins/canvas/shareable_runtime/build
/x-pack/plugins/canvas/storybook
/x-pack/plugins/monitoring/public/lib/jquery_flot
/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/**
/x-pack/legacy/plugins/infra/common/graphql/types.ts
/x-pack/legacy/plugins/infra/public/graphql/types.ts
/x-pack/legacy/plugins/infra/server/graphql/types.ts
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-monaco/src/xjson/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,13 @@ export const createParser = () => {

try {
value();
white();
} catch (e) {
errored = true;
annos.push({ type: AnnoTypes.error, at: e.at - 1, text: e.message });
}
if (!errored && ch) {
error('Syntax error');
annos.push({ type: AnnoTypes.error, at: at, text: 'Syntax Error' });
}
return { annotations: annos };
}
Expand Down
5 changes: 4 additions & 1 deletion packages/kbn-monaco/src/xjson/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ export const registerGrammarChecker = (editor: monaco.editor.IEditor) => {

const updateAnnos = async () => {
const { annotations } = await wps.getAnnos();
const model = editor.getModel() as monaco.editor.ITextModel;
const model = editor.getModel() as monaco.editor.ITextModel | null;
if (!model) {
return;
}
monaco.editor.setModelMarkers(
model,
OWNER,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.dscFieldDetails__barContainer {
// Constrains value to the flex item, and allows for truncation when necessary
min-width: 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
* under the License.
*/
import React from 'react';
import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui';
import { EuiText, EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { StringFieldProgressBar } from './string_progress_bar';
import { Bucket } from './types';
import { IndexPatternField } from '../../../../../data/public';
import './discover_field_bucket.scss';

interface Props {
bucket: Bucket;
Expand All @@ -47,18 +48,40 @@ export function DiscoverFieldBucket({ field, bucket, onAddFilter }: Props) {

return (
<>
<EuiFlexGroup gutterSize="xs" responsive={false}>
<EuiFlexItem className="eui-textTruncate">
<EuiText size="xs" className="eui-textTruncate">
{bucket.display === '' ? emptyTxt : bucket.display}
</EuiText>
<EuiFlexGroup justifyContent="spaceBetween" responsive={false} gutterSize="s">
<EuiFlexItem className="dscFieldDetails__barContainer" grow={1}>
<EuiFlexGroup justifyContent="spaceBetween" gutterSize="xs" responsive={false}>
<EuiFlexItem grow={1} className="eui-textTruncate">
<EuiText
title={
bucket.display === ''
? emptyTxt
: `${bucket.display}: ${bucket.count} (${bucket.percent}%)`
}
size="xs"
className="eui-textTruncate"
>
{bucket.display === '' ? emptyTxt : bucket.display}
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false} className="eui-textTruncate">
<EuiText color="secondary" size="xs" className="eui-textTruncate">
{bucket.percent}%
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
<StringFieldProgressBar
value={bucket.value}
percent={bucket.percent}
count={bucket.count}
/>
</EuiFlexItem>
{field.filterable && (
<EuiFlexItem grow={false}>
<div>
<EuiButtonIcon
iconSize="s"
iconType="magnifyWithPlus"
iconType="plusInCircle"
onClick={() => onAddFilter(field, bucket.value, '+')}
aria-label={addLabel}
data-test-subj={`plus-${field.name}-${bucket.value}`}
Expand All @@ -73,7 +96,7 @@ export function DiscoverFieldBucket({ field, bucket, onAddFilter }: Props) {
/>
<EuiButtonIcon
iconSize="s"
iconType="magnifyWithMinus"
iconType="minusInCircle"
onClick={() => onAddFilter(field, bucket.value, '-')}
aria-label={removeLabel}
data-test-subj={`minus-${field.name}-${bucket.value}`}
Expand All @@ -90,7 +113,7 @@ export function DiscoverFieldBucket({ field, bucket, onAddFilter }: Props) {
</EuiFlexItem>
)}
</EuiFlexGroup>
<StringFieldProgressBar percent={bucket.percent} count={bucket.count} />
<EuiSpacer size="s" />
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import React from 'react';
import { EuiLink, EuiSpacer, EuiIconTip, EuiText } from '@elastic/eui';
import { EuiLink, EuiIconTip, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { DiscoverFieldBucket } from './discover_field_bucket';
import { getWarnings } from './lib/get_warnings';
Expand Down Expand Up @@ -78,7 +78,6 @@ export function DiscoverFieldDetails({

{details.visualizeUrl && (
<>
<EuiSpacer size={'s'} />
<EuiLink
onClick={() => {
getServices().core.application.navigateToApp(details.visualizeUrl.app, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,6 @@
}
}

/*
Fixes EUI known issue https://github.com/elastic/eui/issues/1749
*/
.dscProgressBarTooltip__anchor {
display: block;
}


.dscFieldSearch {
padding: $euiSizeS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,18 @@
* under the License.
*/
import React from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiProgress, EuiText, EuiToolTip } from '@elastic/eui';
import { EuiProgress } from '@elastic/eui';

interface Props {
percent: number;
count: number;
value: string;
}

export function StringFieldProgressBar(props: Props) {
export function StringFieldProgressBar({ value, percent, count }: Props) {
const ariaLabel = `${value}: ${count} (${percent}%)`;

return (
<EuiToolTip
anchorClassName="dscProgressBarTooltip__anchor"
content={props.count}
delay="regular"
position="right"
>
<EuiFlexGroup alignItems="center" responsive={false}>
<EuiFlexItem>
<EuiProgress
value={props.percent}
max={100}
color="secondary"
aria-hidden={true}
size="l"
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText size="xs">{props.percent}%</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
</EuiToolTip>
<EuiProgress value={percent} max={100} color="secondary" aria-label={ariaLabel} size="s" />
);
}
3 changes: 3 additions & 0 deletions src/plugins/ui_actions/public/actions/action_internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import { Presentable } from '../util/presentable';
import { uiToReactComponent } from '../../../kibana_react/public';
import { ActionType } from '../types';

/**
* @internal
*/
export class ActionInternal<A extends ActionDefinition = ActionDefinition>
implements Action<Context<A>>, Presentable<Context<A>> {
constructor(public readonly definition: A) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { UiActionsService } from './ui_actions_service';
import { Action, ActionInternal, createAction } from '../actions';
import { createHelloWorldAction } from '../tests/test_samples';
import { ActionRegistry, TriggerRegistry, TriggerId, ActionType } from '../types';
import { TriggerRegistry, TriggerId, ActionType, ActionRegistry } from '../types';
import { Trigger } from '../triggers';

// Casting to ActionType or TriggerId is a hack - in a real situation use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ export class UiActionsService {
for (const [key, value] of this.actions.entries()) actions.set(key, value);
for (const [key, value] of this.triggerToActions.entries())
triggerToActions.set(key, [...value]);

return new UiActionsService({ triggers, actions, triggerToActions });
};
}
12 changes: 9 additions & 3 deletions test/functional/apps/dashboard/time_zones.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ export default function ({ getService, getPageObjects }) {
const pieChart = getService('pieChart');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['dashboard', 'timePicker', 'settings', 'common']);
const PageObjects = getPageObjects([
'dashboard',
'timePicker',
'settings',
'common',
'savedObjects',
]);

describe('dashboard time zones', function () {
this.tags('includeFirefox');
Expand All @@ -36,10 +42,10 @@ export default function ({ getService, getPageObjects }) {
});
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaSavedObjects();
await PageObjects.settings.importFile(
await PageObjects.savedObjects.importFile(
path.join(__dirname, 'exports', 'timezonetest_6_2_4.json')
);
await PageObjects.settings.checkImportSucceeded();
await PageObjects.savedObjects.checkImportSucceeded();
await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.preserveCrossAppState();
await PageObjects.dashboard.loadSavedDashboard('time zone test');
Expand Down
Loading

0 comments on commit 21597fe

Please sign in to comment.