mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 17:00:55 +00:00
Merge pull request #17245 from strapi/feature/review-workflow-multiple-tracking
Chore: Implement multiple workflow tracking events
This commit is contained in:
commit
7bf1ac9006
@ -6,7 +6,6 @@ import {
|
||||
useAPIErrorHandler,
|
||||
useFetchClient,
|
||||
useNotification,
|
||||
useTracking,
|
||||
} from '@strapi/helper-plugin';
|
||||
import { Check } from '@strapi/icons';
|
||||
import { useFormik, Form, FormikProvider } from 'formik';
|
||||
@ -29,7 +28,6 @@ import { reducer, initialState } from '../../reducer';
|
||||
import { getWorkflowValidationSchema } from '../../utils/getWorkflowValidationSchema';
|
||||
|
||||
export function ReviewWorkflowsEditView() {
|
||||
const { trackUsage } = useTracking();
|
||||
const { workflowId } = useParams();
|
||||
const { formatMessage } = useIntl();
|
||||
const dispatch = useDispatch();
|
||||
@ -143,11 +141,6 @@ export function ReviewWorkflowsEditView() {
|
||||
|
||||
const limits = getFeature('review-workflows');
|
||||
|
||||
React.useEffect(() => {
|
||||
trackUsage('didViewWorkflow');
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
React.useEffect(() => {
|
||||
dispatch(setWorkflow({ status: workflowStatus, data: workflow }));
|
||||
}, [workflowStatus, workflow, dispatch]);
|
||||
|
@ -23,6 +23,7 @@ import {
|
||||
useAPIErrorHandler,
|
||||
useFetchClient,
|
||||
useNotification,
|
||||
useTracking,
|
||||
} from '@strapi/helper-plugin';
|
||||
import { Pencil, Plus, Trash } from '@strapi/icons';
|
||||
import { useIntl } from 'react-intl';
|
||||
@ -74,6 +75,7 @@ export function ReviewWorkflowsListView() {
|
||||
const { formatAPIError } = useAPIErrorHandler();
|
||||
const toggleNotification = useNotification();
|
||||
const { getFeature, isLoading: isLicenseLoading } = useLicenseLimits();
|
||||
const { trackUsage } = useTracking();
|
||||
|
||||
const limits = getFeature('review-workflows');
|
||||
|
||||
@ -181,6 +183,8 @@ export function ReviewWorkflowsListView() {
|
||||
if (limits?.workflows && meta?.workflowCount >= parseInt(limits.workflows, 10)) {
|
||||
event.preventDefault();
|
||||
setShowLimitModal(true);
|
||||
} else {
|
||||
trackUsage('willCreateWorkflow');
|
||||
}
|
||||
}}
|
||||
>
|
||||
@ -230,6 +234,7 @@ export function ReviewWorkflowsListView() {
|
||||
setShowLimitModal(true);
|
||||
} else {
|
||||
push('/settings/review-workflows/create');
|
||||
trackUsage('willCreateWorkflow');
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
Loading…
x
Reference in New Issue
Block a user