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,
|
useAPIErrorHandler,
|
||||||
useFetchClient,
|
useFetchClient,
|
||||||
useNotification,
|
useNotification,
|
||||||
useTracking,
|
|
||||||
} from '@strapi/helper-plugin';
|
} from '@strapi/helper-plugin';
|
||||||
import { Check } from '@strapi/icons';
|
import { Check } from '@strapi/icons';
|
||||||
import { useFormik, Form, FormikProvider } from 'formik';
|
import { useFormik, Form, FormikProvider } from 'formik';
|
||||||
@ -29,7 +28,6 @@ import { reducer, initialState } from '../../reducer';
|
|||||||
import { getWorkflowValidationSchema } from '../../utils/getWorkflowValidationSchema';
|
import { getWorkflowValidationSchema } from '../../utils/getWorkflowValidationSchema';
|
||||||
|
|
||||||
export function ReviewWorkflowsEditView() {
|
export function ReviewWorkflowsEditView() {
|
||||||
const { trackUsage } = useTracking();
|
|
||||||
const { workflowId } = useParams();
|
const { workflowId } = useParams();
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@ -143,11 +141,6 @@ export function ReviewWorkflowsEditView() {
|
|||||||
|
|
||||||
const limits = getFeature('review-workflows');
|
const limits = getFeature('review-workflows');
|
||||||
|
|
||||||
React.useEffect(() => {
|
|
||||||
trackUsage('didViewWorkflow');
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
dispatch(setWorkflow({ status: workflowStatus, data: workflow }));
|
dispatch(setWorkflow({ status: workflowStatus, data: workflow }));
|
||||||
}, [workflowStatus, workflow, dispatch]);
|
}, [workflowStatus, workflow, dispatch]);
|
||||||
|
@ -23,6 +23,7 @@ import {
|
|||||||
useAPIErrorHandler,
|
useAPIErrorHandler,
|
||||||
useFetchClient,
|
useFetchClient,
|
||||||
useNotification,
|
useNotification,
|
||||||
|
useTracking,
|
||||||
} from '@strapi/helper-plugin';
|
} from '@strapi/helper-plugin';
|
||||||
import { Pencil, Plus, Trash } from '@strapi/icons';
|
import { Pencil, Plus, Trash } from '@strapi/icons';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
@ -74,6 +75,7 @@ export function ReviewWorkflowsListView() {
|
|||||||
const { formatAPIError } = useAPIErrorHandler();
|
const { formatAPIError } = useAPIErrorHandler();
|
||||||
const toggleNotification = useNotification();
|
const toggleNotification = useNotification();
|
||||||
const { getFeature, isLoading: isLicenseLoading } = useLicenseLimits();
|
const { getFeature, isLoading: isLicenseLoading } = useLicenseLimits();
|
||||||
|
const { trackUsage } = useTracking();
|
||||||
|
|
||||||
const limits = getFeature('review-workflows');
|
const limits = getFeature('review-workflows');
|
||||||
|
|
||||||
@ -181,6 +183,8 @@ export function ReviewWorkflowsListView() {
|
|||||||
if (limits?.workflows && meta?.workflowCount >= parseInt(limits.workflows, 10)) {
|
if (limits?.workflows && meta?.workflowCount >= parseInt(limits.workflows, 10)) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
setShowLimitModal(true);
|
setShowLimitModal(true);
|
||||||
|
} else {
|
||||||
|
trackUsage('willCreateWorkflow');
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -230,6 +234,7 @@ export function ReviewWorkflowsListView() {
|
|||||||
setShowLimitModal(true);
|
setShowLimitModal(true);
|
||||||
} else {
|
} else {
|
||||||
push('/settings/review-workflows/create');
|
push('/settings/review-workflows/create');
|
||||||
|
trackUsage('willCreateWorkflow');
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user