Skip to content

Commit

Permalink
Fix translations
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Apr 28, 2020
1 parent 33f5361 commit 076900f
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 56 deletions.
10 changes: 5 additions & 5 deletions x-pack/plugins/siem/public/lib/connectors/jira/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@

import { ConnectorConfiguration } from './types';

import { JIRA_TITLE } from './translations';
import * as i18n from './translations';
import logo from './logo.svg';

export const connector: ConnectorConfiguration = {
id: '.jira',
name: JIRA_TITLE,
name: i18n.JIRA_TITLE,
logo,
enabled: true,
enabledInConfig: true,
enabledInLicense: true,
minimumLicenseRequired: 'platinum',
fields: {
summary: {
label: 'Summary',
label: i18n.MAPPING_FIELD_SUMMARY,
validSourceFields: ['title', 'description'],
defaultSourceField: 'title',
defaultActionType: 'overwrite',
},
description: {
label: 'Description',
label: i18n.MAPPING_FIELD_DESC,
validSourceFields: ['title', 'description'],
defaultSourceField: 'description',
defaultActionType: 'overwrite',
},
comments: {
label: 'Comments',
label: i18n.MAPPING_FIELD_COMMENTS,
validSourceFields: ['comments'],
defaultSourceField: 'comments',
defaultActionType: 'append',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ export const JIRA_PROJECT_KEY_REQUIRED = i18n.translate(
defaultMessage: 'Project key is required',
}
);

export const MAPPING_FIELD_SUMMARY = i18n.translate(
'xpack.siem.case.configureCases.mappingFieldSummary',
{
defaultMessage: 'Summary',
}
);
10 changes: 5 additions & 5 deletions x-pack/plugins/siem/public/lib/connectors/servicenow/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@
*/

import { ConnectorConfiguration } from './types';
import { SERVICENOW_TITLE } from './translations';
import * as i18n from './translations';
import logo from './logo.svg';

export const connector: ConnectorConfiguration = {
id: '.servicenow',
name: SERVICENOW_TITLE,
name: i18n.SERVICENOW_TITLE,
logo,
enabled: true,
enabledInConfig: true,
enabledInLicense: true,
minimumLicenseRequired: 'platinum',
fields: {
short_description: {
label: 'Short Description',
label: i18n.MAPPING_FIELD_SHORT_DESC,
validSourceFields: ['title', 'description'],
defaultSourceField: 'title',
defaultActionType: 'overwrite',
},
description: {
label: 'Description',
label: i18n.MAPPING_FIELD_DESC,
validSourceFields: ['title', 'description'],
defaultSourceField: 'description',
defaultActionType: 'overwrite',
},
comments: {
label: 'Comments',
label: i18n.MAPPING_FIELD_COMMENTS,
validSourceFields: ['comments'],
defaultSourceField: 'comments',
defaultActionType: 'append',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ export const SERVICENOW_TITLE = i18n.translate(
defaultMessage: 'ServiceNow',
}
);

export const MAPPING_FIELD_SHORT_DESC = i18n.translate(
'xpack.siem.case.configureCases.mappingFieldShortDescription',
{
defaultMessage: 'Short Description',
}
);
14 changes: 14 additions & 0 deletions x-pack/plugins/siem/public/lib/connectors/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,17 @@ export const EMAIL_REQUIRED = i18n.translate(
defaultMessage: 'Email is required',
}
);

export const MAPPING_FIELD_DESC = i18n.translate(
'xpack.siem.case.configureCases.mappingFieldDescription',
{
defaultMessage: 'Description',
}
);

export const MAPPING_FIELD_COMMENTS = i18n.translate(
'xpack.siem.case.configureCases.mappingFieldComments',
{
defaultMessage: 'Comments',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,6 @@ const FieldRowWrapper = styled.div`
font-size: 14px;
`;

// const supportedThirdPartyFields: Array<EuiSuperSelectOption<ThirdPartyField>> = [
// {
// value: 'not_mapped',
// inputDisplay: <span>{i18n.FIELD_MAPPING_FIELD_NOT_MAPPED}</span>,
// 'data-test-subj': 'third-party-field-not-mapped',
// },
// {
// value: 'short_description',
// inputDisplay: <span>{i18n.FIELD_MAPPING_FIELD_SHORT_DESC}</span>,
// 'data-test-subj': 'third-party-field-short-description',
// },
// {
// value: 'comments',
// inputDisplay: <span>{i18n.FIELD_MAPPING_FIELD_COMMENTS}</span>,
// 'data-test-subj': 'third-party-field-comments',
// },
// {
// value: 'description',
// inputDisplay: <span>{i18n.FIELD_MAPPING_FIELD_DESC}</span>,
// 'data-test-subj': 'third-party-field-description',
// },
// ];

const actionTypeOptions: Array<EuiSuperSelectOption<ActionType>> = [
{
value: 'nothing',
Expand Down Expand Up @@ -88,6 +65,7 @@ const getThirdPartyOptions = (
Object.keys(thirdPartyFields)
.filter(key => thirdPartyFields[key].validSourceFields.includes(caseField))
.map(key => ({ key: key as AllThirdPartyFields, label: thirdPartyFields[key].label }))
.concat([{ key: 'not_mapped', label: i18n.MAPPING_FIELD_NOT_MAPPED }])
);

export interface FieldMappingProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,34 +159,13 @@ export const WARNING_NO_CONNECTOR_MESSAGE = i18n.translate(
}
);

export const FIELD_MAPPING_FIELD_NOT_MAPPED = i18n.translate(
'xpack.siem.case.configureCases.fieldMappingFieldNotMapped',
export const MAPPING_FIELD_NOT_MAPPED = i18n.translate(
'xpack.siem.case.configureCases.mappingFieldNotMapped',
{
defaultMessage: 'Not mapped',
}
);

export const FIELD_MAPPING_FIELD_SHORT_DESC = i18n.translate(
'xpack.siem.case.configureCases.fieldMappingFieldShortDescription',
{
defaultMessage: 'Short Description',
}
);

export const FIELD_MAPPING_FIELD_DESC = i18n.translate(
'xpack.siem.case.configureCases.fieldMappingFieldDescription',
{
defaultMessage: 'Description',
}
);

export const FIELD_MAPPING_FIELD_COMMENTS = i18n.translate(
'xpack.siem.case.configureCases.fieldMappingFieldComments',
{
defaultMessage: 'Comments',
}
);

export const UPDATE_CONNECTOR = i18n.translate('xpack.siem.case.configureCases.updateConnector', {
defaultMessage: 'Update connector',
});
Expand Down

0 comments on commit 076900f

Please sign in to comment.