Skip to content

WIP - I've made some improvements to how _id is handled and the isEmpty#175

Open
OmarBERRABEH wants to merge 1 commit intoekino:mainfrom
OmarBERRABEH:refactor/general-info-view-handling
Open

WIP - I've made some improvements to how _id is handled and the isEmpty#175
OmarBERRABEH wants to merge 1 commit intoekino:mainfrom
OmarBERRABEH:refactor/general-info-view-handling

Conversation

@OmarBERRABEH
Copy link
Copy Markdown

… logic in VitalityGeneralInformationView.

  • I've added validation for the _id URL parameter in VitalityGeneralInformationView.tsx.
    • The useClientQuery will now be disabled if _id isn't a valid numeric string.
    • I'll log a warning to the console if I encounter an invalid _id value.
  • I've clarified the isEmpty prop that gets passed to VitalitySectionView.
    • It now directly reflects whether appInfos data is present (!appInfos).
  • I've updated the unit tests in VitalityGeneralInformationView-test.tsx to cover:
    • Scenarios where _id parameters are invalid or missing.
    • The correct enabled state for useClientQuery.
    • The revised isEmpty logic based on the presence of appInfos.
    • Verification of console warnings for invalid _ids.

Pull Request Template

✨ Title

  • [FEATURE]: for a new feature
  • [EVOL]: for an enhancement
  • [FIX]: for a bug fix
  • [REFACTOR]: for a refactor

📄 Description

Please explain in detail what this PR does, why it is needed, and how it addresses a specific problem. Include any relevant context and background information.

Checklist

  • I have read and followed the Contribution Guide.
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings or errors.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

🔗 Contextual Links (optional)

Add any relevant links to tracking tickets, previous discussions, or other resources.

📸 Visuals (optional)

If possible, include images or videos that show the result of your changes.

🔍 Reviewers

Please assign at least one reviewer for this PR. The PR cannot be merged until it is approved by the reviewer(s).

… logic in `VitalityGeneralInformationView`.

- I've added validation for the `_id` URL parameter in `VitalityGeneralInformationView.tsx`.
  - The `useClientQuery` will now be disabled if `_id` isn't a valid numeric string.
  - I'll log a warning to the console if I encounter an invalid `_id` value.
- I've clarified the `isEmpty` prop that gets passed to `VitalitySectionView`.
  - It now directly reflects whether `appInfos` data is present (`!appInfos`).
- I've updated the unit tests in `VitalityGeneralInformationView-test.tsx` to cover:
  - Scenarios where `_id` parameters are invalid or missing.
  - The correct `enabled` state for `useClientQuery`.
  - The revised `isEmpty` logic based on the presence of `appInfos`.
  - Verification of console warnings for invalid `_id`s.
@OmarBERRABEH OmarBERRABEH changed the title I've made some improvements to how _id is handled and the isEmpty WIP - I've made some improvements to how _id is handled and the isEmpty May 22, 2025
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.

1 participant