Skip to content

Make license number optional in public registration - #429

Merged
JacquesDelfrate merged 1 commit into
mainfrom
issue_428/optional_public_registration_license
Sep 22, 2026
Merged

JacquesDelfrate merged 1 commit into
mainfrom
issue_428/optional_public_registration_license

Conversation

@JacquesDelfrate

@JacquesDelfrate JacquesDelfrate commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #428

Depends on backend: HeartWise-AI/pacs-ai-backend#329

Summary

  • accept a blank license number in public-registration validation
  • identify the registration field as optional in every supported locale
  • normalize blank license input for the API request
  • hide the profile license separator and copy control when no license exists
  • leave administrator member management unchanged

Validation

  • 8 focused Jest suites, 33 tests passed
  • Prettier check passed for changed registration, helper, test, and translation files
  • all five changed locale JSON files parsed and contain the new key
  • Settings.tsx lint regression comparison: baseline 141 errors/4 warnings; branch 141 errors/4 warnings

Summary by Sourcery

Make license numbers optional for public registration while keeping profile credentials clean when no license is provided.

New Features:

  • Allow users to omit their license number during public registration and identify the field as optional across supported locales.

Bug Fixes:

  • Prevent empty license values from displaying separators or copy controls in profile settings.

Enhancements:

  • Normalize license numbers for registration requests and profile display while preserving administrator member management behavior.

Tests:

  • Add coverage for optional license validation, request normalization, and profile credential display.

@cursor

cursor Bot commented Sep 22, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @JacquesDelfrate, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 6 days by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Reviewer's Guide

Public registration now accepts missing or blank license numbers, labels the field as optional in every supported locale, and sends a normalized empty value to the API. Profile settings reuse a credential-formatting helper to trim valid licenses and suppress the separator and copy control when none exists, with focused validation, request, and display tests.

Flow diagram for optional license registration

flowchart TD
    A[Public registration form] --> B[License number optional]
    B --> C[getRegistrationValidationMessage]
    C --> D[createRegistrationRequest]
    D --> E[licenseNo normalized to empty string]
    E --> F[Public registration API]
Loading

Flow diagram for conditional profile license display

flowchart TD
    A[Settings profile] --> B[getProfileCredentialDetails]
    B --> C{licenseNo after trim}
    C -->|Present| D[Show specialty separator and license]
    D --> E[CopyToClipboardButton]
    C -->|Absent| F[Show specialty without separator]
Loading

File-Level Changes

Change Details Files
Makes the public registration license number optional while preserving existing length validation.
  • Removes the required-field check for license input.
  • Marks the field optional in the registration UI and accessibility label.
  • Normalizes whitespace-only license input to an empty API value.
  • Adds validation and request-construction coverage for omitted, blank, and oversized values.
platform/app/src/routes/Register/Register.tsx
platform/app/src/routes/Register/registrationRequest.test.ts
platform/app/src/routes/Register/registrationValidation.test.ts
platform/app/src/routes/Register/registrationValidation.ts
Hides license-specific profile UI when no license is available and normalizes displayed credentials.
  • Extracts specialty and license formatting into a helper.
  • Trims populated license values before display and copy operations.
  • Omits the separator and copy control for absent or whitespace-only licenses.
  • Adds focused helper tests for populated and absent license values.
platform/app/src/routes/Settings/Settings.tsx
platform/app/src/routes/Settings/profileCredentialDetails.ts
platform/app/src/routes/Settings/profileCredentialDetails.test.ts
Adds localized optional-field wording across supported member translations.
  • Adds the translated optional license label in all five supported locales.
  • Leaves administrator member-management behavior unchanged.
platform/i18n/src/locales/ar/Members.json
platform/i18n/src/locales/de/Members.json
platform/i18n/src/locales/en-US/Members.json
platform/i18n/src/locales/es/Members.json
platform/i18n/src/locales/fr/Members.json

Assessment against linked issues

Issue Objective Addressed Explanation
#428 Make the license number optional for public registration while retaining the 100-character maximum and sending a backend-compatible normalized value. ✅
#428 Clearly identify the license field as optional in the registration UI across supported locales. ✅
#428 Render profile details without an empty license copy control or dangling separator, while leaving administrator member-management requirements unchanged. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@JacquesDelfrate
JacquesDelfrate merged commit 52113d3 into main Sep 22, 2026
8 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.

Make license number optional in public registration

1 participant