-
Notifications
You must be signed in to change notification settings - Fork 262
Send email when an issue is escalating #1960
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
Conversation
707802c to
6375d26
Compare
| return ( | ||
| <DetailsPanel bordered ref={ref}> | ||
| <div className='relative w-full overflow-hidden'> | ||
| <div className='relative w-full overflow-hidden custom-scrollbar'> |
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.
Fix sliding horizontal overflow
packages/core/src/services/memberships/updateEscalatingIssuesEmailPreference.ts
Outdated
Show resolved
Hide resolved
packages/core/src/services/memberships/updateWeeklyEmailPreference.ts
Outdated
Show resolved
Hide resolved
e772320 to
1fa6e5e
Compare
| subMonths, | ||
| subWeeks, | ||
| } from 'date-fns' | ||
| import type { RelativeDate } from '@latitude-data/core/constants' |
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.
web-ui was coupled with core, I used sone UI components on emails and that gave me cycle dependencies. So I remove @latitude-data/core from web-ui and moved common parts to constants.
Web UI should never dependent on core. If a UI depends on core it belongs to apps/web
| await cookies(), | ||
| ) | ||
|
|
||
| if (parsedInput.redirectTo) { |
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.
why?
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.
This is used on the normal switch selector and now on the swich redirect for the notifications
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.
🔥 All mails were moved
| "react": "catalog:", | ||
| "react-dom": "catalog:", | ||
| "react-email": "4.0.3", | ||
| "@latitude-data/emails": "workspace:*", |
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.
Isolated so is easy to update and understand
| "@dnd-kit/modifiers": "^9.0.0", | ||
| "@dnd-kit/utilities": "^3.2.2", | ||
| "@latitude-data/constants": "workspace:^", | ||
| "@latitude-data/core": "workspace:^", |
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.
No dep with core 🔥
| redirectTo: ROUTES.dashboard.notifications.root, | ||
| }) | ||
|
|
||
| if (error) { |
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.
why not add this as the onFailure of the action?
| * so frontend can set the right session in cookies. | ||
| * | ||
| * 3. If the user has membership to that workspace and it's the current workspace | ||
| * we redirect to the default notifications page |
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.
tremenda logica
1fa6e5e to
ec67b66
Compare
| ) | ||
|
|
||
| const { execute: updateWeeklyEmail, isPending: isUpdatingWeeklyEmail } = | ||
| useLatitudeAction(updateWeeklyEmailPreferenceAction, { |
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.
nitpick: These two actions dont have to do with the currentUser entity, its more of a new "notification" store
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.
Is totally related with the current user. Only current user can handle notifications. If this growth more we can move to another place
| onSuccess: async ({ data: user }) => { | ||
| mutate(user) // Note: silent update | ||
| onSuccess: async () => { | ||
| mutate() // Get fresh data |
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.
why do we need to do an entire mutate if we have the user data?
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.
Because now the source of truth has changed. The notification settings related to the current user are on the backend only. So whenever the user change i refresh the frontend
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.
You cant return them as part of the update user?
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.
Yes, but also do this fix the problem
We want to let users know when an issue is escalating. To do that we'll send an email to all the members of the workspaces that have activated the notifications for escalating issues.
ec67b66 to
8443abf
Compare
learningbizz
left a comment
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.
Lots of files but, overall, I see things are good 👍 Good job!
What?
We want to let users know when an issue is escalating. To do that, we'll send an email to all members of workspaces that have activated notifications for escalating issues.
TODO