[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>
|
||||
}
|
||||
body={
|
||||
<>
|
||||
<p>
|
||||
{i18n.translate(
|
||||
'xpack.apm.agentConfig.configTable.emptyPromptText',
|
||||
{
|
||||
{i18n.translate('xpack.apm.agentConfig.configTable.emptyPromptText', {
|
||||
defaultMessage:
|
||||
"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={
|
||||
<EuiToolTip
|
||||
content={
|
||||
!canSave &&
|
||||
i18n.translate(
|
||||
'xpack.apm.settings.agentConfig.createConfigButton.tooltip',
|
||||
{
|
||||
defaultMessage:
|
||||
"You don't have permissions to create agent configurations",
|
||||
}
|
||||
)
|
||||
}
|
||||
>
|
||||
<EuiButton
|
||||
color="primary"
|
||||
fill
|
||||
href={createAgentConfigurationHref(search, basePath)}
|
||||
isDisabled={!canSave}
|
||||
>
|
||||
{i18n.translate(
|
||||
'xpack.apm.agentConfig.configTable.createConfigButtonLabel',
|
||||
{ defaultMessage: 'Create configuration' }
|
||||
)}
|
||||
</EuiButton>
|
||||
</EuiToolTip>
|
||||
}
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -248,7 +248,7 @@ export function ApmIndices() {
|
|||
fill
|
||||
onClick={handleApplyChangesEvent}
|
||||
isLoading={isSaving}
|
||||
disabled={!canSave}
|
||||
isDisabled={!canSave}
|
||||
>
|
||||
{i18n.translate(
|
||||
'xpack.apm.settings.apmIndices.applyButton',
|
||||
|
|
Loading…
Reference in a new issue