From e8a0645c4e2bc769ad67a5c04b30ef5b572d4e7f Mon Sep 17 00:00:00 2001 From: Andrea Del Rio Date: Thu, 19 Mar 2020 12:15:34 -0700 Subject: [PATCH 1/3] adding PagerDuty icon to connectors cards --- .../components/builtin_action_types/pagerduty.svg | 13 +++++++++++++ .../components/builtin_action_types/pagerduty.tsx | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty.svg diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty.svg b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty.svg new file mode 100644 index 0000000000000..b11dcb3570c26 --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty.svg @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty.tsx index 7666129e4abdc..b9561854b4029 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty.tsx @@ -25,11 +25,12 @@ import { ActionParamsProps, } from '../../../types'; import { PagerDutyActionParams, PagerDutyActionConnector } from './types'; +import pagerDutySvg from './pagerduty.svg'; export function getActionType(): ActionTypeModel { return { id: '.pagerduty', - iconClass: 'apps', + iconClass: pagerDutySvg, selectMessage: i18n.translate( 'xpack.triggersActionsUI.components.builtinActionTypes.pagerDutyAction.selectMessageText', { From bdbfcf30a19e68ee6113b77b615af62d5cc09c22 Mon Sep 17 00:00:00 2001 From: Mike Cote Date: Sat, 21 Mar 2020 15:51:14 -0400 Subject: [PATCH 2/3] Fix jest --- .../components/builtin_action_types/pagerduty.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty.test.tsx index bb06f7961b20b..7da97b9fe3436 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty.test.tsx @@ -30,7 +30,7 @@ beforeAll(() => { describe('actionTypeRegistry.get() works', () => { test('action type static data is as expected', () => { expect(actionTypeModel.id).toEqual(ACTION_TYPE_ID); - expect(actionTypeModel.iconClass).toEqual('apps'); + expect(actionTypeModel.iconClass).toEqual('test-file-stub'); }); }); From fdd6fea56e84f0c4bad7d1995bd445cdb71e8832 Mon Sep 17 00:00:00 2001 From: spalger Date: Thu, 26 Mar 2020 13:55:04 -0700 Subject: [PATCH 3/3] remove unnecessary global typings from canvas and sync global typings in xpack with oss --- examples/alerting_example/tsconfig.json | 4 +-- typings/index.d.ts | 25 +++++++++++++++++++ .../legacy/plugins/canvas/types/webpack.d.ts | 12 --------- x-pack/typings/index.d.ts | 12 +++++++++ 4 files changed, 38 insertions(+), 15 deletions(-) delete mode 100644 x-pack/legacy/plugins/canvas/types/webpack.d.ts diff --git a/examples/alerting_example/tsconfig.json b/examples/alerting_example/tsconfig.json index 078522b36cb12..fbcec9de439bd 100644 --- a/examples/alerting_example/tsconfig.json +++ b/examples/alerting_example/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true, - "resolveJsonModule": true + "outDir": "./target" }, "include": [ "index.ts", diff --git a/typings/index.d.ts b/typings/index.d.ts index 1c58a92a046df..6d97aca4024c3 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -23,6 +23,27 @@ declare module '*.html' { export default template; } +declare module '*.png' { + const content: string; + // eslint-disable-next-line import/no-default-export + export default content; +} + +declare module '*.svg' { + const content: string; + // eslint-disable-next-line import/no-default-export + export default content; +} + +// allow JSON files to be imported directly without lint errors +// see: https://github.com/palantir/tslint/issues/1264#issuecomment-228433367 +// and: https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#arbitrary-expressions-are-forbidden-in-export-assignments-in-ambient-contexts +declare module '*.json' { + const json: any; + // eslint-disable-next-line import/no-default-export + export default json; +} + type MethodKeysOf = { [K in keyof T]: T[K] extends (...args: any[]) => any ? K : never; }[keyof T]; @@ -37,3 +58,7 @@ type DeeplyMockedKeys = { : DeeplyMockedKeys; } & T; + +type Writable = { + -readonly [K in keyof T]: T[K]; +}; diff --git a/x-pack/legacy/plugins/canvas/types/webpack.d.ts b/x-pack/legacy/plugins/canvas/types/webpack.d.ts deleted file mode 100644 index 8158071e76f08..0000000000000 --- a/x-pack/legacy/plugins/canvas/types/webpack.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -declare module '*.png'; - -declare module '*.svg' { - const content: string; - export = content; -} diff --git a/x-pack/typings/index.d.ts b/x-pack/typings/index.d.ts index 7696ddbfd73cb..1bf1370ad467f 100644 --- a/x-pack/typings/index.d.ts +++ b/x-pack/typings/index.d.ts @@ -10,6 +10,18 @@ declare module '*.html' { export default template; } +declare module '*.png' { + const content: string; + // eslint-disable-next-line import/no-default-export + export default content; +} + +declare module '*.svg' { + const content: string; + // eslint-disable-next-line import/no-default-export + export default content; +} + declare module 'lodash/internal/toPath' { function toPath(value: string | string[]): string[]; export = toPath;