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(resource): cant submit resource request #5443

Merged
merged 4 commits into from
May 9, 2023
Merged

Conversation

aeswibon
Copy link
Member

@aeswibon aeswibon commented May 4, 2023

Bug Fix

WHAT

🤖 Generated by Copilot at 1e08fdd

Refactored the resource creation form and added localization support. The form now uses custom components and the useTranslation hook to render the fields and labels in the user's preferred language. The code was also cleaned up and the types and styles were enhanced. The English locale file was updated with the resource-related strings from Resource.json.

Proposed Changes

  • Updates form validation logic
  • Replaces MUI with tailwind components

Associated Issue

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug/test a new feature.
  • Update product documentation
  • Ensure that UI text is kept in I18n files
  • Prep the screenshot or demo video for the changelog entry, and attach it to issue
  • Request for Peer Reviews
  • Completion of QA

HOW

🤖 Generated by Copilot at 1e08fdd

  • Remove unused imports from ResourceCreate.tsx to clean up the code and avoid unnecessary dependencies (link)
  • Add imports of custom form components and translation hook to ResourceCreate.tsx to improve the form functionality and appearance (link)
  • Initialize the translation hook with const { t } = useTranslation(); in ResourceCreate.tsx to access the translation function for the form labels and title (link)
  • Move the phone number parsing statement inside the relevant case block in the validateForm function in ResourceCreate.tsx to avoid unnecessary parsing of other fields (link, link)
  • Change the handleChange function parameter type to FieldChangeEvent<string> in ResourceCreate.tsx to use the custom type for the form field change event (link)
  • Replace the PageTitle component prop with the translation function for the page title in ResourceCreate.tsx (link)
  • Replace the legacy form components with the custom form components and use the translation function for the field labels in ResourceCreate.tsx (link, link)
  • Import the Resource.json file to index.js in the English locale to include the resource-related translation strings (link)
  • Spread the Resource object to the en object in the English locale to include the resource-related translation strings (link)

@aeswibon aeswibon added needs testing P1 breaking issue or vital feature labels May 4, 2023
@aeswibon aeswibon requested a review from a team May 4, 2023 15:24
@aeswibon aeswibon requested a review from a team as a code owner May 4, 2023 15:24
@aeswibon aeswibon requested a review from mathew-alex May 4, 2023 15:24
@vercel
Copy link

vercel bot commented May 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2023 7:18am

@netlify
Copy link

netlify bot commented May 4, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit e1ddfdd
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/6458a2077cdb4b00083fb286
😎 Deploy Preview https://deploy-preview-5443--care-egov-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the cypress failed pull request with cypress test failure label May 4, 2023
src/Locale/en/Resource.json Outdated Show resolved Hide resolved
src/Components/Resource/ResourceCreate.tsx Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented May 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.4% 1.4% Duplication

@nihal467
Copy link
Member

nihal467 commented May 8, 2023

LGTM

@khavinshankar
Copy link
Member

@rithviknishad can you rereview this once

@khavinshankar khavinshankar merged commit abcdc46 into develop May 9, 2023
25 of 26 checks passed
@khavinshankar khavinshankar deleted the issue#5440 branch May 9, 2023 07:42
@github-actions
Copy link

github-actions bot commented May 9, 2023

@cp-Coder We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cypress failed pull request with cypress test failure P1 breaking issue or vital feature tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cant submit Resource Request
4 participants