Skip to content

Commit

Permalink
Merge branch 'main' into fix-suppression-max-signals
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallmain authored Nov 29, 2022
2 parents 69c826d + 36808ec commit bacb382
Show file tree
Hide file tree
Showing 73 changed files with 1,518 additions and 483 deletions.
10 changes: 6 additions & 4 deletions docs/api-generated/cases/case-apis-passthru.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,9 @@ Any modifications made to this file will be overwritten.
<h3 class="field-label">Query parameters</h3>
<div class="field-items">
<div class="param">defaultSearchOperator (optional)</div>
<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; The default operator to use for the simple_query_string. default: OR </div><div class="param">fields (optional)</div>
Expand Down Expand Up @@ -1922,8 +1924,8 @@ Any modifications made to this file will be overwritten.
<li><a href="#getCaseStatus_200_response"><code>getCaseStatus_200_response</code> - </a></li>
<li><a href="#getCasesByAlert_200_response_inner"><code>getCasesByAlert_200_response_inner</code> - </a></li>
<li><a href="#getCases_200_response"><code>getCases_200_response</code> - </a></li>
<li><a href="#getCases_assignees_parameter"><code>getCases_assignees_parameter</code> - </a></li>
<li><a href="#getCases_owner_parameter"><code>getCases_owner_parameter</code> - </a></li>
<li><a href="#getCases_reporters_parameter"><code>getCases_reporters_parameter</code> - </a></li>
<li><a href="#owners"><code>owners</code> - </a></li>
<li><a href="#payload_alert_comment"><code>payload_alert_comment</code> - </a></li>
<li><a href="#payload_alert_comment_comment"><code>payload_alert_comment_comment</code> - </a></li>
Expand Down Expand Up @@ -2485,13 +2487,13 @@ Any modifications made to this file will be overwritten.
</div> <!-- field-items -->
</div>
<div class="model">
<h3><a name="getCases_owner_parameter"><code>getCases_owner_parameter</code> - </a> <a class="up" href="#__Models">Up</a></h3>
<h3><a name="getCases_assignees_parameter"><code>getCases_assignees_parameter</code> - </a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'></div>
<div class="field-items">
</div> <!-- field-items -->
</div>
<div class="model">
<h3><a name="getCases_reporters_parameter"><code>getCases_reporters_parameter</code> - </a> <a class="up" href="#__Models">Up</a></h3>
<h3><a name="getCases_owner_parameter"><code>getCases_owner_parameter</code> - </a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'></div>
<div class="field-items">
</div> <!-- field-items -->
Expand Down
6 changes: 6 additions & 0 deletions docs/api/cases/cases-api-find-cases.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ default space is used.

=== {api-query-parms-title}

`assignees`::
(Optional, string or array of strings) Filters the returned cases by assignees.
Valid values are `none` or unique identifiers for the user profiles. These
identifiers can be found by using the
{ref}/security-api-suggest-user-profile.html[suggest user profile API].

