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

feat(fe:FSADT1-1761): Contacts - on Edit associated locations is missing #1515

Merged
merged 6 commits into from
Mar 31, 2025

Conversation

fterra-encora
Copy link
Collaborator

@fterra-encora fterra-encora commented Mar 28, 2025

Description

Includes the location code in the locations titles in the options of the Associated locations input, but only on the Client Details page.
ie: instead of "Mailing address", shows "00 - Mailing address".
On the other hand, when location name is empty shows it like: "00".

Fixes FSADT1-1761

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
  • Documentation update

How Has This Been Tested?

  • New unit tests
  • New integrated tests
  • New component tests
  • New end-to-end tests
  • New user flow tests
  • No new tests are required
  • Manual tests (description below)
  • Updated existing tests

Checklist

  • I have read the CONTRIBUTING doc
  • 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
  • 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 already been accepted and merged

Further comments


Thanks for the PR!

Deployments, as required, will be available below:
Any successful deployments (not always required) will be available here

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

Copy link
Contributor

Overall Project NaN% NaN% 🍏

There is no coverage information present for the Files changed

@paulushcgcj paulushcgcj requested a review from Copilot March 31, 2025 17:40
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the formatting of location titles by including the location code (when applicable) across the Client Details page and related components and tests.

  • Introduces a new formatLocation function in the ForestClientService to standardize location title formatting.
  • Updates components and pages to use the new formatting, with corresponding test changes in unit, component, and e2e tests.

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/tests/unittests/services/ForestClientService.spec.ts Adds unit tests for the new formatLocation function.
frontend/tests/components/pages/client-details/ContactView.cy.ts Updates tests to validate the showLocationCode prop in the contact-view.
frontend/tests/components/components/grouping/StaffContactGroupComponent.cy.ts Adds tests for location titles when showLocationCode is enabled, including handling of unnamed locations.
frontend/src/services/ForestClientService.ts Implements the new formatLocation function to format location titles as "code - name".
frontend/src/pages/client-details/ContactView.vue Adds the show-location-code prop for associated locations on the Client Details page.
frontend/src/pages/ClientDetailsPage.vue Refactors location title formatting using getUpdatedLocationTitle that leverages formatLocation.
frontend/src/components/grouping/StaffContactGroupComponent.vue Updates location list formatting and display logic to include location codes when specified.
frontend/cypress/e2e/pages/ClientDetailsPage.cy.ts Updates end-to-end tests to validate the new location title format.
Files not reviewed (1)
  • frontend/stub/__files/response-clients-details-SE.json: Language not supported
Comments suppressed due to low confidence (1)

frontend/src/components/grouping/StaffContactGroupComponent.vue:129

  • [nitpick] Consider renaming 'localFormatLocation' to a more descriptive name such as 'getDisplayLocationText' to clearly convey its purpose.
const localFormatLocation = (location: CodeDescrType) => {

Copy link
Contributor

Overall Project NaN% NaN% 🍏

There is no coverage information present for the Files changed

@fterra-encora fterra-encora merged commit f47335e into main Mar 31, 2025
37 checks passed
@fterra-encora fterra-encora deleted the feat/FSADT1-1761 branch March 31, 2025 18:38
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.

3 participants