Skip to content

Conversation

@ggazzo
Copy link
Member

@ggazzo ggazzo commented Jun 14, 2021

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

@ggazzo ggazzo requested a review from a team June 15, 2021 01:12
@ggazzo ggazzo marked this pull request as ready for review June 15, 2021 01:12
Copy link
Member

@sampaiodiego sampaiodiego left a comment

Choose a reason for hiding this comment

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

additionally to the comments I added on the code, I think very weird having duplicated items on some file paths, like for example definition/IMessage/IMessage.ts and definition/IMessage/MessageAttachment/MessageAttachment.ts

what if those duplicates are moved to the index.ts files? like definition/IMessage/index.ts and definition/IMessage/MessageAttachment/index.ts respectively. or maybe moving them one folder up.. wdyt?


const getUploadDetails = (details: IUploadDetails): Partial<IUploadDetails> => {
if (details.visitorToken) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Copy link
Member

Choose a reason for hiding this comment

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

should we use ignoreRestSiblings:true instead of having to disable the ESLint rule? https://eslint.org/docs/rules/no-unused-vars#ignorerestsiblings

const businessHourToReturn = { ...businessHourData };
delete businessHourData.timezoneName;
delete businessHourData.departmentsToApplyBusinessHour;
delete (businessHourData as any).timezoneName;
Copy link
Member

Choose a reason for hiding this comment

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

I think we should fix this with a better solution. Typings are not well used here 🤔

@@ -1,4 +1,8 @@
import { RocketChatIntegrationHandler } from '../server/lib/triggerHandler';
Copy link
Member

Choose a reason for hiding this comment

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

this file is imported by the client bundle, so doing this doesn't work..

even if this worked, it would fail because ../server/lib/triggerHandler has a dependency on Node's vm , which would fail when trying to use on client.

@ggazzo
Copy link
Member Author

ggazzo commented Jun 20, 2021

additionally to the comments I added on the code, I think very weird having duplicated items on some file paths, like for example definition/IMessage/IMessage.ts and definition/IMessage/MessageAttachment/MessageAttachment.ts

what if those duplicates are moved to the index.ts files? like definition/IMessage/index.ts and definition/IMessage/MessageAttachment/index.ts respectively. or maybe moving them one folder up.. wdyt?

this is a pattern we found during many attempts, the index.js usage is recommended for import, and the file with the full name is for help developers to open the right file quickly, so they dont need to guess if the right file is a index or a named file.

sampaiodiego
sampaiodiego previously approved these changes Jun 21, 2021
@sampaiodiego sampaiodiego merged commit 6924f93 into develop Jun 21, 2021
@sampaiodiego sampaiodiego deleted the chore/attachments branch June 21, 2021 02:49
@sampaiodiego sampaiodiego mentioned this pull request Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants