Skip to content

Use new location metadata fields#1002

Open
slifty wants to merge 2 commits into
mainfrom
1001-use-new-location-fields
Open

Use new location metadata fields#1002
slifty wants to merge 2 commits into
mainfrom
1001-use-new-location-fields

Conversation

@slifty

@slifty slifty commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

This PR modifies the web app to use the new location metadata fields for both reading and writing data.

Resolves #1001

Copilot AI review requested due to automatic review settings April 27, 2026 19:37
@codecov

codecov Bot commented Apr 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.28571% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.47%. Comparing base (2b811f1) to head (fcc3fd0).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/app/core/services/edit/edit.service.ts 57.14% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1002      +/-   ##
==========================================
+ Coverage   50.03%   50.47%   +0.44%     
==========================================
  Files         348      348              
  Lines       11497    11543      +46     
  Branches     1974     1995      +21     
==========================================
+ Hits         5752     5826      +74     
+ Misses       5559     5530      -29     
- Partials      186      187       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI 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.

Pull request overview

Updates the Angular web app’s location handling to support newly introduced location metadata fields (e.g., name/sublocation/city and role/precision/raw metadata), aligning the UI formatting and client-side models with the updated location schema.

Changes:

  • Extend location DTO/model types with new metadata fields (name, sublocation, city, altitudeMeters, role/precision/raw metadata).
  • Map Stela location fields into the app’s LocnVOData shape, including renaming role/precision/raw to locationRole/locationPrecision/rawMetadata.
  • Prefer new location fields when rendering location display strings and when creating locations from Google Places.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/app/shared/services/api/record.repo.ts Adds new Stela location fields and maps role/precision/raw into the app’s renamed metadata fields during conversion.
src/app/shared/pipes/pr-location.pipe.ts Updates display formatting to prefer sublocation, city, and name when present.
src/app/models/locn-vo.ts Extends LocnVOData with new location metadata fields used across the app.
src/app/file-browser/components/location-picker/location-picker.component.ts Populates sublocation, city, and name when creating a location from a selected Google Place.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@slifty slifty force-pushed the 1001-use-new-location-fields branch 2 times, most recently from 8aacc88 to 0ef7893 Compare April 28, 2026 19:54
@slifty slifty requested a review from Copilot April 28, 2026 20:01

Copilot AI 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.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/app/file-browser/components/location-picker/location-picker.component.ts Outdated
Comment thread src/app/shared/pipes/pr-location.pipe.ts Outdated
Comment thread src/app/shared/services/api/record.repo.ts
Comment thread src/app/file-browser/components/location-picker/location-picker.component.spec.ts Outdated
@slifty slifty force-pushed the 1001-use-new-location-fields branch from 0ef7893 to 75feaaa Compare April 29, 2026 19:11
@cecilia-donnelly cecilia-donnelly self-requested a review April 29, 2026 19:15
@slifty slifty force-pushed the 1001-use-new-location-fields branch from 75feaaa to e18814e Compare April 29, 2026 19:21

@cecilia-donnelly cecilia-donnelly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see anything obviously off here! I have some questions, likely answered by your partner PRs to this one, but wanted to ask them right away.

return component
? component[getShortName ? 'short_name' : 'long_name']
: null;
return component ? component.long_name : null;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What was the short name?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@slifty is going to figure out if we want to keep that after all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The idea is that short vs long name isn't part of the new location specification, and so we just use the long name now because it's the only thing that will exist in the future.

Short name might have been "CA" when long name was "California"

@slifty slifty force-pushed the 1001-use-new-location-fields branch from e18814e to 07ca375 Compare April 29, 2026 20:13

@aasandei-vsp aasandei-vsp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, small observations.

Comment thread src/app/shared/services/api/record.repo.ts
Comment thread src/app/shared/services/api/record.repo.ts
@slifty slifty added the QA This issue is ready for QA / user acceptance testing label May 5, 2026
@slifty slifty requested a review from omnignorant May 5, 2026 19:13
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

QA Instructions

QA Testing Instructions for PR: "Use new location metadata fields"

Summary

This PR updates various components and services in the web app to use new location metadata fields (LocnVO) for managing record and folder location data. The changes involve modifying the EditService, updating relevant API calls (e.g., updateStelaRecord and updateStelaFolder), and adding/adjusting associated tests. Changes also include the implementation of new tests for the LocationPickerComponent.


Test Environment Setup

  1. Ensure you are on the branch related to this PR: use-new-location-metadata-fields.
  2. Pull the latest changes and ensure all dependencies are installed by running:
    git pull
    npm install
  3. Start the development server using:
    npm run start
  4. Confirm that the backend services are running and configured to support the updated Stela endpoints for handling the new location metadata fields.

