Skip to content

Commit

Permalink
fixed due to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Apr 9, 2020
1 parent 3ca6b61 commit ba19515
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,18 @@ export const ActionForm = ({
});
}
}
const preconfiguredMessage = i18n.translate(
'xpack.triggersActionsUI.sections.alertForm.preconfiguredTitleMessage',
{
defaultMessage: '(pre-configured)',
}
);
const getSelectedOptions = (actionItemId: string) => {
const val = connectors.find(connector => connector.id === actionItemId);
if (!val) {
return [];
}
const optionTitle = `${val.name}${val.isPreconfigured ? '(pre-configured)' : ''}`;
const optionTitle = `${val.name}${val.isPreconfigured ? preconfiguredMessage : ''}`;
return [
{
label: optionTitle,
Expand Down Expand Up @@ -266,7 +272,7 @@ export const ActionForm = ({
id="xpack.triggersActionsUI.sections.alertForm.selectAlertActionTypeEditTitle"
values={{
actionConnectorName: `${actionConnector.name}${
actionConnector.isPreconfigured ? '(pre-configured)' : ''
actionConnector.isPreconfigured ? preconfiguredMessage : ''
}`,
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const PreconfiguredConnectorFlyout = ({
const actionTypeModel = actionTypeRegistry.get(initialConnector.actionTypeId);

return (
<EuiFlyout onClose={closeFlyout} aria-labelledby="flyoutActionAddTitle" size="m">
<EuiFlyout onClose={closeFlyout} aria-labelledby="flyoutPreconfiguredtActionTitle" size="m">
<EuiFlyoutHeader hasBorder>
<EuiFlexGroup gutterSize="s" alignItems="center">
{actionTypeModel ? (
Expand All @@ -66,7 +66,7 @@ export const PreconfiguredConnectorFlyout = ({
tooltipContent={i18n.translate(
'xpack.triggersActionsUI.sections.preconfiguredConnectorForm.tooltipContent',
{
defaultMessage: 'This connector is preconfigured and not allowed to edit',
defaultMessage: 'This connector is preconfigured and cannot be edited',
}
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,12 @@ export const ActionsConnectorsList: React.FunctionComponent = () => {
<EuiFlexGroup justifyContent="flexEnd" alignItems="flexEnd">
<EuiFlexItem grow={false}>
<EuiBetaBadge
label="Pre-configured"
label={i18n.translate(
'xpack.triggersActionsUI.sections.alertForm.preconfiguredTitleMessage',
{
defaultMessage: 'Pre-configured',
}
)}
tooltipContent="This connector is not allowed to delete."
/>
</EuiFlexItem>
Expand Down

0 comments on commit ba19515

Please sign in to comment.