[Uptime UI] Add warning message to Monitor Management private locations disabled tooltip (#138020)

* Add tooltip message to notify users they need permission to modify private locations.

* Update copy based on PR feedback.
This commit is contained in:
Justin Kambic 2022-08-09 10:37:23 -04:00 committed by GitHub
parent 2b5822e960
commit 7800f4fb75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -129,7 +129,15 @@ export const AddMonitorBtn = () => {
)}
</EuiFlexItem>
<EuiFlexItem style={{ alignItems: 'flex-end' }} grow={false}>
<EuiToolTip content={!isEnabled && !canEnable ? SYNTHETICS_DISABLED_MESSAGE : ''}>
<EuiToolTip
content={
!isEnabled && !canEnable
? SYNTHETICS_DISABLED_MESSAGE
: !canSavePrivate
? PRIVATE_LOCATIONS_NOT_ALLOWED_MESSAGE
: ''
}
>
<EuiButton
isLoading={loading}
fill
@ -150,6 +158,14 @@ export const AddMonitorBtn = () => {
);
};
const PRIVATE_LOCATIONS_NOT_ALLOWED_MESSAGE = i18n.translate(
'xpack.synthetics.monitorManagement.privateLocationsNotAllowedMessage',
{
defaultMessage:
'You do not have permission to add monitors to private locations. Contact your administrator to request access.',
}
);
const ADD_MONITOR_LABEL = i18n.translate('xpack.synthetics.monitorManagement.addMonitorLabel', {
defaultMessage: 'Add monitor',
});