`defaultSearchOperator`::
(Optional, string) The default operator to use for the `simple_query_string`.
Defaults to `OR`.
Expand Down
2 changes: 2 additions & 0 deletions docs/maps/vector-style-properties.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ You can add text labels to your Point features by configuring label style proper
|===
|*Label*
|Specifies label content.
|*Label position*
|Place label above, in the center of, or below the Point feature.
|*Label visibility*
|Specifies the zoom range for which labels are displayed.
|*Label color*
Expand Down
24 changes: 24 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,30 @@
"labels": ["Team:Operations", "release_note:skip"],
"enabled": true
},
{
"groupName": "jest",
"packageNames": [
"@jest/console",
"@jest/reporters",
"@jest/types",
"@types/jest",
"babel-jest",
"expect",
"jest",
"jest-cli",
"jest-config",
"jest-diff",
"jest-environment-jsdom",
"jest-matcher-utils",
"jest-mock",
"jest-runtime",
"jest-snapshot"
],
"reviewers": ["team:kibana-operations"],
"matchBaseBranches": ["main"],
"labels": ["Team:Operations", "release_note:skip"],
"enabled": true
},
{
"groupName": "@storybook",
"reviewers": ["team:kibana-operations"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
COLOR_MAP_TYPE,
FIELD_ORIGIN,
LABEL_BORDER_SIZES,
LABEL_POSITIONS,
LAYER_TYPE,
SOURCE_TYPES,
STYLE_TYPE,
Expand Down Expand Up @@ -74,6 +75,11 @@ function getLayerStyle(): VectorStyleDescriptor {
},
},
},
labelPosition: {
options: {
position: LABEL_POSITIONS.CENTER,
},
},
labelZoomRange: {
options: {
useLayerZoomRange: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ import {
SERVICE_LANGUAGE_NAME,
SERVICE_NAME,
} from '../../../../../common/es_fields/apm';
import { EnvironmentsContextProvider } from '../../../../context/environments_context/environments_context';
import { useApmParams } from '../../../../hooks/use_apm_params';
import { FETCH_STATUS } from '../../../../hooks/use_fetcher';
import { useProgressiveFetcher } from '../../../../hooks/use_progressive_fetcher';
import { useTimeRange } from '../../../../hooks/use_time_range';
import { ApmEnvironmentFilter } from '../../../shared/environment_filter';
import { KueryBar } from '../../../shared/kuery_bar';
import * as urlHelpers from '../../../shared/links/url_helpers';
import { SuggestionsSelect } from '../../../shared/suggestions_select';
Expand Down Expand Up @@ -68,7 +70,10 @@ export function AgentExplorer() {
query: { serviceName, agentLanguage },
} = useApmParams('/settings/agent-explorer');

const { start, end } = useTimeRange({ rangeFrom: 'now-24h', rangeTo: 'now' });
const rangeFrom = 'now-24h';
const rangeTo = 'now';

const { start, end } = useTimeRange({ rangeFrom, rangeTo });
const agents = useAgentExplorerFetcher({ start, end });

const isLoading = agents.status === FETCH_STATUS.LOADING;
Expand Down Expand Up @@ -120,6 +125,13 @@ export function AgentExplorer() {
<EuiSpacer size="xs" />
<EuiFlexItem>
<EuiFlexGroup justifyContent="flexEnd" responsive={true}>
<EuiFlexItem grow={false}>
<EnvironmentsContextProvider
customTimeRange={{ rangeFrom, rangeTo }}
>
<ApmEnvironmentFilter />
</EnvironmentsContextProvider>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<SuggestionsSelect
prepend={i18n.translate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@
*/

import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui';
import React from 'react';
import { i18n } from '@kbn/i18n';
import { ApmMainTemplate } from './apm_main_template';
import { SpanIcon } from '../../shared/span_icon';
import { useApmParams } from '../../../hooks/use_apm_params';
import { useTimeRange } from '../../../hooks/use_time_range';
import { useFetcher } from '../../../hooks/use_fetcher';
import { useApmRouter } from '../../../hooks/use_apm_router';
import { useApmRoutePath } from '../../../hooks/use_apm_route_path';
import { SearchBar } from '../../shared/search_bar';
import React from 'react';
import {
getKueryBarBoolFilter,
kueryBarPlaceholder,
} from '../../../../common/dependencies';
import { useApmParams } from '../../../hooks/use_apm_params';
import { useApmRouter } from '../../../hooks/use_apm_router';
import { useApmRoutePath } from '../../../hooks/use_apm_route_path';
import { useFetcher } from '../../../hooks/use_fetcher';
import { useOperationBreakdownEnabledSetting } from '../../../hooks/use_operations_breakdown_enabled_setting';
import { useTimeRange } from '../../../hooks/use_time_range';
import { BetaBadge } from '../../shared/beta_badge';
import { SearchBar } from '../../shared/search_bar';
import { SpanIcon } from '../../shared/span_icon';
import { ApmMainTemplate } from './apm_main_template';

interface Props {
children: React.ReactNode;
Expand Down Expand Up @@ -90,6 +91,7 @@ export function DependencyDetailTemplate({ children }: Props) {
isSelected:
path === '/dependencies/operations' ||
path === '/dependencies/operation',
append: <BetaBadge />,
},
]
: [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,23 @@ function updateEnvironmentUrl(
}

export function ApmEnvironmentFilter() {
const { environment, environments, status } = useEnvironmentsContext();
const { environment, environments, status, rangeFrom, rangeTo, serviceName } =
useEnvironmentsContext();
const history = useHistory();
const location = useLocation();

if (!rangeFrom || !rangeTo) {
return null;
}

return (
<EnvironmentSelect
status={status}
environment={environment}
availableEnvironments={environments}
serviceName={serviceName}
rangeFrom={rangeFrom}
rangeTo={rangeTo}
onChange={(changeValue: string) =>
updateEnvironmentUrl(history, location, changeValue)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
import { SERVICE_ENVIRONMENT } from '../../../../common/es_fields/apm';
import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher';
import { useTimeRange } from '../../../hooks/use_time_range';
import { useApmParams } from '../../../hooks/use_apm_params';
import { Environment } from '../../../../common/environment_rt';

function getEnvironmentOptions(environments: Environment[]) {
Expand All @@ -41,18 +40,20 @@ export function EnvironmentSelect({
environment,
availableEnvironments,
status,
serviceName,
rangeFrom,
rangeTo,
onChange,
}: {
environment: Environment;
availableEnvironments: Environment[];
status: FETCH_STATUS;
serviceName?: string;
rangeFrom: string;
rangeTo: string;
onChange: (value: string) => void;
}) {
const [searchValue, setSearchValue] = useState('');
const {
path: { serviceName },
query: { rangeFrom, rangeTo },
} = useApmParams('/services/{serviceName}/*');

const { start, end } = useTimeRange({ rangeFrom, rangeTo });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
EuiButton,
EuiButtonEmpty,
EuiCallOut,
EuiFlexGrid,
EuiFlexGroup,
EuiFlexItem,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -167,7 +167,7 @@ export function MLCallout({
const hasAnyActions = properties.primaryAction || dismissable;

const actions = hasAnyActions ? (
<EuiFlexGrid gutterSize="s">
<EuiFlexGroup gutterSize="s" justifyContent="spaceBetween">
{properties.primaryAction && (
<EuiFlexItem grow={false}>{properties.primaryAction}</EuiFlexItem>
)}
Expand All @@ -180,7 +180,7 @@ export function MLCallout({
</EuiButtonEmpty>
</EuiFlexItem>
)}
</EuiFlexGrid>
</EuiFlexGroup>
) : null;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ import React from 'react';
import { ENVIRONMENT_ALL } from '../../../common/environment_filter_values';
import { Environment } from '../../../common/environment_rt';
import { useApmParams } from '../../hooks/use_apm_params';
import { useEnvironmentsFetcher } from '../../hooks/use_environments_fetcher';
import { FETCH_STATUS } from '../../hooks/use_fetcher';
import { useTimeRange } from '../../hooks/use_time_range';
import { useEnvironmentsFetcher } from '../../hooks/use_environments_fetcher';

export const EnvironmentsContext = React.createContext<{
environment: Environment;
environments: Environment[];
status: FETCH_STATUS;
preferredEnvironment: Environment;
serviceName?: string;
rangeFrom?: string;
rangeTo?: string;
}>({
environment: ENVIRONMENT_ALL.value,
environments: [],
Expand All @@ -26,8 +29,10 @@ export const EnvironmentsContext = React.createContext<{

export function EnvironmentsContextProvider({
children,
customTimeRange,
}: {
children: React.ReactElement;
customTimeRange?: { rangeFrom: string; rangeTo: string };
}) {
const { path, query } = useApmParams('/*');

Expand All @@ -36,8 +41,11 @@ export function EnvironmentsContextProvider({
('environment' in query && (query.environment as Environment)) ||
ENVIRONMENT_ALL.value;

const rangeFrom = 'rangeFrom' in query ? query.rangeFrom : undefined;
const rangeTo = 'rangeTo' in query ? query.rangeTo : undefined;
const queryRangeFrom = 'rangeFrom' in query ? query.rangeFrom : undefined;
const queryRangeTo = 'rangeTo' in query ? query.rangeTo : undefined;

const rangeFrom = customTimeRange?.rangeFrom || queryRangeFrom;
const rangeTo = customTimeRange?.rangeTo || queryRangeTo;

const { start, end } = useTimeRange({ rangeFrom, rangeTo, optional: true });

Expand All @@ -58,6 +66,9 @@ export function EnvironmentsContextProvider({
environments,
status,
preferredEnvironment,
serviceName,
rangeFrom,
rangeTo,
}}
>
{children}
Expand Down
18 changes: 18 additions & 0 deletions x-pack/plugins/cases/docs/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,24 @@
{
"$ref": "#/components/parameters/space_id"
},
{
"name": "assignees",
"in": "query",
"description": "Filters the returned cases by assignees. Valid values are `none` or unique identifiers for the user profiles. These identifiers can be found by using the suggest user profile API.",
"schema": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
{
"name": "defaultSearchOperator",
"in": "query",
Expand Down
9 changes: 9 additions & 0 deletions x-pack/plugins/cases/docs/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ paths:
- cases
parameters:
- $ref: '#/components/parameters/space_id'
- name: assignees
in: query
description: Filters the returned cases by assignees. Valid values are `none` or unique identifiers for the user profiles. These identifiers can be found by using the suggest user profile API.
schema:
oneOf:
- type: string
- type: array
items:
type: string
- name: defaultSearchOperator
in: query
description: The default operator to use for the simple_query_string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ get:
- cases
parameters:
- $ref: '../components/parameters/space_id.yaml'
- name: assignees
in: query
description: Filters the returned cases by assignees. Valid values are `none` or unique identifiers for the user profiles. These identifiers can be found by using the suggest user profile API.
schema:
oneOf:
- type: string
- type: array
items:
type: string
- name: defaultSearchOperator
in: query
description: The default operator to use for the simple_query_string.
Expand Down
Loading

0 comments on commit bacb382

Please sign in to comment.