Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEB-574] chore: added new events #3949

Draft
wants to merge 65 commits into
base: preview
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ef05746
chore: title, description removed from change_details
1akhanBaheti Feb 20, 2024
8cd651f
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Feb 20, 2024
64fe785
chore: user properties update
1akhanBaheti Feb 21, 2024
c237eff
chore: added project-views related events
1akhanBaheti Feb 21, 2024
dd54f6b
chore: added getter for track-element
1akhanBaheti Feb 21, 2024
fc5901d
chore: updated project-pages related events
1akhanBaheti Feb 22, 2024
8886afa
chore: issue-open from sidebar events added
1akhanBaheti Feb 22, 2024
238d437
chore: issues-list open event refactored
1akhanBaheti Feb 22, 2024
b354eb8
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Feb 23, 2024
7143c98
chore: added issues filters & layout related events
1akhanBaheti Feb 23, 2024
41c11f7
fix: build warnings
1akhanBaheti Feb 23, 2024
b7aeb0f
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Feb 29, 2024
d263335
chore: added issue open related events
1akhanBaheti Feb 29, 2024
6108f98
chore: updated project member invite events
1akhanBaheti Mar 4, 2024
c94375e
chore: project state events updated
1akhanBaheti Mar 4, 2024
38fbf1f
chore: label events added
1akhanBaheti Mar 4, 2024
604b9c7
chore: added project automation events
1akhanBaheti Mar 5, 2024
6c78b98
added comment events
1akhanBaheti Mar 5, 2024
6cea3f5
estimates events added
1akhanBaheti Mar 6, 2024
cd8de9b
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Mar 6, 2024
b9b7bf1
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Mar 8, 2024
b98e0fe
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Mar 8, 2024
f90e317
chore: refactoring
1akhanBaheti Mar 8, 2024
35a9527
chore: telemetry setup for cloud & selfhosted
1akhanBaheti Mar 11, 2024
2b8569a
chore: added workspace settings events
1akhanBaheti Mar 11, 2024
f6fd579
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Mar 11, 2024
84a6289
Merge branch 'develop' of github.com:makeplane/plane into chore/event…
pablohashescobar Mar 11, 2024
787af3d
dev: add anonymous telemetry field in instance
pablohashescobar Mar 11, 2024
967f9c9
fix: filter event logic
1akhanBaheti Mar 12, 2024
2c4b92d
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Mar 12, 2024
2a51e17
Merge branch 'chore/event-improvements' of https://github.com/makepla…
1akhanBaheti Mar 12, 2024
5b2e271
chore: added telemetry key refrences
1akhanBaheti Mar 12, 2024
e551dac
chore: telemetry update & refactoring
1akhanBaheti Mar 12, 2024
670ba09
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Mar 12, 2024
05c08ef
fix: build warnings
1akhanBaheti Mar 13, 2024
75d8560
chore: added page viewed event
1akhanBaheti Mar 14, 2024
0970d71
chore: All event elements defined in constants.
1akhanBaheti Mar 15, 2024
f289947
fix: build error
1akhanBaheti Mar 15, 2024
72d1b5d
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Mar 18, 2024
68c9107
fix: lints
1akhanBaheti Mar 18, 2024
b7fd570
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Apr 26, 2024
e178bba
feat: session authentication and god-mode implementation (#4302)
sriramveeraghanta Apr 29, 2024
bd75bf7
chore: updated file structure for admin
gurusainath Apr 29, 2024
7061ef4
fix: merge conflicts resolved
sriramveeraghanta Apr 29, 2024
9b3f1a1
fix: build errors
1akhanBaheti Apr 29, 2024
e476f70
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Apr 29, 2024
7ceec94
fix: whitespace
1akhanBaheti Apr 29, 2024
56e9993
chore: updated admin-sidebar
gurusainath Apr 29, 2024
0d7f476
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Apr 29, 2024
a28cca2
chore: telemetery fields in new instance type defination
1akhanBaheti Apr 29, 2024
c389c6b
fix: merge conflicts resolved
sriramveeraghanta Apr 29, 2024
aab34ff
chore: inbox events
1akhanBaheti Apr 30, 2024
bcd3835
project favorite event
1akhanBaheti Apr 30, 2024
b009d8d
fix: lints
1akhanBaheti Apr 30, 2024
d8e54cd
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti Apr 30, 2024
16da29b
fix: merge conflicts resolved
sriramveeraghanta Apr 30, 2024
12b4f74
feat(dashboard): improve label readability (#4321)
redrum15 Apr 30, 2024
bce768d
chore: module events updated
1akhanBaheti May 1, 2024
801f135
chore: cycle events updated
1akhanBaheti May 2, 2024
2669e8e
Merge branch 'develop' of https://github.com/makeplane/plane into cho…
1akhanBaheti May 2, 2024
63b6bfd
fix: lints
1akhanBaheti May 2, 2024
87f56f8
fix: module conflicts
1akhanBaheti May 2, 2024
9f9b312
chore: pages events updated
1akhanBaheti May 2, 2024
2f67ca7
chore: views events updated
1akhanBaheti May 2, 2024
697165e
Merge branch 'preview' of https://github.com/makeplane/plane into cho…
1akhanBaheti May 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions apiserver/plane/license/api/serializers/instance.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Module imports
from plane.app.serializers import BaseSerializer, UserAdminLiteSerializer
from plane.license.models import Instance, InstanceAdmin, InstanceConfiguration
from plane.app.serializers import BaseSerializer
from plane.app.serializers import UserAdminLiteSerializer
from plane.license.utils.encryption import decrypt_data


class InstanceSerializer(BaseSerializer):
primary_owner_details = UserAdminLiteSerializer(
source="primary_owner", read_only=True
)

class Meta:
model = Instance
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.10 on 2024-03-11 15:03

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('license', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='instance',
name='is_telemetry_anonymous',
field=models.BooleanField(default=False),
),
]
3 changes: 2 additions & 1 deletion apiserver/plane/license/models/instance.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Django imports
from django.db import models
from django.conf import settings
from django.db import models

# Module imports
from plane.db.models import BaseModel
Expand All @@ -21,6 +21,7 @@ class Instance(BaseModel):
namespace = models.CharField(max_length=50, blank=True, null=True)
# telemetry and support
is_telemetry_enabled = models.BooleanField(default=True)
is_telemetry_anonymous = models.BooleanField(default=False)
is_support_required = models.BooleanField(default=True)
# is setup done
is_setup_done = models.BooleanField(default=False)
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/instance.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface IInstance {
version: string;
last_checked_at: string;
namespace: string | null;
is_telemetry_anonymous: boolean;
is_telemetry_enabled: boolean;
is_support_required: boolean;
created_by: string | null;
Expand Down
9 changes: 9 additions & 0 deletions web/components/api-token/delete-token-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ import { useState, Fragment, FC } from "react";
import { useRouter } from "next/router";
import { mutate } from "swr";
import { Dialog, Transition } from "@headlessui/react";
// hooks
import { useEventTracker } from "hooks/store";
// services
import { Button, TOAST_TYPE, setToast } from "@plane/ui";
import { API_TOKENS_LIST } from "constants/fetch-keys";
import { APITokenService } from "services/api_token.service";
// ui
// types
import { IApiToken } from "@plane/types";
// constants
import { API_TOKEN_DELETED } from "constants/event-tracker";
// fetch-keys

type Props = {
Expand All @@ -26,6 +30,8 @@ export const DeleteApiTokenModal: FC<Props> = (props) => {
// router
const router = useRouter();
const { workspaceSlug } = router.query;
// store hooks
const { captureEvent } = useEventTracker();

const handleClose = () => {
onClose();
Expand All @@ -45,6 +51,9 @@ export const DeleteApiTokenModal: FC<Props> = (props) => {
title: "Success!",
message: "Token deleted successfully.",
});
captureEvent(API_TOKEN_DELETED, {
token_id: tokenId,
});

mutate<IApiToken[]>(
API_TOKENS_LIST(workspaceSlug.toString()),
Expand Down
11 changes: 11 additions & 0 deletions web/components/api-token/modal/create-token-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React, { useState } from "react";
import { useRouter } from "next/router";
import { mutate } from "swr";
import { Dialog, Transition } from "@headlessui/react";
// hooks
import { useEventTracker } from "hooks/store";
// services
import { TOAST_TYPE, setToast } from "@plane/ui";

Expand All @@ -15,6 +17,8 @@ import { APITokenService } from "services/api_token.service";
// helpers
// types
import { IApiToken } from "@plane/types";
// constants
import { API_TOKEN_CREATED } from "constants/event-tracker";
// fetch-keys

type Props = {
Expand All @@ -33,6 +37,8 @@ export const CreateApiTokenModal: React.FC<Props> = (props) => {
// router
const router = useRouter();
const { workspaceSlug } = router.query;
// store hooks
const { captureEvent } = useEventTracker();

const handleClose = () => {
onClose();
Expand Down Expand Up @@ -73,6 +79,11 @@ export const CreateApiTokenModal: React.FC<Props> = (props) => {
},
false
);
captureEvent(API_TOKEN_CREATED, {
token_id: res.id,
expiry_date: data.expired_at ?? undefined,
never_exprires: res.expired_at ? false : true,
});
})
.catch((err) => {
setToast({
Expand Down
18 changes: 14 additions & 4 deletions web/components/automation/auto-archive-automation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { SelectMonthModal } from "components/automation";
// icon
// constants
import { EUserProjectRoles, PROJECT_AUTOMATION_MONTHS } from "constants/project";
import { useProject, useUser } from "hooks/store";
import { AUTO_ARCHIVE_TOGGLED, AUTO_ARCHIVE_UPDATED } from "constants/event-tracker";
import { useEventTracker, useProject, useUser } from "hooks/store";
// types
import { IProject } from "@plane/types";

Expand All @@ -27,6 +28,7 @@ export const AutoArchiveAutomation: React.FC<Props> = observer((props) => {
membership: { currentProjectRole },
} = useUser();
const { currentProjectDetails } = useProject();
const { captureEvent } = useEventTracker();

const isAdmin = currentProjectRole === EUserProjectRoles.ADMIN;

Expand Down Expand Up @@ -54,11 +56,16 @@ export const AutoArchiveAutomation: React.FC<Props> = observer((props) => {
</div>
<ToggleSwitch
value={currentProjectDetails?.archive_in !== 0}
onChange={() =>
onChange={() => {
currentProjectDetails?.archive_in === 0
? handleChange({ archive_in: 1 })
: handleChange({ archive_in: 0 })
}
: handleChange({ archive_in: 0 });

captureEvent(AUTO_ARCHIVE_TOGGLED, {
toggle: currentProjectDetails?.archive_in === 0 ? "true" : "false",
range: `${currentProjectDetails?.archive_in == 0 ? 1 : 0} month`,
});
}}
size="sm"
disabled={!isAdmin}
/>
Expand All @@ -76,6 +83,9 @@ export const AutoArchiveAutomation: React.FC<Props> = observer((props) => {
currentProjectDetails?.archive_in === 1 ? "month" : "months"
}`}
onChange={(val: number) => {
captureEvent(AUTO_ARCHIVE_UPDATED, {
range: val === 1 ? "1 month" : `${val} months`,
});
handleChange({ archive_in: val });
}}
input
Expand Down
22 changes: 17 additions & 5 deletions web/components/automation/auto-close-automation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import { observer } from "mobx-react-lite";
import { ArchiveX } from "lucide-react";
import { CustomSelect, CustomSearchSelect, ToggleSwitch, StateGroupIcon, DoubleCircleIcon, Loader } from "@plane/ui";
import { SelectMonthModal } from "components/automation";
import { EUserProjectRoles, PROJECT_AUTOMATION_MONTHS } from "constants/project";
import { useProject, useProjectState, useUser } from "hooks/store";
import { useEventTracker, useProject, useProjectState, useUser } from "hooks/store";
// component
// icons
// types
import { IProject } from "@plane/types";
// constants
import { EUserProjectRoles, PROJECT_AUTOMATION_MONTHS } from "constants/project";
import { AUTO_CLOSE_Toggled, AUTO_CLOSE_UPDATED } from "constants/event-tracker";

type Props = {
handleChange: (formData: Partial<IProject>) => Promise<void>;
Expand All @@ -26,6 +27,7 @@ export const AutoCloseAutomation: React.FC<Props> = observer((props) => {
} = useUser();
const { currentProjectDetails } = useProject();
const { projectStates } = useProjectState();
const { captureEvent } = useEventTracker();

// const stateGroups = projectStateStore.groupedProjectStates ?? undefined;

Expand Down Expand Up @@ -80,11 +82,17 @@ export const AutoCloseAutomation: React.FC<Props> = observer((props) => {
</div>
<ToggleSwitch
value={currentProjectDetails?.close_in !== 0}
onChange={() =>
onChange={() => {
currentProjectDetails?.close_in === 0
? handleChange({ close_in: 1, default_state: defaultState })
: handleChange({ close_in: 0, default_state: null })
}
: handleChange({ close_in: 0, default_state: null });

captureEvent(AUTO_CLOSE_Toggled, {
toggle: currentProjectDetails?.close_in === 0 ? "true" : "false",
range: `${currentProjectDetails?.close_in == 0 ? 1 : 0} month`,
state: currentProjectDetails?.close_in === 0 ? undefined : defaultState,
});
}}
size="sm"
disabled={!isAdmin}
/>
Expand All @@ -104,6 +112,10 @@ export const AutoCloseAutomation: React.FC<Props> = observer((props) => {
}`}
onChange={(val: number) => {
handleChange({ close_in: val });
captureEvent(AUTO_CLOSE_UPDATED, {
range: val === 1 ? "1 month" : `${val} months`,
state: currentProjectDetails?.default_state,
});
}}
input
disabled={!isAdmin}
Expand Down
10 changes: 6 additions & 4 deletions web/components/command-palette/actions/project-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { ContrastIcon, FileText } from "lucide-react";
// hooks
import { DiceIcon, PhotoFilterIcon } from "@plane/ui";
import { useApplication, useEventTracker } from "hooks/store";
// constants
import { E_COMMAND_PALETTE } from "constants/event-tracker";
// ui

type Props = {
Expand All @@ -23,7 +25,7 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
<Command.Item
onSelect={() => {
closePalette();
setTrackElement("Command palette");
setTrackElement(E_COMMAND_PALETTE);
toggleCreateCycleModal(true);
}}
className="focus:outline-none"
Expand All @@ -39,7 +41,7 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
<Command.Item
onSelect={() => {
closePalette();
setTrackElement("Command palette");
setTrackElement(E_COMMAND_PALETTE);
toggleCreateModuleModal(true);
}}
className="focus:outline-none"
Expand All @@ -55,7 +57,7 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
<Command.Item
onSelect={() => {
closePalette();
setTrackElement("Command palette");
setTrackElement(E_COMMAND_PALETTE);
toggleCreateViewModal(true);
}}
className="focus:outline-none"
Expand All @@ -71,7 +73,7 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
<Command.Item
onSelect={() => {
closePalette();
setTrackElement("Command palette");
setTrackElement(E_COMMAND_PALETTE);
toggleCreatePageModal(true);
}}
className="focus:outline-none"
Expand Down
6 changes: 4 additions & 2 deletions web/components/command-palette/command-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import { IssueService } from "services/issue";
import { WorkspaceService } from "services/workspace.service";
// types
import { IWorkspaceSearchResults } from "@plane/types";
// constants
import { E_COMMAND_PALETTE } from "constants/event-tracker";
// fetch-keys

// services
Expand Down Expand Up @@ -279,7 +281,7 @@ export const CommandModal: React.FC = observer(() => {
<Command.Item
onSelect={() => {
closePalette();
setTrackElement("Command Palette");
setTrackElement(E_COMMAND_PALETTE);
toggleCreateIssueModal(true);
}}
className="focus:bg-custom-background-80"
Expand All @@ -297,7 +299,7 @@ export const CommandModal: React.FC = observer(() => {
<Command.Item
onSelect={() => {
closePalette();
setTrackElement("Command palette");
setTrackElement(E_COMMAND_PALETTE);
toggleCreateProjectModal(true);
}}
className="focus:outline-none"
Expand Down
4 changes: 3 additions & 1 deletion web/components/command-palette/command-palette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import { EIssuesStoreType } from "constants/issue";
import { copyTextToClipboard } from "helpers/string.helper";
import { useApplication, useEventTracker, useIssues, useUser } from "hooks/store";
import { IssueService } from "services/issue";
// constants
import { E_SHORTCUT_KEY } from "constants/event-tracker";

// services
const issueService = new IssueService();
Expand Down Expand Up @@ -118,7 +120,7 @@ export const CommandPalette: FC = observer(() => {
toggleSidebar();
}
} else if (!isAnyModalOpen) {
setTrackElement("Shortcut key");
setTrackElement(E_SHORTCUT_KEY);
if (keyPressed === "c") {
toggleCreateIssueModal(true);
} else if (keyPressed === "p") {
Expand Down
13 changes: 12 additions & 1 deletion web/components/core/activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ import { Tooltip, BlockedIcon, BlockerIcon, RelatedIcon, LayersIcon, DiceIcon }
// helpers
import { renderFormattedDate } from "helpers/date-time.helper";
import { capitalizeFirstLetter } from "helpers/string.helper";
import { useEstimate, useLabel } from "hooks/store";
import { useEstimate, useEventTracker, useLabel } from "hooks/store";
// types
import { IIssueActivity } from "@plane/types";
// constants
import { ISSUE_OPENED, elementFromPath } from "constants/event-tracker";

export const IssueLink = ({ activity }: { activity: IIssueActivity }) => {
const router = useRouter();
const { workspaceSlug } = router.query;
// store hooks
const { captureEvent } = useEventTracker();
const { isMobile } = usePlatformOS();

return (
Expand All @@ -43,6 +47,13 @@ export const IssueLink = ({ activity }: { activity: IIssueActivity }) => {
href={`${`/${workspaceSlug ?? activity.workspace_detail?.slug}/projects/${activity.project}/issues/${
activity.issue
}`}`}
onClick={() => {
captureEvent(ISSUE_OPENED, {
...elementFromPath(router.asPath),
element_id: "activity",
mode: "detail",
});
}}
target={activity.issue === null ? "_self" : "_blank"}
rel={activity.issue === null ? "" : "noopener noreferrer"}
className="inline-flex items-center gap-1 font-medium text-custom-text-100 hover:underline"
Expand Down
Loading
Loading