[data views] Fix single quotes on field save confirm toast (#184789)

## Summary

Address two cases where single quotes needed to be doubled up to prevent
escaping of string interpolation. Also addressed some doc examples.

Verify confirm toasts after saving field in discover and creating a
scripted field in data view management.

Follow up to https://github.com/elastic/kibana/pull/179506

---------

Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
This commit is contained in:
Matthew Kime 2024-06-05 07:09:51 -05:00 committed by GitHub
parent fb0b81086a
commit 8a5ed874af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View file

@ -58,8 +58,8 @@ Messages can contain placeholders for embedding a value of a variable. For examp
```js
{
'kbn.management.editIndexPattern.scripted.deleteFieldLabel': "Delete scripted field '{fieldName}'?"
'kbn.management.editIndexPattern.scripted.noFieldLabel': "'{indexPatternTitle}' index pattern doesn't have a scripted field called '{fieldName}'"
'kbn.management.editIndexPattern.scripted.deleteFieldLabel': "Delete scripted field ''{fieldName}''?"
'kbn.management.editIndexPattern.scripted.noFieldLabel': "''{indexPatternTitle}'' index pattern doesn't have a scripted field called ''{fieldName}''"
}
```

View file

@ -253,7 +253,7 @@ export class PreviewController {
const afterSave = () => {
const message = i18n.translate('indexPatternFieldEditor.deleteField.savedHeader', {
defaultMessage: "Saved '{fieldName}'",
defaultMessage: "Saved ''{fieldName}''",
values: { fieldName: updatedField.name },
});
this.deps.notifications.toasts.addSuccess(message);

View file

@ -50,7 +50,7 @@ export const CreateEditField = withRouter(
if (mode === 'edit' && !spec) {
const message = i18n.translate('indexPatternManagement.editDataView.scripted.noFieldLabel', {
defaultMessage:
"'{dataViewTitle}' data view doesn't have a scripted field called '{fieldName}'",
"''{dataViewTitle}'' data view doesn't have a scripted field called ''{fieldName}''",
values: { dataViewTitle: indexPattern.title, fieldName },
});
notifications.toasts.addWarning(message);