Share: Add tracking to invite user button (#99376)
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { connect, ConnectedProps } from 'react-redux';
|
import { connect, ConnectedProps } from 'react-redux';
|
||||||
|
|
||||||
|
import { reportInteraction } from '@grafana/runtime';
|
||||||
import { RadioButtonGroup, LinkButton, FilterInput, InlineField } from '@grafana/ui';
|
import { RadioButtonGroup, LinkButton, FilterInput, InlineField } from '@grafana/ui';
|
||||||
import config from 'app/core/config';
|
import config from 'app/core/config';
|
||||||
import { contextSrv } from 'app/core/core';
|
import { contextSrv } from 'app/core/core';
|
||||||
@@ -52,6 +53,13 @@ export const UsersActionBarUnconnected = ({
|
|||||||
// 2) new basic auth users can be created for this instance (!config.disableLoginForm).
|
// 2) new basic auth users can be created for this instance (!config.disableLoginForm).
|
||||||
const showInviteButton: boolean = canAddToOrg && !(config.disableLoginForm && config.externalUserMngInfo);
|
const showInviteButton: boolean = canAddToOrg && !(config.disableLoginForm && config.externalUserMngInfo);
|
||||||
|
|
||||||
|
const onExternalUserMngClick = () => {
|
||||||
|
reportInteraction('users_admin_actions_clicked', {
|
||||||
|
category: 'org_users',
|
||||||
|
item: 'manage_users_external',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="page-action-bar" data-testid="users-action-bar">
|
<div className="page-action-bar" data-testid="users-action-bar">
|
||||||
<InlineField grow>
|
<InlineField grow>
|
||||||
@@ -68,7 +76,12 @@ export const UsersActionBarUnconnected = ({
|
|||||||
)}
|
)}
|
||||||
{showInviteButton && <LinkButton href="org/users/invite">Invite</LinkButton>}
|
{showInviteButton && <LinkButton href="org/users/invite">Invite</LinkButton>}
|
||||||
{externalUserMngLinkUrl && (
|
{externalUserMngLinkUrl && (
|
||||||
<LinkButton href={getExternalUserMngLinkUrl('manage-users')} target="_blank" rel="noopener">
|
<LinkButton
|
||||||
|
onClick={onExternalUserMngClick}
|
||||||
|
href={getExternalUserMngLinkUrl('manage-users')}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
>
|
||||||
{externalUserMngLinkName}
|
{externalUserMngLinkName}
|
||||||
</LinkButton>
|
</LinkButton>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user