Skip to content

Commit

Permalink
[data views] Fix single quotes on field save confirm toast (#184789)
Browse files Browse the repository at this point in the history
## 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 #179506

---------

Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
  • Loading branch information
mattkime and jughosta authored Jun 5, 2024
1 parent fb0b810 commit 8a5ed87
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/kbn-i18n/GUIDELINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}''"
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8a5ed87

Please sign in to comment.