Skip to content
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

🐛 Fix email notification link #738

Merged
merged 6 commits into from
Nov 25, 2024
Merged

Conversation

MontaGhanmy
Copy link
Collaborator

@MontaGhanmy MontaGhanmy commented Nov 20, 2024

demo_scroll

@MontaGhanmy MontaGhanmy added the bug Something isn't working label Nov 20, 2024
@MontaGhanmy MontaGhanmy self-assigned this Nov 20, 2024
@@ -25,6 +35,33 @@ export class DocumentsEngine implements Initializable {
return; // Early return on unknown event type
}

const encodedCompanyId = translator.fromUUID(e.item.company_id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract this part to a one function with two params, item or item path, and receiver. And have the next test cases:

  • file created in the folder that I've shared and the folder Is in: my drive, shared drive
  • the file was shared with me
  • any other cases that I forgot)

I home we will refactor it later, when we refactor UI routings wot have one file URL

@@ -125,9 +125,15 @@ export const eventToTemplateMap: Record<string, any> = {
[DocumentEvents.DOCUMENT_SAHRED]: "notification-document-shared",
};

export enum NotificationActionType {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and what does it mean, "direct" or "update" ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "direct" is a user A share folder/file with user B.
  • "update" is user B does an update on a file/folder shared by user A. (this could be also an anonymous user through public links)

const mockPayload = (
type: NotificationActionType,
overrides: Partial<NotificationPayloadType> = {},
) => ({
Copy link
Contributor

@ericlinagora ericlinagora Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

: NotificationPayloadType this way the ass bellow aren't needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would require specifying all the properties of NotificationPayloadType even for test cases where they're irrelevant. It makes it even more complicated.

@@ -54,6 +54,7 @@ export const DocumentRow = ({
: 'hover:bg-zinc-500 hover:bg-opacity-10 ') +
(className || '')
}
id={item.id}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we either use another attribute (eg: data-item-id={item.id} with querySelector), or if we really want id, then prefix it in case we have multiple items on screen representing the same driveitem

@MontaGhanmy MontaGhanmy merged commit 36881ce into main Nov 25, 2024
7 checks passed
@ericlinagora ericlinagora added this to the v1.0.5-rc2+ milestone Nov 25, 2024
@ericlinagora ericlinagora deleted the fix_email_notification_link branch November 25, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants