Skip to content

Commit 2ac9e23

Browse files
committed
Merge branch 'master' into alerting/action-groups-i18n
* master: [Canvas] Move sample data and feature registration to canvas np plugin (elastic#56564) instrument task manager with apm transactions (elastic#55356) displays Alert Instance state on Alert Details page (elastic#56842) Adding the Accessibility Statement to docs (elastic#57153) [Uptime] Remove redundant adapter function (elastic#56980) [SIEM][Detection Engine] Backend end-to-end tests [Uptime] Added tests for pages (elastic#56736) Updating to kind-of@6.0.3 (elastic#57367)
2 parents 17987e2 + 0dd8129 commit 2ac9e23

File tree

182 files changed

+9998
-1220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+9998
-1220
lines changed

docs/accessibility.asciidoc

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
[chapter]
2+
[[accessibility]]
3+
= Accessibility Statement for Kibana
4+
++++
5+
<titleabbrev>Accessibility</titleabbrev>
6+
++++
7+
8+
Elastic is committed to ensuring digital accessibility for people with disabilities. We are continually improving the user experience, and strive toward ensuring our tools are usable by everyone.
9+
10+
[float]
11+
[[accessibility-measures]]
12+
== Measures to support accessibility
13+
Elastic takes the following measures to ensure accessibility of Kibana:
14+
15+
* Maintains and incorporates an https://elastic.github.io/eui/[accessible component library].
16+
* Provides continual accessibility training for our staff.
17+
* Employs a third-party audit.
18+
19+
[float]
20+
[[accessibility-conformance-status]]
21+
== Conformance status
22+
Kibana aims to meet https://www.w3.org/WAI/WCAG21/quickref/?currentsidebar=%23col_customize&levels=aaa&technologies=server%2Csmil%2Cflash%2Csl[WCAG 2.1 level AA] compliance. Currently, we can only claim to partially conform, meaning we do not fully meet all of the success criteria. However, we do try to take a broader view of accessibility, and go above and beyond the legal and regulatory standards to provide a good experience for all of our users.
23+
24+
[float]
25+
[[accessibility-feedback]]
26+
== Feedback
27+
We welcome your feedback on the accessibility of Kibana. Please let us know if you encounter accessibility barriers on Kibana by either emailing us at accessibility@elastic.co or opening https://github.com/elastic/kibana/issues/new?labels=Project%3AAccessibility&template=Accessibility.md&title=%28Accessibility%29[an issue on GitHub].
28+
29+
[float]
30+
[[accessibility-specs]]
31+
== Technical specifications
32+
Accessibility of Kibana relies on the following technologies to work with your web browser and any assistive technologies or plugins installed on your computer:
33+
34+
* HTML
35+
* CSS
36+
* JavaScript
37+
* WAI-ARIA
38+
39+
[float]
40+
[[accessibility-limitations-and-alternatives]]
41+
== Limitations and alternatives
42+
Despite our best efforts to ensure accessibility of Kibana, there are some limitations. Please https://github.com/elastic/kibana/issues/new?labels=Project%3AAccessibility&template=Accessibility.md&title=%28Accessibility%29[open an issue on GitHub] if you observe an issue not in this list.
43+
44+
Known limitations are in the following areas:
45+
46+
* *Charts*: We have a clear plan for the first steps of making charts accessible. We’ve opened this https://github.com/elastic/elastic-charts/issues/300[Charts accessibility ticket on GitHub] for tracking our progress.
47+
* *Maps*: Maps might pose difficulties to users with vision disabilities. We welcome your input on making our maps accessible. Go to the https://github.com/elastic/kibana/issues/57271[Maps accessibility ticket on GitHub] to join the discussion and view our plans.
48+
* *Tables*: Although generally accessible and marked-up as standard HTML tables with column headers, tables rarely make use of row headers and have poor captions. You will see incremental improvements as various applications adopt a new accessible component.
49+
* *Color contrast*: Modern Kibana interfaces generally do not have color contrast issues. However, older code might fall below the recommended contrast levels. As we continue to update our code, this issue will phase out naturally.
50+
51+
To see individual tickets, view our https://github.com/elastic/kibana/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3AProject%3AAccessibility[GitHub issues with label "`Project:Accessibility`"].
52+
53+
[float]
54+
[[accessibility-approach]]
55+
== Assessment approach
56+
Elastic assesses the accessibility of Kibana with the following approaches:
57+
58+
* *Self-evaluation*: Our employees are familiar with accessibility standards and review new designs and implemented features to confirm that they are accessible.
59+
* *External evaluation*: We engage external contractors to help us conduct an independent assessment and generate a formal VPAT. Please email accessibility@elastic.co if you’d like a copy.
60+
* *Automated evaluation*: We are starting to run https://www.deque.com/axe/[axe] on every page. See our current progress in the https://github.com/elastic/kibana/issues/51456[automated testing GitHub issue].
61+
62+
Manual testing largely focuses on screen reader support and is done on:
63+
64+
* VoiceOver on MacOS with Safari, Chrome and Edge
65+
* NVDA on Windows with Chrome and Firefox

docs/index.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ include::{asciidoc-dir}/../../shared/attributes.asciidoc[]
2222

2323
include::user/index.asciidoc[]
2424

25+
include::accessibility.asciidoc[]
26+
2527
include::limitations.asciidoc[]
2628

2729
include::release-notes/highlights.asciidoc[]

packages/kbn-pm/dist/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88442,7 +88442,7 @@ module.exports = function kindOf(val) {
8844288442
};
8844388443

8844488444
function ctorName(val) {
88445-
return val.constructor ? val.constructor.name : null;
88445+
return typeof val.constructor === 'function' ? val.constructor.name : null;
8844688446
}
8844788447

8844888448
function isArray(val) {
@@ -88653,7 +88653,7 @@ module.exports = function kindOf(val) {
8865388653
};
8865488654

8865588655
function ctorName(val) {
88656-
return val.constructor ? val.constructor.name : null;
88656+
return typeof val.constructor === 'function' ? val.constructor.name : null;
8865788657
}
8865888658

8865988659
function isArray(val) {
@@ -88844,7 +88844,7 @@ module.exports = function kindOf(val) {
8884488844
};
8884588845

8884688846
function ctorName(val) {
88847-
return val.constructor ? val.constructor.name : null;
88847+
return typeof val.constructor === 'function' ? val.constructor.name : null;
8884888848
}
8884988849

8885088850
function isArray(val) {
@@ -101921,7 +101921,7 @@ module.exports = function kindOf(val) {
101921101921
};
101922101922

101923101923
function ctorName(val) {
101924-
return val.constructor ? val.constructor.name : null;
101924+
return typeof val.constructor === 'function' ? val.constructor.name : null;
101925101925
}
101926101926

101927101927
function isArray(val) {
@@ -104780,7 +104780,7 @@ module.exports = function kindOf(val) {
104780104780
};
104781104781

104782104782
function ctorName(val) {
104783-
return val.constructor ? val.constructor.name : null;
104783+
return typeof val.constructor === 'function' ? val.constructor.name : null;
104784104784
}
104785104785

104786104786
function isArray(val) {

x-pack/legacy/plugins/alerting/common/types.ts renamed to x-pack/legacy/plugins/alerting/common/alert.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
*/
66

77
import { SavedObjectAttributes } from 'kibana/server';
8-
import { AlertActionParams } from '../server/types';
98

109
export interface IntervalSchedule extends SavedObjectAttributes {
1110
interval: string;
1211
}
1312

13+
export type AlertActionParams = SavedObjectAttributes;
14+
1415
export interface AlertAction {
1516
group: string;
1617
id: string;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
import * as t from 'io-ts';
7+
import { DateFromString } from './date_from_string';
8+
9+
const metaSchema = t.partial({
10+
lastScheduledActions: t.type({
11+
group: t.string,
12+
date: DateFromString,
13+
}),
14+
});
15+
export type AlertInstanceMeta = t.TypeOf<typeof metaSchema>;
16+
17+
const stateSchema = t.record(t.string, t.unknown);
18+
export type AlertInstanceState = t.TypeOf<typeof stateSchema>;
19+
20+
export const rawAlertInstance = t.partial({
21+
state: stateSchema,
22+
meta: metaSchema,
23+
});
24+
export type RawAlertInstance = t.TypeOf<typeof rawAlertInstance>;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
import * as t from 'io-ts';
7+
import { rawAlertInstance } from './alert_instance';
8+
import { DateFromString } from './date_from_string';
9+
10+
export const alertStateSchema = t.partial({
11+
alertTypeState: t.record(t.string, t.unknown),
12+
alertInstances: t.record(t.string, rawAlertInstance),
13+
previousStartedAt: t.union([t.null, DateFromString]),
14+
});
15+
16+
export type AlertTaskState = t.TypeOf<typeof alertStateSchema>;
17+
18+
export const alertParamsSchema = t.intersection([
19+
t.type({
20+
alertId: t.string,
21+
}),
22+
t.partial({
23+
spaceId: t.string,
24+
}),
25+
]);
26+
export type AlertTaskParams = t.TypeOf<typeof alertParamsSchema>;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import { DateFromString } from './date_from_string';
8+
import { right, isLeft } from 'fp-ts/lib/Either';
9+
10+
describe('DateFromString', () => {
11+
test('validated and parses a string into a Date', () => {
12+
const date = new Date(1973, 10, 30);
13+
expect(DateFromString.decode(date.toISOString())).toEqual(right(date));
14+
});
15+
16+
test('validated and returns a failure for an actual Date', () => {
17+
const date = new Date(1973, 10, 30);
18+
expect(isLeft(DateFromString.decode(date))).toEqual(true);
19+
});
20+
21+
test('validated and returns a failure for an invalid Date string', () => {
22+
expect(isLeft(DateFromString.decode('1234-23-45'))).toEqual(true);
23+
});
24+
25+
test('validated and returns a failure for a null value', () => {
26+
expect(isLeft(DateFromString.decode(null))).toEqual(true);
27+
});
28+
});
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import * as t from 'io-ts';
8+
import { either } from 'fp-ts/lib/Either';
9+
10+
// represents a Date from an ISO string
11+
export const DateFromString = new t.Type<Date, string, unknown>(
12+
'DateFromString',
13+
// detect the type
14+
(value): value is Date => value instanceof Date,
15+
(valueToDecode, context) =>
16+
either.chain(
17+
// validate this is a string
18+
t.string.validate(valueToDecode, context),
19+
// decode
20+
value => {
21+
const decoded = new Date(value);
22+
return isNaN(decoded.getTime()) ? t.failure(valueToDecode, context) : t.success(decoded);
23+
}
24+
),
25+
valueToEncode => valueToEncode.toISOString()
26+
);

x-pack/legacy/plugins/alerting/common/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
export * from './types';
7+
export * from './alert';
8+
export * from './alert_instance';
9+
export * from './alert_task_instance';

x-pack/legacy/plugins/alerting/server/alert_instance/alert_instance.ts

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,22 @@
33
* or more contributor license agreements. Licensed under the Elastic License;
44
* you may not use this file except in compliance with the Elastic License.
55
*/
6-
import * as t from 'io-ts';
6+
import {
7+
AlertInstanceMeta,
8+
AlertInstanceState,
9+
RawAlertInstance,
10+
rawAlertInstance,
11+
} from '../../common';
712

813
import { State, Context } from '../types';
9-
import { DateFromString } from '../lib/types';
1014
import { parseDuration } from '../lib';
1115

1216
interface ScheduledExecutionOptions {
1317
actionGroup: string;
1418
context: Context;
1519
state: State;
1620
}
17-
18-
const metaSchema = t.partial({
19-
lastScheduledActions: t.type({
20-
group: t.string,
21-
date: DateFromString,
22-
}),
23-
});
24-
type AlertInstanceMeta = t.TypeOf<typeof metaSchema>;
25-
26-
const stateSchema = t.record(t.string, t.unknown);
27-
type AlertInstanceState = t.TypeOf<typeof stateSchema>;
28-
29-
export const rawAlertInstance = t.partial({
30-
state: stateSchema,
31-
meta: metaSchema,
32-
});
33-
export type RawAlertInstance = t.TypeOf<typeof rawAlertInstance>;
34-
21+
export type AlertInstances = Record<string, AlertInstance>;
3522
export class AlertInstance {
3623
private scheduledExecutionOptions?: ScheduledExecutionOptions;
3724
private meta: AlertInstanceMeta;

0 commit comments

Comments
 (0)