diff --git a/cl2-component-library/package.json b/cl2-component-library/package.json index eb940c45797f..aead71e6eaef 100644 --- a/cl2-component-library/package.json +++ b/cl2-component-library/package.json @@ -1,5 +1,5 @@ { - "version": "0.11.34", + "version": "0.11.35", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/cl2-component-library/src/components/Icon/index.tsx b/cl2-component-library/src/components/Icon/index.tsx index 50e1f75824f6..348ffa934100 100644 --- a/cl2-component-library/src/components/Icon/index.tsx +++ b/cl2-component-library/src/components/Icon/index.tsx @@ -755,6 +755,18 @@ export const icons = { ), + stars: (props: IconPropsWithoutName) => ( + + + + + ), database: (props: IconPropsWithoutName) => ( { ? additionalCustomFieldIds.filter((id) => id !== customFieldId) : [...(additionalCustomFieldIds || []), customFieldId]; - updateAnalysis({ - id: analysisId, - additional_custom_field_ids: newAdditionalCustomFieldIds, - }); + updateAnalysis( + { + id: analysisId, + additional_custom_field_ids: newAdditionalCustomFieldIds, + }, + { + onSuccess: () => { + trackEventByName( + additionalCustomFieldIds?.includes(customFieldId) + ? tracks.removeQuestionFromAIAnalysis.name + : tracks.addQuestionToAIAnalysis.name + ); + }, + } + ); }; return ( diff --git a/front/app/containers/Admin/projects/project/analysis/Insights/SummarizeButton.tsx b/front/app/containers/Admin/projects/project/analysis/Insights/SummarizeButton.tsx index 94a469fdb016..f542231e4850 100644 --- a/front/app/containers/Admin/projects/project/analysis/Insights/SummarizeButton.tsx +++ b/front/app/containers/Admin/projects/project/analysis/Insights/SummarizeButton.tsx @@ -92,7 +92,7 @@ const SummarizeButton = () => { > ); diff --git a/front/app/containers/Admin/projects/project/analysis/LaunchModal/index.tsx b/front/app/containers/Admin/projects/project/analysis/LaunchModal/index.tsx index 0a832683a745..ba56980a8a07 100644 --- a/front/app/containers/Admin/projects/project/analysis/LaunchModal/index.tsx +++ b/front/app/containers/Admin/projects/project/analysis/LaunchModal/index.tsx @@ -28,7 +28,7 @@ const LaunchModal = ({ onClose }: LaunchModalProps) => { id="e2e-analysis-launch-modal" > - + {formatMessage(messages.title)} diff --git a/front/app/containers/Admin/projects/project/analysis/Tags/AutoTaggingModal/Step1.tsx b/front/app/containers/Admin/projects/project/analysis/Tags/AutoTaggingModal/Step1.tsx index f72dd90829d2..1aaefddc435c 100644 --- a/front/app/containers/Admin/projects/project/analysis/Tags/AutoTaggingModal/Step1.tsx +++ b/front/app/containers/Admin/projects/project/analysis/Tags/AutoTaggingModal/Step1.tsx @@ -121,7 +121,7 @@ const AutoTagOption = ({ alignItems="center" > - {' '} + {' '} {formatMessage(messages.autoTagTitle)} {formatMessage(messages.autoTagDescription)} diff --git a/front/app/containers/Admin/projects/project/analysis/Tags/index.tsx b/front/app/containers/Admin/projects/project/analysis/Tags/index.tsx index a931717ddd6d..7b8bcbe16db9 100644 --- a/front/app/containers/Admin/projects/project/analysis/Tags/index.tsx +++ b/front/app/containers/Admin/projects/project/analysis/Tags/index.tsx @@ -195,7 +195,7 @@ const Tags = () => { @@ -192,7 +192,7 @@ const Analysis = ({ }) } buttonStyle="secondary" - icon="flash" + icon="stars" > {formatMessage(messages.showSummaries)} diff --git a/front/app/containers/Admin/projects/project/nativeSurvey/FormResults/FormResultsQuestion/TextQuestion/AnalysisUpsell/index.tsx b/front/app/containers/Admin/projects/project/nativeSurvey/FormResults/FormResultsQuestion/TextQuestion/AnalysisUpsell/index.tsx index 4affac4a3581..09c283796d56 100644 --- a/front/app/containers/Admin/projects/project/nativeSurvey/FormResults/FormResultsQuestion/TextQuestion/AnalysisUpsell/index.tsx +++ b/front/app/containers/Admin/projects/project/nativeSurvey/FormResults/FormResultsQuestion/TextQuestion/AnalysisUpsell/index.tsx @@ -18,7 +18,7 @@ const AnalysisUpsell = () => { const { formatMessage } = useIntl(); return ( - + {formatMessage(messages.title)}
    diff --git a/front/app/containers/Admin/reporting/components/ReportBuilder/Analysis/DraggableInsights.tsx b/front/app/containers/Admin/reporting/components/ReportBuilder/Analysis/DraggableInsights.tsx index 27c8147c8920..8582db06d1ee 100644 --- a/front/app/containers/Admin/reporting/components/ReportBuilder/Analysis/DraggableInsights.tsx +++ b/front/app/containers/Admin/reporting/components/ReportBuilder/Analysis/DraggableInsights.tsx @@ -3,6 +3,10 @@ import React from 'react'; import { Box } from '@citizenlab/cl2-component-library'; import { useEditor } from '@craftjs/core'; +import tracks from 'containers/Admin/projects/project/analysis/tracks'; + +import { trackEventByName } from 'utils/analytics'; + const DraggableInsight = ({ id, component, @@ -25,6 +29,7 @@ const DraggableInsight = ({ connectors.create(ref, component, { onCreate: (node) => { selectNode(node.rootNodeId); + trackEventByName(tracks.dragAndDropInsightInReportBuilder.name); }, }) } diff --git a/front/app/containers/Admin/reporting/components/ReportBuilder/Toolbox/index.tsx b/front/app/containers/Admin/reporting/components/ReportBuilder/Toolbox/index.tsx index dbf27ba75703..a6c98eeb548d 100644 --- a/front/app/containers/Admin/reporting/components/ReportBuilder/Toolbox/index.tsx +++ b/front/app/containers/Admin/reporting/components/ReportBuilder/Toolbox/index.tsx @@ -17,6 +17,7 @@ import useProjects from 'api/projects/useProjects'; import useAppConfigurationLocales from 'hooks/useAppConfigurationLocales'; +import tracks from 'containers/Admin/projects/project/analysis/tracks'; import { useReportContext } from 'containers/Admin/reporting/context/ReportContext'; import { createMultiloc } from 'containers/Admin/reporting/utils/multiloc'; @@ -24,6 +25,7 @@ import Container from 'components/admin/ContentBuilder/Toolbox/Container'; import DraggableElement from 'components/admin/ContentBuilder/Toolbox/DraggableElement'; import WhiteSpace from 'components/admin/ContentBuilder/Widgets/WhiteSpace'; +import { trackEventByName } from 'utils/analytics'; import { useIntl, useFormatMessageWithLocale, @@ -142,9 +144,12 @@ const ReportBuilderToolbox = ({