mirror of
https://github.com/strapi/strapi.git
synced 2025-09-20 22:10:06 +00:00
Add willNavigate event to settings page menu
This commit is contained in:
parent
2aa13b416d
commit
dd4ab5bc31
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink, useLocation } from 'react-router-dom';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTracking } from '@strapi/helper-plugin';
|
import { useTracking } from '@strapi/helper-plugin';
|
||||||
@ -15,6 +15,7 @@ import { getSectionsToDisplay } from '../../utils';
|
|||||||
const SettingsNav = ({ menu }) => {
|
const SettingsNav = ({ menu }) => {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
const { trackUsage } = useTracking();
|
const { trackUsage } = useTracking();
|
||||||
|
const { pathname } = useLocation();
|
||||||
|
|
||||||
const filteredMenu = getSectionsToDisplay(menu);
|
const filteredMenu = getSectionsToDisplay(menu);
|
||||||
|
|
||||||
@ -38,9 +39,7 @@ const SettingsNav = ({ menu }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handleClick = (link) => {
|
const handleClick = (link) => {
|
||||||
if (link.to.startsWith('/settings/audit-logs')) {
|
trackUsage('willNavigate', { from: pathname, to: link.to });
|
||||||
trackUsage('didGoToAuditLogs');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user