Skip to content

Commit

Permalink
fix: formdata email parsing error fix (#1186)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiram15 authored Mar 20, 2024
1 parent 37e3151 commit c7dd327
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
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

0 comments on commit c7dd327

Please sign in to comment.