-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[WEB-2382]chore:notification files restructuring #6181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c9a8e8f
bf57d9e
8d181d7
bc37bf8
9b8bed4
64c3dfd
5f36d99
2768eaa
17d3169
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| export * from './root' | ||
| export * from "./notification-card/root"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| export * from "./notification-app-sidebar-option"; | ||
| export * from "./sidebar"; | ||
| export * from "./root"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| export * from "./root"; | ||
| export * from "./item"; | ||
| export * from "./options"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ export interface INotification extends TNotification { | |
|
|
||
| export class Notification implements INotification { | ||
| // observables | ||
| id: string | undefined = undefined; | ||
| id: string; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Refactor: Remove redundant ID null checks Since Here's how to clean up the redundant checks: - if (!this.id) return undefined;This change should be applied to all methods that have this check.
|
||
| title: string | undefined = undefined; | ||
| data: TNotificationData | undefined = undefined; | ||
| entity_identifier: string | undefined = undefined; | ||
|
|
@@ -54,6 +54,7 @@ export class Notification implements INotification { | |
| private store: CoreRootStore, | ||
| private notification: TNotification | ||
| ) { | ||
| this.id = this.notification.id; | ||
| makeObservable(this, { | ||
| // observables | ||
| id: observable.ref, | ||
|
|
@@ -90,7 +91,6 @@ export class Notification implements INotification { | |
| snoozeNotification: action, | ||
| unSnoozeNotification: action, | ||
| }); | ||
| this.id = this.notification.id; | ||
| this.title = this.notification.title; | ||
| this.data = this.notification.data; | ||
| this.entity_identifier = this.notification.entity_identifier; | ||
|
|
@@ -169,8 +169,6 @@ export class Notification implements INotification { | |
| workspaceSlug: string, | ||
| payload: Partial<TNotification> | ||
| ): Promise<TNotification | undefined> => { | ||
| if (!this.id) return undefined; | ||
|
|
||
| try { | ||
| const notification = await workspaceNotificationService.updateNotificationById(workspaceSlug, this.id, payload); | ||
| if (notification) { | ||
|
|
@@ -188,8 +186,6 @@ export class Notification implements INotification { | |
| * @returns { TNotification | undefined } | ||
| */ | ||
| markNotificationAsRead = async (workspaceSlug: string): Promise<TNotification | undefined> => { | ||
| if (!this.id) return undefined; | ||
|
|
||
| const currentNotificationReadAt = this.read_at; | ||
| try { | ||
| const payload: Partial<TNotification> = { | ||
|
|
@@ -215,8 +211,6 @@ export class Notification implements INotification { | |
| * @returns { TNotification | undefined } | ||
| */ | ||
| markNotificationAsUnRead = async (workspaceSlug: string): Promise<TNotification | undefined> => { | ||
| if (!this.id) return undefined; | ||
|
|
||
| const currentNotificationReadAt = this.read_at; | ||
| try { | ||
| const payload: Partial<TNotification> = { | ||
|
|
@@ -242,8 +236,6 @@ export class Notification implements INotification { | |
| * @returns { TNotification | undefined } | ||
| */ | ||
| archiveNotification = async (workspaceSlug: string): Promise<TNotification | undefined> => { | ||
| if (!this.id) return undefined; | ||
|
|
||
| const currentNotificationArchivedAt = this.archived_at; | ||
| try { | ||
| const payload: Partial<TNotification> = { | ||
|
|
@@ -267,8 +259,6 @@ export class Notification implements INotification { | |
| * @returns { TNotification | undefined } | ||
| */ | ||
| unArchiveNotification = async (workspaceSlug: string): Promise<TNotification | undefined> => { | ||
| if (!this.id) return undefined; | ||
|
|
||
| const currentNotificationArchivedAt = this.archived_at; | ||
| try { | ||
| const payload: Partial<TNotification> = { | ||
|
|
@@ -293,8 +283,6 @@ export class Notification implements INotification { | |
| * @returns { TNotification | undefined } | ||
| */ | ||
| snoozeNotification = async (workspaceSlug: string, snoozeTill: Date): Promise<TNotification | undefined> => { | ||
| if (!this.id) return undefined; | ||
|
|
||
| const currentNotificationSnoozeTill = this.snoozed_till; | ||
| try { | ||
| const payload: Partial<TNotification> = { | ||
|
|
@@ -315,8 +303,6 @@ export class Notification implements INotification { | |
| * @returns { TNotification | undefined } | ||
| */ | ||
| unSnoozeNotification = async (workspaceSlug: string): Promise<TNotification | undefined> => { | ||
| if (!this.id) return undefined; | ||
|
|
||
| const currentNotificationSnoozeTill = this.snoozed_till; | ||
| try { | ||
| const payload: Partial<TNotification> = { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Multiple components still using old import path need attention
The verification reveals that while
NotificationCardListRoothas been moved to the new path, several other components in the file are still using the old import path@/components/workspace-notifications:NotificationsLoaderNotificationEmptyStateNotificationSidebarHeaderAppliedFiltersAdditionally, there are multiple other files in the codebase still importing components from the old path, suggesting this migration is incomplete.
🔗 Analysis chain
Import path change aligns with component restructuring.
The NotificationCardListRoot component has been moved to @/plane-web/components, which aligns with the ongoing restructuring effort. Based on the retrieved learning, this is part of a gradual migration where some components remain in core.
Let's verify if there are other notification components that might need similar updates:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 316
Script:
Length of output: 706
Script:
Length of output: 4420
Script:
Length of output: 1967