-
Notifications
You must be signed in to change notification settings - Fork 7
feat: Adds Address Validation demo. #352
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
Conversation
|
Here is the summary of changes. You are about to add 4 region tags.
This comment is generated by snippet-bot.
|
There was a problem hiding this 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> |
Copilot
AI
May 7, 2025
There was a problem hiding this comment.
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.
| resultDisplay!.textContent = 'Validating...'; // Clear previous results | ||
|
|
||
| // Validate the address | ||
| try { |
Copilot
AI
May 7, 2025
There was a problem hiding this comment.
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.
| try { | |
| try { | |
| // Suppress TypeScript error due to missing type definitions for fetchAddressValidation in google.maps library. |
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.