Skip to content

Commit 666ddf7

Browse files
[WEB-2382]chore:notification snooze modal (#6164)
* modified notification store * notification snooze types fix * handled promise * modified notifications layout * incresed pagination count for notifications
1 parent 4499a5f commit 666ddf7

File tree

7 files changed

+10
-12
lines changed

7 files changed

+10
-12
lines changed

web/app/[workspaceSlug]/(projects)/notifications/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"use client";
22

33
// components
4-
import { NotificationsSidebar } from "@/plane-web/components/workspace-notifications";
4+
import { NotificationsSidebarRoot } from "@/plane-web/components/workspace-notifications";
55

66
export default function ProjectInboxIssuesLayout({ children }: { children: React.ReactNode }) {
77
return (
88
<div className="relative w-full h-full overflow-hidden flex items-center">
9-
<NotificationsSidebar />
9+
<NotificationsSidebarRoot />
1010
<div className="w-full h-full overflow-hidden overflow-y-auto">{children}</div>
1111
</div>
1212
);

web/ce/components/workspace-notifications/root.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { getNumberCount } from "@/helpers/string.helper";
2121
// hooks
2222
import { useWorkspace, useWorkspaceNotifications } from "@/hooks/store";
2323

24-
export const NotificationsSidebar: FC = observer(() => {
24+
export const NotificationsSidebarRoot: FC = observer(() => {
2525
const { workspaceSlug } = useParams();
2626
// hooks
2727
const { getWorkspaceBySlug } = useWorkspace();
@@ -65,7 +65,7 @@ export const NotificationsSidebar: FC = observer(() => {
6565
<div
6666
key={tab.value}
6767
className="h-full px-3 relative cursor-pointer"
68-
onClick={()=>handleTabClick(tab.value)}
68+
onClick={() => handleTabClick(tab.value)}
6969
>
7070
<div
7171
className={cn(

web/core/components/workspace-notifications/sidebar/notification-card/options/snooze/modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { getDate } from "@/helpers/date-time.helper";
1717
type TNotificationSnoozeModal = {
1818
isOpen: boolean;
1919
onClose: () => void;
20-
onSubmit: (dateTime?: Date | undefined) => Promise<TNotification | undefined>;
20+
onSubmit: (dateTime?: Date | undefined) => Promise<void>;
2121
};
2222

2323
type FormValues = {

web/core/components/workspace-notifications/sidebar/notification-card/options/snooze/root.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,23 @@ export const NotificationItemSnoozeOption: FC<TNotificationItemSnoozeOption> = o
3434
const handleNotificationSnoozeDate = async (snoozeTill: Date | undefined) => {
3535
if (snoozeTill) {
3636
try {
37-
const response = await snoozeNotification(workspaceSlug, snoozeTill);
37+
await snoozeNotification(workspaceSlug, snoozeTill);
3838
setToast({
3939
title: "Success!",
4040
message: "Notification snoozed successfully",
4141
type: TOAST_TYPE.SUCCESS,
4242
});
43-
return response;
4443
} catch (e) {
4544
console.error(e);
4645
}
4746
} else {
4847
try {
49-
const response = await unSnoozeNotification(workspaceSlug);
48+
await unSnoozeNotification(workspaceSlug);
5049
setToast({
5150
title: "Success!",
5251
message: "Notification un snoozed successfully",
5352
type: TOAST_TYPE.SUCCESS,
5453
});
55-
return response;
5654
} catch (e) {
5755
console.error(e);
5856
}

web/core/store/notifications/workspace-notifications.store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export interface IWorkspaceNotificationStore {
6262

6363
export class WorkspaceNotificationStore implements IWorkspaceNotificationStore {
6464
// constants
65-
paginatedCount = 30;
65+
paginatedCount = 300;
6666
// observables
6767
loader: TNotificationLoader = undefined;
6868
unreadNotificationsCount: TUnreadNotificationsCount = {
@@ -84,7 +84,7 @@ export class WorkspaceNotificationStore implements IWorkspaceNotificationStore {
8484
read: false,
8585
};
8686

87-
constructor(private store: CoreRootStore) {
87+
constructor(protected store: CoreRootStore) {
8888
makeObservable(this, {
8989
// observables
9090
loader: observable.ref,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "ce/components/workspace-notifications";

web/ee/components/workspace-notifications/root.tsx

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)