Skip to content

Commit

Permalink
expandUnits -> mailable (#142)
Browse files Browse the repository at this point in the history
* expandUnits -> mailable

* Bump up version and mark expandUnits as deprecated

* Continue to send up expandUnits in http request

* Bump code version

* Bump package-lock version

* Switch to beta release

* Remove deprecated layers

* send time zone to POST /track

* bump version

* expandUnits -> mailable

* Bump up version and mark expandUnits as deprecated

* Continue to send up expandUnits in http request

* Bump package-lock version

* Switch to beta release

* Remove deprecated layers

* bump to 4.2.0

* Update package-lock.json

* fix rebase

* patch bump

* bump

---------

Co-authored-by: Nick Patrick <[email protected]>
Co-authored-by: York Wei <[email protected]>
  • Loading branch information
3 people authored Jan 16, 2024
1 parent 283c26d commit 61741d5
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 23 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Radar.initialize('prj_test_pk_...', { /* options */ });
Add the following script in your `html` file
```html
<script src="https://js.radar.com/v4.1.13/radar.min.js"></script>
<script src="https://js.radar.com/v4.1.14/radar.min.js"></script>
```

Then initialize the Radar SDK
Expand All @@ -73,8 +73,8 @@ To create a map, first initialize the Radar SDK with your publishable key. Then
```html
<html>
<head>
<link href="https://js.radar.com/v4.1.13/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.13/radar.min.js"></script>
<link href="https://js.radar.com/v4.1.14/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.14/radar.min.js"></script>
</head>

<body>
Expand All @@ -98,8 +98,8 @@ To create an autocomplete input, first initialize the Radar SDK with your publis
```html
<html>
<head>
<link href="https://js.radar.com/v4.1.13/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.13/radar.min.js"></script>
<link href="https://js.radar.com/v4.1.14/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.14/radar.min.js"></script>
</head>

<body>
Expand Down Expand Up @@ -130,8 +130,8 @@ To power [geofencing](https://radar.com/documentation/geofencing/overview) exper
```html
<html>
<head>
<link href="https://js.radar.com/v4.1.13/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.13/radar.min.js"></script>
<link href="https://js.radar.com/v4.1.14/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.1.14/radar.min.js"></script>
</head>

<body>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "radar-sdk-js",
"version": "4.1.13",
"version": "4.1.14",
"description": "Web Javascript SDK for Radar, location infrastructure for mobile and web apps.",
"homepage": "https://radar.com",
"type": "module",
Expand Down
2 changes: 2 additions & 0 deletions src/api/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class SearchAPI {
layers,
countryCode,
expandUnits,
mailable,
} = params;

// near can be provided as a string or Location object
Expand All @@ -42,6 +43,7 @@ class SearchAPI {
layers,
countryCode,
expandUnits,
mailable,
},
});

Expand Down
8 changes: 0 additions & 8 deletions src/api/track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ class TrackAPI {
const deviceType = params.deviceType || 'Web';
const description = params.description || Storage.getItem(Storage.DESCRIPTION);

let timeZone;
try {
timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
} catch (err: any) {
Logger.warn(`Error getting time zone: ${err.message}`);
}

// save userId for trip tracking
if (!userId) {
Logger.warn('userId not provided for trackOnce.');
Expand Down Expand Up @@ -82,7 +75,6 @@ class TrackAPI {
stopped: true,
userId,
tripOptions,
timeZone,
};

const response: any = await Http.request({
Expand Down
6 changes: 3 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,6 @@ export interface RadarConversionResponse extends RadarResponse {
export type RadarGeocodeLayer =
| 'place'
| 'address'
| 'intersection'
| 'street'
| 'neighborhood'
| 'postalCode'
| 'locality'
| 'county'
Expand Down Expand Up @@ -341,7 +338,9 @@ export interface RadarAutocompleteParams {
limit?: number;
layers?: RadarGeocodeLayer[];
countryCode?: string;
/** @deprecated this is always true, regardless of the value passed here */
expandUnits?: boolean;
mailable?: boolean;
}

export interface RadarAutocompleteResponse extends RadarResponse {
Expand Down Expand Up @@ -476,6 +475,7 @@ export interface RadarAutocompleteUIOptions {
layers?: RadarGeocodeLayer[];
countryCode?: string;
expandUnits?: boolean;
mailable?: boolean;
placeholder?: string, // Placeholder text for the input field
onSelection?: (selection: any) => void,
onRequest?: (params: RadarAutocompleteParams) => void,
Expand Down
3 changes: 2 additions & 1 deletion src/ui/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,15 @@ class AutocompleteUI {
}

public async fetchResults(query: string) {
const { limit, layers, countryCode, expandUnits, onRequest } = this.config;
const { limit, layers, countryCode, expandUnits, mailable, onRequest } = this.config;

const params: RadarAutocompleteParams = {
query,
limit,
layers,
countryCode,
expandUnits,
mailable,
}

if (this.near) {
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default '4.1.13';
export default '4.1.14';

0 comments on commit 61741d5

Please sign in to comment.