From 903252750402abc304835e4a5873aeef5946eaeb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jul 2023 06:44:32 +0000 Subject: [PATCH 1/8] Bump semver from 5.7.1 to 5.7.2 Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2) --- updated-dependencies: - dependency-name: semver dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2e936eb4c..c9cab8c4e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12333,11 +12333,11 @@ __metadata: linkType: hard "semver@npm:2 || 3 || 4 || 5, semver@npm:^5.5.0, semver@npm:^5.6.0": - version: 5.7.1 - resolution: "semver@npm:5.7.1" + version: 5.7.2 + resolution: "semver@npm:5.7.2" bin: - semver: ./bin/semver - checksum: 57fd0acfd0bac382ee87cd52cd0aaa5af086a7dc8d60379dfe65fea491fb2489b6016400813930ecd61fd0952dae75c115287a1b16c234b1550887117744dfaf + semver: bin/semver + checksum: fb4ab5e0dd1c22ce0c937ea390b4a822147a9c53dbd2a9a0132f12fe382902beef4fbf12cf51bb955248d8d15874ce8cd89532569756384f994309825f10b686 languageName: node linkType: hard From ddc86c3636c9fee5285cbec06669e40c02af2efd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jul 2023 06:33:47 +0000 Subject: [PATCH 2/8] Bump word-wrap from 1.2.3 to 1.2.4 Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c9cab8c4e..da62d11c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14679,9 +14679,9 @@ __metadata: linkType: hard "word-wrap@npm:^1.2.3": - version: 1.2.3 - resolution: "word-wrap@npm:1.2.3" - checksum: 30b48f91fcf12106ed3186ae4fa86a6a1842416df425be7b60485de14bec665a54a68e4b5156647dec3a70f25e84d270ca8bc8cd23182ed095f5c7206a938c1f + version: 1.2.4 + resolution: "word-wrap@npm:1.2.4" + checksum: 8f1f2e0a397c0e074ca225ba9f67baa23f99293bc064e31355d426ae91b8b3f6b5f6c1fc9ae5e9141178bb362d563f55e62fd8d5c31f2a77e3ade56cb3e35bd1 languageName: node linkType: hard From 581ac29594013caef38eb494d630d8bfea2ef65c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Aug 2023 06:13:30 +0000 Subject: [PATCH 3/8] Bump @adobe/css-tools from 4.2.0 to 4.3.1 Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.2.0 to 4.3.1. - [Changelog](https://github.com/adobe/css-tools/blob/main/History.md) - [Commits](https://github.com/adobe/css-tools/commits) --- updated-dependencies: - dependency-name: "@adobe/css-tools" dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c9cab8c4e..de51fb4e8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6,9 +6,9 @@ __metadata: cacheKey: 8 "@adobe/css-tools@npm:^4.0.1": - version: 4.2.0 - resolution: "@adobe/css-tools@npm:4.2.0" - checksum: dc5cc92ba3d562e7ffddb79d6d222c7e00b65f255fd2725b3d71490ff268844be322f917415d8c4ab39eca646343b632058db8bd5b1d646193fcc94d1d3e420b + version: 4.3.1 + resolution: "@adobe/css-tools@npm:4.3.1" + checksum: ad43456379ff391132aff687ece190cb23ea69395e23c9b96690eeabe2468da89a4aaf266e4f8b6eaab53db3d1064107ce0f63c3a974e864f4a04affc768da3f languageName: node linkType: hard From 21d77c5599333d094475a4213065300571983bfe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 20:54:13 +0000 Subject: [PATCH 4/8] Bump get-func-name from 2.0.0 to 2.0.2 Bumps [get-func-name](https://github.com/chaijs/get-func-name) from 2.0.0 to 2.0.2. - [Release notes](https://github.com/chaijs/get-func-name/releases) - [Commits](https://github.com/chaijs/get-func-name/commits/v2.0.2) --- updated-dependencies: - dependency-name: get-func-name dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index de51fb4e8..d7fae0499 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7062,9 +7062,9 @@ __metadata: linkType: hard "get-func-name@npm:^2.0.0": - version: 2.0.0 - resolution: "get-func-name@npm:2.0.0" - checksum: 8d82e69f3e7fab9e27c547945dfe5cc0c57fc0adf08ce135dddb01081d75684a03e7a0487466f478872b341d52ac763ae49e660d01ab83741f74932085f693c3 + version: 2.0.2 + resolution: "get-func-name@npm:2.0.2" + checksum: 3f62f4c23647de9d46e6f76d2b3eafe58933a9b3830c60669e4180d6c601ce1b4aa310ba8366143f55e52b139f992087a9f0647274e8745621fa2af7e0acf13b languageName: node linkType: hard From 50c6c8ce2d36bcc33317d376552574c623c31b1e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 20:53:27 +0000 Subject: [PATCH 5/8] Bump postcss from 8.4.21 to 8.4.31 Bumps [postcss](https://github.com/postcss/postcss) from 8.4.21 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.21...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 205e97ce5..c233c03b7 100644 --- a/package.json +++ b/package.json @@ -148,7 +148,7 @@ "null-loader": "^4.0.1", "nyc": "^15.1.0", "open-cli": "^7.1.0", - "postcss": "^8.4.21", + "postcss": "^8.4.31", "postcss-loader": "^7.0.2", "prettier": "2.8.8", "proxyquire": "^1.7.11", diff --git a/yarn.lock b/yarn.lock index e579fb0ca..bc046a3f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9338,7 +9338,7 @@ __metadata: passport-google-oauth20: ^2.0.0 passport-local: ^1.0.0 pg: ^8.9.0 - postcss: ^8.4.21 + postcss: ^8.4.31 postcss-loader: ^7.0.2 preact: ^10.15.1 preact-render-to-string: ^6.1.0 @@ -11111,6 +11111,17 @@ __metadata: languageName: node linkType: hard +"postcss@npm:^8.4.31": + version: 8.4.31 + resolution: "postcss@npm:8.4.31" + dependencies: + nanoid: ^3.3.6 + picocolors: ^1.0.0 + source-map-js: ^1.0.2 + checksum: 1d8611341b073143ad90486fcdfeab49edd243377b1f51834dc4f6d028e82ce5190e4f11bb2633276864503654fb7cab28e67abdc0fbf9d1f88cad4a0ff0beea + languageName: node + linkType: hard + "postgres-array@npm:~2.0.0": version: 2.0.0 resolution: "postgres-array@npm:2.0.0" From 83cc2006d44f7dbca8f48260e815441a5b960140 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Oct 2023 02:50:47 +0000 Subject: [PATCH 6/8] Bump @babel/traverse from 7.21.5 to 7.23.2 Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.21.5 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 139 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 126 insertions(+), 13 deletions(-) diff --git a/yarn.lock b/yarn.lock index bc046a3f2..976d56ce4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -44,6 +44,16 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.22.13": + version: 7.22.13 + resolution: "@babel/code-frame@npm:7.22.13" + dependencies: + "@babel/highlight": ^7.22.13 + chalk: ^2.4.2 + checksum: 22e342c8077c8b77eeb11f554ecca2ba14153f707b85294fcf6070b6f6150aae88a7b7436dd88d8c9289970585f3fe5b9b941c5aa3aa26a6d5a8ef3f292da058 + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.17.7, @babel/compat-data@npm:^7.20.1, @babel/compat-data@npm:^7.20.5, @babel/compat-data@npm:^7.21.5": version: 7.21.7 resolution: "@babel/compat-data@npm:7.21.7" @@ -86,6 +96,18 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/generator@npm:7.23.0" + dependencies: + "@babel/types": ^7.23.0 + "@jridgewell/gen-mapping": ^0.3.2 + "@jridgewell/trace-mapping": ^0.3.17 + jsesc: ^2.5.1 + checksum: 8efe24adad34300f1f8ea2add420b28171a646edc70f2a1b3e1683842f23b8b7ffa7e35ef0119294e1901f45bfea5b3dc70abe1f10a1917ccdfb41bed69be5f1 + languageName: node + linkType: hard + "@babel/helper-annotate-as-pure@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-annotate-as-pure@npm:7.18.6" @@ -173,6 +195,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-environment-visitor@npm:^7.22.20": + version: 7.22.20 + resolution: "@babel/helper-environment-visitor@npm:7.22.20" + checksum: d80ee98ff66f41e233f36ca1921774c37e88a803b2f7dca3db7c057a5fea0473804db9fb6729e5dbfd07f4bed722d60f7852035c2c739382e84c335661590b69 + languageName: node + linkType: hard + "@babel/helper-explode-assignable-expression@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-explode-assignable-expression@npm:7.18.6" @@ -192,6 +221,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-function-name@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/helper-function-name@npm:7.23.0" + dependencies: + "@babel/template": ^7.22.15 + "@babel/types": ^7.23.0 + checksum: e44542257b2d4634a1f979244eb2a4ad8e6d75eb6761b4cfceb56b562f7db150d134bc538c8e6adca3783e3bc31be949071527aa8e3aab7867d1ad2d84a26e10 + languageName: node + linkType: hard + "@babel/helper-hoist-variables@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-hoist-variables@npm:7.18.6" @@ -201,6 +240,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-hoist-variables@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-hoist-variables@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + checksum: 394ca191b4ac908a76e7c50ab52102669efe3a1c277033e49467913c7ed6f7c64d7eacbeabf3bed39ea1f41731e22993f763b1edce0f74ff8563fd1f380d92cc + languageName: node + linkType: hard + "@babel/helper-member-expression-to-functions@npm:^7.20.7, @babel/helper-member-expression-to-functions@npm:^7.21.0": version: 7.21.0 resolution: "@babel/helper-member-expression-to-functions@npm:7.21.0" @@ -306,6 +354,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-split-export-declaration@npm:^7.22.6": + version: 7.22.6 + resolution: "@babel/helper-split-export-declaration@npm:7.22.6" + dependencies: + "@babel/types": ^7.22.5 + checksum: e141cace583b19d9195f9c2b8e17a3ae913b7ee9b8120246d0f9ca349ca6f03cb2c001fd5ec57488c544347c0bb584afec66c936511e447fd20a360e591ac921 + languageName: node + linkType: hard + "@babel/helper-string-parser@npm:^7.21.5": version: 7.21.5 resolution: "@babel/helper-string-parser@npm:7.21.5" @@ -313,6 +370,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-string-parser@npm:7.22.5" + checksum: 836851ca5ec813077bbb303acc992d75a360267aa3b5de7134d220411c852a6f17de7c0d0b8c8dcc0f567f67874c00f4528672b2a4f1bc978a3ada64c8c78467 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.18.6, @babel/helper-validator-identifier@npm:^7.19.1": version: 7.19.1 resolution: "@babel/helper-validator-identifier@npm:7.19.1" @@ -320,6 +384,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.22.20": + version: 7.22.20 + resolution: "@babel/helper-validator-identifier@npm:7.22.20" + checksum: 136412784d9428266bcdd4d91c32bcf9ff0e8d25534a9d94b044f77fe76bc50f941a90319b05aafd1ec04f7d127cd57a179a3716009ff7f3412ef835ada95bdc + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.18.6, @babel/helper-validator-option@npm:^7.21.0": version: 7.21.0 resolution: "@babel/helper-validator-option@npm:7.21.0" @@ -361,7 +432,18 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.5, @babel/parser@npm:^7.21.8": +"@babel/highlight@npm:^7.22.13": + version: 7.22.20 + resolution: "@babel/highlight@npm:7.22.20" + dependencies: + "@babel/helper-validator-identifier": ^7.22.20 + chalk: ^2.4.2 + js-tokens: ^4.0.0 + checksum: 84bd034dca309a5e680083cd827a766780ca63cef37308404f17653d32366ea76262bd2364b2d38776232f2d01b649f26721417d507e8b4b6da3e4e739f6d134 + languageName: node + linkType: hard + +"@babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.8": version: 7.21.8 resolution: "@babel/parser@npm:7.21.8" bin: @@ -370,6 +452,15 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/parser@npm:7.23.0" + bin: + parser: ./bin/babel-parser.js + checksum: 453fdf8b9e2c2b7d7b02139e0ce003d1af21947bbc03eb350fb248ee335c9b85e4ab41697ddbdd97079698de825a265e45a0846bb2ed47a2c7c1df833f42a354 + languageName: node + linkType: hard + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.18.6": version: 7.18.6 resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.18.6" @@ -1247,21 +1338,32 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.20.5, @babel/traverse@npm:^7.20.7, @babel/traverse@npm:^7.21.5": - version: 7.21.5 - resolution: "@babel/traverse@npm:7.21.5" +"@babel/template@npm:^7.22.15": + version: 7.22.15 + resolution: "@babel/template@npm:7.22.15" dependencies: - "@babel/code-frame": ^7.21.4 - "@babel/generator": ^7.21.5 - "@babel/helper-environment-visitor": ^7.21.5 - "@babel/helper-function-name": ^7.21.0 - "@babel/helper-hoist-variables": ^7.18.6 - "@babel/helper-split-export-declaration": ^7.18.6 - "@babel/parser": ^7.21.5 - "@babel/types": ^7.21.5 + "@babel/code-frame": ^7.22.13 + "@babel/parser": ^7.22.15 + "@babel/types": ^7.22.15 + checksum: 1f3e7dcd6c44f5904c184b3f7fe280394b191f2fed819919ffa1e529c259d5b197da8981b6ca491c235aee8dbad4a50b7e31304aa531271cb823a4a24a0dd8fd + languageName: node + linkType: hard + +"@babel/traverse@npm:^7.20.5, @babel/traverse@npm:^7.20.7, @babel/traverse@npm:^7.21.5": + version: 7.23.2 + resolution: "@babel/traverse@npm:7.23.2" + dependencies: + "@babel/code-frame": ^7.22.13 + "@babel/generator": ^7.23.0 + "@babel/helper-environment-visitor": ^7.22.20 + "@babel/helper-function-name": ^7.23.0 + "@babel/helper-hoist-variables": ^7.22.5 + "@babel/helper-split-export-declaration": ^7.22.6 + "@babel/parser": ^7.23.0 + "@babel/types": ^7.23.0 debug: ^4.1.0 globals: ^11.1.0 - checksum: b403733fa7d858f0c8e224f0434a6ade641bc469a4f92975363391e796629d5bf53e544761dfe85039aab92d5389ebe7721edb309d7a5bb7df2bf74f37bf9f47 + checksum: 26a1eea0dde41ab99dde8b9773a013a0dc50324e5110a049f5d634e721ff08afffd54940b3974a20308d7952085ac769689369e9127dea655f868c0f6e1ab35d languageName: node linkType: hard @@ -1276,6 +1378,17 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.22.15, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/types@npm:7.23.0" + dependencies: + "@babel/helper-string-parser": ^7.22.5 + "@babel/helper-validator-identifier": ^7.22.20 + to-fast-properties: ^2.0.0 + checksum: 215fe04bd7feef79eeb4d33374b39909ce9cad1611c4135a4f7fdf41fe3280594105af6d7094354751514625ea92d0875aba355f53e86a92600f290e77b0e604 + languageName: node + linkType: hard + "@colors/colors@npm:1.5.0": version: 1.5.0 resolution: "@colors/colors@npm:1.5.0" From cc919330eda769c0cfe82403df6977e48505ebd0 Mon Sep 17 00:00:00 2001 From: Jeffrey Carl Faden Date: Thu, 9 Nov 2023 15:18:45 -0800 Subject: [PATCH 7/8] Upgrade react-geosuggest, add missing popover styling --- package.json | 2 +- .../RestaurantAddForm/RestaurantAddForm.tsx | 28 ++++++++++++++--- .../RestaurantAddFormContainer.ts | 9 ++---- .../TeamGeosuggest/TeamGeosuggest.tsx | 4 +-- src/styles/globalCss.scss | 3 +- typings/react-geosuggest.d.ts | 4 +-- yarn.lock | 30 +++++++++---------- 7 files changed, 48 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index c233c03b7..4896a30dc 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@reduxjs/toolkit": "^1.9.2", "@sendgrid/helpers": "^7.7.0", "@sendgrid/mail": "^7.7.0", + "@ubilabs/react-geosuggest": "^2.16.1", "bcrypt": "^5.1.0", "body-parser": "^1.18.3", "bootstrap": "^5.2.3", @@ -59,7 +60,6 @@ "react-bootstrap": "^2.7.0", "react-dom": "npm:@preact/compat@*", "react-flip-toolkit": "^7.0.17", - "react-geosuggest": "^2.14.1", "react-icons": "^4.7.1", "react-redux": "^8.0.5", "react-scroll": "^1.8.9", diff --git a/src/components/RestaurantAddForm/RestaurantAddForm.tsx b/src/components/RestaurantAddForm/RestaurantAddForm.tsx index 69142cded..9c5cca239 100644 --- a/src/components/RestaurantAddForm/RestaurantAddForm.tsx +++ b/src/components/RestaurantAddForm/RestaurantAddForm.tsx @@ -1,7 +1,10 @@ /* eslint-disable max-classes-per-file */ import React, { Component, RefObject, Suspense, createRef, lazy } from "react"; -import GeosuggestClass, { GeosuggestProps, Suggest } from "react-geosuggest"; +import GeosuggestClass, { + GeosuggestProps, + Suggest, +} from "@ubilabs/react-geosuggest"; import withStyles from "isomorphic-style-loader/withStyles"; import canUseDOM from "../../helpers/canUseDOM"; import { LatLng } from "../../interfaces"; @@ -11,7 +14,7 @@ import GoogleMapsLoaderContext, { import s from "./RestaurantAddForm.scss"; const Geosuggest = lazy( - () => import(/* webpackChunkName: 'geosuggest' */ "react-geosuggest") + () => import(/* webpackChunkName: 'geosuggest' */ "@ubilabs/react-geosuggest") ); interface RestaurantAddFormProps @@ -25,7 +28,14 @@ interface RestaurantAddFormProps latLng: LatLng; } -class RestaurantAddForm extends Component { +interface RestaurantAddFormState { + value: string; +} + +class RestaurantAddForm extends Component< + RestaurantAddFormProps, + RestaurantAddFormState +> { static contextType = GoogleMapsLoaderContext; geocoder: google.maps.Geocoder; @@ -42,6 +52,10 @@ class RestaurantAddForm extends Component { this.geosuggest = createRef(); + this.state = { + value: "", + }; + if (canUseDOM) { const { loader } = context; loader?.load().then((google) => { @@ -64,8 +78,12 @@ class RestaurantAddForm extends Component { } }; + handleChange = (value: string) => { + this.setState({ value }); + }; + handleSuggestSelect = (suggestion: Suggest) => { - this.props.handleSuggestSelect(suggestion, this.geosuggest!.current!); + this.props.handleSuggestSelect(suggestion); this.geosuggest.current?.clear(); this.geosuggest.current?.focus(); }; @@ -95,9 +113,11 @@ class RestaurantAddForm extends Component { placeholder="Add places" onBlur={this.props.clearTempMarker} onActivateSuggest={this.getCoordsForMarker} + onChange={this.handleChange} onSuggestSelect={this.handleSuggestSelect} getSuggestLabel={this.props.getSuggestLabel} ref={this.geosuggest} + value={this.state.value} /> ) : null} diff --git a/src/components/RestaurantAddForm/RestaurantAddFormContainer.ts b/src/components/RestaurantAddForm/RestaurantAddFormContainer.ts index 74b9d1726..be1627808 100644 --- a/src/components/RestaurantAddForm/RestaurantAddFormContainer.ts +++ b/src/components/RestaurantAddForm/RestaurantAddFormContainer.ts @@ -1,4 +1,4 @@ -import Geosuggest, { Suggest } from "react-geosuggest"; +import Geosuggest, { Suggest } from "@ubilabs/react-geosuggest"; import { connect } from "react-redux"; import { scroller } from "react-scroll"; import { Dispatch, State } from "../../interfaces"; @@ -47,10 +47,7 @@ const mergeProps = ( ) => ({ ...stateProps, ...dispatchProps, - handleSuggestSelect: ( - suggestion: Suggest | undefined, - geosuggest: Geosuggest - ) => { + handleSuggestSelect: (suggestion: Suggest | undefined) => { if (suggestion) { let name = suggestion.label; let address = ""; @@ -70,8 +67,6 @@ const mergeProps = ( address = suggestion.gmaps.formatted_address; } suggestCache = {}; - geosuggest.update(""); - geosuggest.showSuggests(); const existingRestaurant = stateProps.restaurants.find( (r) => r.placeId === placeId ); diff --git a/src/components/TeamGeosuggest/TeamGeosuggest.tsx b/src/components/TeamGeosuggest/TeamGeosuggest.tsx index 1f2a506f0..eaa9f9006 100644 --- a/src/components/TeamGeosuggest/TeamGeosuggest.tsx +++ b/src/components/TeamGeosuggest/TeamGeosuggest.tsx @@ -1,5 +1,5 @@ import React, { Component, Suspense, lazy } from "react"; -import { Suggest } from "react-geosuggest"; +import { Suggest } from "@ubilabs/react-geosuggest"; import canUseDOM from "../../helpers/canUseDOM"; import { LatLng } from "../../interfaces"; import GoogleMapsLoaderContext, { @@ -7,7 +7,7 @@ import GoogleMapsLoaderContext, { } from "../GoogleMapsLoaderContext/GoogleMapsLoaderContext"; const Geosuggest = lazy( - () => import(/* webpackChunkName: 'geosuggest' */ "react-geosuggest") + () => import(/* webpackChunkName: 'geosuggest' */ "@ubilabs/react-geosuggest") ); export interface TeamGeosuggestProps { diff --git a/src/styles/globalCss.scss b/src/styles/globalCss.scss index 380c34fa7..e9a7cc838 100644 --- a/src/styles/globalCss.scss +++ b/src/styles/globalCss.scss @@ -1,6 +1,6 @@ /* stylelint-disable selector-class-pattern */ -@import "~react-geosuggest/module/geosuggest.css"; +@import "~@ubilabs/react-geosuggest/module/geosuggest.css"; @import "./variables"; @import "~bootstrap/scss/functions"; @import "~bootstrap/scss/variables"; @@ -19,6 +19,7 @@ @import "~bootstrap/scss/nav"; @import "~bootstrap/scss/list-group"; @import "~bootstrap/scss/modal"; +@import "~bootstrap/scss/popover"; @import "~bootstrap/scss/helpers/visually-hidden"; @import "~bootstrap/scss/utilities/api"; diff --git a/typings/react-geosuggest.d.ts b/typings/react-geosuggest.d.ts index d38096960..0e09f9ef4 100644 --- a/typings/react-geosuggest.d.ts +++ b/typings/react-geosuggest.d.ts @@ -1,6 +1,6 @@ -import "react-geosuggest"; +import "@ubilabs/react-geosuggest"; -declare module "react-geosuggest" { +declare module "@ubilabs/react-geosuggest" { export interface Suggest { description: string; place_id: string; diff --git a/yarn.lock b/yarn.lock index bc046a3f2..e5b929fd5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2959,6 +2959,19 @@ __metadata: languageName: node linkType: hard +"@ubilabs/react-geosuggest@npm:^2.16.1": + version: 2.16.1 + resolution: "@ubilabs/react-geosuggest@npm:2.16.1" + dependencies: + classnames: ^2.3.2 + lodash.debounce: ^4.0.6 + peerDependencies: + react: ^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 + react-dom: ^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 + checksum: 903d55fdfe8005104a96e8ea33a1963d21ad4527f61bbf973e1dc6d0863dd8da641dc37c82b3052e1efc5f876d48d3a40503015266e32c620b8dbd39163197f7 + languageName: node + linkType: hard + "@webassemblyjs/ast@npm:1.11.1": version: 1.11.1 resolution: "@webassemblyjs/ast@npm:1.11.1" @@ -4306,7 +4319,7 @@ __metadata: languageName: node linkType: hard -"classnames@npm:^2.2.6, classnames@npm:^2.3.1": +"classnames@npm:^2.2.6, classnames@npm:^2.3.1, classnames@npm:^2.3.2": version: 2.3.2 resolution: "classnames@npm:2.3.2" checksum: 2c62199789618d95545c872787137262e741f9db13328e216b093eea91c85ef2bfb152c1f9e63027204e2559a006a92eb74147d46c800a9f96297ae1d9f96f4e @@ -9274,6 +9287,7 @@ __metadata: "@types/webpack-env": ^1.18.0 "@typescript-eslint/eslint-plugin": ^5.59.1 "@typescript-eslint/parser": ^5.59.1 + "@ubilabs/react-geosuggest": ^2.16.1 autoprefixer: ^9.1.5 bcrypt: ^5.1.0 body-parser: ^1.18.3 @@ -9355,7 +9369,6 @@ __metadata: react-dom: "npm:@preact/compat@*" react-error-overlay: ^4.0.1 react-flip-toolkit: ^7.0.17 - react-geosuggest: ^2.14.1 react-icons: ^4.7.1 react-redux: ^8.0.5 react-refresh: ^0.14.0 @@ -11569,19 +11582,6 @@ __metadata: languageName: node linkType: hard -"react-geosuggest@npm:^2.14.1": - version: 2.14.1 - resolution: "react-geosuggest@npm:2.14.1" - dependencies: - classnames: ^2.2.6 - lodash.debounce: ^4.0.6 - peerDependencies: - react: ^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - react-dom: ^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: ce08966519dd1c7f2e4826588b91f809daf105819fdb8c8925333e0c0c4be07aa6db0a303b24c7d5d59e08f5c0aaeab437ca76fd8e3919813b1d781a72e1c66b - languageName: node - linkType: hard - "react-icons@npm:^4.7.1": version: 4.7.1 resolution: "react-icons@npm:4.7.1" From 3cc47b111be216d492f2002f660653e17330673a Mon Sep 17 00:00:00 2001 From: Jeffrey Carl Faden Date: Thu, 9 Nov 2023 15:48:31 -0800 Subject: [PATCH 8/8] Fix TS errors, remove extra db setup and build from CI --- .circleci/config.yml | 6 --- .../RestaurantAddForm/RestaurantAddForm.tsx | 39 +++++-------------- .../RestaurantAddFormContainer.ts | 7 ++-- .../TeamGeosuggest/TeamGeosuggest.tsx | 6 +-- 4 files changed, 16 insertions(+), 42 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e7e70faa6..5a24b34a1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,12 +92,6 @@ jobs: environment: MOCHA_FILE: junit/unit-test-results.xml - # set up for integration tests - # set up the database - - run: - name: database-setup - command: NODE_ENV=test npm run integration-setup - - run: name: setup /etc/hosts command: | diff --git a/src/components/RestaurantAddForm/RestaurantAddForm.tsx b/src/components/RestaurantAddForm/RestaurantAddForm.tsx index 9c5cca239..17124080d 100644 --- a/src/components/RestaurantAddForm/RestaurantAddForm.tsx +++ b/src/components/RestaurantAddForm/RestaurantAddForm.tsx @@ -1,10 +1,7 @@ /* eslint-disable max-classes-per-file */ import React, { Component, RefObject, Suspense, createRef, lazy } from "react"; -import GeosuggestClass, { - GeosuggestProps, - Suggest, -} from "@ubilabs/react-geosuggest"; +import GeosuggestClass, { Location, Suggest } from "@ubilabs/react-geosuggest"; import withStyles from "isomorphic-style-loader/withStyles"; import canUseDOM from "../../helpers/canUseDOM"; import { LatLng } from "../../interfaces"; @@ -17,25 +14,17 @@ const Geosuggest = lazy( () => import(/* webpackChunkName: 'geosuggest' */ "@ubilabs/react-geosuggest") ); -interface RestaurantAddFormProps - extends Pick { +interface RestaurantAddFormProps { createTempMarker: (result: google.maps.GeocoderResult) => void; clearTempMarker: () => void; - handleSuggestSelect: ( - suggestion: Suggest, - geosuggest: GeosuggestClass - ) => void; + getSuggestLabel: ( + suggest: google.maps.places.AutocompletePrediction + ) => string; + handleSuggestSelect: (suggestion?: Location) => void; latLng: LatLng; } -interface RestaurantAddFormState { - value: string; -} - -class RestaurantAddForm extends Component< - RestaurantAddFormProps, - RestaurantAddFormState -> { +class RestaurantAddForm extends Component { static contextType = GoogleMapsLoaderContext; geocoder: google.maps.Geocoder; @@ -52,10 +41,6 @@ class RestaurantAddForm extends Component< this.geosuggest = createRef(); - this.state = { - value: "", - }; - if (canUseDOM) { const { loader } = context; loader?.load().then((google) => { @@ -65,7 +50,7 @@ class RestaurantAddForm extends Component< } } - getCoordsForMarker = (suggest: Suggest) => { + getCoordsForMarker = (suggest: Suggest | null) => { if (suggest !== null) { if (this.geocoder === undefined) { this.geocoder = new this.maps.Geocoder(); @@ -78,11 +63,7 @@ class RestaurantAddForm extends Component< } }; - handleChange = (value: string) => { - this.setState({ value }); - }; - - handleSuggestSelect = (suggestion: Suggest) => { + handleSuggestSelect = (suggestion?: Location) => { this.props.handleSuggestSelect(suggestion); this.geosuggest.current?.clear(); this.geosuggest.current?.focus(); @@ -113,11 +94,9 @@ class RestaurantAddForm extends Component< placeholder="Add places" onBlur={this.props.clearTempMarker} onActivateSuggest={this.getCoordsForMarker} - onChange={this.handleChange} onSuggestSelect={this.handleSuggestSelect} getSuggestLabel={this.props.getSuggestLabel} ref={this.geosuggest} - value={this.state.value} /> ) : null} diff --git a/src/components/RestaurantAddForm/RestaurantAddFormContainer.ts b/src/components/RestaurantAddForm/RestaurantAddFormContainer.ts index be1627808..53b4069f8 100644 --- a/src/components/RestaurantAddForm/RestaurantAddFormContainer.ts +++ b/src/components/RestaurantAddForm/RestaurantAddFormContainer.ts @@ -1,4 +1,4 @@ -import Geosuggest, { Suggest } from "@ubilabs/react-geosuggest"; +import { Location, Suggest } from "@ubilabs/react-geosuggest"; import { connect } from "react-redux"; import { scroller } from "react-scroll"; import { Dispatch, State } from "../../interfaces"; @@ -47,7 +47,7 @@ const mergeProps = ( ) => ({ ...stateProps, ...dispatchProps, - handleSuggestSelect: (suggestion: Suggest | undefined) => { + handleSuggestSelect: (suggestion: Location | undefined) => { if (suggestion) { let name = suggestion.label; let address = ""; @@ -57,6 +57,7 @@ const mergeProps = ( } = suggestion; const isEstablishment = suggestion.gmaps && + suggestion.gmaps.types && suggestion.gmaps.types.indexOf("establishment") > -1; if (suggestCache[placeId] !== undefined && isEstablishment) { name = suggestCache[placeId]; @@ -64,7 +65,7 @@ const mergeProps = ( name = name.split(",")[0]; } if (suggestion.gmaps !== undefined) { - address = suggestion.gmaps.formatted_address; + address = suggestion.gmaps.formatted_address || ""; } suggestCache = {}; const existingRestaurant = stateProps.restaurants.find( diff --git a/src/components/TeamGeosuggest/TeamGeosuggest.tsx b/src/components/TeamGeosuggest/TeamGeosuggest.tsx index eaa9f9006..87fda4e4e 100644 --- a/src/components/TeamGeosuggest/TeamGeosuggest.tsx +++ b/src/components/TeamGeosuggest/TeamGeosuggest.tsx @@ -40,7 +40,7 @@ class TeamGeosuggest extends Component { } } - getCoordsForMarker = (suggest: Suggest) => { + getCoordsForMarker = (suggest: Suggest | null) => { if (suggest !== null) { if (this.geocoder === undefined) { this.geocoder = new this.maps.Geocoder(); @@ -58,8 +58,8 @@ class TeamGeosuggest extends Component { } }; - handleSuggestSelect = (suggestion: Suggest) => { - if (suggestion) { + handleSuggestSelect = (suggestion?: Suggest) => { + if (suggestion?.location) { this.props.setCenter(suggestion.location); } };