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

Refactor Subscriber Modal Page #100

Merged
merged 19 commits into from
Aug 19, 2024

Conversation

yccodr
Copy link
Collaborator

@yccodr yccodr commented Jun 12, 2024

Description

This PR is mainly focusing on refactoring the subscriber create/update page. It aims to reduce the complexity of the page and separate it into multiple components. Also, this PR adds react-hook-form to help with validation and improving performance.

Changes

  • New Mapper Layer
    • map subscription model to form schema (called SubscriptionDTO in codebase)
    • hide complex logic from presentation layer (form, in this case)
  • Form state management: useState() -> useForm()
  • Added some validation:
    • userNumber should be a positive integer
    • plmnId should be a five digit number string
    • etc
  • Modular components: split 1700-ish-line page into multiple 200-ish-line components
  • New Dependencies: react-hook-form, @hookform/resolvers, zod
  • Allow empty SD value (closes Webconsole shall not require SD when provisioning a 5G subscriber #19 )

@andy89923 andy89923 self-requested a review July 15, 2024 17:37
@yccodr yccodr force-pushed the refactor/subscriber-modal branch from 1813815 to 9aaca38 Compare July 31, 2024 11:53
@yccodr yccodr marked this pull request as ready for review July 31, 2024 12:47
@yccodr
Copy link
Collaborator Author

yccodr commented Aug 1, 2024

@ianchen0119 @andy89923 Ready for review! 🙏

@ianchen0119 ianchen0119 merged commit 94a0f1a into free5gc:main Aug 19, 2024
3 checks passed
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.

Webconsole shall not require SD when provisioning a 5G subscriber
3 participants