Skip to content

Commit

Permalink
Revert "revert siem changes"
Browse files Browse the repository at this point in the history
This reverts commit f1ffe64.
  • Loading branch information
gmmorris committed May 6, 2020
1 parent 687607e commit 12e8da4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 24 deletions.
3 changes: 3 additions & 0 deletions x-pack/plugins/siem/public/lib/connectors/jira/flyout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,6 @@ export const JiraConnectorFlyout = withConnectorFlyout<JiraActionConnector>({
configKeys: ['projectKey'],
connectorActionTypeId: '.jira',
});

// eslint-disable-next-line import/no-default-export
export { JiraConnectorFlyout as default };
4 changes: 2 additions & 2 deletions x-pack/plugins/siem/public/lib/connectors/jira/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { lazy } from 'react';
import {
ValidationResult,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
Expand All @@ -13,7 +14,6 @@ import { connector } from './config';
import { createActionType } from '../utils';
import logo from './logo.svg';
import { JiraActionConnector } from './types';
import { JiraConnectorFlyout } from './flyout';
import * as i18n from './translations';

interface Errors {
Expand Down Expand Up @@ -50,5 +50,5 @@ export const getActionType = createActionType({
selectMessage: i18n.JIRA_DESC,
actionTypeTitle: connector.name,
validateConnector,
actionConnectorFields: JiraConnectorFlyout,
actionConnectorFields: lazy(() => import('./flyout')),
});
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ export const ServiceNowConnectorFlyout = withConnectorFlyout<ServiceNowActionCon
secretKeys: ['username', 'password'],
connectorActionTypeId: '.servicenow',
});

// eslint-disable-next-line import/no-default-export
export { ServiceNowConnectorFlyout as default };
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { lazy } from 'react';
import {
ValidationResult,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../../../triggers_actions_ui/public/types';

import { connector } from './config';
import { createActionType } from '../utils';
import logo from './logo.svg';
import { ServiceNowActionConnector } from './types';
import { ServiceNowConnectorFlyout } from './flyout';
import * as i18n from './translations';

interface Errors {
Expand Down Expand Up @@ -44,5 +43,5 @@ export const getActionType = createActionType({
selectMessage: i18n.SERVICENOW_DESC,
actionTypeTitle: connector.name,
validateConnector,
actionConnectorFields: ServiceNowConnectorFlyout,
actionConnectorFields: lazy(() => import('./flyout')),
});
12 changes: 1 addition & 11 deletions x-pack/plugins/siem/public/lib/connectors/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import {
ActionTypeModel,
ValidationResult,
ActionParamsProps,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../../triggers_actions_ui/public/types';

Expand All @@ -31,7 +30,7 @@ export const createActionType = ({
validateConnector,
validateParams = connectorParamsValidator,
actionConnectorFields,
actionParamsFields = ConnectorParamsFields,
actionParamsFields = null,
}: Optional<ActionTypeModel, 'validateParams' | 'actionParamsFields'>) => (): ActionTypeModel => {
return {
id,
Expand Down Expand Up @@ -59,15 +58,6 @@ export const createActionType = ({
};
};

const ConnectorParamsFields: React.FunctionComponent<ActionParamsProps<ActionConnectorParams>> = ({
actionParams,
editAction,
index,
errors,
}) => {
return null;
};

const connectorParamsValidator = (actionParams: ActionConnectorParams): ValidationResult => {
return { errors: {} };
};
Expand Down
14 changes: 6 additions & 8 deletions x-pack/plugins/triggers_actions_ui/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ export interface ActionTypeModel<ActionConnector = any, ActionParams = any> {
actionTypeTitle?: string;
validateConnector: (connector: any) => ValidationResult;
validateParams: (actionParams: any) => ValidationResult;
actionConnectorFields:
| React.FunctionComponent<any>
| React.LazyExoticComponent<ComponentType<ActionConnectorFieldsProps<ActionConnector>>>
| null;
actionParamsFields:
| React.FunctionComponent<any>
| React.LazyExoticComponent<ComponentType<ActionParamsProps<ActionParams>>>
| null;
actionConnectorFields: React.LazyExoticComponent<
ComponentType<ActionConnectorFieldsProps<ActionConnector>>
> | null;
actionParamsFields: React.LazyExoticComponent<
ComponentType<ActionParamsProps<ActionParams>>
> | null;
}

export interface ValidationResult {
Expand Down

0 comments on commit 12e8da4

Please sign in to comment.