Adding PagerDuty icon to connectors cards (#60805) (#62033)

* 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>
This commit is contained in:
Mike Côté 2020-03-31 15:21:36 -04:00 committed by GitHub
parent 40ef05e436
commit 7efdcd5da9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 54 additions and 17 deletions

View file

@ -1,9 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true,
"resolveJsonModule": true
"outDir": "./target"
},
"include": [
"index.ts",

25
typings/index.d.ts vendored
View file

@ -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];
@ -37,3 +58,7 @@ type DeeplyMockedKeys<T> = {
: DeeplyMockedKeys<T[P]>;
} &
T;
type Writable<T> = {
-readonly [K in keyof T]: T[K];
};

View file

@ -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;
}

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 120.6 175" style="enable-background:new 0 0 120.6 175;" xml:space="preserve">
<style type="text/css">
.st0{fill:#06AC38;}
</style>
<g>
<rect y="128.4" class="st0" width="25.7" height="46.6"/>
<path class="st0" d="M96.5,8.6C82.8,1.2,73.2,0,50.7,0H0v106.1h25.7H29h21.5c20,0,35-1.2,48.2-10c14.4-9.5,21.9-25.4,21.9-43.8
C120.6,32.5,111.4,16.6,96.5,8.6z M56.4,83.9H25.7V22.7l29-0.2c26.4-0.2,39.6,9,39.6,30.1C94.3,75.3,77.9,83.9,56.4,83.9z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 729 B

View file

@ -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');
});
});

View file

@ -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',
{

View file

@ -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;