Skip to content

Commit

Permalink
Update saved object management UI text
Browse files Browse the repository at this point in the history
  • Loading branch information
jportner committed Sep 4, 2020
1 parent fef21ab commit 84cc53a
Show file tree
Hide file tree
Showing 23 changed files with 92 additions and 91 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ export class Flyout extends Component<FlyoutProps, FlyoutState> {
label={
<FormattedMessage
id="savedObjectsManagement.objectsTable.flyout.selectFileToImportFormRowLabel"
defaultMessage="Please select a file to import"
defaultMessage="Select a file to import"
/>
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ export const Header = ({
<EuiTextColor color="subdued">
<FormattedMessage
id="savedObjectsManagement.objectsTable.howToDeleteSavedObjectsDescription"
defaultMessage="From here you can delete saved objects, such as saved searches.
You can also edit the raw data of saved objects.
Typically objects are only modified via their associated application,
which is probably what you should use instead of this screen."
defaultMessage="Manage and share your saved objects. To edit the underlying data of an object, go to its associated application."
/>
</EuiTextColor>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ const createNewCopiesDisabled = {
tooltip: i18n.translate(
'savedObjectsManagement.objectsTable.importModeControl.createNewCopies.disabledText',
{
defaultMessage:
'Check if each object was previously copied or imported into the destination space.',
defaultMessage: 'Check if objects were previously copied or imported into the space.',
}
),
};
Expand All @@ -64,21 +63,24 @@ const createNewCopiesEnabled = {
),
tooltip: i18n.translate(
'savedObjectsManagement.objectsTable.importModeControl.createNewCopies.enabledText',
{ defaultMessage: 'All imported objects will be created with new random IDs.' }
{
defaultMessage:
'This option enables you to create multiple copies of the object in the same space.',
}
),
};
const overwriteEnabled = {
id: 'overwriteEnabled',
label: i18n.translate(
'savedObjectsManagement.objectsTable.importModeControl.overwrite.enabledLabel',
{ defaultMessage: 'Automatically try to overwrite conflicts' }
{ defaultMessage: 'Automatically overwrite conflicts' }
),
};
const overwriteDisabled = {
id: 'overwriteDisabled',
label: i18n.translate(
'savedObjectsManagement.objectsTable.importModeControl.overwrite.disabledLabel',
{ defaultMessage: 'Request action when conflict occurs' }
{ defaultMessage: 'Request action on conflict' }
),
};
const importOptionsTitle = i18n.translate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('ImportSummary', () => {
const wrapper = shallowWithI18nProvider(<ImportSummary {...props} />);

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

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

expect(findHeader(wrapper).childAt(0).props()).toEqual(
expect.objectContaining({ values: { importCount: 1 } })
expect.not.objectContaining({ values: expect.anything() }) // no importCount for singular
);
expect(findCountCreated(wrapper)).toHaveLength(0);
expect(findCountOverwritten(wrapper)).toHaveLength(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const getCountIndicators = (importItems: ImportItem[]) => {
);
};

const getStatusIndicator = ({ outcome, errorMessage }: ImportItem) => {
const getStatusIndicator = ({ outcome, errorMessage = 'Error' }: ImportItem) => {
switch (outcome) {
case 'created':
return (
Expand All @@ -168,8 +168,8 @@ const getStatusIndicator = ({ outcome, errorMessage }: ImportItem) => {
type={'alert'}
color={'danger'}
content={i18n.translate('savedObjectsManagement.importSummary.errorOutcomeLabel', {
defaultMessage: 'Error{message}',
values: { message: errorMessage ? `: ${errorMessage}` : '' },
defaultMessage: '{errorMessage}',
values: { errorMessage },
})}
/>
);
Expand All @@ -194,11 +194,18 @@ export const ImportSummary = ({ failedImports, successfulImports }: ImportSummar
}
>
<h3>
<FormattedMessage
id="savedObjectsManagement.importSummary.headerLabel"
defaultMessage="{importCount} object(s) imported"
values={{ importCount: importItems.length }}
/>
{importItems.length === 1 ? (
<FormattedMessage
id="savedObjectsManagement.importSummary.headerLabelSingular"
defaultMessage="1 object imported"
/>
) : (
<FormattedMessage
id="savedObjectsManagement.importSummary.headerLabelPlural"
defaultMessage="{importCount} objects imported"
values={{ importCount: importItems.length }}
/>
)}
</h3>
</EuiTitle>
<EuiSpacer size="m" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('OverwriteModal', () => {
const wrapper = shallowWithI18nProvider(<OverwriteModal {...props} />);

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

expect(wrapper.find('p').text()).toMatchInlineSnapshot(
`"\\"baz\\" conflicts with multiple existing objects, do you want to overwrite one of them?"`
`"\\"baz\\" conflicts with multiple existing objects, overwrite one?"`
);
expect(wrapper.find('EuiSuperSelect')).toHaveLength(1);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,13 @@ export const OverwriteModal = ({ conflict, onFinish }: OverwriteModalProps) => {
const bodyText =
error.type === 'conflict'
? i18n.translate('savedObjectsManagement.objectsTable.overwriteModal.body.conflict', {
defaultMessage:
'"{title}" conflicts with an existing object, are you sure you want to overwrite it?',
defaultMessage: '"{title}" conflicts with an existing object, overwrite it?',
values: { title },
})
: i18n.translate(
'savedObjectsManagement.objectsTable.overwriteModal.body.ambiguousConflict',
{
defaultMessage:
'"{title}" conflicts with multiple existing objects, do you want to overwrite one of them?',
defaultMessage: '"{title}" conflicts with multiple existing objects, overwrite one?',
values: { title },
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ const createNewCopiesDisabled = {
tooltip: i18n.translate(
'xpack.spaces.management.copyToSpace.copyModeControl.createNewCopies.disabledText',
{
defaultMessage:
'Check if each object was previously copied or imported into the destination space.',
defaultMessage: 'Check if objects were previously copied or imported into the space.',
}
),
};
Expand All @@ -50,33 +49,36 @@ const createNewCopiesEnabled = {
),
tooltip: i18n.translate(
'xpack.spaces.management.copyToSpace.copyModeControl.createNewCopies.enabledText',
{ defaultMessage: 'All copied objects will be created with new random IDs.' }
{
defaultMessage:
'This option enables you to create multiple copies of the object in the same space.',
}
),
};
const overwriteEnabled = {
id: 'overwriteEnabled',
label: i18n.translate(
'xpack.spaces.management.copyToSpace.copyModeControl.overwrite.enabledLabel',
{ defaultMessage: 'Automatically try to overwrite conflicts' }
{ defaultMessage: 'Automatically overwrite conflicts' }
),
};
const overwriteDisabled = {
id: 'overwriteDisabled',
label: i18n.translate(
'xpack.spaces.management.copyToSpace.copyModeControl.overwrite.disabledLabel',
{ defaultMessage: 'Request action when conflict occurs' }
{ defaultMessage: 'Request action on conflict' }
),
};
const includeRelated = {
id: 'includeRelated',
text: i18n.translate('xpack.spaces.management.copyToSpace.copyModeControl.includeRelated.title', {
defaultMessage: 'Include related saved objects',
defaultMessage: 'Include related objects',
}),
tooltip: i18n.translate(
'xpack.spaces.management.copyToSpace.copyModeControl.includeRelated.text',
{
defaultMessage:
'This will copy any other objects this has references to -- for example, a dashboard may have references to multiple visualizations.',
'Copy this object and its related objects. For dashboards, related visualizations, index patterns, and saved searches are also copied.',
}
),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ export const CopyStatusIndicator = (props: Props) => {
// the object was overwritten
<FormattedMessage
id="xpack.spaces.management.copyToSpace.copyStatus.successAutomaticOverwriteMessage"
defaultMessage="Saved object overwritten successfully."
defaultMessage="Object was overwritten."
/>
) : (
// the object was not overwritten
<FormattedMessage
id="xpack.spaces.management.copyToSpace.copyStatus.successMessage"
defaultMessage="Saved object copied successfully."
defaultMessage="Object was copied."
/>
);
return <EuiIconTip type={'checkInCircleFilled'} color={'success'} content={message} />;
Expand All @@ -53,19 +53,19 @@ export const CopyStatusIndicator = (props: Props) => {
// this is an "automatic overwrite", e.g., the "Overwrite all conflicts" option was selected
<FormattedMessage
id="xpack.spaces.management.copyToSpace.copyStatus.pendingAutomaticOverwriteMessage"
defaultMessage="Saved object will be overwritten."
defaultMessage="Object will be overwritten."
/>
) : pendingObjectRetry?.overwrite ? (
// this is a manual overwrite, e.g., the individual "Overwrite?" switch was enabled
<FormattedMessage
id="xpack.spaces.management.copyToSpace.copyStatus.pendingOverwriteMessage"
defaultMessage="Saved object will be overwritten. Disable 'Overwrite' to cancel this operation."
defaultMessage="Object will be overwritten. Disable to skip."
/>
) : (
// this object is pending success, but it will not result in an overwrite
<FormattedMessage
id="xpack.spaces.management.copyToSpace.copyStatus.pendingMessage"
defaultMessage="Saved object will be copied."
defaultMessage="Object will be copied."
/>
);
return <EuiIconTip type={'check'} color={'warning'} content={message} />;
Expand Down Expand Up @@ -96,15 +96,7 @@ export const CopyStatusIndicator = (props: Props) => {
<Fragment>
<FormattedMessage
id="xpack.spaces.management.copyToSpace.copyStatus.conflictsMessage"
defaultMessage="A saved object with a matching id ({id}) already exists in this space."
values={{
id: objectResult.conflict!.obj.id,
}}
/>
<EuiSpacer />
<FormattedMessage
id="xpack.spaces.management.copyToSpace.copyStatus.conflictsOverwriteMessage"
defaultMessage="Enable 'Overwrite' to replace this version with the copied one."
defaultMessage="An object with this ID already exists in this space. Enable ‘Overwrite’ to replace the existing object."
/>
</Fragment>
}
Expand All @@ -121,17 +113,17 @@ export const CopyStatusIndicator = (props: Props) => {
overwrite ? (
<FormattedMessage
id="xpack.spaces.management.copyToSpace.copyStatus.missingReferencesAutomaticOverwriteMessage"
defaultMessage="This object has missing references; it will be overwritten, but one or more of its references are broken."
defaultMessage="This object will be overwritten, but one or more references are missing."
/>
) : conflict ? (
<FormattedMessage
id="xpack.spaces.management.copyToSpace.copyStatus.missingReferencesOverwriteMessage"
defaultMessage="This object has missing references; it will be overwritten, but one or more of its references are broken. Disable 'Overwrite' to cancel this operation."
defaultMessage="This object will be overwritten, but one or more references are missing. Disable to skip."
/>
) : (
<FormattedMessage
id="xpack.spaces.management.copyToSpace.copyStatus.missingReferencesMessage"
defaultMessage="Saved object has missing references; it will be copied, but one or more of its references are broken."
defaultMessage="This object will be copied, but one or more references are missing."
/>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const renderIcon = (props: Props) => {
content={
<FormattedMessage
id="xpack.spaces.management.copyToSpace.copyStatusSummary.successMessage"
defaultMessage="Copied successfully to the {space} space."
defaultMessage="Copy to the {space} space was successful."
values={{ space: space.name }}
/>
}
Expand Down Expand Up @@ -93,7 +93,7 @@ const renderIcon = (props: Props) => {
content={
<FormattedMessage
id="xpack.spaces.management.copyToSpace.copyStatusSummary.missingReferencesMessage"
defaultMessage="One or more missing references detected in the {space} space. Expand this section for details."
defaultMessage="Missing references detected in the {space} space. Expand this section for details."
values={{ space: space.name }}
/>
}
Expand All @@ -119,7 +119,7 @@ const renderIcon = (props: Props) => {
content={
<FormattedMessage
id="xpack.spaces.management.copyToSpace.copyStatusSummary.conflictsMessage"
defaultMessage="One or more conflicts detected in the {space} space. Expand this section to resolve."
defaultMessage="Conflicts detected in the {space} space. Expand this section to resolve."
values={{ space: space.name }}
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ describe('CopyToSpaceFlyout', () => {
Object {
"color": "warning",
"content": <FormattedMessage
defaultMessage="Saved object has missing references; it will be copied, but one or more of its references are broken."
defaultMessage="This object will be copied, but one or more references are missing."
id="xpack.spaces.management.copyToSpace.copyStatus.missingReferencesMessage"
values={Object {}}
/>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const CopyToSpaceForm = (props: Props) => {
label={
<FormattedMessage
id="xpack.spaces.management.copyToSpace.selectSpacesLabel"
defaultMessage="Select space(s):"
defaultMessage="Select spaces"
/>
}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ const renderCopyOptions = ({ createNewCopies, overwrite, includeRelated }: CopyO
const overwriteLabel = overwrite ? (
<FormattedMessage
id="xpack.spaces.management.copyToSpace.overwriteLabel"
defaultMessage="Automatically try to overwrite conflicts"
defaultMessage="Automatically overwrite conflicts"
/>
) : (
<FormattedMessage
id="xpack.spaces.management.copyToSpace.dontOverwriteLabel"
defaultMessage="Do not automatically try to overwrite conflicts"
defaultMessage="Do not automatically overwrite conflicts"
/>
);
const includeRelatedLabel = includeRelated ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const SelectableSpacesControl = (props: Props) => {
content={
<FormattedMessage
id="xpack.spaces.management.copyToSpace.selectSpacesControl.disabledTooltip"
defaultMessage="The object already exists in this space and cannot be copied here"
defaultMessage="The object already exists in this space."
/>
}
position="left"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const UnauthorizedPrompt = () => (
<p data-test-subj="permissionDeniedMessage">
<FormattedMessage
id="xpack.spaces.management.unauthorizedPrompt.permissionDeniedDescription"
defaultMessage="You do not have permission to manage spaces."
defaultMessage="You don't have permission to manage spaces."
/>
</p>
}
Expand Down
Loading

0 comments on commit 84cc53a

Please sign in to comment.