Skip to content

Commit

Permalink
Merge branch 'main' into serverless/add-global-search-ux
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Jun 21, 2023
2 parents f4678a1 + be71e33 commit 8bc19ed
Show file tree
Hide file tree
Showing 244 changed files with 4,191 additions and 1,930 deletions.
6 changes: 4 additions & 2 deletions docs/api-generated/cases/case-apis-passthru.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ Any modifications made to this file will be overwritten.
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; The page number to return. default: 1 </div><div class="param">perPage (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; The number of items to return. default: 20 </div><div class="param">sortOrder (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; The number of items to return. Limited to 100 items. default: 20 </div><div class="param">sortOrder (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; Determines the sort order. default: desc </div>
</div> <!-- field-items -->
Expand Down Expand Up @@ -724,7 +724,9 @@ Any modifications made to this file will be overwritten.
<div class="field-items">
<div class="param">assignees (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; Filters the returned cases by assignees. Valid values are <code>none</code> or unique identifiers for the user profiles. These identifiers can be found by using the suggest user profile API. default: null </div><div class="param">defaultSearchOperator (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; Filters the returned cases by assignees. Valid values are <code>none</code> or unique identifiers for the user profiles. These identifiers can be found by using the suggest user profile API. default: null </div><div class="param">category (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; Filters the returned cases by category. Limited to 100 categories. default: null </div><div class="param">defaultSearchOperator (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; The default operator to use for the simple_query_string. default: OR </div><div class="param">from (optional)</div>
Expand Down
11 changes: 1 addition & 10 deletions packages/kbn-chart-icons/src/assets/annotation_icons/circle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

import React from 'react';
import { EuiIconProps } from '@elastic/eui';
import { cx } from '@emotion/css';
import { noFill } from '../common_styles';

export const IconCircle = ({ title, titleId, ...props }: Omit<EuiIconProps, 'type'>) => (
<svg
Expand All @@ -21,13 +19,6 @@ export const IconCircle = ({ title, titleId, ...props }: Omit<EuiIconProps, 'typ
{...props}
>
{title ? <title id={titleId}>{title}</title> : null}
<circle
strokeWidth="1"
stroke="currentColor"
cx="8"
cy="8"
className={cx(noFill, props.className)}
r="7"
/>
<path d="M7.427.522c-.813.081-1.398.21-2.039.45a7.318 7.318 0 0 0-2.67 1.72A7.045 7.045 0 0 0 1.28 4.68 7.241 7.241 0 0 0 .507 8c0 1.196.243 2.24.773 3.32a7.047 7.047 0 0 0 1.425 1.975A7.047 7.047 0 0 0 4.68 14.72a7.254 7.254 0 0 0 3.32.773 7.254 7.254 0 0 0 3.32-.773 7.047 7.047 0 0 0 1.975-1.425 7.047 7.047 0 0 0 1.425-1.975A7.254 7.254 0 0 0 15.493 8a7.254 7.254 0 0 0-.773-3.32 7.045 7.045 0 0 0-1.438-1.988C12.111 1.524 10.695.818 9.027.571 8.773.533 7.659.499 7.427.522m1.426 1.041a6.519 6.519 0 0 1 3.091 1.271c.329.246.976.893 1.222 1.222.561.751.976 1.634 1.164 2.479a6.766 6.766 0 0 1 0 2.93c-.414 1.861-1.725 3.513-3.463 4.363a6.76 6.76 0 0 1-1.987.616c-.424.065-1.336.065-1.76 0-1.948-.296-3.592-1.359-4.627-2.993a7.502 7.502 0 0 1-.634-1.332A6.158 6.158 0 0 1 1.514 8c0-1.039.201-1.925.646-2.84.34-.698.686-1.18 1.253-1.747A5.956 5.956 0 0 1 5.16 2.16a6.452 6.452 0 0 1 3.693-.597" />
</svg>
);
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

import React from 'react';
import { EuiIconProps } from '@elastic/eui';
import { cx } from '@emotion/css';
import { noFill } from '../common_styles';

export const IconTriangle = ({ title, titleId, ...props }: Omit<EuiIconProps, 'type'>) => (
<svg
Expand All @@ -22,11 +20,6 @@ export const IconTriangle = ({ title, titleId, ...props }: Omit<EuiIconProps, 't
{...props}
>
{title ? <title id={titleId}>{title}</title> : null}
<path
strokeWidth="1"
stroke="currentColor"
d="M 6.9 11.612 C 7.64533 12.7953 8.39067 12.7953 9.136 11.612 L 13.11 5.3 C 13.8553 4.11667 13.4827 3.525 11.992 3.525 L 4.044 3.525 C 2.55333 3.525 2.18067 4.11667 2.926 5.3 Z"
className={cx(noFill, props.className)}
/>
<path d="M3.373 3.079c-.391.062-.637.158-.88.342-.545.415-.577 1.146-.087 1.979.174.296 3.984 6.347 4.164 6.613.32.474.755.838 1.117.937a1.7 1.7 0 0 0 .596.021c.138-.032.341-.126.49-.226.202-.135.523-.478.713-.762.378-.563 4.084-6.475 4.211-6.716.385-.733.368-1.339-.051-1.757-.168-.168-.437-.307-.767-.395l-.226-.06L8.12 3.05c-3.567-.004-4.579.002-4.747.029m9.267 1.004c.208.058.317.121.335.194.022.086-.029.259-.141.482-.129.258-4.174 6.679-4.327 6.87-.264.328-.441.419-.63.323-.116-.059-.33-.275-.454-.459-.276-.405-4.148-6.585-4.234-6.758a.93.93 0 0 1-.117-.364l-.011-.153.103-.053c.094-.048.288-.095.503-.121.044-.006 2.048-.008 4.453-.006 3.853.003 4.391.009 4.52.045" />
</svg>
);
4 changes: 0 additions & 4 deletions packages/kbn-chart-icons/src/assets/common_styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@ export const colors = {
fill: ${euiThemeVars.euiColorVis0};
`,
};

export const noFill = css`
fill: none;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}

.xyAnnotationIcon_rotate90 {
transform: rotate(45deg);
transform: rotate(90deg) !important;
transform-origin: center;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import React from 'react';
import { Position } from '@elastic/charts';
import { EuiFlexGroup, EuiIcon, EuiIconProps, EuiText } from '@elastic/eui';
import classnames from 'classnames';
import type {
IconPosition,
ReferenceLineDecorationConfig,
Expand Down Expand Up @@ -180,12 +179,7 @@ export const AnnotationIcon = ({
{...rest}
data-test-subj="xyVisAnnotationIcon"
type={iconConfig.icon || type}
className={classnames(
{ [rotateClassName]: iconConfig.shouldRotate },
{
lensAnnotationIconFill: renderedInChart && iconConfig.canFill,
}
)}
className={iconConfig.shouldRotate ? rotateClassName : undefined}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export const iconSet = [
defaultMessage: 'Circle',
}),
icon: IconCircle,
canFill: true,
},

{
Expand Down Expand Up @@ -113,6 +112,5 @@ export const iconSet = [
}),
icon: IconTriangle,
shouldRotate: true,
canFill: true,
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const annotationsIconSet: IconSet<AvailableAnnotationIcon> = [
defaultMessage: 'Circle',
}),
icon: IconCircle,
canFill: true,
},

{
Expand Down Expand Up @@ -106,6 +105,5 @@ export const annotationsIconSet: IconSet<AvailableAnnotationIcon> = [
}),
icon: IconTriangle,
shouldRotate: true,
canFill: true,
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -32,66 +32,183 @@ describe('getBaseUrl', () => {
});

describe('getChannel', () => {
it('throws on unknown channel', () => {
expect(() =>
// @ts-expect-error
getChannel('ANY')
).toThrowErrorMatchingInlineSnapshot(`"Unknown telemetry channel ANY."`);
});
describe('Classic offering', () => {
it('throws on unknown channel', () => {
expect(() =>
// @ts-expect-error
getChannel('ANY', false)
).toThrowErrorMatchingInlineSnapshot(`"Unknown telemetry channel ANY."`);
});

it('returns correct snapshot channel name', () => {
const channelName = getChannel('snapshot');
expect(channelName).toMatchInlineSnapshot(`"kibana-snapshot"`);
it('returns correct snapshot channel name', () => {
const channelName = getChannel('snapshot', false);
expect(channelName).toMatchInlineSnapshot(`"kibana-snapshot"`);
});

it('returns correct optInStatus channel name', () => {
const channelName = getChannel('optInStatus', false);
expect(channelName).toMatchInlineSnapshot(`"kibana-opt-in-reports"`);
});
});

it('returns correct optInStatus channel name', () => {
const channelName = getChannel('optInStatus');
expect(channelName).toMatchInlineSnapshot(`"kibana-opt-in-reports"`);
describe('Serverless offering', () => {
it('throws on unknown channel', () => {
expect(() =>
// @ts-expect-error
getChannel('ANY', true)
).toThrowErrorMatchingInlineSnapshot(`"Unknown telemetry channel ANY."`);
});

it('returns correct snapshot channel name', () => {
const channelName = getChannel('snapshot', true);
expect(channelName).toMatchInlineSnapshot(`"kibana-snapshot-serverless"`);
});

it('returns correct optInStatus channel name', () => {
const channelName = getChannel('optInStatus', true);
expect(channelName).toMatchInlineSnapshot(`"kibana-opt-in-reports-serverless"`);
});
});
});

describe('getTelemetryChannelEndpoint', () => {
it('throws on unknown env', () => {
expect(() =>
// @ts-expect-error
getTelemetryChannelEndpoint({ env: 'ANY', channelName: 'snapshot' })
).toThrowErrorMatchingInlineSnapshot(`"Unknown telemetry endpoint env ANY."`);
});
describe('Classic offering', () => {
it('throws on unknown env', () => {
expect(() =>
getTelemetryChannelEndpoint({
// @ts-expect-error
env: 'ANY',
channelName: 'snapshot',
appendServerlessChannelsSuffix: false,
})
).toThrowErrorMatchingInlineSnapshot(`"Unknown telemetry endpoint env ANY."`);
});

it('throws on unknown channelName', () => {
expect(() =>
// @ts-expect-error
getTelemetryChannelEndpoint({ env: 'prod', channelName: 'ANY' })
).toThrowErrorMatchingInlineSnapshot(`"Unknown telemetry channel ANY."`);
});
it('throws on unknown channelName', () => {
expect(() =>
getTelemetryChannelEndpoint({
env: 'prod',
// @ts-expect-error
channelName: 'ANY',
appendServerlessChannelsSuffix: false,
})
).toThrowErrorMatchingInlineSnapshot(`"Unknown telemetry channel ANY."`);
});

describe('snapshot channel', () => {
it('returns correct prod endpoint', () => {
const endpoint = getTelemetryChannelEndpoint({ env: 'prod', channelName: 'snapshot' });
expect(endpoint).toMatchInlineSnapshot(
`"https://telemetry.elastic.co/v3/send/kibana-snapshot"`
);
describe('snapshot channel', () => {
it('returns correct prod endpoint', () => {
const endpoint = getTelemetryChannelEndpoint({
env: 'prod',
channelName: 'snapshot',
appendServerlessChannelsSuffix: false,
});
expect(endpoint).toMatchInlineSnapshot(
`"https://telemetry.elastic.co/v3/send/kibana-snapshot"`
);
});
it('returns correct staging endpoint', () => {
const endpoint = getTelemetryChannelEndpoint({
env: 'staging',
channelName: 'snapshot',
appendServerlessChannelsSuffix: false,
});
expect(endpoint).toMatchInlineSnapshot(
`"https://telemetry-staging.elastic.co/v3/send/kibana-snapshot"`
);
});
});
it('returns correct staging endpoint', () => {
const endpoint = getTelemetryChannelEndpoint({ env: 'staging', channelName: 'snapshot' });
expect(endpoint).toMatchInlineSnapshot(
`"https://telemetry-staging.elastic.co/v3/send/kibana-snapshot"`
);

describe('optInStatus channel', () => {
it('returns correct prod endpoint', () => {
const endpoint = getTelemetryChannelEndpoint({
env: 'prod',
channelName: 'optInStatus',
appendServerlessChannelsSuffix: false,
});
expect(endpoint).toMatchInlineSnapshot(
`"https://telemetry.elastic.co/v3/send/kibana-opt-in-reports"`
);
});
it('returns correct staging endpoint', () => {
const endpoint = getTelemetryChannelEndpoint({
env: 'staging',
channelName: 'optInStatus',
appendServerlessChannelsSuffix: false,
});
expect(endpoint).toMatchInlineSnapshot(
`"https://telemetry-staging.elastic.co/v3/send/kibana-opt-in-reports"`
);
});
});
});

describe('optInStatus channel', () => {
it('returns correct prod endpoint', () => {
const endpoint = getTelemetryChannelEndpoint({ env: 'prod', channelName: 'optInStatus' });
expect(endpoint).toMatchInlineSnapshot(
`"https://telemetry.elastic.co/v3/send/kibana-opt-in-reports"`
);
describe('Serverless offering', () => {
it('throws on unknown env', () => {
expect(() =>
getTelemetryChannelEndpoint({
// @ts-expect-error
env: 'ANY',
channelName: 'snapshot',
appendServerlessChannelsSuffix: true,
})
).toThrowErrorMatchingInlineSnapshot(`"Unknown telemetry endpoint env ANY."`);
});

it('throws on unknown channelName', () => {
expect(() =>
getTelemetryChannelEndpoint({
env: 'prod',
// @ts-expect-error
channelName: 'ANY',
appendServerlessChannelsSuffix: true,
})
).toThrowErrorMatchingInlineSnapshot(`"Unknown telemetry channel ANY."`);
});
it('returns correct staging endpoint', () => {
const endpoint = getTelemetryChannelEndpoint({ env: 'staging', channelName: 'optInStatus' });
expect(endpoint).toMatchInlineSnapshot(
`"https://telemetry-staging.elastic.co/v3/send/kibana-opt-in-reports"`
);

describe('snapshot channel', () => {
it('returns correct prod endpoint', () => {
const endpoint = getTelemetryChannelEndpoint({
env: 'prod',
channelName: 'snapshot',
appendServerlessChannelsSuffix: true,
});
expect(endpoint).toMatchInlineSnapshot(
`"https://telemetry.elastic.co/v3/send/kibana-snapshot-serverless"`
);
});
it('returns correct staging endpoint', () => {
const endpoint = getTelemetryChannelEndpoint({
env: 'staging',
channelName: 'snapshot',
appendServerlessChannelsSuffix: true,
});
expect(endpoint).toMatchInlineSnapshot(
`"https://telemetry-staging.elastic.co/v3/send/kibana-snapshot-serverless"`
);
});
});

describe('optInStatus channel', () => {
it('returns correct prod endpoint', () => {
const endpoint = getTelemetryChannelEndpoint({
env: 'prod',
channelName: 'optInStatus',
appendServerlessChannelsSuffix: true,
});
expect(endpoint).toMatchInlineSnapshot(
`"https://telemetry.elastic.co/v3/send/kibana-opt-in-reports-serverless"`
);
});
it('returns correct staging endpoint', () => {
const endpoint = getTelemetryChannelEndpoint({
env: 'staging',
channelName: 'optInStatus',
appendServerlessChannelsSuffix: true,
});
expect(endpoint).toMatchInlineSnapshot(
`"https://telemetry-staging.elastic.co/v3/send/kibana-opt-in-reports-serverless"`
);
});
});
});
});
Loading

0 comments on commit 8bc19ed

Please sign in to comment.