Skip to content

Conversation

@willum070
Copy link
Collaborator

This PR adds a new demo to support documentation for Address Validation in the Maps JavaScript API. It's an address form with a dropdown containing some example addresses (not all doc examples are included as they are numerous). Validation results are displayed in a text window. This includes formatted address, summary of verdict results, and raw JSON response.

@snippet-bot
Copy link

snippet-bot bot commented May 7, 2025

Here is the summary of changes.

You are about to add 4 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@willum070 willum070 requested a review from Copilot May 7, 2025 20:52
Copy link

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 introduces an Address Validation demo for the Maps JavaScript API, adding a new sample with a full address form, live validation results, and updated build scripts for local development.

  • Configured sample TypeScript settings and build scripts
  • Added UI elements and styles for the address validation form
  • Implemented form handling and API integration in TypeScript

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
samples/address-validation/tsconfig.json Configures TypeScript compiler options for the demo
samples/address-validation/style.css Provides stylistic and responsive design for the form UI
samples/address-validation/package.json Adds build, start, and test scripts for the sample
samples/address-validation/index.ts Implements address validation logic, form handling, and result display
samples/address-validation/index.html Defines the HTML structure for the address validation demo
samples/address-validation/README.md Offers setup and usage instructions for the sample


<button id="validate-button" type="submit">Validate Address</button>

<button id="clear-form-button" type="button" event="handleClearForm">Clear Form</button>
Copy link

Copilot AI May 7, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider removing the non-standard 'event' attribute from the clear form button since event listeners are properly attached via JavaScript.

Copilot uses AI. Check for mistakes.
resultDisplay!.textContent = 'Validating...'; // Clear previous results

// Validate the address
try {
Copy link

Copilot AI May 7, 2025

Choose a reason for hiding this comment

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

[nitpick] Add a brief comment explaining the reason for using '@ts-ignore' above the fetchAddressValidation call to aid future maintenance and improve clarity.

Suggested change
try {
try {
// Suppress TypeScript error due to missing type definitions for fetchAddressValidation in google.maps library.

Copilot uses AI. Check for mistakes.
@willum070 willum070 merged commit daf8205 into main May 7, 2025
8 checks passed
@willum070 willum070 deleted the address-validation-demo branch May 7, 2025 20:59
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