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(provider): Remove sender name field and make boolean type a switch in nodemailer #3365

Merged
merged 6 commits into from
May 10, 2023

Conversation

peoray
Copy link
Contributor

@peoray peoray commented May 9, 2023

What change does this PR introduce?

Why was this change needed?

Closes #1753

Other information (Screenshots)

@@ -181,7 +181,7 @@ export const nodemailerConfig: IConfigCredentials[] = [
type: 'string',
required: false,
},
...mailConfigBase,
mailConfigBase[0],
Copy link
Contributor

Choose a reason for hiding this comment

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

I consider we shouldn't remove the option to set the sender name from Nodemailer. If it is not used in the provider package we should implement it. Probably the change for the credentials would be to make the sender name optional instead of mandatory as it is right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

alright, I'll add it to the config in the provider file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines +76 to +96
if (credential.type === 'boolean') {
return (
<Switch
styles={() => ({
root: {
display: 'block !important',
maxWidth: '100% !important',
},
})}
label={credential.displayName}
required={credential.required}
placeholder={credential.displayName}
description={credential.description ?? ''}
data-test-id={credential.key}
error={errors[credential.key]?.message}
{...register(credential.key)}
checked={field.value}
onChange={field.onChange}
/>
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This change will make all boolean values for all integrations to become a Switch. We should review all the providers to see nothing breaks in the functionality.
Adding screenshots of how they would look like now would be also helpful for the PR reviewers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, although, it makes sense for a boolean to be a toggle rather than an input field. I know I have been confused by that when creating documentation for (sparkpost).

The only providers affected are Sparkpost and Nodemailer (I checked). The others have a type of switch, which frankly I don't understand why it is so, boolean sounds like a better option since it's only true or false. (Note that this switch type is only included in the nodemailer config as well so it's the same behaviour as the boolean.

@peoray
Copy link
Contributor Author

peoray commented May 9, 2023

Screen Shot 2023-05-09 at 10 30 54 AM

@p-fernandez

Copy link
Contributor

@p-fernandez p-fernandez left a comment

Choose a reason for hiding this comment

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

🌟
Well done!

@p-fernandez
Copy link
Contributor

@peoray could you do a pnpm install and pnpm build in your branch and commit the changes? The lock file is not working as expected and blocking the CI. 🙏🏻

@peoray
Copy link
Contributor Author

peoray commented May 10, 2023

@p-fernandez done

@p-fernandez p-fernandez added this pull request to the merge queue May 10, 2023
Merged via the queue into novuhq:next with commit f4fd05c May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: nodemailer sendername field & secure field
2 participants