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: Notification QA fixes #2349

Merged
merged 51 commits into from
Jan 13, 2025

Conversation

shivani170
Copy link
Contributor

Description

fix: Notification QA fixes

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@@ -53,24 +52,22 @@ const SESConfigModal = ({

const [form, setForm] = useState<SESFormType>(getSESDefaultConfiguration(shouldBeDefault))
const [isFormValid, setFormValid] = useState(DefaultSESValidations)

const awsRegionListParsed = awsRegionList
Copy link
Contributor

@vivek-devtron vivek-devtron Jan 11, 2025

Choose a reason for hiding this comment

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

Instead of removing this we should move it on line no 43 and use it in the component

!!authPassword &&
!!fromEmail &&
getFormValidated(isFormValid, fromEmail)
validateKeyValueConfig(ConfigurationFieldKeys.CONFIG_NAME, configName).isValid &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are again validationg the same. we should use the value from line no 94 setter

webhookUrl: validateKeyValueConfig(ConfigurationFieldKeys.WEBHOOK_URL, webhookUrl),
projectId: validateKeyValueConfig(ConfigurationFieldKeys.PROJECT_ID, selectedProject?.value ?? ''),
}))
return (
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of calling the method again we should reuse the values from line no 90

webhookUrl: validateKeyValueConfig(ConfigurationFieldKeys.WEBHOOK_URL, webhookUrl),
payload: validatePayloadField(payload),
})
setFormValid({
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the duplicated code

webhookUrl: validateKeyValueConfig(ConfigurationFieldKeys.WEBHOOK_URL, webhookUrl),
payload: validatePayloadField(payload),
})
return (
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we calling the sam emthod again and again

if (element.key != '') {
headerObj[element.key] = element.value
}
})

const payload = {
Copy link
Contributor

Choose a reason for hiding this comment

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

This payload should be created from the form itself

@@ -358,3 +353,8 @@ export const renderErrorToast = () =>
variant: ToastVariantType.error,
description: 'Some required fields are missing or Invalid',
})

export const getAwsRegionListParsed = (awsRegionList) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are using this util in other component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this util to the component.

@shivani170 shivani170 merged commit 5556ef1 into feat/notification-configuration Jan 13, 2025
5 checks passed
@shivani170 shivani170 deleted the feat/uat-add-button branch January 13, 2025 07:28
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.

6 participants