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: formdata email parsing error fix #1186

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/ReportingConfig/EmailDeliveryMethodForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const EmailDeliveryMethodForm = ({ invalidFields, config, handleBlur }) => {
<Form.Label>Email(s)</Form.Label>
<Form.Control
as="textarea"
name="emailRaw"
data-testid="emailRaw"
defaultValue={config ? config.email.join('\n') : undefined}
onBlur={e => handleBlur(e, () => {
Expand Down Expand Up @@ -47,6 +48,7 @@ const EmailDeliveryMethodForm = ({ invalidFields, config, handleBlur }) => {
<Form.Label>Password</Form.Label>
<Form.Control
type="password"
name="encryptedPassword"
disabled={config && !checked}
onBlur={e => handleBlur(e)}
data-hj-suppress
Expand Down
3 changes: 3 additions & 0 deletions src/components/ReportingConfig/ReportingConfigForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ class ReportingConfigForm extends React.Component {
handleSubmit = async (formData, config) => {
await this.setState({ submitState: SUBMIT_STATES.PENDING });
let requiredFields = [];
formData.append('active', this.state.active);
formData.append('enableCompression', this.state.enableCompression);
if (formData.get('deliveryMethod') === 'email') {
requiredFields = config ? [...REQUIRED_EMAIL_FIELDS] : [...REQUIRED_NEW_EMAIL_FIELDS];
// transform email field to match what the api is looking for
Expand Down Expand Up @@ -343,6 +345,7 @@ class ReportingConfigForm extends React.Component {
helpText: 'The hour of the day to send the report, in Eastern Standard Time (EST). This is required for all frequency settings',
invalidMessage: 'Required for all frequency types',
isInvalid: invalidFields.hourOfDay,
min: 0,
label: 'Hour of Day',
})}
</div>
Expand Down
Loading