From fce4448b587975baea3cdb32fef72d305679c66d Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Wed, 28 Feb 2024 12:03:50 -0600 Subject: [PATCH 1/3] upgrade the wcl to `v0.1.22` --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3b79040..291f0d8 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "@rjsf/core": "^5.0.0-beta.17", "@rjsf/utils": "^5.0.0-beta.17", "@rjsf/validator-ajv8": "^5.0.1", - "@scientist-softserv/webstore-component-library": "^0.1.21", + "@scientist-softserv/webstore-component-library": "^0.1.22", "@sentry/nextjs": "^7.42.0", "axios": "^1.1.3", "bootstrap": "^5.2.3", diff --git a/yarn.lock b/yarn.lock index d140c2f..0afd744 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1073,10 +1073,10 @@ resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.6.0.tgz#1898e7a7b943680d757417a47fb10f5fcc230b39" integrity sha512-2/U3GXA6YiPYQDLGwtGlnNgKYBSwCFIHf8Y9LUY5VATHdtbLlU0Y1R3QoBnT0aB4qv/BEiVVsj7LJXoQCgJ2vA== -"@scientist-softserv/webstore-component-library@^0.1.21": - version "0.1.21" - resolved "https://registry.yarnpkg.com/@scientist-softserv/webstore-component-library/-/webstore-component-library-0.1.21.tgz#c522229e9f49d697009f3db237c4985213b115db" - integrity sha512-W/lKhzNC2ApvMj6xKVu0CH3jfQHiEnmYk8S3a3RhNzEeeGTu6pT0BgzNRZ5SAxUwFjtE8TrXB9rGaVYs7toNSA== +"@scientist-softserv/webstore-component-library@^0.1.22": + version "0.1.22" + resolved "https://registry.yarnpkg.com/@scientist-softserv/webstore-component-library/-/webstore-component-library-0.1.22.tgz#4cfdba48f691d047dedb25962a062a382aab0036" + integrity sha512-8p4NrTFTaRZyu/x0ScKQ3lfEWMUBYy7t94dnFeg9U+GStqXnHKYfNaY75T2TFwjOG6tQQ8G2a2lJJxnKejMvbQ== dependencies: "@fortawesome/fontawesome-svg-core" "^6.2.1" "@fortawesome/free-regular-svg-icons" "^6.2.1" From 2a2f2170fdc8bf9d78e5e93c978a9c8fef6b6ad7 Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Wed, 28 Feb 2024 12:30:00 -0600 Subject: [PATCH 2/3] update the readme - formatting - add step to running the wcl in dev mode --- README.md | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 821b6dd..236b47f 100644 --- a/README.md +++ b/README.md @@ -103,30 +103,39 @@ yarn upgrade @scientist-softserv/webstore-component-library --latest Using the local github repository requires you to manually clone the component library to your computer, build, and link it: #### Preparing your local copy of the component library: -_Prerequisite: clone the [webstore-component-library](https://github.com/scientist-softserv/webstore-component-library.git) and [get the app running](https://github.com/scientist-softserv/webstore-component-library#running-the-app)_ - - cd webstore-component-library - yarn link # now there is a magic symlink in `~/.config/yarn/link` usable by the webstore app +_Prerequisite: clone the [webstore-component-library](https://github.com/scientist-softserv/webstore-component-library.git) (wcl) and [get the app running](https://github.com/scientist-softserv/webstore-component-library#running-the-app)_ +``` bash +cd webstore-component-library +yarn link # now there is a magic symlink in `~/.config/yarn/link` usable by the webstore app +``` Choose one of the below: - - npm run build-lib # must be run every time you want a change to show in the webstore - npm run watch-lib # run once and the wcl will watch for changes +``` bash +npm run build-lib # must be run every time you want a change to show in the webstore +npm run watch-lib # run once and the wcl will watch for changes +``` #### Preparing your local copy of the webstore: - - # run in a separate terminal window than where the wcl is - cd webstore - yarn link "@scientist-softserv/webstore-component-library" - yarn remove @scientist-softserv/webstore-component-library - (restart the dev server) +``` bash +# run in a separate terminal window than where the wcl is + +cd webstore +yarn link "@scientist-softserv/webstore-component-library" +yarn add react-bootstrap@ # e.g. yarn add react-bootstrap@2.6.0 +# use the version listed in the dependencies of "@scientist-softserv/webstore-component-library" in the "yarn.lock" file. +yarn remove @scientist-softserv/webstore-component-library +(restart the dev server) +``` #### Return to using the packaged version of the webstore-component-library: - # in the webstore repository - yarn unlink "@scientist-softserv/webstore-component-library" - git checkout package.json yarn.lock - yarn install --check-files --force - (restart the dev server) +``` bash +# in the webstore repository + +yarn unlink "@scientist-softserv/webstore-component-library" +git checkout package.json yarn.lock +yarn install --check-files --force +(restart the dev server) +``` ## Exception Handling The application is configured to use Sentry. Refer to ".env.development.example" for how to find the necessary variables. From 26be1d494765cf913f1b187dd2e4c2127ac14090 Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Wed, 28 Feb 2024 16:35:36 -0600 Subject: [PATCH 3/3] able to log in again the `signIn` function from "next-auth/react" uses `fetcher` and returns a 404 error response. throwing that error causes an `OAUTH_CALLBACK_HANDLER_ERROR`, which prevents users from signing in. `signIn` doesn't pass a url to `fetcher`. the check below ensures that other errors still get thrown - ref: https://github.com/scientist-softserv/webstore/issues/321 --- utils/api/base.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/api/base.js b/utils/api/base.js index 1ae2a44..c1d293b 100644 --- a/utils/api/base.js +++ b/utils/api/base.js @@ -11,7 +11,10 @@ export const fetcher = (url, token) => { .then(res => res.data) .catch(error => { Sentry.captureException(error) - throw error + // the `signIn` function from "next-auth/react" uses `fetcher` and returns a 404 error response. throwing that error causes an + // `OAUTH_CALLBACK_HANDLER_ERROR`, which prevents users from signing in. `signIn` doesn't pass a url to `fetcher`. the check below + // ensures that other errors still get thrown + if (error.config.url !== null) throw error }) }