Skip to content

Commit

Permalink
Adding PagerDuty icon to connectors cards (#60805) (#62034)
Browse files Browse the repository at this point in the history
* adding PagerDuty icon to connectors cards

* Fix jest

* remove unnecessary global typings from canvas and sync global typings in xpack with oss

Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
4 people authored Mar 31, 2020
1 parent 32c927d commit 27a783e
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 17 deletions.
4 changes: 1 addition & 3 deletions examples/alerting_example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true,
"resolveJsonModule": true
"outDir": "./target"
},
"include": [
"index.ts",
Expand Down
25 changes: 25 additions & 0 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> = {
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
}[keyof T];
Expand All @@ -37,3 +58,7 @@ type DeeplyMockedKeys<T> = {
: DeeplyMockedKeys<T[P]>;
} &
T;

type Writable<T> = {
-readonly [K in keyof T]: T[K];
};
12 changes: 0 additions & 12 deletions x-pack/legacy/plugins/canvas/types/webpack.d.ts

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand Down
12 changes: 12 additions & 0 deletions x-pack/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 27a783e

Please sign in to comment.