Skip to content

Commit 0cdffab

Browse files
authored
feat: Adds new 'possible next action' to verdict summary. (#614)
1 parent c20a94f commit 0cdffab

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

samples/address-validation/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ async function handleValidationSubmit(event) {
5858
`Formatted address: ${result.address.formattedAddress}\n` +
5959
`Entered: ${result.verdict.inputGranularity}\n` +
6060
`Validated: ${result.verdict.validationGranularity}\n` +
61-
`Geocoded: ${result.verdict.geocodeGranularity}\n\n` +
61+
`Geocoded: ${result.verdict.geocodeGranularity}\n` +
62+
`Possible next action: ${result.verdict.possibleNextAction}\n\n` +
6263
`${getVerdictMessage(result.verdict, 'addressComplete')}\n` +
6364
`${getVerdictMessage(result.verdict, 'hasUnconfirmedComponents')}\n` +
6465
`${getVerdictMessage(result.verdict, 'hasInferredComponents')}\n` +
@@ -75,7 +76,7 @@ async function handleValidationSubmit(event) {
7576
}
7677
// [END maps_address_validation_form_handler]
7778

78-
// --- Verdict Messages ---
79+
// Verdict messages
7980
const verdictMessages = {
8081
addressComplete: {
8182
trueMessage:
@@ -106,11 +107,10 @@ function getVerdictMessage(verdict, key) {
106107

107108
// Handler for Dropdown Change
108109
function handleExampleSelectChange(event) {
109-
const selectedValue = event.target.value; // e.g., "google", "suite", ""
110+
const selectedValue = event.target.value;
110111
if (selectedValue && examples[selectedValue]) {
111112
populateAddressFields(examples[selectedValue]);
112113
} else if (!selectedValue) {
113-
// Optional: Clear fields if the "-- Select --" option is chosen
114114
populateAddressFields(null); // Pass null to clear fields
115115
}
116116
}
@@ -198,7 +198,7 @@ function populateAddressFields(exampleAddress) {
198198
// Clear previous results and errors
199199
resultDisplay!.textContent = 'Result will appear here...';
200200

201-
console.log("Populated fields with example:", exampleAddress);
201+
console.log("Populated fields with example: ", exampleAddress);
202202
}
203203

204204
init();

0 commit comments

Comments
 (0)