Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Oct 15, 2021
1 parent 14f5aab commit 2937675
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React, { memo } from 'react';
import { EuiSpacer, EuiCallOut, EuiButtonEmpty } from '@elastic/eui';
import { EuiSpacer, EuiCallOut, EuiLink } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

Expand All @@ -31,22 +31,28 @@ const DeprecatedCalloutComponent: React.FC<Props> = ({ onMigrate }) => {
)}
>
<FormattedMessage
defaultMessage="{migrate} or create a new one."
defaultMessage="{update} {create} "
id="xpack.triggersActionsUI.components.builtinActionTypes.servicenow.appInstallationInfo"
values={{
migrate: (
<EuiButtonEmpty
onClick={onMigrate}
flush="left"
data-test-subj="update-connector-btn"
>
update: (
<EuiLink onClick={onMigrate} data-test-subj="update-connector-btn">
{i18n.translate(
'xpack.triggersActionsUI.components.builtinActionTypes.serviceNow.deprecatedCalloutMigrate',
{
defaultMessage: 'Update this connector',
}
)}
</EuiButtonEmpty>
</EuiLink>
),
create: (
<span>
{i18n.translate(
'xpack.triggersActionsUI.components.builtinActionTypes.serviceNow.deprecatedCalloutMigrate',
{
defaultMessage: 'or create a new one.',
}
)}
</span>
),
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ describe('ServiceNowActionConnectorFields renders', () => {
);

expect(services.notifications.toasts.addSuccess).toHaveBeenCalledWith({
text: 'Connector has been successfully migrated.',
title: 'Migrated connector SN',
text: 'Connector has been successfully updated.',
title: 'SN connector updated',
});

// The flyout is closed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ const ServiceNowConnectorFields: React.FC<ActionConnectorFieldsProps<ServiceNowA
setShowUpdateConnector(false);

toasts.addSuccess({
title: i18n.MIGRATION_SUCCESS_TOAST_TITLE(action.name),
text: i18n.MIGRATION_SUCCESS_TOAST_TEXT,
title: i18n.UPDATE_SUCCESS_TOAST_TITLE(action.name),
text: i18n.UPDATE_SUCCESS_TOAST_TEXT,
});
} catch (err) {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,21 +197,21 @@ export const INSTALLATION_CALLOUT_TITLE = i18n.translate(
}
);

export const MIGRATION_SUCCESS_TOAST_TITLE = (connectorName: string) =>
export const UPDATE_SUCCESS_TOAST_TITLE = (connectorName: string) =>
i18n.translate(
'xpack.triggersActionsUI.components.builtinActionTypes.servicenow.migrationSuccessToastTitle',
'xpack.triggersActionsUI.components.builtinActionTypes.servicenow.updateSuccessToastTitle',
{
defaultMessage: 'Migrated connector {connectorName}',
defaultMessage: '{connectorName} connector updated',
values: {
connectorName,
},
}
);

export const MIGRATION_SUCCESS_TOAST_TEXT = i18n.translate(
'xpack.triggersActionsUI.components.builtinActionTypes.servicenow.installationCalloutText',
export const UPDATE_SUCCESS_TOAST_TEXT = i18n.translate(
'xpack.triggersActionsUI.components.builtinActionTypes.servicenow.updateCalloutText',
{
defaultMessage: 'Connector has been successfully migrated.',
defaultMessage: 'Connector has been successfully updated.',
}
);

Expand Down

0 comments on commit 2937675

Please sign in to comment.