[Share] Improved Share Permalink copy (#149141)

## Summary

As reported in
https://github.com/elastic/kibana/pull/148829#issuecomment-1385622195
some of the labels in the Permalink share panel had to be updated.

@KOTungseth updated here copy. I'm a bit unsure to change `Permalink` to
`Get a link`: while the latter gets to the point directly, `Permalink`
had a precise meaning (in general). Not sure that was the original aim
of the plugin.

### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
This commit is contained in:
Marco Liberati 2023-01-26 10:58:18 +01:00 committed by GitHub
parent c19ef2f818
commit 1a3ea3a6bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 17 deletions

View file

@ -14,7 +14,7 @@ exports[`shareContextMenuExtensions should render a custom panel title when prov
urlService={Object {}}
/>,
"id": 1,
"title": "Permalink",
"title": "Get link",
},
Object {
"content": <UrlPanelContent
@ -53,7 +53,7 @@ exports[`shareContextMenuExtensions should render a custom panel title when prov
"data-test-subj": "sharePanel-Permalinks",
"disabled": false,
"icon": "link",
"name": "Permalinks",
"name": "Get links",
"panel": 1,
},
Object {
@ -90,7 +90,7 @@ exports[`shareContextMenuExtensions should sort ascending on sort order first an
urlService={Object {}}
/>,
"id": 1,
"title": "Permalink",
"title": "Get link",
},
Object {
"content": <div>
@ -113,7 +113,7 @@ exports[`shareContextMenuExtensions should sort ascending on sort order first an
"data-test-subj": "sharePanel-Permalinks",
"disabled": false,
"icon": "link",
"name": "Permalinks",
"name": "Get links",
"panel": 1,
},
Object {
@ -150,7 +150,7 @@ exports[`should disable the share URL when set 1`] = `
urlService={Object {}}
/>,
"id": 1,
"title": "Permalink",
"title": "Get link",
},
Object {
"content": <UrlPanelContent
@ -175,7 +175,7 @@ exports[`should disable the share URL when set 1`] = `
"data-test-subj": "sharePanel-Permalinks",
"disabled": true,
"icon": "link",
"name": "Permalinks",
"name": "Get links",
"panel": 1,
},
],
@ -202,7 +202,7 @@ exports[`should only render permalink panel when there are no other panels 1`] =
urlService={Object {}}
/>,
"id": 1,
"title": "Permalink",
"title": "Get link",
},
]
}
@ -225,7 +225,7 @@ exports[`should render context menu panel when there are more than one panel 1`]
urlService={Object {}}
/>,
"id": 1,
"title": "Permalink",
"title": "Get link",
},
Object {
"content": <UrlPanelContent
@ -250,7 +250,7 @@ exports[`should render context menu panel when there are more than one panel 1`]
"data-test-subj": "sharePanel-Permalinks",
"disabled": false,
"icon": "link",
"name": "Permalinks",
"name": "Get links",
"panel": 1,
},
],

View file

@ -13,7 +13,7 @@ exports[`share url panel content render 1`] = `
hasEmptyLabelSpace={false}
helpText={
<FormattedMessage
defaultMessage="Can't share as saved object until the {objectType} has been saved."
defaultMessage="To share as a saved object, save the {objectType}."
id="share.urlPanel.canNotShareAsSavedObjectHelpText"
values={
Object {

View file

@ -59,7 +59,7 @@ export class ShareContextMenu extends Component<ShareContextMenuProps> {
const permalinkPanel = {
id: panels.length + 1,
title: i18n.translate('share.contextMenu.permalinkPanelTitle', {
defaultMessage: 'Permalink',
defaultMessage: 'Get link',
}),
content: (
<UrlPanelContent
@ -77,12 +77,14 @@ export class ShareContextMenu extends Component<ShareContextMenuProps> {
};
menuItems.push({
name: i18n.translate('share.contextMenu.permalinksLabel', {
defaultMessage: 'Permalinks',
defaultMessage: 'Get links',
}),
icon: 'link',
panel: permalinkPanel.id,
sortOrder: 0,
disabled: Boolean(this.props.disabledShareUrl),
// do not break functional tests
'data-test-subj': 'Permalinks',
});
panels.push(permalinkPanel);
@ -157,7 +159,9 @@ export class ShareContextMenu extends Component<ShareContextMenuProps> {
return -1;
})
.map((menuItem) => {
menuItem['data-test-subj'] = `sharePanel-${menuItem.name.replace(' ', '')}`;
menuItem['data-test-subj'] = `sharePanel-${
menuItem['data-test-subj'] ?? menuItem.name.replace(' ', '')
}`;
delete menuItem.sortOrder;
return menuItem;
}),

View file

@ -481,7 +481,7 @@ export class UrlPanelContent extends Component<UrlPanelContentProps, State> {
const generateLinkAsHelp = this.isNotSaved() ? (
<FormattedMessage
id="share.urlPanel.canNotShareAsSavedObjectHelpText"
defaultMessage="Can't share as saved object until the {objectType} has been saved."
defaultMessage="To share as a saved object, save the {objectType}."
values={{ objectType: this.props.objectType }}
/>
) : undefined;

View file

@ -72,7 +72,7 @@ export const reportingCsvShareProvider = ({
icon: 'document',
toolTipContent: licenseToolTipContent,
disabled: licenseDisabled,
['data-test-subj']: 'csvReportMenuItem',
['data-test-subj']: 'CSVReports',
sortOrder: 1,
},
panel: {

View file

@ -132,7 +132,7 @@ export const reportingScreenshotShareProvider = ({
icon: 'document',
toolTipContent: licenseToolTipContent,
disabled: licenseDisabled,
['data-test-subj']: 'pngReportMenuItem',
['data-test-subj']: 'PNGReports',
sortOrder: 10,
},
panel: {
@ -167,7 +167,7 @@ export const reportingScreenshotShareProvider = ({
icon: 'document',
toolTipContent: licenseToolTipContent,
disabled: licenseDisabled,
['data-test-subj']: 'pdfReportMenuItem',
['data-test-subj']: 'PDFReports',
sortOrder: 10,
},
panel: {