Skip to content

Commit f82ebf0

Browse files
committed
addressing PR comments
1 parent 01f190f commit f82ebf0

File tree

3 files changed

+52
-25
lines changed

3 files changed

+52
-25
lines changed

x-pack/plugins/apm/public/components/app/Settings/AgentConfigurations/index.tsx

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* or more contributor license agreements. Licensed under the Elastic License;
44
* you may not use this file except in compliance with the Elastic License.
55
*/
6+
import { EuiToolTip } from '@elastic/eui';
67
import {
78
EuiButton,
89
EuiFlexGroup,
@@ -78,17 +79,30 @@ function CreateConfigurationButton() {
7879
<EuiFlexItem>
7980
<EuiFlexGroup alignItems="center" justifyContent="flexEnd">
8081
<EuiFlexItem grow={false}>
81-
<EuiButton
82-
color="primary"
83-
fill
84-
iconType="plusInCircle"
85-
href={href}
86-
isDisabled={!canSave}
82+
<EuiToolTip
83+
content={
84+
!canSave &&
85+
i18n.translate(
86+
'xpack.apm.agentConfig.configurationsPanelTitle.noPermissionTooltipLabel',
87+
{
88+
defaultMessage:
89+
"Your user role doesn't have permissions to create agent configurations",
90+
}
91+
)
92+
}
8793
>
88-
{i18n.translate('xpack.apm.agentConfig.createConfigButtonLabel', {
89-
defaultMessage: 'Create configuration',
90-
})}
91-
</EuiButton>
94+
<EuiButton
95+
color="primary"
96+
fill
97+
iconType="plusInCircle"
98+
href={href}
99+
isDisabled={!canSave}
100+
>
101+
{i18n.translate('xpack.apm.agentConfig.createConfigButtonLabel', {
102+
defaultMessage: 'Create configuration',
103+
})}
104+
</EuiButton>
105+
</EuiToolTip>
92106
</EuiFlexItem>
93107
</EuiFlexGroup>
94108
</EuiFlexItem>

x-pack/plugins/apm/public/components/app/Settings/CustomizeUI/CustomLink/CreateCustomLinkButton.tsx

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,40 @@
33
* or more contributor license agreements. Licensed under the Elastic License;
44
* you may not use this file except in compliance with the Elastic License.
55
*/
6-
import React from 'react';
7-
import { EuiButton } from '@elastic/eui';
6+
import { EuiButton, EuiToolTip } from '@elastic/eui';
87
import { i18n } from '@kbn/i18n';
8+
import React from 'react';
99
import { useApmPluginContext } from '../../../../../context/apm_plugin/use_apm_plugin_context';
1010

1111
export function CreateCustomLinkButton({ onClick }: { onClick: () => void }) {
1212
const { core } = useApmPluginContext();
1313
const canSave = core.application.capabilities.apm.save;
1414
return (
15-
<EuiButton
16-
color="primary"
17-
fill
18-
iconType="plusInCircle"
19-
onClick={onClick}
20-
isDisabled={!canSave}
21-
data-test-subj="createButton"
15+
<EuiToolTip
16+
content={
17+
!canSave &&
18+
i18n.translate(
19+
'xpack.apm.settings.customizeUI.customLink.noPermissionTooltipLabel',
20+
{
21+
defaultMessage:
22+
"Your user role doesn't have permissions to create custom links",
23+
}
24+
)
25+
}
2226
>
23-
{i18n.translate(
24-
'xpack.apm.settings.customizeUI.customLink.createCustomLink',
25-
{ defaultMessage: 'Create custom link' }
26-
)}
27-
</EuiButton>
27+
<EuiButton
28+
color="primary"
29+
fill
30+
iconType="plusInCircle"
31+
onClick={onClick}
32+
isDisabled={!canSave}
33+
data-test-subj="createButton"
34+
>
35+
{i18n.translate(
36+
'xpack.apm.settings.customizeUI.customLink.createCustomLink',
37+
{ defaultMessage: 'Create custom link' }
38+
)}
39+
</EuiButton>
40+
</EuiToolTip>
2841
);
2942
}

x-pack/plugins/apm/server/routes/settings/custom_link.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const createCustomLinkRoute = createRoute({
6464
params: t.type({
6565
body: payloadRt,
6666
}),
67-
options: { tags: ['access:apm'] },
67+
options: { tags: ['access:apm', 'access:apm_write'] },
6868
handler: async ({ context, request }) => {
6969
if (!isActiveGoldLicense(context.licensing.license)) {
7070
throw Boom.forbidden(INVALID_LICENSE);

0 commit comments

Comments
 (0)