Skip to content

Commit 60294cb

Browse files
authored
Update saved object management UI text (#76826)
1 parent 1ea58d9 commit 60294cb

File tree

24 files changed

+162
-137
lines changed

24 files changed

+162
-137
lines changed

src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/header.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ describe('Flyout', () => {
267267

268268
expect(component.state('status')).toBe('success');
269269
expect(component.find('EuiFlyout ImportSummary')).toMatchSnapshot();
270+
const cancelButton = await component.find(
271+
'EuiButtonEmpty[data-test-subj="importSavedObjectsCancelBtn"]'
272+
);
273+
expect(cancelButton.prop('disabled')).toBe(true);
270274
});
271275
});
272276

src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ export class Flyout extends Component<FlyoutProps, FlyoutState> {
729729
label={
730730
<FormattedMessage
731731
id="savedObjectsManagement.objectsTable.flyout.selectFileToImportFormRowLabel"
732-
defaultMessage="Please select a file to import"
732+
defaultMessage="Select a file to import"
733733
/>
734734
}
735735
>
@@ -756,7 +756,7 @@ export class Flyout extends Component<FlyoutProps, FlyoutState> {
756756
}
757757

758758
renderFooter() {
759-
const { status } = this.state;
759+
const { isLegacyFile, status } = this.state;
760760
const { done, close } = this.props;
761761

762762
let confirmButton;
@@ -773,7 +773,7 @@ export class Flyout extends Component<FlyoutProps, FlyoutState> {
773773
} else if (this.hasUnmatchedReferences) {
774774
confirmButton = (
775775
<EuiButton
776-
onClick={this.state.isLegacyFile ? this.confirmLegacyImport : this.resolveImportErrors}
776+
onClick={isLegacyFile ? this.confirmLegacyImport : this.resolveImportErrors}
777777
size="s"
778778
fill
779779
isLoading={status === 'loading'}
@@ -788,7 +788,7 @@ export class Flyout extends Component<FlyoutProps, FlyoutState> {
788788
} else {
789789
confirmButton = (
790790
<EuiButton
791-
onClick={this.state.isLegacyFile ? this.legacyImport : this.import}
791+
onClick={isLegacyFile ? this.legacyImport : this.import}
792792
size="s"
793793
fill
794794
isLoading={status === 'loading'}
@@ -805,7 +805,12 @@ export class Flyout extends Component<FlyoutProps, FlyoutState> {
805805
return (
806806
<EuiFlexGroup justifyContent="spaceBetween">
807807
<EuiFlexItem grow={false}>
808-
<EuiButtonEmpty onClick={close} size="s">
808+
<EuiButtonEmpty
809+
onClick={close}
810+
size="s"
811+
disabled={status === 'loading' || (isLegacyFile === false && status === 'success')}
812+
data-test-subj="importSavedObjectsCancelBtn"
813+
>
809814
<FormattedMessage
810815
id="savedObjectsManagement.objectsTable.flyout.import.cancelButtonLabel"
811816
defaultMessage="Cancel"

src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@ export const Header = ({
101101
<EuiTextColor color="subdued">
102102
<FormattedMessage
103103
id="savedObjectsManagement.objectsTable.howToDeleteSavedObjectsDescription"
104-
defaultMessage="From here you can delete saved objects, such as saved searches.
105-
You can also edit the raw data of saved objects.
106-
Typically objects are only modified via their associated application,
107-
which is probably what you should use instead of this screen."
104+
defaultMessage="Manage and share your saved objects. To edit the underlying data of an object, go to its associated application."
108105
/>
109106
</EuiTextColor>
110107
</p>

src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ const createNewCopiesDisabled = {
5151
tooltip: i18n.translate(
5252
'savedObjectsManagement.objectsTable.importModeControl.createNewCopies.disabledText',
5353
{
54-
defaultMessage:
55-
'Check if each object was previously copied or imported into the destination space.',
54+
defaultMessage: 'Check if objects were previously copied or imported.',
5655
}
5756
),
5857
};
@@ -64,21 +63,23 @@ const createNewCopiesEnabled = {
6463
),
6564
tooltip: i18n.translate(
6665
'savedObjectsManagement.objectsTable.importModeControl.createNewCopies.enabledText',
67-
{ defaultMessage: 'All imported objects will be created with new random IDs.' }
66+
{
67+
defaultMessage: 'Use this option to create one or more copies of the object.',
68+
}
6869
),
6970
};
7071
const overwriteEnabled = {
7172
id: 'overwriteEnabled',
7273
label: i18n.translate(
7374
'savedObjectsManagement.objectsTable.importModeControl.overwrite.enabledLabel',
74-
{ defaultMessage: 'Automatically try to overwrite conflicts' }
75+
{ defaultMessage: 'Automatically overwrite conflicts' }
7576
),
7677
};
7778
const overwriteDisabled = {
7879
id: 'overwriteDisabled',
7980
label: i18n.translate(
8081
'savedObjectsManagement.objectsTable.importModeControl.overwrite.disabledLabel',
81-
{ defaultMessage: 'Request action when conflict occurs' }
82+
{ defaultMessage: 'Request action on conflict' }
8283
),
8384
};
8485
const importOptionsTitle = i18n.translate(

src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('ImportSummary', () => {
7070
const wrapper = shallowWithI18nProvider(<ImportSummary {...props} />);
7171

7272
expect(findHeader(wrapper).childAt(0).props()).toEqual(
73-
expect.objectContaining({ values: { importCount: 1 } })
73+
expect.not.objectContaining({ values: expect.anything() }) // no importCount for singular
7474
);
7575
const countCreated = findCountCreated(wrapper);
7676
expect(countCreated).toHaveLength(1);
@@ -90,7 +90,7 @@ describe('ImportSummary', () => {
9090
const wrapper = shallowWithI18nProvider(<ImportSummary {...props} />);
9191

9292
expect(findHeader(wrapper).childAt(0).props()).toEqual(
93-
expect.objectContaining({ values: { importCount: 1 } })
93+
expect.not.objectContaining({ values: expect.anything() }) // no importCount for singular
9494
);
9595
expect(findCountCreated(wrapper)).toHaveLength(0);
9696
const countOverwritten = findCountOverwritten(wrapper);
@@ -110,7 +110,7 @@ describe('ImportSummary', () => {
110110
const wrapper = shallowWithI18nProvider(<ImportSummary {...props} />);
111111

112112
expect(findHeader(wrapper).childAt(0).props()).toEqual(
113-
expect.objectContaining({ values: { importCount: 1 } })
113+
expect.not.objectContaining({ values: expect.anything() }) // no importCount for singular
114114
);
115115
expect(findCountCreated(wrapper)).toHaveLength(0);
116116
expect(findCountOverwritten(wrapper)).toHaveLength(0);

src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const getCountIndicators = (importItems: ImportItem[]) => {
141141
);
142142
};
143143

144-
const getStatusIndicator = ({ outcome, errorMessage }: ImportItem) => {
144+
const getStatusIndicator = ({ outcome, errorMessage = 'Error' }: ImportItem) => {
145145
switch (outcome) {
146146
case 'created':
147147
return (
@@ -168,8 +168,8 @@ const getStatusIndicator = ({ outcome, errorMessage }: ImportItem) => {
168168
type={'alert'}
169169
color={'danger'}
170170
content={i18n.translate('savedObjectsManagement.importSummary.errorOutcomeLabel', {
171-
defaultMessage: 'Error{message}',
172-
values: { message: errorMessage ? `: ${errorMessage}` : '' },
171+
defaultMessage: '{errorMessage}',
172+
values: { errorMessage },
173173
})}
174174
/>
175175
);
@@ -194,11 +194,18 @@ export const ImportSummary = ({ failedImports, successfulImports }: ImportSummar
194194
}
195195
>
196196
<h3>
197-
<FormattedMessage
198-
id="savedObjectsManagement.importSummary.headerLabel"
199-
defaultMessage="{importCount} object(s) imported"
200-
values={{ importCount: importItems.length }}
201-
/>
197+
{importItems.length === 1 ? (
198+
<FormattedMessage
199+
id="savedObjectsManagement.importSummary.headerLabelSingular"
200+
defaultMessage="1 object imported"
201+
/>
202+
) : (
203+
<FormattedMessage
204+
id="savedObjectsManagement.importSummary.headerLabelPlural"
205+
defaultMessage="{importCount} objects imported"
206+
values={{ importCount: importItems.length }}
207+
/>
208+
)}
202209
</h3>
203210
</EuiTitle>
204211
<EuiSpacer size="m" />

src/plugins/saved_objects_management/public/management_section/objects_table/components/overwrite_modal.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('OverwriteModal', () => {
4040
const wrapper = shallowWithI18nProvider(<OverwriteModal {...props} />);
4141

4242
expect(wrapper.find('p').text()).toMatchInlineSnapshot(
43-
`"\\"baz\\" conflicts with an existing object, are you sure you want to overwrite it?"`
43+
`"\\"baz\\" conflicts with an existing object. Overwrite it?"`
4444
);
4545
expect(wrapper.find('EuiSuperSelect')).toHaveLength(0);
4646
});
@@ -82,7 +82,7 @@ describe('OverwriteModal', () => {
8282
const wrapper = shallowWithI18nProvider(<OverwriteModal {...props} />);
8383

8484
expect(wrapper.find('p').text()).toMatchInlineSnapshot(
85-
`"\\"baz\\" conflicts with multiple existing objects, do you want to overwrite one of them?"`
85+
`"\\"baz\\" conflicts with multiple existing objects. Overwrite one?"`
8686
);
8787
expect(wrapper.find('EuiSuperSelect')).toHaveLength(1);
8888
});

src/plugins/saved_objects_management/public/management_section/objects_table/components/overwrite_modal.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,13 @@ export const OverwriteModal = ({ conflict, onFinish }: OverwriteModalProps) => {
9898
const bodyText =
9999
error.type === 'conflict'
100100
? i18n.translate('savedObjectsManagement.objectsTable.overwriteModal.body.conflict', {
101-
defaultMessage:
102-
'"{title}" conflicts with an existing object, are you sure you want to overwrite it?',
101+
defaultMessage: '"{title}" conflicts with an existing object. Overwrite it?',
103102
values: { title },
104103
})
105104
: i18n.translate(
106105
'savedObjectsManagement.objectsTable.overwriteModal.body.ambiguousConflict',
107106
{
108-
defaultMessage:
109-
'"{title}" conflicts with multiple existing objects, do you want to overwrite one of them?',
107+
defaultMessage: '"{title}" conflicts with multiple existing objects. Overwrite one?',
110108
values: { title },
111109
}
112110
);

0 commit comments

Comments
 (0)