Test Scenarios

  1. Verify Updates to Records with New LocnVO Field

    • Steps:
      1. Open the web app and navigate to a page where you can manage a record.
      2. Modify the location metadata (LocnVO) of the record using the Location Picker.
      3. Save the changes.
      4. Check the network requests and confirm that the API call updateStelaRecord was made with correct parameters, including the location key in the metadata payload.
    • Expected Result:
      • The updated location metadata (e.g., latitude, longitude, or address) should correctly reflect on the UI after saving.
      • The API call to updateStelaRecord should include LocnVO in its parameters.
  2. Verify Updates to Folders with New LocnVO Field

    • Steps:
      1. Navigate to a folder whose location metadata can be edited.
      2. Modify the location data (LocnVO) of the folder using the Location Picker.
      3. Save the changes.
      4. Verify via network requests that the updateStelaFolder API was called with the correct payload, including the location key in the metadata update.
    • Expected Result:
      • The folder's location details should be updated and displayed correctly in the UI.
      • The network request should include the location as part of its payload.
  3. Validate Location Picker Component Behavior

    • Steps:
      1. Open the LocationPickerComponent in the UI.
      2. Enter a location in the input field and verify that suggestions are displayed.
      3. Select a location from the suggestions.
      4. Confirm that the location preview updates correctly with the selected place details (e.g., address and map location).
    • Expected Result:
      • The suggestions should show based on the user input.
      • Selecting a location should populate the address and map fields in the UI accurately.
  4. Verify Component-Level Integration with LocationPickerComponent

    • Steps:
      1. Navigate to a sample record or folder page where the LocationPickerComponent is used.
      2. Perform location updates via the location picker.
      3. Save the changes and refresh the page.
      • Observe if the changes persist and are displayed correctly.
    • Expected Result:
      • The updated location metadata should persist in the backend and match across page loads.
  5. Validate Test Coverage

    • Steps:
      1. Run unit tests for the project:
        npm run test
      2. Verify updated test files:
        • edit.service.spec.ts
        • location-picker.component.spec.ts
      • Confirm all test cases pass without errors.
    • Expected Result:
      • All test cases in the modified specs pass.
      • No regressions or new errors are introduced.

Regression Risks

  1. EditService Core Functionality:

    • Edits and updates for records and folders that do not involve location metadata (LocnVO) should still function as expected.
    • Watch for potential side effects in methods like updateItems in edit.service.ts.
  2. Legacy Field Dependencies:

    • Ensure existing location-related functionality (previously tied to other metadata fields) continues to work correctly.
    • Scenarios involving older location fields should gracefully degrade if they are no longer supported.
  3. Integration with Backend:

    • Any mismatches between frontend and backend in the payload structure for location metadata updates could cause API call failures, so validate API request payloads thoroughly.

Things to Watch For

  1. Validation of Location Metadata Entries:

    • Ensure that invalid or incomplete location data (e.g., missing latitude/longitude) is properly handled on the frontend, and users are prompted accordingly without errors.
  2. Map Rendering Issues:

    • While testing the LocationPickerComponent, verify correct map rendering for edge cases:
      • Locations with minimal metadata (e.g., missing coordinates).
      • International addresses with non-Western characters.
      • Rapid switching between different autocomplete suggestions.
  3. Performance of Bulk Updates:

    • Confirm the updateItems method handles larger batches of records/folders without timing out or exhibiting performance issues.
    • Monitor the API calls for compliance with new expected payload formats.

Notes

  • The changes in this PR are primarily backend-dependent. Any issues with the updated Stela endpoints might manifest as errors in saving location metadata. Ensure to closely monitor API responses.
  • Validate changes in major browsers (Chrome, Firefox, Safari, Edge) to ensure compatibility.
  • Keep logs enabled during testing to track errors or unexpected behavior for debugging purposes.

Generated by QA Instructions Action

@slifty slifty removed QA This issue is ready for QA / user acceptance testing labels May 5, 2026
@slifty

slifty commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

In my own testing: I'd like to wait until the stela endpoints for location creation are live before moving the frontend to use the new properties.

@omnignorant omnignorant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not 100% sure what I am testing or what the success condition should be, but I did my best to suss it out of the QA guide. The gist seems to be "does a location properly save using the current picker UI"

Location editing seems to work inconsistently. In the screen capture attached here, I seem to have determined the following:

  • location seems to save on initial selection
  • for records without existing location data, the changed metadata persists after a refresh;
  • for records with existing location data, the metadata does not persist;
  • location metadata in profile, both general and milestone persists.
Screen.Recording.2026-05-08.at.4.50.36.PM.mov

@slifty

slifty commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

@omnignorant sorry for the confusion -- I pulled this off of the QA pile since we need to do some additional changes for everything to work as expected!

@slifty slifty force-pushed the 1001-use-new-location-fields branch 3 times, most recently from 5a36b6d to 143c687 Compare June 4, 2026 18:58
@slifty slifty requested a review from aasandei-vsp June 4, 2026 18:58
@slifty slifty force-pushed the 1001-use-new-location-fields branch from 143c687 to 3665fa9 Compare June 4, 2026 18:58
@slifty

slifty commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Before we merge this I want to re-check to ensure that records with legacy location metadata work as expected.

@aasandei-vsp aasandei-vsp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left a few comments, but overall looks good.

Checked all location instances that I know of(manual testing):

  • Sidebar
  • Archive settings --> Milestones --> Location
  • Group info --> Location established
  • Gallery --> current archive --> info

Comment thread src/app/shared/services/api/record.repo.ts
Comment thread src/app/shared/services/api/record.repo.ts
@slifty slifty added the QA This issue is ready for QA / user acceptance testing label Jun 15, 2026
@slifty slifty requested a review from omnignorant June 15, 2026 15:31
slifty added 2 commits June 15, 2026 11:46
The backend is changing which location metadata fields to store and we
need to use those fields.

Issue #1001 Use new location metadata fields
Stela now supports editing location metadata using the modern location
fields.  This change helps us migrate from the use PHP and the old model
for locations.

Issue #1001 Use new location metadata fields
@slifty slifty force-pushed the 1001-use-new-location-fields branch from 3665fa9 to fcc3fd0 Compare June 15, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA This issue is ready for QA / user acceptance testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use new location metadata fields

5 participants