Skip to content

Commit

Permalink
chore: track project navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheartman committed Oct 10, 2024
1 parent 9dc1618 commit 43a350a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
13 changes: 12 additions & 1 deletion frontend/src/component/personalDashboard/ConnectSDK.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const ActionBox = styled('div')(({ theme }) => ({
}));

export const CreateFlag: FC<{ project: string }> = ({ project }) => {
const { trackEvent } = usePlausibleTracker();

Check failure on line 48 in frontend/src/component/personalDashboard/ConnectSDK.tsx

View workflow job for this annotation

GitHub Actions / build

src/component/personalDashboard/PersonalDashboard.test.tsx > Render personal dashboard for a long running project

ReferenceError: usePlausibleTracker is not defined ❯ CreateFlag src/component/personalDashboard/ConnectSDK.tsx:48:28 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25777:74 ❯ flushActQueue node_modules/react/cjs/react.development.js:2667:24

Check failure on line 48 in frontend/src/component/personalDashboard/ConnectSDK.tsx

View workflow job for this annotation

GitHub Actions / build

src/component/personalDashboard/PersonalDashboard.test.tsx > Render personal dashboard for a new project

ReferenceError: usePlausibleTracker is not defined ❯ CreateFlag src/component/personalDashboard/ConnectSDK.tsx:48:28 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25777:74 ❯ flushActQueue node_modules/react/cjs/react.development.js:2667:24
return (
<ActionBox data-loading>
<TitleContainer>
Expand All @@ -56,7 +57,17 @@ export const CreateFlag: FC<{ project: string }> = ({ project }) => {
<p>Create one to get started.</p>
</div>
<div>
<Button href={`projects/${project}`} variant='contained'>
<Button
href={`/projects/${project}`}
onClick={() => {
trackEvent('personal-dashboard', {
props: {
eventType: `Go to project from onboarding`,
},
});
}}
variant='contained'
>
Go to project
</Button>
</div>
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/component/personalDashboard/MyProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
SpacedGridItem,
} from './Grid';
import { ContactAdmins, DataError } from './ProjectDetailsError';
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';

const ActiveProjectDetails: FC<{
project: PersonalDashboardSchemaProjectsItem;
Expand Down Expand Up @@ -70,6 +71,7 @@ const ProjectListItem: FC<{
onClick: () => void;
}> = ({ project, selected, onClick }) => {
const activeProjectRef = useRef<HTMLLIElement>(null);
const { trackEvent } = usePlausibleTracker();

useEffect(() => {
if (activeProjectRef.current) {
Expand Down Expand Up @@ -99,6 +101,13 @@ const ProjectListItem: FC<{
href={`projects/${project.id}`}
size='small'
sx={{ ml: 'auto' }}
onClick={() => {
trackEvent('personal-dashboard', {
props: {
eventType: `Go to project from list`,
},
});
}}
>
<LinkIcon titleAccess={`projects/${project.id}`} />
</IconButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const FlagListItem: FC<{
onClick={() => {
trackEvent('personal-dashboard', {
props: {
eventType: `Go to flag`,
eventType: `Go to flag from list`,
},
});
}}
Expand Down

0 comments on commit 43a350a

Please sign in to comment.