Skip to content

Commit

Permalink
Use connectors from config
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Mar 1, 2020
1 parent d0e5e65 commit 37afe9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@ import * as i18n from './translations';
import { ServiceNowActionConnector } from './types';
import { isUrlInvalid } from './validators';

import logo from './logos/servicenow.svg';
import { connectors } from './config';

const serviceNowDefinition = connectors.get('.servicenow')!;

interface ServiceNowActionParams {
message: string;
}

export function getActionType(): ActionTypeModel {
return {
id: '.servicenow',
iconClass: logo,
id: serviceNowDefinition.actionTypeId,
iconClass: serviceNowDefinition.logo,
selectMessage: i18n.SERVICENOW_DESC,
actionTypeTitle: i18n.SERVICENOW_TITLE,
validateConnector: (action: ServiceNowActionConnector): ValidationResult => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import styled from 'styled-components';

import * as i18n from '../translations';

import serviceNowLogo from '../../../../../lib/connectors/logos/servicenow.svg';
import { connectors as connectorsDefinition } from '../../../../../lib/connectors/config';

const ICON_SIZE = 'm';
const serviceNowDefinition = connectorsDefinition.get('.servicenow')!;

const EuiIconExtended = styled(EuiIcon)`
margin-right: 13px;
Expand All @@ -33,7 +34,7 @@ const connectors: Array<EuiSuperSelectOption<string>> = [
value: 'servicenow-connector',
inputDisplay: (
<>
<EuiIconExtended type={serviceNowLogo} size={ICON_SIZE} />
<EuiIconExtended type={serviceNowDefinition.logo} size={ICON_SIZE} />
<span>{'My ServiceNow connector'}</span>
</>
),
Expand Down

0 comments on commit 37afe9f

Please sign in to comment.