Compare commits

...

11 Commits

Author SHA1 Message Date
sriramveeraghanta 1ecd68e4a0 feat: implementing zod schema in services pacakges 2025-08-01 12:45:40 +05:30
Akshat Jain cc49a2ca4f [INFRA-219] fix: update Dockerfile and docker-compose for proxy service (#7523)
* fix: update Dockerfile and docker-compose for version v0.28.0 and improve curl commands in install script

* fix: update docker-compose to use 'stable' tag for all services

* fix: improve curl command options in install script for better reliability
2025-07-31 13:27:34 +05:30
sriram veeraghanta ee53ee33d0 Potential fix for code scanning alert no. 631: Incomplete URL scheme check (#7514)
* Potential fix for code scanning alert no. 631: Incomplete URL scheme check

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* fix: ignore warning in this file

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-07-31 13:23:59 +05:30
sriram veeraghanta 99f9337f35 fix: enable email notification by default for new users (#7521) 2025-07-31 13:02:41 +05:30
sriram veeraghanta 1458c758a3 fix: adding proxy command in compose file #7518
fix: adding proxy command in compose file
2025-07-30 21:01:34 +05:30
sriramveeraghanta 2d9988f584 fix: adding proxy command 2025-07-30 21:00:16 +05:30
Sangeetha 27fa439c8d [WEB-4602] fix: 500 error on draft wi labels update #7515 2025-07-30 20:18:48 +05:30
sriramveeraghanta 57935a94cc fix: header observer for state changes 2025-07-30 17:24:40 +05:30
Vamsi Krishna 876ccce86b [WEB-4597] fix: project icon render in switcher #7504 2025-07-30 17:18:18 +05:30
Nikhil a67dba45f8 [WEB-4599] feat: add marketing email consent field to Profile model and timezone migration #7510 2025-07-30 17:17:16 +05:30
Prateek Shourya ef8e613358 [WEB-4603] feat: add missing event trackers (#7513)
* feat: add event trackers for password creation

* feat: add event trackers for project views

* feat: add event trackers for product updates and changelogs

* chore: use element name instead of event name for changelog redirect link
2025-07-30 17:15:59 +05:30
42 changed files with 2165 additions and 98 deletions
+1 -1
View File
@@ -260,7 +260,7 @@ class DraftIssueCreateSerializer(BaseSerializer):
DraftIssueLabel.objects.bulk_create(
[
DraftIssueLabel(
label=label,
label_id=label,
draft_issue=instance,
workspace_id=workspace_id,
project_id=project_id,
+8 -5
View File
@@ -226,6 +226,9 @@ class Profile(TimeAuditModel):
goals = models.JSONField(default=dict)
background_color = models.CharField(max_length=255, default=get_random_color)
# marketing
has_marketing_email_consent = models.BooleanField(default=False)
class Meta:
verbose_name = "Profile"
verbose_name_plural = "Profiles"
@@ -273,9 +276,9 @@ def create_user_notification(sender, instance, created, **kwargs):
UserNotificationPreference.objects.create(
user=instance,
property_change=False,
state_change=False,
comment=False,
mention=False,
issue_completed=False,
property_change=True,
state_change=True,
comment=True,
mention=True,
issue_completed=True,
)
@@ -1,15 +1,18 @@
# Module imports
from plane.license.models import Instance
from plane.app.serializers import BaseSerializer
from plane.app.serializers import UserAdminLiteSerializer
class InstanceSerializer(BaseSerializer):
primary_owner_details = UserAdminLiteSerializer(
source="primary_owner", read_only=True
)
class Meta:
model = Instance
fields = "__all__"
read_only_fields = ["id", "email", "last_checked_at", "is_setup_done"]
exclude = [
"created_by",
"deleted_at",
"created_at",
"last_checked_at",
"updated_at",
"updated_by",
]
+1 -1
View File
@@ -5,7 +5,7 @@ RUN xcaddy build \
--with github.com/caddy-dns/digitalocean@04bde2867106aa1b44c2f9da41a285fa02e629c5 \
--with github.com/mholt/caddy-l4@4d3c80e89c5f80438a3e048a410d5543ff5fb9f4
FROM caddy:2.10.0-builder-alpine
FROM caddy:2.10.0-alpine
RUN apk add --no-cache nss-tools bash curl
@@ -3,7 +3,7 @@
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// ui
import { EProjectFeatureKey } from "@plane/constants";
import { EProjectFeatureKey, PROJECT_VIEW_TRACKER_ELEMENTS } from "@plane/constants";
import { Breadcrumbs, Button, Header } from "@plane/ui";
// components
import { ViewListHeader } from "@/components/views";
@@ -34,7 +34,12 @@ export const ProjectViewsHeader = observer(() => {
<Header.RightItem>
<ViewListHeader />
<div>
<Button variant="primary" size="sm" onClick={() => toggleCreateViewModal(true)}>
<Button
data-ph-element={PROJECT_VIEW_TRACKER_ELEMENTS.RIGHT_HEADER_ADD_BUTTON}
variant="primary"
size="sm"
onClick={() => toggleCreateViewModal(true)}
>
Add view
</Button>
</div>
@@ -9,7 +9,7 @@ import { useSearchParams } from "next/navigation";
import { useTheme } from "next-themes";
import { Eye, EyeOff } from "lucide-react";
// plane imports
import { E_PASSWORD_STRENGTH } from "@plane/constants";
import { AUTH_TRACKER_ELEMENTS, AUTH_TRACKER_EVENTS, E_PASSWORD_STRENGTH } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { Button, Input, PasswordStrengthIndicator, TOAST_TYPE, setToast } from "@plane/ui";
// components
@@ -17,6 +17,7 @@ import { getPasswordStrength } from "@plane/utils";
// helpers
import { EPageTypes } from "@/helpers/authentication.helper";
// hooks
import { captureError, captureSuccess, captureView } from "@/helpers/event-tracker.helper";
import { useUser } from "@/hooks/store";
import { useAppRouter } from "@/hooks/use-app-router";
// wrappers
@@ -67,6 +68,12 @@ const SetPasswordPage = observer(() => {
const { resolvedTheme } = useTheme();
const { data: user, handleSetPassword } = useUser();
useEffect(() => {
captureView({
elementName: AUTH_TRACKER_ELEMENTS.SET_PASSWORD_FORM,
});
}, []);
useEffect(() => {
if (csrfToken === undefined)
authService.requestCSRFToken().then((data) => data?.csrf_token && setCsrfToken(data.csrf_token));
@@ -93,6 +100,9 @@ const SetPasswordPage = observer(() => {
e.preventDefault();
if (!csrfToken) throw new Error("csrf token not found");
await handleSetPassword(csrfToken, { password: passwordFormData.password });
captureSuccess({
eventName: AUTH_TRACKER_EVENTS.password_created,
});
router.push("/");
} catch (error: unknown) {
let message = undefined;
@@ -100,7 +110,9 @@ const SetPasswordPage = observer(() => {
const err = error as Error & { error?: string };
message = err.error;
}
captureError({
eventName: AUTH_TRACKER_EVENTS.password_created,
});
setToast({
type: TOAST_TYPE.ERROR,
title: t("common.errors.default.title"),
@@ -116,8 +128,7 @@ const SetPasswordPage = observer(() => {
const logo = resolvedTheme === "light" ? BlackHorizontalLogo : WhiteHorizontalLogo;
return (
// TODO: change to EPageTypes.SET_PASSWORD
<AuthenticationWrapper pageType={EPageTypes.NON_AUTHENTICATED}>
<AuthenticationWrapper pageType={EPageTypes.SET_PASSWORD}>
<div className="relative w-screen h-screen overflow-hidden">
<div className="absolute inset-0 z-0">
<Image
@@ -37,7 +37,9 @@ export const ProjectBreadcrumb = observer((props: TProjectBreadcrumbProps) => {
return {
value: projectId,
query: project?.name,
content: <SwitcherLabel name={project?.name} logo_props={project?.logo_props} LabelIcon={Briefcase} />,
content: (
<SwitcherLabel name={project?.name} logo_props={project?.logo_props} LabelIcon={Briefcase} type="material" />
),
};
})
.filter((option) => option !== undefined) as ICustomSearchSelectOption[];
@@ -1,8 +1,9 @@
import { ReactNode } from "react";
import { observer } from "mobx-react";
import { AppSidebarToggleButton } from "@/components/sidebar";
import { useAppTheme } from "@/hooks/store/use-app-theme";
export const ExtendedAppHeader = (props: { header: ReactNode }) => {
export const ExtendedAppHeader = observer((props: { header: ReactNode }) => {
const { header } = props;
// store hooks
const { sidebarCollapsed } = useAppTheme();
@@ -13,4 +14,4 @@ export const ExtendedAppHeader = (props: { header: ReactNode }) => {
<div className="w-full">{header}</div>
</>
);
};
});
+5 -1
View File
@@ -4,6 +4,7 @@ import {
MODULE_TRACKER_ELEMENTS,
PROJECT_PAGE_TRACKER_ELEMENTS,
PROJECT_TRACKER_ELEMENTS,
PROJECT_VIEW_TRACKER_ELEMENTS,
WORK_ITEM_TRACKER_ELEMENTS,
} from "@plane/constants";
import { TCommandPaletteActionList, TCommandPaletteShortcut, TCommandPaletteShortcutList } from "@plane/types";
@@ -78,7 +79,10 @@ export const getProjectShortcutsList: () => TCommandPaletteActionList = () => {
v: {
title: "Create a new view",
description: "Create a new view in the current project",
action: () => toggleCreateViewModal(true),
action: () => {
toggleCreateViewModal(true);
captureClick({ elementName: PROJECT_VIEW_TRACKER_ELEMENTS.COMMAND_PALETTE_ADD_ITEM });
},
},
backspace: {
title: "Bulk delete work items",
@@ -3,7 +3,12 @@
import { Command } from "cmdk";
import { ContrastIcon, FileText, Layers } from "lucide-react";
// hooks
import { CYCLE_TRACKER_ELEMENTS, MODULE_TRACKER_ELEMENTS, PROJECT_PAGE_TRACKER_ELEMENTS } from "@plane/constants";
import {
CYCLE_TRACKER_ELEMENTS,
MODULE_TRACKER_ELEMENTS,
PROJECT_PAGE_TRACKER_ELEMENTS,
PROJECT_VIEW_TRACKER_ELEMENTS,
} from "@plane/constants";
import { DiceIcon } from "@plane/ui";
// hooks
import { useCommandPalette } from "@/hooks/store";
@@ -55,6 +60,7 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
</Command.Group>
<Command.Group heading="View">
<Command.Item
data-ph-element={PROJECT_VIEW_TRACKER_ELEMENTS.COMMAND_PALETTE_ADD_ITEM}
onSelect={() => {
closePalette();
toggleCreateViewModal(true);
@@ -8,11 +8,18 @@ type TSwitcherIconProps = {
logo_url?: string;
LabelIcon: FC<ISvgIcons>;
size?: number;
type?: "lucide" | "material";
};
export const SwitcherIcon: FC<TSwitcherIconProps> = ({ logo_props, logo_url, LabelIcon, size = 12 }) => {
export const SwitcherIcon: FC<TSwitcherIconProps> = ({
logo_props,
logo_url,
LabelIcon,
size = 12,
type = "lucide",
}) => {
if (logo_props?.in_use) {
return <Logo logo={logo_props} size={size} type="lucide" />;
return <Logo logo={logo_props} size={size} type={type} />;
}
if (logo_url) {
@@ -33,13 +40,14 @@ type TSwitcherLabelProps = {
logo_url?: string;
name?: string;
LabelIcon: FC<ISvgIcons>;
type?: "lucide" | "material";
};
export const SwitcherLabel: FC<TSwitcherLabelProps> = (props) => {
const { logo_props, name, LabelIcon, logo_url } = props;
const { logo_props, name, LabelIcon, logo_url, type = "lucide" } = props;
return (
<div className="flex items-center gap-1 text-custom-text-200">
<SwitcherIcon logo_props={logo_props} logo_url={logo_url} LabelIcon={LabelIcon} />
<SwitcherIcon logo_props={logo_props} logo_url={logo_url} LabelIcon={LabelIcon} type={type} />
{truncateText(name ?? "", 40)}
</div>
);
@@ -1,4 +1,5 @@
import Image from "next/image";
import { USER_TRACKER_ELEMENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
// ui
import { getButtonStyling } from "@plane/ui";
@@ -23,6 +24,7 @@ export const ProductUpdatesFooter = () => {
<circle cx={1} cy={1} r={1} />
</svg>
<a
data-ph-element={USER_TRACKER_ELEMENTS.CHANGELOG_REDIRECTED}
href="https://go.plane.so/p-changelog"
target="_blank"
className="text-sm text-custom-text-200 hover:text-custom-text-100 hover:underline underline-offset-1 outline-none"
@@ -1,10 +1,13 @@
import { FC } from "react";
import { FC, useEffect } from "react";
import { observer } from "mobx-react";
import { USER_TRACKER_ELEMENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
// ui
import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
// components
import { ProductUpdatesFooter } from "@/components/global";
// helpers
import { captureView } from "@/helpers/event-tracker.helper";
// hooks
import { useInstance } from "@/hooks/store";
// plane web components
@@ -20,6 +23,12 @@ export const ProductUpdatesModal: FC<ProductUpdatesModalProps> = observer((props
const { t } = useTranslation();
const { config } = useInstance();
useEffect(() => {
if (isOpen) {
captureView({ elementName: USER_TRACKER_ELEMENTS.PRODUCT_CHANGELOG_MODAL });
}
}, [isOpen]);
return (
<ModalCore isOpen={isOpen} handleClose={handleClose} position={EModalPosition.CENTER} width={EModalWidth.XXXXL}>
<ProductUpdatesHeader />
@@ -32,6 +41,7 @@ export const ProductUpdatesModal: FC<ProductUpdatesModalProps> = observer((props
<div className="text-sm text-custom-text-200">
{t("please_visit")}
<a
data-ph-element={USER_TRACKER_ELEMENTS.CHANGELOG_REDIRECTED}
href="https://go.plane.so/p-changelog"
target="_blank"
className="text-sm text-custom-primary-100 font-medium hover:text-custom-primary-200 underline underline-offset-1 outline-none"
@@ -1,6 +1,6 @@
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import { EIssueFilterType } from "@plane/constants";
import { EIssueFilterType, PROJECT_VIEW_TRACKER_ELEMENTS } from "@plane/constants";
import { EIssuesStoreType, IIssueFilterOptions } from "@plane/types";
// hooks
import { Header, EHeaderVariant } from "@plane/ui";
@@ -95,6 +95,7 @@ export const CycleAppliedFiltersRoot: React.FC = observer(() => {
display_filters: issueFilters?.displayFilters,
display_properties: issueFilters?.displayProperties,
}}
trackerElement={PROJECT_VIEW_TRACKER_ELEMENTS.CYCLE_HEADER_SAVE_AS_VIEW_BUTTON}
/>
</Header>
);
@@ -11,6 +11,7 @@ import {
EIssueFilterType,
EUserPermissions,
EUserPermissionsLevel,
GLOBAL_VIEW_TRACKER_ELEMENTS,
GLOBAL_VIEW_TRACKER_EVENTS,
} from "@plane/constants";
import { EIssuesStoreType, EViewAccess, IIssueFilterOptions, TStaticViewTypes } from "@plane/types";
@@ -189,6 +190,7 @@ export const GlobalViewsAppliedFiltersRoot = observer((props: Props) => {
isAuthorizedUser={isAuthorizedUser}
setIsModalOpen={setIsModalOpen}
handleUpdateView={handleUpdateView}
trackerElement={GLOBAL_VIEW_TRACKER_ELEMENTS.HEADER_SAVE_VIEW_BUTTON}
/>
) : (
<></>
@@ -1,6 +1,6 @@
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import { EIssueFilterType } from "@plane/constants";
import { EIssueFilterType, PROJECT_VIEW_TRACKER_ELEMENTS } from "@plane/constants";
import { EIssuesStoreType, IIssueFilterOptions } from "@plane/types";
// hooks
import { Header, EHeaderVariant } from "@plane/ui";
@@ -94,6 +94,7 @@ export const ModuleAppliedFiltersRoot: React.FC = observer(() => {
display_filters: issueFilters?.displayFilters,
display_properties: issueFilters?.displayProperties,
}}
trackerElement={PROJECT_VIEW_TRACKER_ELEMENTS.MODULE_HEADER_SAVE_AS_VIEW_BUTTON}
/>
</Header>
);
@@ -1,7 +1,12 @@
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// types
import { EIssueFilterType, EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import {
EIssueFilterType,
EUserPermissions,
EUserPermissionsLevel,
PROJECT_VIEW_TRACKER_ELEMENTS,
} from "@plane/constants";
import { EIssuesStoreType, IIssueFilterOptions } from "@plane/types";
// ui
import { Header, EHeaderVariant } from "@plane/ui";
@@ -94,6 +99,7 @@ export const ProjectAppliedFiltersRoot: React.FC<TProjectAppliedFiltersRootProps
display_filters: issueFilters?.displayFilters,
display_properties: issueFilters?.displayProperties,
}}
trackerElement={PROJECT_VIEW_TRACKER_ELEMENTS.PROJECT_HEADER_SAVE_AS_VIEW_BUTTON}
/>
)}
</Header.RightItem>
@@ -6,7 +6,12 @@ import isEmpty from "lodash/isEmpty";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// types
import { EIssueFilterType, EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import {
EIssueFilterType,
EUserPermissions,
EUserPermissionsLevel,
PROJECT_VIEW_TRACKER_ELEMENTS,
} from "@plane/constants";
import { EIssuesStoreType, EViewAccess, IIssueFilterOptions } from "@plane/types";
// components
import { Header, EHeaderVariant } from "@plane/ui";
@@ -145,6 +150,7 @@ export const ProjectViewAppliedFiltersRoot: React.FC = observer(() => {
isAuthorizedUser={isAuthorizedUser}
setIsModalOpen={setIsModalOpen}
handleUpdateView={handleUpdateView}
trackerElement={PROJECT_VIEW_TRACKER_ELEMENTS.HEADER_SAVE_VIEW_BUTTON}
/>
</Header.RightItem>
</Header>
@@ -14,10 +14,11 @@ interface ISaveFilterView {
display_filters?: IIssueDisplayFilterOptions;
display_properties?: IIssueDisplayProperties;
};
trackerElement: string;
}
export const SaveFilterView: FC<ISaveFilterView> = (props) => {
const { workspaceSlug, projectId, filterParams } = props;
const { workspaceSlug, projectId, filterParams, trackerElement } = props;
const [viewModal, setViewModal] = useState<boolean>(false);
@@ -31,7 +32,7 @@ export const SaveFilterView: FC<ISaveFilterView> = (props) => {
onClose={() => setViewModal(false)}
/>
<Button size="sm" onClick={() => setViewModal(true)}>
<Button size="sm" onClick={() => setViewModal(true)} data-ph-element={trackerElement}>
Save View
</Button>
</div>
@@ -6,7 +6,12 @@ import Image from "next/image";
import { useTheme } from "next-themes";
import { Controller, useForm } from "react-hook-form";
import { Eye, EyeOff } from "lucide-react";
import { E_PASSWORD_STRENGTH, ONBOARDING_TRACKER_ELEMENTS, USER_TRACKER_EVENTS } from "@plane/constants";
import {
AUTH_TRACKER_EVENTS,
E_PASSWORD_STRENGTH,
ONBOARDING_TRACKER_ELEMENTS,
USER_TRACKER_EVENTS,
} from "@plane/constants";
// types
import { useTranslation } from "@plane/i18n";
import { IUser, TUserProfile, TOnboardingSteps } from "@plane/types";
@@ -123,7 +128,18 @@ export const ProfileSetup: React.FC<Props> = observer((props) => {
const handleSetPassword = async (password: string) => {
const token = await authService.requestCSRFToken().then((data) => data?.csrf_token);
await authService.setPassword(token, { password });
await authService
.setPassword(token, { password })
.then(() => {
captureSuccess({
eventName: AUTH_TRACKER_EVENTS.password_created,
});
})
.catch(() => {
captureError({
eventName: AUTH_TRACKER_EVENTS.password_created,
});
});
};
const handleSubmitProfileSetup = async (formData: TProfileSetupFormValues) => {
@@ -180,7 +196,18 @@ export const ProfileSetup: React.FC<Props> = observer((props) => {
await Promise.all([
updateCurrentUser(userDetailsPayload),
formData.password && handleSetPassword(formData.password),
]).then(() => setProfileSetupStep(EProfileSetupSteps.USER_PERSONALIZATION));
]).then(() => {
if (formData.password) {
captureView({
elementName: ONBOARDING_TRACKER_ELEMENTS.PASSWORD_CREATION_SELECTED,
});
} else {
captureView({
elementName: ONBOARDING_TRACKER_ELEMENTS.PASSWORD_CREATION_SKIPPED,
});
}
setProfileSetupStep(EProfileSetupSteps.USER_PERSONALIZATION);
});
} catch {
captureError({
eventName: USER_TRACKER_EVENTS.add_details,
@@ -4,9 +4,12 @@ import React, { useState } from "react";
import { observer } from "mobx-react";
import { useParams, useRouter } from "next/navigation";
// types
import { PROJECT_VIEW_TRACKER_EVENTS } from "@plane/constants";
import { IProjectView } from "@plane/types";
// ui
import { AlertModalCore, TOAST_TYPE, setToast } from "@plane/ui";
// helpers
import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useProjectView } from "@/hooks/store";
@@ -45,14 +48,26 @@ export const DeleteProjectViewModal: React.FC<Props> = observer((props) => {
title: "Success!",
message: "View deleted successfully.",
});
captureSuccess({
eventName: PROJECT_VIEW_TRACKER_EVENTS.delete,
payload: {
view_id: data.id,
},
});
})
.catch(() =>
.catch(() => {
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
message: "View could not be deleted. Please try again.",
})
)
});
captureError({
eventName: PROJECT_VIEW_TRACKER_EVENTS.delete,
payload: {
view_id: data.id,
},
});
})
.finally(() => {
setIsDeleteLoading(false);
});
+32 -7
View File
@@ -3,12 +3,14 @@
import { FC } from "react";
import { observer } from "mobx-react";
// types
import { PROJECT_VIEW_TRACKER_EVENTS } from "@plane/constants";
import { IProjectView } from "@plane/types";
// ui
import { EModalPosition, EModalWidth, ModalCore, TOAST_TYPE, setToast } from "@plane/ui";
// components
import { ProjectViewForm } from "@/components/views";
// hooks
import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useProjectView } from "@/hooks/store";
import { useAppRouter } from "@/hooks/use-app-router";
import useKeypress from "@/hooks/use-keypress";
@@ -43,26 +45,49 @@ export const CreateUpdateProjectViewModal: FC<Props> = observer((props) => {
title: "Success!",
message: "View created successfully.",
});
captureSuccess({
eventName: PROJECT_VIEW_TRACKER_EVENTS.create,
payload: {
view_id: res.id,
},
});
})
.catch(() =>
.catch(() => {
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
message: "Something went wrong. Please try again.",
})
);
});
captureError({
eventName: PROJECT_VIEW_TRACKER_EVENTS.create,
});
});
};
const handleUpdateView = async (payload: IProjectView) => {
await updateView(workspaceSlug, projectId, data?.id as string, payload)
.then(() => handleClose())
.catch((err) =>
.then(() => {
handleClose();
captureSuccess({
eventName: PROJECT_VIEW_TRACKER_EVENTS.update,
payload: {
view_id: data?.id,
},
});
})
.catch((err) => {
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
message: err?.detail ?? "Something went wrong. Please try again.",
})
);
});
captureError({
eventName: PROJECT_VIEW_TRACKER_EVENTS.update,
payload: {
view_id: data?.id,
},
});
});
};
const handleFormSubmit = async (formData: IProjectView) => {
@@ -4,7 +4,7 @@ import { useState } from "react";
import { observer } from "mobx-react";
import { ExternalLink, Link, Pencil, Trash2 } from "lucide-react";
// types
import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { EUserPermissions, EUserPermissionsLevel, PROJECT_VIEW_TRACKER_ELEMENTS } from "@plane/constants";
import { IProjectView } from "@plane/types";
// ui
import { ContextMenu, CustomMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui";
@@ -12,6 +12,7 @@ import { copyUrlToClipboard, cn } from "@plane/utils";
// components
import { CreateUpdateProjectViewModal, DeleteProjectViewModal } from "@/components/views";
// helpers
import { captureClick } from "@/helpers/event-tracker.helper";
// hooks
import { useUser, useUserPermissions } from "@/hooks/store";
import { PublishViewModal, useViewPublish } from "@/plane-web/components/views/publish";
@@ -83,6 +84,14 @@ export const ViewQuickActions: React.FC<Props> = observer((props) => {
if (publishContextMenu) MENU_ITEMS.splice(2, 0, publishContextMenu);
const CONTEXT_MENU_ITEMS = MENU_ITEMS.map((item) => ({
...item,
action: () => {
captureClick({ elementName: PROJECT_VIEW_TRACKER_ELEMENTS.LIST_ITEM_CONTEXT_MENU });
item.action();
},
}));
return (
<>
<CreateUpdateProjectViewModal
@@ -94,7 +103,7 @@ export const ViewQuickActions: React.FC<Props> = observer((props) => {
/>
<DeleteProjectViewModal data={view} isOpen={deleteViewModal} onClose={() => setDeleteViewModal(false)} />
<PublishViewModal isOpen={isPublishModalOpen} onClose={() => setPublishModalOpen(false)} view={view} />
<ContextMenu parentRef={parentRef} items={MENU_ITEMS} />
<ContextMenu parentRef={parentRef} items={CONTEXT_MENU_ITEMS} />
<CustomMenu ellipsis placement="bottom-end" closeOnSelect buttonClassName={customClassName}>
{MENU_ITEMS.map((item) => {
if (item.shouldRender === false) return null;
@@ -104,6 +113,7 @@ export const ViewQuickActions: React.FC<Props> = observer((props) => {
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
captureClick({ elementName: PROJECT_VIEW_TRACKER_ELEMENTS.QUICK_ACTIONS });
item.action();
}}
className={cn(
@@ -1,5 +1,4 @@
import { SetStateAction, useEffect, useState } from "react";
import { GLOBAL_VIEW_TRACKER_ELEMENTS } from "@plane/constants";
import { Button } from "@plane/ui";
import { LockedComponent } from "../icons/locked-component";
@@ -11,6 +10,7 @@ type Props = {
setIsModalOpen: (value: SetStateAction<boolean>) => void;
handleUpdateView: () => void;
lockedTooltipContent?: string;
trackerElement: string;
};
export const UpdateViewComponent = (props: Props) => {
@@ -22,6 +22,7 @@ export const UpdateViewComponent = (props: Props) => {
setIsModalOpen,
handleUpdateView,
lockedTooltipContent,
trackerElement,
} = props;
const [isUpdating, setIsUpdating] = useState(false);
@@ -63,7 +64,7 @@ export const UpdateViewComponent = (props: Props) => {
variant="outline-primary"
size="md"
className="flex-shrink-0"
data-ph-element={GLOBAL_VIEW_TRACKER_ELEMENTS.HEADER_SAVE_VIEW_BUTTON}
data-ph-element={trackerElement}
onClick={() => setIsModalOpen(true)}
>
Save as
@@ -1,7 +1,7 @@
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// plane imports
import { EUserPermissionsLevel } from "@plane/constants";
import { EUserPermissionsLevel, PROJECT_VIEW_TRACKER_ELEMENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { EUserProjectRoles } from "@plane/types";
// components
@@ -10,6 +10,7 @@ import { ComicBoxButton, DetailedEmptyState, SimpleEmptyState } from "@/componen
import { ViewListLoader } from "@/components/ui";
import { ProjectViewListItem } from "@/components/views";
// hooks
import { captureClick } from "@/helpers/event-tracker.helper";
import { useCommandPalette, useProjectView, useUserPermissions } from "@/hooks/store";
import { useResolvedAssetPath } from "@/hooks/use-resolved-asset-path";
@@ -71,7 +72,10 @@ export const ProjectViewsList = observer(() => {
label={t("project_views.empty_state.general.primary_button.text")}
title={t("project_views.empty_state.general.primary_button.comic.title")}
description={t("project_views.empty_state.general.primary_button.comic.description")}
onClick={() => toggleCreateViewModal(true)}
onClick={() => {
toggleCreateViewModal(true);
captureClick({ elementName: PROJECT_VIEW_TRACKER_ELEMENTS.EMPTY_STATE_CREATE_BUTTON });
}}
disabled={!canPerformEmptyStateActions}
/>
}
@@ -113,6 +113,7 @@ export const AppProgressBar = React.memo(
useEffect(() => {
if (progressDoneTimer) clearTimeout(progressDoneTimer);
// eslint-disable-next-line react-hooks/exhaustive-deps
progressDoneTimer = setTimeout(() => {
NProgress.done();
}, stopDelay);
@@ -141,6 +142,7 @@ export const AppProgressBar = React.memo(
}, stopDelay);
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const handleAnchorClick: any = (event: MouseEvent) => {
// Skip preventDefault
if (event.defaultPrevented) return;
@@ -182,7 +184,9 @@ export const AppProgressBar = React.memo(
!href.startsWith("tel:") &&
!href.startsWith("mailto:") &&
!href.startsWith("blob:") &&
!href.startsWith("javascript:");
!href.startsWith("javascript:") &&
!href.startsWith("data:") &&
!href.startsWith("vbscript:");
return !isNProgressDisabled && isNotTelOrMailto && getAnchorProperty(anchor, "target") !== "_blank";
});
@@ -211,6 +215,7 @@ export const AppProgressBar = React.memo(
elementsWithAttachedHandlers.current = [];
window.history.pushState = originalWindowHistoryPushState;
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return styles;
@@ -250,6 +255,7 @@ export function useRouter() {
if (startPosition && startPosition > 0) NProgress.set(startPosition);
NProgress.start();
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[router]
);
@@ -267,6 +273,7 @@ export function useRouter() {
startProgress(NProgressOptions?.startPosition);
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[router]
);
@@ -275,6 +282,7 @@ export function useRouter() {
progress(href, options, NProgressOptions);
return router.push(href, options);
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[router, startProgress]
);
@@ -283,6 +291,7 @@ export function useRouter() {
progress(href, options, NProgressOptions);
return router.replace(href, options);
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[router, startProgress]
);
@@ -294,6 +303,7 @@ export function useRouter() {
return router.back();
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[router]
);
@@ -1 +1 @@
export * from "./extended-app-header";
export * from "ce/components/common/extended-app-header";
+5 -5
View File
@@ -57,7 +57,7 @@ function spinner() {
function checkLatestRelease(){
echo "Checking for the latest release..." >&2
local latest_release=$(curl -s https://api.github.com/repos/$GH_REPO/releases/latest | grep -o '"tag_name": "[^"]*"' | sed 's/"tag_name": "//;s/"//g')
local latest_release=$(curl -sSL https://api.github.com/repos/$GH_REPO/releases/latest | grep -o '"tag_name": "[^"]*"' | sed 's/"tag_name": "//;s/"//g')
if [ -z "$latest_release" ]; then
echo "Failed to check for the latest release. Exiting..." >&2
exit 1
@@ -247,7 +247,7 @@ function download() {
mv $PLANE_INSTALL_DIR/docker-compose.yaml $PLANE_INSTALL_DIR/archive/$TS.docker-compose.yaml
fi
RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml?$(date +%s)")
RESPONSE=$(curl -sSL -H 'Cache-Control: no-cache, no-store' -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml?$(date +%s)")
BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g')
STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
@@ -255,7 +255,7 @@ function download() {
echo "$BODY" > $PLANE_INSTALL_DIR/docker-compose.yaml
else
# Fallback to download from the raw github url
RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/docker-compose.yml?$(date +%s)")
RESPONSE=$(curl -sSL -H 'Cache-Control: no-cache, no-store' -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/docker-compose.yml?$(date +%s)")
BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g')
STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
@@ -269,7 +269,7 @@ function download() {
fi
fi
RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env?$(date +%s)")
RESPONSE=$(curl -sSL -H 'Cache-Control: no-cache, no-store' -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env?$(date +%s)")
BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g')
STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
@@ -277,7 +277,7 @@ function download() {
echo "$BODY" > $PLANE_INSTALL_DIR/variables-upgrade.env
else
# Fallback to download from the raw github url
RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/variables.env?$(date +%s)")
RESPONSE=$(curl -sSL -H 'Cache-Control: no-cache, no-store' -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/variables.env?$(date +%s)")
BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g')
STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
@@ -268,6 +268,7 @@ export const AUTH_TRACKER_EVENTS = {
sign_in_with_password: "sign_in_with_password",
forgot_password: "forgot_password_clicked",
new_code_requested: "new_code_requested",
password_created: "password_created",
};
export const AUTH_TRACKER_ELEMENTS = {
@@ -278,6 +279,7 @@ export const AUTH_TRACKER_ELEMENTS = {
SIGN_IN_WITH_UNIQUE_CODE: "sign_in_with_unique_code",
REQUEST_NEW_CODE: "request_new_code",
VERIFY_CODE: "verify_code",
SET_PASSWORD_FORM: "set_password_form",
};
/**
@@ -299,6 +301,29 @@ export const GLOBAL_VIEW_TRACKER_ELEMENTS = {
LIST_ITEM: "global_view_list_item",
};
/**
* ===========================================================================
* Project View Events and Elements
* ===========================================================================
*/
export const PROJECT_VIEW_TRACKER_EVENTS = {
create: "project_view_created",
update: "project_view_updated",
delete: "project_view_deleted",
};
export const PROJECT_VIEW_TRACKER_ELEMENTS = {
RIGHT_HEADER_ADD_BUTTON: "project_view_right_header_add_button",
COMMAND_PALETTE_ADD_ITEM: "command_palette_add_project_view_item",
EMPTY_STATE_CREATE_BUTTON: "project_view_empty_state_create_button",
HEADER_SAVE_VIEW_BUTTON: "project_view_header_save_view_button",
PROJECT_HEADER_SAVE_AS_VIEW_BUTTON: "project_view_header_save_as_view_button",
CYCLE_HEADER_SAVE_AS_VIEW_BUTTON: "cycle_header_save_as_view_button",
MODULE_HEADER_SAVE_AS_VIEW_BUTTON: "module_header_save_as_view_button",
QUICK_ACTIONS: "project_view_quick_actions",
LIST_ITEM_CONTEXT_MENU: "project_view_list_item_context_menu",
};
/**
* ===========================================================================
* Product Tour Events and Elements
@@ -343,6 +368,11 @@ export const USER_TRACKER_EVENTS = {
onboarding_complete: "user_onboarding_completed",
};
export const USER_TRACKER_ELEMENTS = {
PRODUCT_CHANGELOG_MODAL: "product_changelog_modal",
CHANGELOG_REDIRECTED: "changelog_redirected",
};
/**
* ===========================================================================
* Onboarding Events and Elements
@@ -350,6 +380,8 @@ export const USER_TRACKER_EVENTS = {
*/
export const ONBOARDING_TRACKER_ELEMENTS = {
PROFILE_SETUP_FORM: "onboarding_profile_setup_form",
PASSWORD_CREATION_SELECTED: "onboarding_password_creation_selected",
PASSWORD_CREATION_SKIPPED: "onboarding_password_creation_skipped",
};
/**
+1
View File
@@ -0,0 +1 @@
export {};
+2 -1
View File
@@ -1 +1,2 @@
export * from "./ai.service";
export * from "./core";
export * from "./extended";
+1
View File
@@ -0,0 +1 @@
export {};
+3 -2
View File
@@ -1,2 +1,3 @@
export * from "./auth.service";
export * from "./sites-auth.service";
export * from "./admin";
export * from "./sites";
export * from "./web";
@@ -1,8 +1,8 @@
import { API_BASE_URL } from "@plane/constants";
// types
import { IEmailCheckData, IEmailCheckResponse } from "@plane/types";
// services
import { APIService } from "../api.service";
// types
import { EmailCheckResponseSchema, TEmailCheckResponse, TEmailCheckData } from "./types";
/**
* Service class for handling authentication-related operations for Plane space application
@@ -11,10 +11,6 @@ import { APIService } from "../api.service";
* @remarks This service is only available for plane sites
*/
export class SitesAuthService extends APIService {
/**
* Creates an instance of SitesAuthService
* Initializes with the base API URL
*/
constructor(BASE_URL?: string) {
super(BASE_URL || API_BASE_URL);
}
@@ -25,9 +21,9 @@ export class SitesAuthService extends APIService {
* @returns {Promise<IEmailCheckResponse>} Response indicating email status
* @throws {Error} Throws response data if the request fails
*/
async emailCheck(data: IEmailCheckData): Promise<IEmailCheckResponse> {
async emailCheck(data: TEmailCheckData): Promise<TEmailCheckResponse> {
return this.post("/auth/spaces/email-check/", data, { headers: {} })
.then((response) => response?.data)
.then((response) => EmailCheckResponseSchema.parse(response?.data))
.catch((error) => {
throw error?.response?.data;
});
+14
View File
@@ -0,0 +1,14 @@
import * as z from "zod";
export const EmailCheckResponseSchema = z.object({
email: z.string().email(),
status: z.enum(["MAGIC_CODE", "CREDENTIAL"]),
existing: z.boolean(),
is_password_autoset: z.boolean(),
});
export type TEmailCheckResponse = z.infer<typeof EmailCheckResponseSchema>;
export type TEmailCheckData = {
email: string;
};
@@ -6,7 +6,6 @@ import type {
IInstanceAdmin,
IInstanceConfiguration,
IInstanceInfo,
TPage,
} from "@plane/types";
// api service
import { APIService } from "../api.service";
@@ -17,10 +16,6 @@ import { APIService } from "../api.service";
* @extends {APIService}
*/
export class InstanceService extends APIService {
/**
* Creates an instance of InstanceService
* Initializes the service with the base API URL
*/
constructor() {
super(API_BASE_URL);
}
@@ -39,19 +34,6 @@ export class InstanceService extends APIService {
});
}
/**
* Fetches the changelog for the current instance
* @returns {Promise<TPage>} Promise resolving to the changelog page data
* @throws {Error} If the API request fails
*/
async changelog(): Promise<TPage> {
return this.get("/api/instances/changelog/")
.then((response) => response.data)
.catch((error) => {
throw error?.response?.data;
});
}
/**
* Fetches the list of instance admins
* @returns {Promise<IInstanceAdmin[]>} Promise resolving to an array of instance admins
+1 -1
View File
@@ -1 +1 @@
export * from "./instance.service";
export * from "./core";
+57
View File
@@ -0,0 +1,57 @@
import * as z from "zod";
export const InstanceSchema = z.object({
id: z.string(),
created_at: z.string(),
updated_at: z.string(),
instance_name: z.string().optional(),
whitelist_emails: z.string().optional(),
instance_id: z.string().optional(),
current_version: z.string().optional(),
latest_version: z.string().optional(),
last_checked_at: z.string().optional(),
namespace: z.string().optional(),
is_telemetry_enabled: z.boolean(),
is_support_required: z.boolean(),
is_activated: z.boolean(),
is_setup_done: z.boolean(),
is_signup_screen_visited: z.boolean(),
user_count: z.number().optional(),
is_verified: z.boolean(),
workspaces_exist: z.boolean(),
});
export type TInstance = z.infer<typeof InstanceSchema>;
export const InstanceConfigSchema = z.object({
enable_signup: z.boolean(),
is_workspace_creation_disabled: z.boolean(),
is_google_enabled: z.boolean(),
is_github_enabled: z.boolean(),
is_gitlab_enabled: z.boolean(),
is_magic_login_enabled: z.boolean(),
is_email_password_enabled: z.boolean(),
github_app_name: z.string().optional(),
slack_client_id: z.string().optional(),
posthog_api_key: z.string().optional(),
posthog_host: z.string().optional(),
has_unsplash_configured: z.boolean(),
has_llm_configured: z.boolean(),
file_size_limit: z.number().optional(),
is_smtp_configured: z.boolean(),
app_base_url: z.string().optional(),
space_base_url: z.string().optional(),
admin_base_url: z.string().optional(),
is_intercom_enabled: z.boolean(),
intercom_app_id: z.string().optional(),
instance_changelog_url: z.string().optional(),
});
export type TInstanceConfig = z.infer<typeof InstanceConfigSchema>;
export const InstanceResponseSchema = z.object({
instance: InstanceSchema,
config: InstanceConfigSchema,
});
export type TInstanceResponse = z.infer<typeof InstanceResponseSchema>;
-8
View File
@@ -1,8 +0,0 @@
import { API_BASE_URL } from "@plane/constants";
import { APIService } from "./api.service";
export abstract class LiveService extends APIService {
constructor(BASE_URL?: string) {
super(BASE_URL || API_BASE_URL);
}
}