[APM] Hide “Create configuration” for users without write access (#88149)
* [APM] Hide “Create configuration” for read-only user * also hide description * disable create button * fix ts error for EuiButton
This commit is contained in:
parent
e2dc9464fa
commit
badd2b35f2
|
@ -61,29 +61,38 @@ export function AgentConfigurationList({ status, data, refetch }: Props) {
|
||||||
</h2>
|
</h2>
|
||||||
}
|
}
|
||||||
body={
|
body={
|
||||||
<>
|
<p>
|
||||||
<p>
|
{i18n.translate('xpack.apm.agentConfig.configTable.emptyPromptText', {
|
||||||
{i18n.translate(
|
defaultMessage:
|
||||||
'xpack.apm.agentConfig.configTable.emptyPromptText',
|
"Let's change that! You can fine-tune agent configuration directly from Kibana without having to redeploy. Get started by creating your first configuration.",
|
||||||
{
|
})}
|
||||||
defaultMessage:
|
</p>
|
||||||
"Let's change that! You can fine-tune agent configuration directly from Kibana without having to redeploy. Get started by creating your first configuration.",
|
|
||||||
}
|
|
||||||
)}
|
|
||||||
</p>
|
|
||||||
</>
|
|
||||||
}
|
}
|
||||||
actions={
|
actions={
|
||||||
<EuiButton
|
<EuiToolTip
|
||||||
color="primary"
|
content={
|
||||||
fill
|
!canSave &&
|
||||||
href={createAgentConfigurationHref(search, basePath)}
|
i18n.translate(
|
||||||
|
'xpack.apm.settings.agentConfig.createConfigButton.tooltip',
|
||||||
|
{
|
||||||
|
defaultMessage:
|
||||||
|
"You don't have permissions to create agent configurations",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{i18n.translate(
|
<EuiButton
|
||||||
'xpack.apm.agentConfig.configTable.createConfigButtonLabel',
|
color="primary"
|
||||||
{ defaultMessage: 'Create configuration' }
|
fill
|
||||||
)}
|
href={createAgentConfigurationHref(search, basePath)}
|
||||||
</EuiButton>
|
isDisabled={!canSave}
|
||||||
|
>
|
||||||
|
{i18n.translate(
|
||||||
|
'xpack.apm.agentConfig.configTable.createConfigButtonLabel',
|
||||||
|
{ defaultMessage: 'Create configuration' }
|
||||||
|
)}
|
||||||
|
</EuiButton>
|
||||||
|
</EuiToolTip>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
@ -248,7 +248,7 @@ export function ApmIndices() {
|
||||||
fill
|
fill
|
||||||
onClick={handleApplyChangesEvent}
|
onClick={handleApplyChangesEvent}
|
||||||
isLoading={isSaving}
|
isLoading={isSaving}
|
||||||
disabled={!canSave}
|
isDisabled={!canSave}
|
||||||
>
|
>
|
||||||
{i18n.translate(
|
{i18n.translate(
|
||||||
'xpack.apm.settings.apmIndices.applyButton',
|
'xpack.apm.settings.apmIndices.applyButton',
|
||||||
|
|
Loading…
Reference in a new issue