-
+
+
+ {
+ setSnoozed(false);
+ setArchived(false);
+ setReadNotification((prev) => !prev);
+ }}
+ >
+
+
+
+
+ {
+ setArchived(false);
+ setReadNotification(false);
+ setSnoozed((prev) => !prev);
+ }}
+ >
+
+
+
+
+ {
+ setSnoozed(false);
+ setReadNotification(false);
+ setArchived((prev) => !prev);
+ }}
+ >
+
+
+
closePopover()}>
From 1bae9289f50b4d59ea6270c207900a3df1e53dd7 Mon Sep 17 00:00:00 2001
From: Nikhil <118773738+pablohashescobar@users.noreply.github.com>
Date: Wed, 19 Jul 2023 20:06:12 +0530
Subject: [PATCH 04/15] fix: user migrations for back population (#1578)
---
.../0037_issue_archived_at_project_archive_in_and_more.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/apiserver/plane/db/migrations/0037_issue_archived_at_project_archive_in_and_more.py b/apiserver/plane/db/migrations/0037_issue_archived_at_project_archive_in_and_more.py
index bd2ff322f..d11e1afd8 100644
--- a/apiserver/plane/db/migrations/0037_issue_archived_at_project_archive_in_and_more.py
+++ b/apiserver/plane/db/migrations/0037_issue_archived_at_project_archive_in_and_more.py
@@ -8,6 +8,7 @@ import plane.db.models.user
import uuid
+
def onboarding_default_steps(apps, schema_editor):
default_onboarding_schema = {
"workspace_join": True,
@@ -23,7 +24,7 @@ def onboarding_default_steps(apps, schema_editor):
obj.is_tour_completed = True
updated_user.append(obj)
- Model.objects.bulk_update(updated_user, ["onboarding_step"], batch_size=100)
+ Model.objects.bulk_update(updated_user, ["onboarding_step", "is_tour_completed"], batch_size=100)
class Migration(migrations.Migration):
@@ -79,6 +80,7 @@ class Migration(migrations.Migration):
name="onboarding_step",
field=models.JSONField(default=plane.db.models.user.get_default_onboarding),
),
+ migrations.RunPython(onboarding_default_steps),
migrations.CreateModel(
name="Notification",
fields=[
From 26b18b431ba6ad5b3e7bf5f1a1a38ea651930753 Mon Sep 17 00:00:00 2001
From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com>
Date: Wed, 19 Jul 2023 20:37:40 +0530
Subject: [PATCH 05/15] fix: total notifications count (#1579)
---
apps/app/components/notifications/notification-popover.tsx | 2 +-
apps/app/hooks/use-user-notifications.tsx | 2 +-
apps/app/services/notifications.service.ts | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/apps/app/components/notifications/notification-popover.tsx b/apps/app/components/notifications/notification-popover.tsx
index 45e5d7bc0..001669721 100644
--- a/apps/app/components/notifications/notification-popover.tsx
+++ b/apps/app/components/notifications/notification-popover.tsx
@@ -69,7 +69,7 @@ export const NotificationPopover = () => {
{
label: "Subscribed",
value: "watching",
- unreadCount: notificationCount?.watching_notifications,
+ unreadCount: notificationCount?.watching_issues,
},
];
diff --git a/apps/app/hooks/use-user-notifications.tsx b/apps/app/hooks/use-user-notifications.tsx
index 3225e9639..b202a1deb 100644
--- a/apps/app/hooks/use-user-notifications.tsx
+++ b/apps/app/hooks/use-user-notifications.tsx
@@ -170,7 +170,7 @@ const useUserNotification = () => {
setSelectedTab,
totalNotificationCount: notificationCount
? notificationCount.created_issues +
- notificationCount.watching_notifications +
+ notificationCount.watching_issues +
notificationCount.my_issues
: null,
notificationCount,
diff --git a/apps/app/services/notifications.service.ts b/apps/app/services/notifications.service.ts
index f2b49b954..412b03988 100644
--- a/apps/app/services/notifications.service.ts
+++ b/apps/app/services/notifications.service.ts
@@ -159,7 +159,7 @@ class UserNotificationsServices extends APIService {
async getUnreadNotificationsCount(workspaceSlug: string): Promise<{
created_issues: number;
my_issues: number;
- watching_notifications: number;
+ watching_issues: number;
}> {
return this.get(`/api/workspaces/${workspaceSlug}/users/notifications/unread/`)
.then((response) => response?.data)
From 6eb72507a59afe954b86277fe4bb5c8ce20a0734 Mon Sep 17 00:00:00 2001
From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com>
Date: Thu, 20 Jul 2023 10:52:52 +0530
Subject: [PATCH 06/15] fix: notification card (#1583)
---
.../notifications/notification-card.tsx | 163 ++++++------
.../notifications/notification-popover.tsx | 4 +-
.../app/components/workspace/help-section.tsx | 199 ++++----------
.../components/workspace/sidebar-dropdown.tsx | 6 +-
.../workspace/upgrade-to-pro-modal.tsx | 248 ------------------
apps/app/helpers/date-time.helper.ts | 2 +-
.../[workspaceSlug]/settings/billing.tsx | 14 +-
7 files changed, 145 insertions(+), 491 deletions(-)
delete mode 100644 apps/app/components/workspace/upgrade-to-pro-modal.tsx
diff --git a/apps/app/components/notifications/notification-card.tsx b/apps/app/components/notifications/notification-card.tsx
index 40728d804..321e9694c 100644
--- a/apps/app/components/notifications/notification-card.tsx
+++ b/apps/app/components/notifications/notification-card.tsx
@@ -10,7 +10,7 @@ import useToast from "hooks/use-toast";
import { CustomMenu, Icon, Tooltip } from "components/ui";
// helper
-import { stripHTML, replaceUnderscoreIfSnakeCase } from "helpers/string.helper";
+import { stripHTML, replaceUnderscoreIfSnakeCase, truncateText } from "helpers/string.helper";
import {
formatDateDistance,
render12HourFormatTime,
@@ -32,7 +32,7 @@ type NotificationCardProps = {
const snoozeOptions = [
{
- label: "1 days",
+ label: "1 day",
value: new Date(new Date().getTime() + 24 * 60 * 60 * 1000),
},
{
@@ -79,99 +79,100 @@ export const NotificationCard: React.FC
= (props) => {
`/${workspaceSlug}/projects/${notification.project}/issues/${notification.data.issue.id}`
);
}}
- className={`group relative py-3 px-6 cursor-pointer ${
+ className={`group w-full flex items-center gap-4 p-3 pl-6 relative cursor-pointer ${
notification.read_at === null ? "bg-custom-primary-70/5" : "hover:bg-custom-background-200"
}`}
>
{notification.read_at === null && (
)}
-
-
- {notification.triggered_by_details.avatar &&
- notification.triggered_by_details.avatar !== "" ? (
-
-
-
- ) : (
-
-
- {notification.triggered_by_details.first_name[0].toUpperCase()}
-
-
- )}
-
-
-
-
- {notification.triggered_by_details.first_name}{" "}
- {notification.triggered_by_details.last_name}{" "}
+
+ {notification.triggered_by_details.avatar &&
+ notification.triggered_by_details.avatar !== "" ? (
+
+
+
+ ) : (
+
+
+ {notification.triggered_by_details.first_name[0].toUpperCase()}
- {notification.data.issue_activity.field !== "comment" &&
- notification.data.issue_activity.verb}{" "}
- {notification.data.issue_activity.field === "comment"
- ? "commented"
- : notification.data.issue_activity.field === "None"
- ? null
- : replaceUnderscoreIfSnakeCase(notification.data.issue_activity.field)}{" "}
- {notification.data.issue_activity.field !== "comment" &&
- notification.data.issue_activity.field !== "None"
- ? "to"
- : ""}
-
- {" "}
- {notification.data.issue_activity.field !== "None" ? (
- notification.data.issue_activity.field !== "comment" ? (
- notification.data.issue_activity.field === "target_date" ? (
- renderShortDateWithYearFormat(notification.data.issue_activity.new_value)
- ) : notification.data.issue_activity.field === "attachment" ? (
- "the issue"
- ) : stripHTML(notification.data.issue_activity.new_value).length > 55 ? (
- stripHTML(notification.data.issue_activity.new_value).slice(0, 50) + "..."
- ) : (
- stripHTML(notification.data.issue_activity.new_value)
- )
+
+ )}
+
+
+
+
+ {notification.triggered_by_details.first_name}{" "}
+ {notification.triggered_by_details.last_name}{" "}
+
+ {notification.data.issue_activity.field !== "comment" &&
+ notification.data.issue_activity.verb}{" "}
+ {notification.data.issue_activity.field === "comment"
+ ? "commented"
+ : notification.data.issue_activity.field === "None"
+ ? null
+ : replaceUnderscoreIfSnakeCase(notification.data.issue_activity.field)}{" "}
+ {notification.data.issue_activity.field !== "comment" &&
+ notification.data.issue_activity.field !== "None"
+ ? "to"
+ : ""}
+
+ {" "}
+ {notification.data.issue_activity.field !== "None" ? (
+ notification.data.issue_activity.field !== "comment" ? (
+ notification.data.issue_activity.field === "target_date" ? (
+ renderShortDateWithYearFormat(notification.data.issue_activity.new_value)
+ ) : notification.data.issue_activity.field === "attachment" ? (
+ "the issue"
+ ) : stripHTML(notification.data.issue_activity.new_value).length > 55 ? (
+ stripHTML(notification.data.issue_activity.new_value).slice(0, 50) + "..."
) : (
-
- {`"`}
- {notification.data.issue_activity.new_value.length > 55
- ? notification?.data?.issue_activity?.issue_comment?.slice(0, 50) + "..."
- : notification.data.issue_activity.issue_comment}
- {`"`}
-
+ stripHTML(notification.data.issue_activity.new_value)
)
) : (
- "the issue and assigned it to you."
- )}
-
-
-
-
-
- {notification.data.issue.identifier}-{notification.data.issue.sequence_id}{" "}
- {notification.data.issue.name}
-
- {notification.snoozed_till ? (
-
-
- Till {renderShortDate(notification.snoozed_till)},{" "}
- {render12HourFormatTime(notification.snoozed_till)}
+ {`"`}
+ {notification.data.issue_activity.new_value.length > 55
+ ? notification?.data?.issue_activity?.issue_comment?.slice(0, 50) + "..."
+ : notification.data.issue_activity.issue_comment}
+ {`"`}
-
+ )
) : (
-
{formatDateDistance(notification.created_at)}
+ "the issue and assigned it to you."
)}
-
+
+
+
+
+
+ {truncateText(
+ `${notification.data.issue.identifier}-${notification.data.issue.sequence_id} ${notification.data.issue.name}`,
+ 50
+ )}
+
+ {notification.snoozed_till ? (
+
+
+
+ Till {renderShortDate(notification.snoozed_till)},{" "}
+ {render12HourFormatTime(notification.snoozed_till)}
+
+
+ ) : (
+
+ {formatDateDistance(notification.created_at)}
+
+ )}
-
{[
{
@@ -192,7 +193,7 @@ export const NotificationCard: React.FC = (props) => {
{
id: 2,
name: notification.archived_at ? "Unarchive" : "Archive",
- icon: "archive",
+ icon: notification.archived_at ? "unarchive" : "archive",
onClick: () => {
markNotificationArchivedStatus(notification.id).then(() => {
setToastAlert({
@@ -213,7 +214,7 @@ export const NotificationCard: React.FC = (props) => {
item.onClick();
}}
key={item.id}
- className="text-sm flex w-full items-center gap-x-2 bg-custom-background-80 hover:bg-custom-background-100 p-0.5 rounded"
+ className="text-sm flex w-full items-center gap-x-2 bg-custom-background-80 hover:bg-custom-background-100 p-0.5 rounded outline-none"
>
diff --git a/apps/app/components/notifications/notification-popover.tsx b/apps/app/components/notifications/notification-popover.tsx
index 001669721..a7369bbb1 100644
--- a/apps/app/components/notifications/notification-popover.tsx
+++ b/apps/app/components/notifications/notification-popover.tsx
@@ -96,7 +96,7 @@ export const NotificationPopover = () => {
className={`group flex w-full items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium outline-none ${
isActive
? "bg-custom-primary-100/10 text-custom-primary-100"
- : "text-custom-sidebar-text-200 hover:bg-custom-sidebar-background-80 focus:bg-custom-sidebar-background-80"
+ : "text-custom-sidebar-text-200 hover:bg-custom-sidebar-background-80"
} ${sidebarCollapse ? "justify-center" : ""}`}
>
@@ -282,7 +282,7 @@ export const NotificationPopover = () => {
)
) : (
-
+
diff --git a/apps/app/components/workspace/help-section.tsx b/apps/app/components/workspace/help-section.tsx
index 5c00b8490..0819a50d0 100644
--- a/apps/app/components/workspace/help-section.tsx
+++ b/apps/app/components/workspace/help-section.tsx
@@ -1,33 +1,17 @@
import React, { useRef, useState } from "react";
-import { useRouter } from "next/router";
-
import Link from "next/link";
-import useSWR from "swr";
-
// headless ui
import { Transition } from "@headlessui/react";
-// services
-import workspaceService from "services/workspace.service";
// hooks
import useTheme from "hooks/use-theme";
-import useUser from "hooks/use-user";
import useOutsideClickDetector from "hooks/use-outside-click-detector";
-// components
-import UpgradeToProModal from "./upgrade-to-pro-modal";
// ui
-import { CircularProgress, Icon } from "components/ui";
+import { Icon } from "components/ui";
// icons
-import {
- ArrowLongLeftIcon,
- ChatBubbleOvalLeftEllipsisIcon,
- ArrowUpCircleIcon,
- XMarkIcon,
-} from "@heroicons/react/24/outline";
+import { ArrowLongLeftIcon, ChatBubbleOvalLeftEllipsisIcon } from "@heroicons/react/24/outline";
import { QuestionMarkCircleIcon, DocumentIcon, DiscordIcon, GithubIcon } from "components/icons";
-// fetch-keys
-import { WORKSPACE_DETAILS } from "constants/fetch-keys";
const helpOptions = [
{
@@ -58,150 +42,77 @@ export interface WorkspaceHelpSectionProps {
}
export const WorkspaceHelpSection: React.FC = ({ setSidebarActive }) => {
- const [alert, setAlert] = useState(false);
const [isNeedHelpOpen, setIsNeedHelpOpen] = useState(false);
const helpOptionsRef = useRef(null);
- const router = useRouter();
- const { workspaceSlug } = router.query;
-
const { collapsed: sidebarCollapse, toggleCollapsed } = useTheme();
useOutsideClickDetector(helpOptionsRef, () => setIsNeedHelpOpen(false));
- const { user } = useUser();
-
- const [upgradeModal, setUpgradeModal] = useState(false);
-
- const { data: workspaceDetails } = useSWR(
- workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null,
- workspaceSlug ? () => workspaceService.getWorkspace(workspaceSlug as string) : null
- );
-
- const issueNumber = workspaceDetails?.total_issues || 0;
-
return (
<>
- setUpgradeModal(false)}
- user={user}
- issueNumber={issueNumber}
- />
- {!sidebarCollapse && (alert || issueNumber >= 750) && (
- = 750
- ? "bg-red-500/10 text-red-600"
- : issueNumber >= 500
- ? "bg-yellow-500/10 text-yellow-600"
- : "text-green-600"
- }`}
- >
-
-
-
Free Plan
- {issueNumber < 750 && (
-
setAlert(false)}
- >
-
-
- )}
-
-
- This workspace has used {issueNumber} of its 1024 issues creation limit (
- {((issueNumber / 1024) * 100).toFixed(0)}
- %).
-
-
- )}
- {alert || issueNumber >= 750 ? (
-
= 750
- ? "bg-red-500/10 text-red-500"
- : "bg-blue-500/10 text-custom-primary-100"
- } ${sidebarCollapse ? "w-full justify-center" : ""}`}
- title="Shortcuts"
- onClick={() => setUpgradeModal(true)}
- >
-
- {!sidebarCollapse && Learn more}
-
- ) : (
-
= 750
- ? "bg-red-500/10 text-red-600"
- : issueNumber >= 500
- ? "bg-yellow-500/10 text-yellow-600"
- : "bg-green-500/10 text-green-600"
- }
- ${sidebarCollapse ? "w-full justify-center" : ""}`}
- title="Shortcuts"
- onClick={() => setAlert(true)}
- >
- 100 ? 100 : (issueNumber / 1024) * 100}
- />
- {!sidebarCollapse && Free Plan}
-
+ {!sidebarCollapse && (
+
+ Free Plan
+
)}
-
{
- const e = new KeyboardEvent("keydown", {
- key: "h",
- });
- document.dispatchEvent(e);
- }}
- title="Shortcuts"
>
-
-
-
setIsNeedHelpOpen((prev) => !prev)}
- title="Help"
- >
-
-
-
setSidebarActive(false)}
- >
-
-
-
toggleCollapsed()}
- >
-
-
+ onClick={() => {
+ const e = new KeyboardEvent("keydown", {
+ key: "h",
+ });
+ document.dispatchEvent(e);
+ }}
+ title="Shortcuts"
+ >
+
+
+
setIsNeedHelpOpen((prev) => !prev)}
+ title="Help"
+ >
+
+
+
setSidebarActive(false)}
+ >
+
+
+
toggleCollapsed()}
+ >
+
+
+
[
export const WorkspaceSidebarDropdown = () => {
const router = useRouter();
const { workspaceSlug } = router.query;
- // fetching user details
+
const { user, mutateUser } = useUser();
const { collapsed: sidebarCollapse } = useThemeHook();
@@ -139,8 +139,8 @@ export const WorkspaceSidebarDropdown = () => {
leaveTo="transform opacity-0 scale-95"
>
{user?.email}
diff --git a/apps/app/components/workspace/upgrade-to-pro-modal.tsx b/apps/app/components/workspace/upgrade-to-pro-modal.tsx
deleted file mode 100644
index 99190c9cc..000000000
--- a/apps/app/components/workspace/upgrade-to-pro-modal.tsx
+++ /dev/null
@@ -1,248 +0,0 @@
-import React, { useState, useEffect } from "react";
-// headless ui
-import { Dialog, Transition } from "@headlessui/react";
-// icons
-import { XCircleIcon, RocketLaunchIcon } from "@heroicons/react/24/outline";
-import { CheckCircleIcon } from "@heroicons/react/24/solid";
-// ui
-import { CircularProgress } from "components/ui";
-// types
-import type { ICurrentUserResponse, IWorkspace } from "types";
-
-declare global {
- interface Window {
- supabase: any;
- }
-}
-
-type Props = {
- isOpen: boolean;
- onClose: () => void;
- user: ICurrentUserResponse | undefined;
- issueNumber: number;
-};
-
-const UpgradeToProModal: React.FC
= ({ isOpen, onClose, user, issueNumber }) => {
- const [supabaseClient, setSupabaseClient] = useState(null);
-
- useEffect(() => {
- // Create a Supabase client
- if (process.env.NEXT_PUBLIC_SUPABASE_URL && process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY) {
- const { createClient } = window.supabase;
- const supabase = createClient(
- process.env.NEXT_PUBLIC_SUPABASE_URL,
- process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
- {
- auth: {
- autoRefreshToken: false,
- persistSession: false,
- },
- }
- );
-
- if (supabase) {
- setSupabaseClient(supabase);
- }
- }
- }, []);
-
- const [isLoading, setIsLoading] = useState(false);
-
- const handleClose = () => {
- onClose();
- setIsLoading(false);
- };
-
- const proFeatures = [
- "Everything in free",
- "Unlimited users",
- "Unlimited file uploads",
- "Priority Support",
- "Custom Theming",
- "Access to Roadmap",
- "Plane AI (GPT unlimited)",
- ];
-
- const [errorMessage, setErrorMessage] = useState(
- null
- );
- const [loader, setLoader] = useState(false);
- const submitEmail = async () => {
- setLoader(true);
- const payload = { email: user?.email || "" };
-
- if (supabaseClient) {
- if (payload?.email) {
- const emailExists = await supabaseClient
- .from("web-waitlist")
- .select("id,email,count")
- .eq("email", payload?.email);
- if (emailExists.data.length === 0) {
- const emailCreation = await supabaseClient
- .from("web-waitlist")
- .insert([{ email: payload?.email, count: 1, last_visited: new Date() }])
- .select("id,email,count");
- if (emailCreation.status === 201)
- setErrorMessage({ status: "success", message: "Successfully registered." });
- else setErrorMessage({ status: "insert_error", message: "Insertion Error." });
- } else {
- const emailCountUpdate = await supabaseClient
- .from("web-waitlist")
- .upsert({
- id: emailExists.data[0]?.id,
- count: emailExists.data[0]?.count + 1,
- last_visited: new Date(),
- })
- .select("id,email,count");
- if (emailCountUpdate.status === 201)
- setErrorMessage({
- status: "email_already_exists",
- message: "Email already exists.",
- });
- else setErrorMessage({ status: "update_error", message: "Update Error." });
- }
- } else setErrorMessage({ status: "email_required", message: "Please provide email." });
- } else
- setErrorMessage({
- status: "supabase_error",
- message: "Network error. Please try again later.",
- });
-
- setLoader(false);
- };
-
- return (
-
-
-
- );
-};
-
-export default UpgradeToProModal;
diff --git a/apps/app/helpers/date-time.helper.ts b/apps/app/helpers/date-time.helper.ts
index ea2170afb..a98f08cb7 100644
--- a/apps/app/helpers/date-time.helper.ts
+++ b/apps/app/helpers/date-time.helper.ts
@@ -217,7 +217,7 @@ export const render12HourFormatTime = (date: string | Date): string => {
if (hours > 12) hours -= 12;
}
- return hours + ":" + minutes + " " + period;
+ return hours + ":" + (minutes < 10 ? `0${minutes}` : minutes) + " " + period;
};
export const render24HourFormatTime = (date: string | Date): string => {
diff --git a/apps/app/pages/[workspaceSlug]/settings/billing.tsx b/apps/app/pages/[workspaceSlug]/settings/billing.tsx
index 3c2934c6c..2367b94b4 100644
--- a/apps/app/pages/[workspaceSlug]/settings/billing.tsx
+++ b/apps/app/pages/[workspaceSlug]/settings/billing.tsx
@@ -44,28 +44,18 @@ const BillingSettings: NextPage = () => {
Billing & Plans
-
[Free launch preview] plan Pro
+
Free launch preview
-
-
-
Billing history
-
There are no invoices to display
-
From c72ff782ac7376103983b3c975fe197d9f9b7d06 Mon Sep 17 00:00:00 2001
From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com>
Date: Thu, 20 Jul 2023 14:17:21 +0530
Subject: [PATCH 07/15] feat: add new icons package (#1586)
* feat: add material icons package
* chore: replace issue view icons
---
.../core/filters/issues-view-filter.tsx | 36 ++--
.../notifications/notification-popover.tsx | 4 +-
.../components/onboarding/tour/sidebar.tsx | 31 +--
.../project/single-sidebar-project.tsx | 38 ++--
apps/app/components/ui/custom-menu.tsx | 187 ------------------
.../components/ui/dropdowns/custom-menu.tsx | 18 +-
.../app/components/workspace/help-section.tsx | 42 ++--
.../app/components/workspace/sidebar-menu.tsx | 25 ++-
apps/app/package.json | 2 +
apps/app/pages/[workspaceSlug]/index.tsx | 8 +-
.../pages/[workspaceSlug]/settings/index.tsx | 5 +-
yarn.lock | 157 +++++++++++++++
12 files changed, 282 insertions(+), 271 deletions(-)
delete mode 100644 apps/app/components/ui/custom-menu.tsx
diff --git a/apps/app/components/core/filters/issues-view-filter.tsx b/apps/app/components/core/filters/issues-view-filter.tsx
index 722dfc1a2..d1a6281b1 100644
--- a/apps/app/components/core/filters/issues-view-filter.tsx
+++ b/apps/app/components/core/filters/issues-view-filter.tsx
@@ -11,14 +11,16 @@ import useEstimateOption from "hooks/use-estimate-option";
// components
import { SelectFilters } from "components/views";
// ui
-import { CustomMenu, Icon, ToggleSwitch, Tooltip } from "components/ui";
+import { CustomMenu, ToggleSwitch, Tooltip } from "components/ui";
// icons
+import { ChevronDownIcon } from "@heroicons/react/24/outline";
import {
- ChevronDownIcon,
- ListBulletIcon,
- Squares2X2Icon,
- CalendarDaysIcon,
-} from "@heroicons/react/24/outline";
+ CalendarMonthOutlined,
+ FormatListBulletedOutlined,
+ GridViewOutlined,
+ TableChartOutlined,
+ WaterfallChartOutlined,
+} from "@mui/icons-material";
// helpers
import { replaceUnderscoreIfSnakeCase } from "helpers/string.helper";
import { checkIfArraysHaveSameElements } from "helpers/array.helper";
@@ -27,26 +29,26 @@ import { Properties, TIssueViewOptions } from "types";
// constants
import { GROUP_BY_OPTIONS, ORDER_BY_OPTIONS, FILTER_ISSUE_OPTIONS } from "constants/issue";
-const issueViewOptions: { type: TIssueViewOptions; icon: any }[] = [
+const issueViewOptions: { type: TIssueViewOptions; Icon: any }[] = [
{
type: "list",
- icon: ,
+ Icon: FormatListBulletedOutlined,
},
{
type: "kanban",
- icon: ,
+ Icon: GridViewOutlined,
},
{
type: "calendar",
- icon: ,
+ Icon: CalendarMonthOutlined,
},
{
type: "spreadsheet",
- icon: ,
+ Icon: TableChartOutlined,
},
{
type: "gantt_chart",
- icon: ,
+ Icon: WaterfallChartOutlined,
},
];
@@ -98,7 +100,12 @@ export const IssuesFilterView: React.FC = () => {
}`}
onClick={() => setIssueView(option.type)}
>
- {option.icon}
+
))}
@@ -177,7 +184,6 @@ export const IssuesFilterView: React.FC = () => {
GROUP_BY_OPTIONS.find((option) => option.key === groupByProperty)
?.name ?? "Select"
}
- width="lg"
>
{GROUP_BY_OPTIONS.map((option) =>
issueView === "kanban" && option.key === null ? null : (
@@ -198,7 +204,6 @@ export const IssuesFilterView: React.FC = () => {
ORDER_BY_OPTIONS.find((option) => option.key === orderBy)?.name ??
"Select"
}
- width="lg"
>
{ORDER_BY_OPTIONS.map((option) =>
groupByProperty === "priority" && option.key === "priority" ? null : (
@@ -223,7 +228,6 @@ export const IssuesFilterView: React.FC = () => {
FILTER_ISSUE_OPTIONS.find((option) => option.key === filters.type)
?.name ?? "Select"
}
- width="lg"
>
{FILTER_ISSUE_OPTIONS.map((option) => (
{
: "text-custom-sidebar-text-200 hover:bg-custom-sidebar-background-80"
} ${sidebarCollapse ? "justify-center" : ""}`}
>
-
+
{sidebarCollapse ? null : Notifications}
{totalNotificationCount && totalNotificationCount > 0 ? (
diff --git a/apps/app/components/onboarding/tour/sidebar.tsx b/apps/app/components/onboarding/tour/sidebar.tsx
index 99832c166..dce49f098 100644
--- a/apps/app/components/onboarding/tour/sidebar.tsx
+++ b/apps/app/components/onboarding/tour/sidebar.tsx
@@ -1,31 +1,37 @@
-// ui
-import { Icon } from "components/ui";
+// icons
+import {
+ ArticleOutlined,
+ ContrastOutlined,
+ DatasetOutlined,
+ FilterNoneOutlined,
+ PhotoFilterOutlined,
+} from "@mui/icons-material";
// types
import { TTourSteps } from "./root";
const sidebarOptions: {
key: TTourSteps;
- icon: string;
+ Icon: any;
}[] = [
{
key: "issues",
- icon: "stack",
+ Icon: FilterNoneOutlined,
},
{
key: "cycles",
- icon: "contrast",
+ Icon: ContrastOutlined,
},
{
key: "modules",
- icon: "dataset",
+ Icon: DatasetOutlined,
},
{
key: "views",
- icon: "photo_filter",
+ Icon: PhotoFilterOutlined,
},
{
key: "pages",
- icon: "article",
+ Icon: ArticleOutlined,
},
];
@@ -52,11 +58,10 @@ export const TourSidebar: React.FC = ({ step, setStep }) => (
}`}
onClick={() => setStep(option.key)}
>
-
{option.key}
diff --git a/apps/app/components/project/single-sidebar-project.tsx b/apps/app/components/project/single-sidebar-project.tsx
index 06b030ccb..e43ff0a65 100644
--- a/apps/app/components/project/single-sidebar-project.tsx
+++ b/apps/app/components/project/single-sidebar-project.tsx
@@ -10,9 +10,19 @@ import projectService from "services/project.service";
// hooks
import useToast from "hooks/use-toast";
// ui
-import { CustomMenu, Icon, Tooltip } from "components/ui";
+import { CustomMenu, Tooltip } from "components/ui";
// icons
import { LinkIcon, StarIcon, TrashIcon } from "@heroicons/react/24/outline";
+import {
+ ArchiveOutlined,
+ ArticleOutlined,
+ ContrastOutlined,
+ DatasetOutlined,
+ ExpandMoreOutlined,
+ FilterNoneOutlined,
+ PhotoFilterOutlined,
+ SettingsOutlined,
+} from "@mui/icons-material";
// helpers
import { truncateText } from "helpers/string.helper";
import { renderEmoji } from "helpers/emoji.helper";
@@ -33,32 +43,32 @@ const navigation = (workspaceSlug: string, projectId: string) => [
{
name: "Issues",
href: `/${workspaceSlug}/projects/${projectId}/issues`,
- icon: "stack",
+ Icon: FilterNoneOutlined,
},
{
name: "Cycles",
href: `/${workspaceSlug}/projects/${projectId}/cycles`,
- icon: "contrast",
+ Icon: ContrastOutlined,
},
{
name: "Modules",
href: `/${workspaceSlug}/projects/${projectId}/modules`,
- icon: "dataset",
+ Icon: DatasetOutlined,
},
{
name: "Views",
href: `/${workspaceSlug}/projects/${projectId}/views`,
- icon: "photo_filter",
+ Icon: PhotoFilterOutlined,
},
{
name: "Pages",
href: `/${workspaceSlug}/projects/${projectId}/pages`,
- icon: "article",
+ Icon: ArticleOutlined,
},
{
name: "Settings",
href: `/${workspaceSlug}/projects/${projectId}/settings`,
- icon: "settings",
+ Icon: SettingsOutlined,
},
];
@@ -164,8 +174,8 @@ export const SingleSidebarProject: React.FC = ({
)}
{!sidebarCollapse && (
-
)}
@@ -211,7 +221,7 @@ export const SingleSidebarProject: React.FC = ({
}
>
@@ -248,13 +258,17 @@ export const SingleSidebarProject: React.FC = ({
disabled={!sidebarCollapse}
>
-
+
{!sidebarCollapse && item.name}
diff --git a/apps/app/components/ui/custom-menu.tsx b/apps/app/components/ui/custom-menu.tsx
deleted file mode 100644
index ab11ca16f..000000000
--- a/apps/app/components/ui/custom-menu.tsx
+++ /dev/null
@@ -1,187 +0,0 @@
-import React from "react";
-// next
-import Link from "next/link";
-// headless ui
-import { Menu, Transition } from "@headlessui/react";
-// icons
-import { ChevronDownIcon } from "@heroicons/react/24/outline";
-import { Icon } from "./icon";
-
-type Props = {
- children: React.ReactNode;
- label?: string | JSX.Element;
- className?: string;
- ellipsis?: boolean;
- verticalEllipsis?: boolean;
- height?: "sm" | "md" | "rg" | "lg";
- width?: "sm" | "md" | "lg" | "xl" | "auto";
- textAlignment?: "left" | "center" | "right";
- noBorder?: boolean;
- noChevron?: boolean;
- position?: "left" | "right";
- verticalPosition?: "top" | "bottom";
- menuItemsClassName?: string;
- customButton?: JSX.Element;
- menuItemsWhiteBg?: boolean;
-};
-
-type MenuItemProps = {
- children: JSX.Element | string;
- renderAs?: "button" | "a";
- href?: string;
- onClick?: (args?: any) => void;
- className?: string;
-};
-
-const CustomMenu = ({
- children,
- label,
- className = "",
- ellipsis = false,
- verticalEllipsis = false,
- height = "md",
- width = "auto",
- textAlignment,
- noBorder = false,
- noChevron = false,
- position = "right",
- verticalPosition = "bottom",
- menuItemsClassName = "",
- customButton,
- menuItemsWhiteBg = false,
-}: Props) => (
-
-);
-
-const MenuItem: React.FC = ({
- children,
- renderAs,
- href,
- onClick,
- className = "",
-}) => (
-
- {({ active, close }) =>
- renderAs === "a" ? (
-
-
- {children}
-
-
- ) : (
-
- {children}
-
- )
- }
-
-);
-
-CustomMenu.MenuItem = MenuItem;
-
-export { CustomMenu };
diff --git a/apps/app/components/ui/dropdowns/custom-menu.tsx b/apps/app/components/ui/dropdowns/custom-menu.tsx
index e33583ce0..315349195 100644
--- a/apps/app/components/ui/dropdowns/custom-menu.tsx
+++ b/apps/app/components/ui/dropdowns/custom-menu.tsx
@@ -4,9 +4,10 @@ import Link from "next/link";
// headless ui
import { Menu, Transition } from "@headlessui/react";
+// ui
+import { DropdownProps } from "components/ui";
// icons
-import { DropdownProps, Icon } from "components/ui";
-import { ChevronDownIcon } from "@heroicons/react/24/outline";
+import { ExpandMoreOutlined, MoreHorizOutlined } from "@mui/icons-material";
export type CustomMenuProps = DropdownProps & {
children: React.ReactNode;
@@ -53,8 +54,8 @@ const CustomMenu = ({
disabled ? "cursor-not-allowed" : "cursor-pointer hover:bg-custom-background-80"
} ${buttonClassName}`}
>
-
@@ -72,7 +73,14 @@ const CustomMenu = ({
} ${buttonClassName}`}
>
{label}
- {!noChevron && }
+ {!noChevron && (
+
+ )}
)}
>
diff --git a/apps/app/components/workspace/help-section.tsx b/apps/app/components/workspace/help-section.tsx
index 0819a50d0..ea7825d91 100644
--- a/apps/app/components/workspace/help-section.tsx
+++ b/apps/app/components/workspace/help-section.tsx
@@ -7,11 +7,10 @@ import { Transition } from "@headlessui/react";
// hooks
import useTheme from "hooks/use-theme";
import useOutsideClickDetector from "hooks/use-outside-click-detector";
-// ui
-import { Icon } from "components/ui";
// icons
-import { ArrowLongLeftIcon, ChatBubbleOvalLeftEllipsisIcon } from "@heroicons/react/24/outline";
-import { QuestionMarkCircleIcon, DocumentIcon, DiscordIcon, GithubIcon } from "components/icons";
+import { Bolt, HelpOutlineOutlined, WestOutlined } from "@mui/icons-material";
+import { ChatBubbleOvalLeftEllipsisIcon } from "@heroicons/react/24/outline";
+import { DocumentIcon, DiscordIcon, GithubIcon } from "components/icons";
const helpOptions = [
{
@@ -53,7 +52,7 @@ export const WorkspaceHelpSection: React.FC = ({ setS
return (
<>
@@ -63,14 +62,14 @@ export const WorkspaceHelpSection: React.FC = ({ setS
)}
{
const e = new KeyboardEvent("keydown", {
@@ -78,38 +77,35 @@ export const WorkspaceHelpSection: React.FC = ({ setS
});
document.dispatchEvent(e);
}}
- title="Shortcuts"
>
-
+
setIsNeedHelpOpen((prev) => !prev)}
- title="Help"
>
-
+
setSidebarActive(false)}
>
-
+
toggleCollapsed()}
>
-
diff --git a/apps/app/components/workspace/sidebar-menu.tsx b/apps/app/components/workspace/sidebar-menu.tsx
index 4f4d841b6..629a7b3a1 100644
--- a/apps/app/components/workspace/sidebar-menu.tsx
+++ b/apps/app/components/workspace/sidebar-menu.tsx
@@ -5,40 +5,45 @@ import { useRouter } from "next/router";
// hooks
import useTheme from "hooks/use-theme";
-
+// components
import { NotificationPopover } from "components/notifications";
+// ui
+import { Tooltip } from "components/ui";
+// icons
+import {
+ BarChartRounded,
+ GridViewOutlined,
+ TaskAltOutlined,
+ WorkOutlineOutlined,
+} from "@mui/icons-material";
const workspaceLinks = (workspaceSlug: string) => [
{
- icon: "grid_view",
+ Icon: GridViewOutlined,
name: "Dashboard",
href: `/${workspaceSlug}`,
},
{
- icon: "bar_chart",
+ Icon: BarChartRounded,
name: "Analytics",
href: `/${workspaceSlug}/analytics`,
},
{
- icon: "work",
+ Icon: WorkOutlineOutlined,
name: "Projects",
href: `/${workspaceSlug}/projects`,
},
{
- icon: "task_alt",
+ Icon: TaskAltOutlined,
name: "My Issues",
href: `/${workspaceSlug}/me/my-issues`,
},
];
-// components
-import { Icon, Tooltip } from "components/ui";
-
export const WorkspaceSidebarMenu = () => {
const router = useRouter();
const { workspaceSlug } = router.query;
- // theme context
const { collapsed: sidebarCollapse } = useTheme();
return (
@@ -65,7 +70,7 @@ export const WorkspaceSidebarMenu = () => {
: "text-custom-sidebar-text-200 hover:bg-custom-sidebar-background-80 focus:bg-custom-sidebar-background-80"
} ${sidebarCollapse ? "justify-center" : ""}`}
>
-
+ {}
{!sidebarCollapse && link.name}
diff --git a/apps/app/package.json b/apps/app/package.json
index 64eb1aa99..4397696ab 100644
--- a/apps/app/package.json
+++ b/apps/app/package.json
@@ -14,6 +14,8 @@
"@headlessui/react": "^1.7.3",
"@heroicons/react": "^2.0.12",
"@jitsu/nextjs": "^3.1.5",
+ "@mui/icons-material": "^5.14.1",
+ "@mui/material": "^5.14.1",
"@nivo/bar": "0.80.0",
"@nivo/calendar": "0.80.0",
"@nivo/core": "0.80.0",
diff --git a/apps/app/pages/[workspaceSlug]/index.tsx b/apps/app/pages/[workspaceSlug]/index.tsx
index aca40f85d..df1a69865 100644
--- a/apps/app/pages/[workspaceSlug]/index.tsx
+++ b/apps/app/pages/[workspaceSlug]/index.tsx
@@ -24,7 +24,9 @@ import {
} from "components/workspace";
import { TourRoot } from "components/onboarding";
// ui
-import { Icon, PrimaryButton, ProductUpdatesModal } from "components/ui";
+import { PrimaryButton, ProductUpdatesModal } from "components/ui";
+// icons
+import { BoltOutlined, GridViewOutlined } from "@mui/icons-material";
// images
import emptyDashboard from "public/empty-state/dashboard.svg";
import githubBlackImage from "/public/logos/github-black.png";
@@ -70,7 +72,7 @@ const WorkspacePage: NextPage = () => {
-
+
Dashboard
}
@@ -80,7 +82,7 @@ const WorkspacePage: NextPage = () => {
onClick={() => setIsProductUpdatesModalOpen(true)}
className="flex items-center gap-1.5 bg-custom-background-80 text-xs font-medium py-1.5 px-3 rounded"
>
-
+
What{"'"}s New?
diff --git a/apps/app/pages/[workspaceSlug]/settings/index.tsx b/apps/app/pages/[workspaceSlug]/settings/index.tsx
index c80386da9..6306605ed 100644
--- a/apps/app/pages/[workspaceSlug]/settings/index.tsx
+++ b/apps/app/pages/[workspaceSlug]/settings/index.tsx
@@ -207,7 +207,10 @@ const WorkspaceSettings: NextPage = () => {
{isImageUploading ? "Uploading..." : "Upload"}
{activeWorkspace.logo && activeWorkspace.logo !== "" && (
- handleDelete(activeWorkspace.logo)}>
+ handleDelete(activeWorkspace.logo)}
+ loading={isImageRemoving}
+ >
{isImageRemoving ? "Removing..." : "Remove"}
)}
diff --git a/yarn.lock b/yarn.lock
index 652df3ed8..4a8d0a942 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -899,6 +899,13 @@
dependencies:
regenerator-runtime "^0.13.11"
+"@babel/runtime@^7.22.5", "@babel/runtime@^7.22.6":
+ version "7.22.6"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.6.tgz#57d64b9ae3cff1d67eb067ae117dac087f5bd438"
+ integrity sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==
+ dependencies:
+ regenerator-runtime "^0.13.11"
+
"@babel/template@^7.18.10", "@babel/template@^7.20.7":
version "7.20.7"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8"
@@ -1005,6 +1012,17 @@
"@emotion/weak-memoize" "^0.3.0"
stylis "4.1.4"
+"@emotion/cache@^11.11.0":
+ version "11.11.0"
+ resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-11.11.0.tgz#809b33ee6b1cb1a625fef7a45bc568ccd9b8f3ff"
+ integrity sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==
+ dependencies:
+ "@emotion/memoize" "^0.8.1"
+ "@emotion/sheet" "^1.2.2"
+ "@emotion/utils" "^1.2.1"
+ "@emotion/weak-memoize" "^0.3.1"
+ stylis "4.2.0"
+
"@emotion/css@^11.10.6":
version "11.10.8"
resolved "https://registry.yarnpkg.com/@emotion/css/-/css-11.10.8.tgz#9dec9996ad9a1cc28ec8d26b1b27ab0b8f6fb053"
@@ -1028,11 +1046,23 @@
dependencies:
"@emotion/memoize" "^0.8.0"
+"@emotion/is-prop-valid@^1.2.1":
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-1.2.1.tgz#23116cf1ed18bfeac910ec6436561ecb1a3885cc"
+ integrity sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw==
+ dependencies:
+ "@emotion/memoize" "^0.8.1"
+
"@emotion/memoize@^0.8.0":
version "0.8.0"
resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.8.0.tgz#f580f9beb67176fa57aae70b08ed510e1b18980f"
integrity sha512-G/YwXTkv7Den9mXDO7AhLWkE3q+I92B+VqAE+dYG4NGPaHZGvt3G8Q0p9vmE+sq7rTGphUbAvmQ9YpbfMQGGlA==
+"@emotion/memoize@^0.8.1":
+ version "0.8.1"
+ resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.8.1.tgz#c1ddb040429c6d21d38cc945fe75c818cfb68e17"
+ integrity sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==
+
"@emotion/react@^11.10.6":
version "11.10.8"
resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.10.8.tgz#02e274ecb45e03ab9d7a8eb9f0f0c064613eaf7b"
@@ -1063,6 +1093,11 @@
resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-1.2.1.tgz#0767e0305230e894897cadb6c8df2c51e61a6c2c"
integrity sha512-zxRBwl93sHMsOj4zs+OslQKg/uhF38MB+OMKoCrVuS0nyTkqnau+BM3WGEoOptg9Oz45T/aIGs1qbVAsEFo3nA==
+"@emotion/sheet@^1.2.2":
+ version "1.2.2"
+ resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-1.2.2.tgz#d58e788ee27267a14342303e1abb3d508b6d0fec"
+ integrity sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==
+
"@emotion/styled@^11.10.6":
version "11.10.8"
resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-11.10.8.tgz#a3fd68efd90bd7e8a06b82b95adec643d386fa69"
@@ -1090,11 +1125,21 @@
resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-1.2.0.tgz#9716eaccbc6b5ded2ea5a90d65562609aab0f561"
integrity sha512-sn3WH53Kzpw8oQ5mgMmIzzyAaH2ZqFEbozVVBSYp538E06OSE6ytOp7pRAjNQR+Q/orwqdQYJSe2m3hCOeznkw==
+"@emotion/utils@^1.2.1":
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-1.2.1.tgz#bbab58465738d31ae4cb3dbb6fc00a5991f755e4"
+ integrity sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==
+
"@emotion/weak-memoize@^0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.3.0.tgz#ea89004119dc42db2e1dba0f97d553f7372f6fcb"
integrity sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg==
+"@emotion/weak-memoize@^0.3.1":
+ version "0.3.1"
+ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz#d0fce5d07b0620caa282b5131c297bb60f9d87e6"
+ integrity sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==
+
"@eslint-community/eslint-utils@^4.2.0":
version "4.4.0"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
@@ -1333,11 +1378,37 @@
prop-types "^15.8.1"
react-is "^18.2.0"
+"@mui/base@5.0.0-beta.8":
+ version "5.0.0-beta.8"
+ resolved "https://registry.yarnpkg.com/@mui/base/-/base-5.0.0-beta.8.tgz#a0a9531ae9147be92d17e4f0e3b9accc57916841"
+ integrity sha512-b4vVjMZx5KzzEMf4arXKoeV5ZegAMOoPwoy1vfUBwhvXc2QtaaAyBp50U7OA2L06Leubc1A+lEp3eqwZoFn87g==
+ dependencies:
+ "@babel/runtime" "^7.22.6"
+ "@emotion/is-prop-valid" "^1.2.1"
+ "@mui/types" "^7.2.4"
+ "@mui/utils" "^5.14.1"
+ "@popperjs/core" "^2.11.8"
+ clsx "^1.2.1"
+ prop-types "^15.8.1"
+ react-is "^18.2.0"
+
"@mui/core-downloads-tracker@^5.12.3":
version "5.12.3"
resolved "https://registry.yarnpkg.com/@mui/core-downloads-tracker/-/core-downloads-tracker-5.12.3.tgz#3dffe62dccc065ddd7338e97d7be4b917004287e"
integrity sha512-yiJZ+knaknPHuRKhRk4L6XiwppwkAahVal3LuYpvBH7GkA2g+D9WLEXOEnNYtVFUggyKf6fWGLGnx0iqzkU5YA==
+"@mui/core-downloads-tracker@^5.14.1":
+ version "5.14.1"
+ resolved "https://registry.yarnpkg.com/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.1.tgz#af156cb3e15b202f5c09f66e7d8b71ca86aef525"
+ integrity sha512-mIa1WmDmNr1LoupV1Rbxt9bTFKMbIn10RHG1bnZ/FJCkAYpuU/D4n+R+ttiycgcZNngU++zyh/OQeJblzbQPzg==
+
+"@mui/icons-material@^5.14.1":
+ version "5.14.1"
+ resolved "https://registry.yarnpkg.com/@mui/icons-material/-/icons-material-5.14.1.tgz#2f145c15047a0c7f01353ce620cb88276dadba9e"
+ integrity sha512-xV/f26muQqtWzerzOIdGPrXoxp/OKaE2G2Wp9gnmG47mHua5Slup/tMc3fA4ZYUreGGrK6+tT81TEvt1Wsng8Q==
+ dependencies:
+ "@babel/runtime" "^7.22.6"
+
"@mui/material@^5.12.1":
version "5.12.3"
resolved "https://registry.yarnpkg.com/@mui/material/-/material-5.12.3.tgz#398c1b123fb065763558bc1f9fc47d1f8cb87d0c"
@@ -1356,6 +1427,24 @@
react-is "^18.2.0"
react-transition-group "^4.4.5"
+"@mui/material@^5.14.1":
+ version "5.14.1"
+ resolved "https://registry.yarnpkg.com/@mui/material/-/material-5.14.1.tgz#2711e4ca5c9bdc67b916d01faee650a7a5260bb8"
+ integrity sha512-WtsgYuageTunLfxH3Ri+o1RuQTFImtRHxMcVNyD0Hhd2/znjW6KODNz0XfjvLRnNCAynBxZNiflcoIBW40h9PQ==
+ dependencies:
+ "@babel/runtime" "^7.22.6"
+ "@mui/base" "5.0.0-beta.8"
+ "@mui/core-downloads-tracker" "^5.14.1"
+ "@mui/system" "^5.14.1"
+ "@mui/types" "^7.2.4"
+ "@mui/utils" "^5.14.1"
+ "@types/react-transition-group" "^4.4.6"
+ clsx "^1.2.1"
+ csstype "^3.1.2"
+ prop-types "^15.8.1"
+ react-is "^18.2.0"
+ react-transition-group "^4.4.5"
+
"@mui/private-theming@^5.12.3":
version "5.12.3"
resolved "https://registry.yarnpkg.com/@mui/private-theming/-/private-theming-5.12.3.tgz#f5e4704e25d9d91b906561cae573cda8f3801e10"
@@ -1365,6 +1454,15 @@
"@mui/utils" "^5.12.3"
prop-types "^15.8.1"
+"@mui/private-theming@^5.13.7":
+ version "5.13.7"
+ resolved "https://registry.yarnpkg.com/@mui/private-theming/-/private-theming-5.13.7.tgz#2f8ef5da066f3c6c6423bd4260d003a28d10b099"
+ integrity sha512-qbSr+udcij5F9dKhGX7fEdx2drXchq7htLNr2Qg2Ma+WJ6q0ERlEqGSBiPiVDJkptcjeVL4DGmcf1wl5+vD4EA==
+ dependencies:
+ "@babel/runtime" "^7.22.5"
+ "@mui/utils" "^5.13.7"
+ prop-types "^15.8.1"
+
"@mui/styled-engine@^5.12.3":
version "5.12.3"
resolved "https://registry.yarnpkg.com/@mui/styled-engine/-/styled-engine-5.12.3.tgz#3307643d52c81947a624cdd0437536cc8109c4f0"
@@ -1375,6 +1473,16 @@
csstype "^3.1.2"
prop-types "^15.8.1"
+"@mui/styled-engine@^5.13.2":
+ version "5.13.2"
+ resolved "https://registry.yarnpkg.com/@mui/styled-engine/-/styled-engine-5.13.2.tgz#c87bd61c0ab8086d34828b6defe97c02bcd642ef"
+ integrity sha512-VCYCU6xVtXOrIN8lcbuPmoG+u7FYuOERG++fpY74hPpEWkyFQG97F+/XfTQVYzlR2m7nPjnwVUgATcTCMEaMvw==
+ dependencies:
+ "@babel/runtime" "^7.21.0"
+ "@emotion/cache" "^11.11.0"
+ csstype "^3.1.2"
+ prop-types "^15.8.1"
+
"@mui/system@^5.12.3":
version "5.12.3"
resolved "https://registry.yarnpkg.com/@mui/system/-/system-5.12.3.tgz#306b3cdffa3046067640219c1e5dd7e3dae38ff9"
@@ -1389,6 +1497,20 @@
csstype "^3.1.2"
prop-types "^15.8.1"
+"@mui/system@^5.14.1":
+ version "5.14.1"
+ resolved "https://registry.yarnpkg.com/@mui/system/-/system-5.14.1.tgz#ec8ae69f63963b5916dad4bca2f8a86a001a2392"
+ integrity sha512-u+xlsU34Jdkgx1CxmBnIC4Y08uPdVX5iEd3S/1dggDFtOGp+Lj8xmKRJAQ8PJOOJLOh8pDwaZx4AwXikL4l1QA==
+ dependencies:
+ "@babel/runtime" "^7.22.6"
+ "@mui/private-theming" "^5.13.7"
+ "@mui/styled-engine" "^5.13.2"
+ "@mui/types" "^7.2.4"
+ "@mui/utils" "^5.14.1"
+ clsx "^1.2.1"
+ csstype "^3.1.2"
+ prop-types "^15.8.1"
+
"@mui/types@^7.2.4":
version "7.2.4"
resolved "https://registry.yarnpkg.com/@mui/types/-/types-7.2.4.tgz#b6fade19323b754c5c6de679a38f068fd50b9328"
@@ -1405,6 +1527,17 @@
prop-types "^15.8.1"
react-is "^18.2.0"
+"@mui/utils@^5.13.7", "@mui/utils@^5.14.1":
+ version "5.14.1"
+ resolved "https://registry.yarnpkg.com/@mui/utils/-/utils-5.14.1.tgz#29696371016552a6eb3af975bc7af429ec88b29a"
+ integrity sha512-39KHKK2JeqRmuUcLDLwM+c2XfVC136C5/yUyQXmO2PVbOb2Bol4KxtkssEqCbTwg87PSCG3f1Tb0keRsK7cVGw==
+ dependencies:
+ "@babel/runtime" "^7.22.6"
+ "@types/prop-types" "^15.7.5"
+ "@types/react-is" "^18.2.1"
+ prop-types "^15.8.1"
+ react-is "^18.2.0"
+
"@next/env@12.3.2":
version "12.3.2"
resolved "https://registry.yarnpkg.com/@next/env/-/env-12.3.2.tgz#fb819366771f5721e9438ca3a42ad18684f0949b"
@@ -1684,6 +1817,11 @@
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.7.tgz#ccab5c8f7dc557a52ca3288c10075c9ccd37fff7"
integrity sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw==
+"@popperjs/core@^2.11.8":
+ version "2.11.8"
+ resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f"
+ integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==
+
"@radix-ui/primitive@1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@radix-ui/primitive/-/primitive-1.0.0.tgz#e1d8ef30b10ea10e69c76e896f608d9276352253"
@@ -3230,6 +3368,13 @@
dependencies:
"@types/react" "^17"
+"@types/react-is@^18.2.1":
+ version "18.2.1"
+ resolved "https://registry.yarnpkg.com/@types/react-is/-/react-is-18.2.1.tgz#61d01c2a6fc089a53520c0b66996d458fdc46863"
+ integrity sha512-wyUkmaaSZEzFZivD8F2ftSyAfk6L+DfFliVj/mYdOXbVjRcS87fQJLTnhk6dRZPuJjI+9g6RZJO4PNCngUrmyw==
+ dependencies:
+ "@types/react" "*"
+
"@types/react-redux@^7.1.20":
version "7.1.25"
resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.25.tgz#de841631205b24f9dfb4967dd4a7901e048f9a88"
@@ -3247,6 +3392,13 @@
dependencies:
"@types/react" "*"
+"@types/react-transition-group@^4.4.6":
+ version "4.4.6"
+ resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.6.tgz#18187bcda5281f8e10dfc48f0943e2fdf4f75e2e"
+ integrity sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew==
+ dependencies:
+ "@types/react" "*"
+
"@types/react@*", "@types/react@^18.0.17":
version "18.2.3"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.3.tgz#509ad6c4c77378e686f9bb6e0f8756936392f0e8"
@@ -7947,6 +8099,11 @@ stylis@4.1.4:
resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.4.tgz#9cb60e7153d8ac6d02d773552bf51c7a0344535b"
integrity sha512-USf5pszRYwuE6hg9by0OkKChkQYEXfkeTtm0xKw+jqQhwyjCVLdYyMBK7R+n7dhzsblAWJnGxju4vxq5eH20GQ==
+stylis@4.2.0:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.2.0.tgz#79daee0208964c8fe695a42fcffcac633a211a51"
+ integrity sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==
+
sucrase@^3.32.0:
version "3.32.0"
resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.32.0.tgz#c4a95e0f1e18b6847127258a75cf360bc568d4a7"
From 34123681cf5bc0610210ce891db871e2a11a7a16 Mon Sep 17 00:00:00 2001
From: Nikhil <118773738+pablohashescobar@users.noreply.github.com>
Date: Thu, 20 Jul 2023 14:18:06 +0530
Subject: [PATCH 08/15] chore: notification ordering (#1584)
---
apiserver/plane/api/views/notification.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/apiserver/plane/api/views/notification.py b/apiserver/plane/api/views/notification.py
index e81fd2b5f..f0c8e05d5 100644
--- a/apiserver/plane/api/views/notification.py
+++ b/apiserver/plane/api/views/notification.py
@@ -30,7 +30,6 @@ class NotificationViewSet(BaseViewSet):
def list(self, request, slug):
try:
- order_by = request.GET.get("order_by", "-created_at")
snoozed = request.GET.get("snoozed", "false")
archived = request.GET.get("archived", "false")
read = request.GET.get("read", "true")
@@ -40,7 +39,7 @@ class NotificationViewSet(BaseViewSet):
notifications = Notification.objects.filter(
workspace__slug=slug, receiver_id=request.user.id
- ).order_by(order_by)
+ ).order_by("snoozed_till", "-created_at")
# Filter for snoozed notifications
if snoozed == "false":
From 5e625ab1327dee87acd080cb8bc7a6da6425797d Mon Sep 17 00:00:00 2001
From: Nikhil <118773738+pablohashescobar@users.noreply.github.com>
Date: Thu, 20 Jul 2023 14:18:28 +0530
Subject: [PATCH 09/15] fix: uuid error when cycle and module updates (#1585)
---
.../plane/bgtasks/issue_activites_task.py | 147 ++++++++++--------
1 file changed, 82 insertions(+), 65 deletions(-)
diff --git a/apiserver/plane/bgtasks/issue_activites_task.py b/apiserver/plane/bgtasks/issue_activites_task.py
index e45ad9b32..523e4bc30 100644
--- a/apiserver/plane/bgtasks/issue_activites_task.py
+++ b/apiserver/plane/bgtasks/issue_activites_task.py
@@ -1028,21 +1028,26 @@ def issue_activity(
actor = User.objects.get(pk=actor_id)
project = Project.objects.get(pk=project_id)
+ if type not in [
+ "cycle.activity.created",
+ "cycle.activity.deleted",
+ "module.activity.created",
+ "module.activity.deleted",
+ ]:
+ issue = Issue.objects.filter(pk=issue_id, project_id=project_id).first()
- issue = Issue.objects.filter(pk=issue_id, project_id=project_id).first()
+ if issue is not None:
+ issue.updated_at = timezone.now()
+ issue.save(update_fields=["updated_at"])
- if issue is not None:
- issue.updated_at = timezone.now()
- issue.save(update_fields=["updated_at"])
-
- if subscriber:
- # add the user to issue subscriber
- try:
- _ = IssueSubscriber.objects.get_or_create(
- issue_id=issue_id, subscriber=actor
- )
- except Exception as e:
- pass
+ if subscriber:
+ # add the user to issue subscriber
+ try:
+ _ = IssueSubscriber.objects.get_or_create(
+ issue_id=issue_id, subscriber=actor
+ )
+ except Exception as e:
+ pass
ACTIVITY_MAPPER = {
"issue.activity.created": create_issue_activity,
@@ -1094,67 +1099,79 @@ def issue_activity(
except Exception as e:
capture_exception(e)
- # Create Notifications
- bulk_notifications = []
+ if type not in [
+ "cycle.activity.created",
+ "cycle.activity.deleted",
+ "module.activity.created",
+ "module.activity.deleted",
+ ]:
+ # Create Notifications
+ bulk_notifications = []
- issue_subscribers = list(
- IssueSubscriber.objects.filter(project=project, issue_id=issue_id)
- .exclude(subscriber_id=actor_id)
- .values_list("subscriber", flat=True)
- )
+ issue_subscribers = list(
+ IssueSubscriber.objects.filter(project=project, issue_id=issue_id)
+ .exclude(subscriber_id=actor_id)
+ .values_list("subscriber", flat=True)
+ )
- issue_assignees = list(
- IssueAssignee.objects.filter(project=project, issue_id=issue_id)
- .exclude(assignee_id=actor_id)
- .values_list("assignee", flat=True)
- )
+ issue_assignees = list(
+ IssueAssignee.objects.filter(project=project, issue_id=issue_id)
+ .exclude(assignee_id=actor_id)
+ .values_list("assignee", flat=True)
+ )
- issue_subscribers = issue_subscribers + issue_assignees
+ issue_subscribers = issue_subscribers + issue_assignees
- issue = Issue.objects.filter(pk=issue_id, project_id=project_id).first()
+ issue = Issue.objects.filter(pk=issue_id, project_id=project_id).first()
- # Add bot filtering
- if issue is not None and issue.created_by_id is not None and not issue.created_by.is_bot:
- issue_subscribers = issue_subscribers + [issue.created_by_id]
+ # Add bot filtering
+ if (
+ issue is not None
+ and issue.created_by_id is not None
+ and not issue.created_by.is_bot
+ ):
+ issue_subscribers = issue_subscribers + [issue.created_by_id]
- for subscriber in issue_subscribers:
- for issue_activity in issue_activities_created:
- bulk_notifications.append(
- Notification(
- workspace=project.workspace,
- sender="in_app:issue_activities",
- triggered_by_id=actor_id,
- receiver_id=subscriber,
- entity_identifier=issue_id,
- entity_name="issue",
- project=project,
- title=issue_activity.comment,
- data={
- "issue": {
- "id": str(issue_id),
- "name": str(issue.name),
- "identifier": str(project.identifier),
- "sequence_id": issue.sequence_id,
- "state_name": issue.state.name,
- "state_group": issue.state.group,
+ for subscriber in issue_subscribers:
+ for issue_activity in issue_activities_created:
+ bulk_notifications.append(
+ Notification(
+ workspace=project.workspace,
+ sender="in_app:issue_activities",
+ triggered_by_id=actor_id,
+ receiver_id=subscriber,
+ entity_identifier=issue_id,
+ entity_name="issue",
+ project=project,
+ title=issue_activity.comment,
+ data={
+ "issue": {
+ "id": str(issue_id),
+ "name": str(issue.name),
+ "identifier": str(project.identifier),
+ "sequence_id": issue.sequence_id,
+ "state_name": issue.state.name,
+ "state_group": issue.state.group,
+ },
+ "issue_activity": {
+ "id": str(issue_activity.id),
+ "verb": str(issue_activity.verb),
+ "field": str(issue_activity.field),
+ "actor": str(issue_activity.actor_id),
+ "new_value": str(issue_activity.new_value),
+ "old_value": str(issue_activity.old_value),
+ "issue_comment": str(
+ issue_activity.issue_comment.comment_stripped
+ if issue_activity.issue_comment is not None
+ else ""
+ ),
+ },
},
- "issue_activity": {
- "id": str(issue_activity.id),
- "verb": str(issue_activity.verb),
- "field": str(issue_activity.field),
- "actor": str(issue_activity.actor_id),
- "new_value": str(issue_activity.new_value),
- "old_value": str(issue_activity.old_value),
- "issue_comment": str(
- issue_activity.issue_comment.comment_stripped if issue_activity.issue_comment is not None else ""
- ),
- },
- },
+ )
)
- )
- # Bulk create notifications
- Notification.objects.bulk_create(bulk_notifications, batch_size=100)
+ # Bulk create notifications
+ Notification.objects.bulk_create(bulk_notifications, batch_size=100)
return
except Exception as e:
From 780573dadd7f8537a9d577807116ce87ed29624e Mon Sep 17 00:00:00 2001
From: Dakshesh Jain <65905942+dakshesh14@users.noreply.github.com>
Date: Thu, 20 Jul 2023 14:33:24 +0530
Subject: [PATCH 10/15] refactor: height of popover & api fetch call (#1587)
---
.../notifications/notification-popover.tsx | 2 +-
apps/app/hooks/use-user-notifications.tsx | 96 +++++++++++--------
2 files changed, 55 insertions(+), 43 deletions(-)
diff --git a/apps/app/components/notifications/notification-popover.tsx b/apps/app/components/notifications/notification-popover.tsx
index 6080ee5e8..0ad6ae66f 100644
--- a/apps/app/components/notifications/notification-popover.tsx
+++ b/apps/app/components/notifications/notification-popover.tsx
@@ -118,7 +118,7 @@ export const NotificationPopover = () => {
leaveFrom="opacity-100 translate-y-0"
leaveTo="opacity-0 translate-y-1"
>
-
+
Notifications
diff --git a/apps/app/hooks/use-user-notifications.tsx b/apps/app/hooks/use-user-notifications.tsx
index b202a1deb..394628aee 100644
--- a/apps/app/hooks/use-user-notifications.tsx
+++ b/apps/app/hooks/use-user-notifications.tsx
@@ -54,44 +54,48 @@ const useUserNotification = () => {
notifications?.find((notification) => notification.id === notificationId)?.read_at !== null;
if (isRead) {
+ notificationsMutate(
+ (prev) =>
+ prev?.map((prevNotification) => {
+ if (prevNotification.id === notificationId) {
+ return {
+ ...prevNotification,
+ read_at: null,
+ };
+ }
+ return prevNotification;
+ }),
+ false
+ );
await userNotificationServices
.markUserNotificationAsUnread(workspaceSlug.toString(), notificationId)
- .then(() => {
- notificationsMutate((prev) =>
- prev?.map((prevNotification) => {
- if (prevNotification.id === notificationId) {
- return {
- ...prevNotification,
- read_at: null,
- };
- }
- return prevNotification;
- })
- );
- mutateNotificationCount();
- })
.catch(() => {
throw new Error("Something went wrong");
+ })
+ .finally(() => {
+ notificationsMutate();
});
} else {
+ notificationsMutate(
+ (prev) =>
+ prev?.map((prevNotification) => {
+ if (prevNotification.id === notificationId) {
+ return {
+ ...prevNotification,
+ read_at: new Date(),
+ };
+ }
+ return prevNotification;
+ }),
+ false
+ );
await userNotificationServices
.markUserNotificationAsRead(workspaceSlug.toString(), notificationId)
- .then(() => {
- notificationsMutate((prev) =>
- prev?.map((prevNotification) => {
- if (prevNotification.id === notificationId) {
- return {
- ...prevNotification,
- read_at: new Date(),
- };
- }
- return prevNotification;
- })
- );
- mutateNotificationCount();
- })
.catch(() => {
throw new Error("Something went wrong");
+ })
+ .finally(() => {
+ notificationsMutate();
});
}
};
@@ -105,22 +109,24 @@ const useUserNotification = () => {
if (isArchived) {
await userNotificationServices
.markUserNotificationAsUnarchived(workspaceSlug.toString(), notificationId)
- .then(() => {
- notificationsMutate();
- })
.catch(() => {
throw new Error("Something went wrong");
+ })
+ .finally(() => {
+ notificationsMutate();
});
} else {
+ notificationsMutate(
+ (prev) => prev?.filter((prevNotification) => prevNotification.id !== notificationId),
+ false
+ );
await userNotificationServices
.markUserNotificationAsArchived(workspaceSlug.toString(), notificationId)
- .then(() => {
- notificationsMutate((prev) =>
- prev?.filter((prevNotification) => prevNotification.id !== notificationId)
- );
- })
.catch(() => {
throw new Error("Something went wrong");
+ })
+ .finally(() => {
+ notificationsMutate();
});
}
};
@@ -137,19 +143,25 @@ const useUserNotification = () => {
.patchUserNotification(workspaceSlug.toString(), notificationId, {
snoozed_till: null,
})
- .then(() => {
+ .finally(() => {
notificationsMutate();
});
- } else
+ } else {
+ notificationsMutate(
+ (prevData) => prevData?.filter((prev) => prev.id !== notificationId) || [],
+ false
+ );
await userNotificationServices
.patchUserNotification(workspaceSlug.toString(), notificationId, {
snoozed_till: dateTime,
})
- .then(() => {
- notificationsMutate(
- (prevData) => prevData?.filter((prev) => prev.id !== notificationId) || []
- );
+ .catch(() => {
+ new Error("Something went wrong");
+ })
+ .finally(() => {
+ notificationsMutate();
});
+ }
};
return {
From 4aef8c2242aebeeae72eff220f831b07524ba4aa Mon Sep 17 00:00:00 2001
From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com>
Date: Thu, 20 Jul 2023 14:49:30 +0530
Subject: [PATCH 11/15] fix: snooze dropdown overflow (#1588)
---
apps/app/components/notifications/notification-popover.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/app/components/notifications/notification-popover.tsx b/apps/app/components/notifications/notification-popover.tsx
index 0ad6ae66f..a8652e7ff 100644
--- a/apps/app/components/notifications/notification-popover.tsx
+++ b/apps/app/components/notifications/notification-popover.tsx
@@ -261,7 +261,7 @@ export const NotificationPopover = () => {
{notifications ? (
notifications.length > 0 ? (
-
+
{notifications.map((notification) => (
Date: Thu, 20 Jul 2023 16:35:18 +0530
Subject: [PATCH 12/15] fix: notification subscribe endpoint (#1593)
* refactor: height of popover & api fetch call
* fix: notification subscribe endpoint
---
.../use-issue-notification-subscription.tsx | 29 +++++++++++++------
apps/app/services/notifications.service.ts | 8 ++---
2 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/apps/app/hooks/use-issue-notification-subscription.tsx b/apps/app/hooks/use-issue-notification-subscription.tsx
index 2abe353b0..a118bdf6a 100644
--- a/apps/app/hooks/use-issue-notification-subscription.tsx
+++ b/apps/app/hooks/use-issue-notification-subscription.tsx
@@ -31,11 +31,18 @@ const useUserIssueNotificationSubscription = (
const handleUnsubscribe = useCallback(() => {
if (!workspaceSlug || !projectId || !issueId) return;
+ mutate(
+ {
+ subscribed: false,
+ },
+ false
+ );
+
userNotificationServices
.unsubscribeFromIssueNotifications(
- workspaceSlug as string,
- projectId as string,
- issueId as string
+ workspaceSlug.toString(),
+ projectId.toString(),
+ issueId.toString()
)
.then(() => {
mutate({
@@ -47,14 +54,18 @@ const useUserIssueNotificationSubscription = (
const handleSubscribe = useCallback(() => {
if (!workspaceSlug || !projectId || !issueId || !user) return;
+ mutate(
+ {
+ subscribed: true,
+ },
+ false
+ );
+
userNotificationServices
.subscribeToIssueNotifications(
- workspaceSlug as string,
- projectId as string,
- issueId as string,
- {
- subscriber: user.id,
- }
+ workspaceSlug.toString(),
+ projectId.toString(),
+ issueId.toString()
)
.then(() => {
mutate({
diff --git a/apps/app/services/notifications.service.ts b/apps/app/services/notifications.service.ts
index 412b03988..6c6bec62d 100644
--- a/apps/app/services/notifications.service.ts
+++ b/apps/app/services/notifications.service.ts
@@ -111,14 +111,10 @@ class UserNotificationsServices extends APIService {
async subscribeToIssueNotifications(
workspaceSlug: string,
projectId: string,
- issueId: string,
- data: {
- subscriber: string;
- }
+ issueId: string
): Promise {
return this.post(
- `/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/issue-subscribers/`,
- data
+ `/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/subscribe/`
)
.then((response) => response?.data)
.catch((error) => {
From 52d21b9ddab916acdbc4300f7c9fffe1c548adb6 Mon Sep 17 00:00:00 2001
From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com>
Date: Thu, 20 Jul 2023 16:51:00 +0530
Subject: [PATCH 13/15] chore: notification empty state overflow (#1592)
* chore: notification empty state overflow
* fix: white logo
* fix: custom theme default values
* fix: custom theme default values
---
.../core/theme/custom-theme-selector.tsx | 2 +-
apps/app/components/core/theme/theme-switch.tsx | 17 ++++++++++++++++-
.../notifications/notification-popover.tsx | 2 +-
apps/app/contexts/theme.context.tsx | 7 ++++++-
.../[workspaceSlug]/me/profile/preferences.tsx | 17 ++++++++++++++++-
.../white-horizontal-with-blue-logo.svg | 10 +++++-----
6 files changed, 45 insertions(+), 10 deletions(-)
diff --git a/apps/app/components/core/theme/custom-theme-selector.tsx b/apps/app/components/core/theme/custom-theme-selector.tsx
index 5f36115f8..40450ee2c 100644
--- a/apps/app/components/core/theme/custom-theme-selector.tsx
+++ b/apps/app/components/core/theme/custom-theme-selector.tsx
@@ -69,8 +69,8 @@ export const CustomThemeSelector: React.FC = ({ preLoadedData }) => {
return { ...prevData, ...res };
}, false);
- applyTheme(payload.palette, darkPalette);
setTheme("custom");
+ applyTheme(payload.palette, darkPalette);
})
.catch((err) => console.log(err));
};
diff --git a/apps/app/components/core/theme/theme-switch.tsx b/apps/app/components/core/theme/theme-switch.tsx
index 8929015ee..39b570bc5 100644
--- a/apps/app/components/core/theme/theme-switch.tsx
+++ b/apps/app/components/core/theme/theme-switch.tsx
@@ -71,7 +71,21 @@ export const ThemeSwitch: React.FC = ({
}
onChange={({ value, type }: { value: string; type: string }) => {
if (value === "custom") {
- if (user?.theme.palette) setPreLoadedData(user.theme);
+ if (user?.theme.palette) {
+ setPreLoadedData({
+ background: user.theme.background !== "" ? user.theme.background : "#0d101b",
+ text: user.theme.text !== "" ? user.theme.text : "#c5c5c5",
+ primary: user.theme.primary !== "" ? user.theme.primary : "#3f76ff",
+ sidebarBackground:
+ user.theme.sidebarBackground !== "" ? user.theme.sidebarBackground : "#0d101b",
+ sidebarText: user.theme.sidebarText !== "" ? user.theme.sidebarText : "#c5c5c5",
+ darkPalette: false,
+ palette:
+ user.theme.palette !== ",,,,"
+ ? user.theme.palette
+ : "#0d101b,#c5c5c5,#3f76ff,#0d101b,#c5c5c5",
+ });
+ }
if (!customThemeSelectorOptions) setCustomThemeSelectorOptions(true);
} else {
@@ -87,6 +101,7 @@ export const ThemeSwitch: React.FC = ({
document.documentElement.style.removeProperty(`--color-sidebar-border-${i}`);
}
}
+
setTheme(value);
document.documentElement.style.setProperty("color-scheme", type);
}}
diff --git a/apps/app/components/notifications/notification-popover.tsx b/apps/app/components/notifications/notification-popover.tsx
index a8652e7ff..255d8af04 100644
--- a/apps/app/components/notifications/notification-popover.tsx
+++ b/apps/app/components/notifications/notification-popover.tsx
@@ -274,7 +274,7 @@ export const NotificationPopover = () => {
))}
) : (
-
+
= ({
const theme = localStorage.getItem("theme");
if (theme && theme === "custom") {
if (user && user.theme.palette) {
- applyTheme(user.theme.palette, user.theme.darkPalette);
+ applyTheme(
+ user.theme.palette !== ",,,,"
+ ? user.theme.palette
+ : "#0d101b,#c5c5c5,#3f76ff,#0d101b,#c5c5c5",
+ user.theme.darkPalette
+ );
}
}
}, [user]);
diff --git a/apps/app/pages/[workspaceSlug]/me/profile/preferences.tsx b/apps/app/pages/[workspaceSlug]/me/profile/preferences.tsx
index 64b598f7f..605131aa4 100644
--- a/apps/app/pages/[workspaceSlug]/me/profile/preferences.tsx
+++ b/apps/app/pages/[workspaceSlug]/me/profile/preferences.tsx
@@ -22,7 +22,22 @@ const ProfilePreferences = () => {
useEffect(() => {
if (theme === "custom") {
- if (myProfile?.theme.palette) setPreLoadedData(myProfile.theme);
+ if (myProfile?.theme.palette)
+ setPreLoadedData({
+ background: myProfile.theme.background !== "" ? myProfile.theme.background : "#0d101b",
+ text: myProfile.theme.text !== "" ? myProfile.theme.text : "#c5c5c5",
+ primary: myProfile.theme.primary !== "" ? myProfile.theme.primary : "#3f76ff",
+ sidebarBackground:
+ myProfile.theme.sidebarBackground !== ""
+ ? myProfile.theme.sidebarBackground
+ : "#0d101b",
+ sidebarText: myProfile.theme.sidebarText !== "" ? myProfile.theme.sidebarText : "#c5c5c5",
+ darkPalette: false,
+ palette:
+ myProfile.theme.palette !== ",,,,"
+ ? myProfile.theme.palette
+ : "#0d101b,#c5c5c5,#3f76ff,#0d101b,#c5c5c5",
+ });
if (!customThemeSelectorOptions) setCustomThemeSelectorOptions(true);
}
}, [myProfile, theme, customThemeSelectorOptions]);
diff --git a/apps/app/public/plane-logos/white-horizontal-with-blue-logo.svg b/apps/app/public/plane-logos/white-horizontal-with-blue-logo.svg
index d8cc6f4ef..1f09cc34a 100644
--- a/apps/app/public/plane-logos/white-horizontal-with-blue-logo.svg
+++ b/apps/app/public/plane-logos/white-horizontal-with-blue-logo.svg
@@ -1,10 +1,10 @@