From cf7b1d168de2295427656c1af28e187d6623843d Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Mon, 30 Sep 2024 14:00:46 +1000 Subject: [PATCH 1/2] fix(@dpc-sdp/ripple-tide-webform): fixed verifycaptcha not fetching webform correctly --- packages/nuxt-ripple/server/utils/verifyCaptcha.ts | 14 ++++++++------ packages/ripple-tide-webform/package.json | 1 + .../ripple-tide-webform/server/api/tide/webform.ts | 2 +- packages/ripple-tide-webform/server/index.ts | 1 + 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 packages/ripple-tide-webform/server/index.ts diff --git a/packages/nuxt-ripple/server/utils/verifyCaptcha.ts b/packages/nuxt-ripple/server/utils/verifyCaptcha.ts index 9ce7b212d8..cd2e1be378 100644 --- a/packages/nuxt-ripple/server/utils/verifyCaptcha.ts +++ b/packages/nuxt-ripple/server/utils/verifyCaptcha.ts @@ -11,6 +11,8 @@ import { MappedCaptchaConfig } from '@dpc-sdp/ripple-tide-webform/types' +import { TideWebformApi } from '@dpc-sdp/ripple-tide-webform/api' + const logLabel = 'Verify CAPTCHA' const genericCaptchaVerify = async ( @@ -145,12 +147,12 @@ const verifyCaptcha = async (event: H3Event) => { let webform try { - webform = await $fetch('/api/tide/webform', { - baseURL: config.apiUrl || '', - params: { - id: formId - } - }) + const webformApi = new TideWebformApi( + { ...config.public.tide, ...config.tide }, + logger + ) + + webform = webformApi.getWebform(formId) } catch (error) { throw new ApplicationError( `Couldn't get webform data, unable to continue because we don't know if a captcha is required`, diff --git a/packages/ripple-tide-webform/package.json b/packages/ripple-tide-webform/package.json index 67a4f82c90..da32294ccf 100644 --- a/packages/ripple-tide-webform/package.json +++ b/packages/ripple-tide-webform/package.json @@ -10,6 +10,7 @@ "./mapping": "./mapping/index.ts", "./mapping/utils": "./mapping/webform-utils.ts", "./server/utils": "./server/webform-utils.ts", + "./api": "./server/index.ts", "./types": "./types.ts" }, "dependencies": { diff --git a/packages/ripple-tide-webform/server/api/tide/webform.ts b/packages/ripple-tide-webform/server/api/tide/webform.ts index ce573a6d89..923c377c26 100644 --- a/packages/ripple-tide-webform/server/api/tide/webform.ts +++ b/packages/ripple-tide-webform/server/api/tide/webform.ts @@ -19,7 +19,7 @@ import { getFormSchemaFromMapping, getCaptchaSettings } from '../../../mapping' /** * @description Custom API call methods and response mapping for webform */ -class TideWebformApi extends TideApiBase { +export class TideWebformApi extends TideApiBase { webformMapping: IRplTideModuleMapping declare logLabel: string diff --git a/packages/ripple-tide-webform/server/index.ts b/packages/ripple-tide-webform/server/index.ts new file mode 100644 index 0000000000..e3e63d647c --- /dev/null +++ b/packages/ripple-tide-webform/server/index.ts @@ -0,0 +1 @@ +export { TideWebformApi } from './api/tide/webform' From d623a34dd1eb91e8e90bd185469c3ba7fcbf6ce0 Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Mon, 30 Sep 2024 14:25:16 +1000 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=F0=9F=94=96=20hotfix=20update=20t?= =?UTF-8?q?o=20ripple=202.17.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 13 +++++++++++++ lerna.json | 2 +- packages/eslint-config-ripple/package.json | 2 +- packages/nuxt-ripple-analytics/package.json | 2 +- packages/nuxt-ripple-cli/package.json | 2 +- packages/nuxt-ripple-preview/package.json | 2 +- packages/nuxt-ripple/package.json | 2 +- packages/ripple-sdp-core/package.json | 2 +- packages/ripple-storybook/package.json | 2 +- packages/ripple-test-utils/package.json | 2 +- packages/ripple-tide-api/package.json | 2 +- packages/ripple-tide-event/package.json | 2 +- packages/ripple-tide-grant/package.json | 2 +- packages/ripple-tide-landing-page/package.json | 2 +- packages/ripple-tide-media/package.json | 2 +- packages/ripple-tide-news/package.json | 2 +- packages/ripple-tide-publication/package.json | 2 +- packages/ripple-tide-search/package.json | 2 +- packages/ripple-tide-topic/package.json | 2 +- packages/ripple-tide-webform/package.json | 2 +- packages/ripple-ui-core/package.json | 2 +- packages/ripple-ui-forms/package.json | 2 +- packages/ripple-ui-maps/package.json | 2 +- packages/stylelint-config-ripple/package.json | 2 +- 24 files changed, 36 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 011b3c9b02..f26b65d883 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## v2.17.1 + +[compare changes](https://github.com/dpc-sdp/ripple-framework/compare/2.17.0...v2.17.1) + + +### 🩹 Fixes + + - **@dpc-sdp/ripple-tide-webform:** Fixed verifycaptcha not fetching webform correctly ([cf7b1d168](https://github.com/dpc-sdp/ripple-framework/commit/cf7b1d168)) + +### ❤️ Contributors + +- Jeffrey Dowdle + ## v2.17.0 [compare changes](https://github.com/dpc-sdp/ripple-framework/compare/2.16.0...v2.17.0) diff --git a/lerna.json b/lerna.json index fd5b3b779e..fd2c270054 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.17.0", + "version": "2.17.1", "npmClient": "pnpm", "exact": true, "command": { diff --git a/packages/eslint-config-ripple/package.json b/packages/eslint-config-ripple/package.json index 6df30432da..f112290891 100644 --- a/packages/eslint-config-ripple/package.json +++ b/packages/eslint-config-ripple/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/eslint-config-ripple", "description": "ESLint config for Ripple projects", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "index.js", diff --git a/packages/nuxt-ripple-analytics/package.json b/packages/nuxt-ripple-analytics/package.json index c52389517d..342047a53a 100644 --- a/packages/nuxt-ripple-analytics/package.json +++ b/packages/nuxt-ripple-analytics/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/nuxt-ripple-analytics", "description": "Nuxt module for handling event tracking.", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "main": "./nuxt.config.ts", "repository": "https://github.com/dpc-sdp/ripple-framework", diff --git a/packages/nuxt-ripple-cli/package.json b/packages/nuxt-ripple-cli/package.json index 6e30a128b0..e1f4f3091c 100644 --- a/packages/nuxt-ripple-cli/package.json +++ b/packages/nuxt-ripple-cli/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/nuxt-ripple-cli", "description": "A CLI for simplifying common setup and scaffolding tasks", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "./dist/index.js", diff --git a/packages/nuxt-ripple-preview/package.json b/packages/nuxt-ripple-preview/package.json index c6c1c7baa3..558e2bdf96 100644 --- a/packages/nuxt-ripple-preview/package.json +++ b/packages/nuxt-ripple-preview/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/nuxt-ripple-preview", "description": "Adds support for drupal preview links in Ripple frontend sites", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "main": "./nuxt.config.ts", "repository": "https://github.com/dpc-sdp/ripple-framework", diff --git a/packages/nuxt-ripple/package.json b/packages/nuxt-ripple/package.json index 6512982f37..4a6560426f 100644 --- a/packages/nuxt-ripple/package.json +++ b/packages/nuxt-ripple/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/nuxt-ripple", "description": "Nuxt module for integrating Ripple and Tide", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "main": "./nuxt.config.ts", "repository": "https://github.com/dpc-sdp/ripple-framework", diff --git a/packages/ripple-sdp-core/package.json b/packages/ripple-sdp-core/package.json index 3200fbb187..9be963fb98 100644 --- a/packages/ripple-sdp-core/package.json +++ b/packages/ripple-sdp-core/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-sdp-core", "description": "SDP core content types", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "./nuxt.config.ts", diff --git a/packages/ripple-storybook/package.json b/packages/ripple-storybook/package.json index 97c421db2d..6442c06add 100644 --- a/packages/ripple-storybook/package.json +++ b/packages/ripple-storybook/package.json @@ -1,7 +1,7 @@ { "name": "ripple-storybook", "description": "Ripple Storybook instance", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "private": true, "repository": "https://github.com/dpc-sdp/ripple-framework", diff --git a/packages/ripple-test-utils/package.json b/packages/ripple-test-utils/package.json index 9ff6283098..7fe6616899 100644 --- a/packages/ripple-test-utils/package.json +++ b/packages/ripple-test-utils/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-test-utils", "description": "Test utils for Ripple sites", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "type": "module", "main": "./dist/config/index.js", diff --git a/packages/ripple-tide-api/package.json b/packages/ripple-tide-api/package.json index 7e46491f8a..d00ee6c8c7 100644 --- a/packages/ripple-tide-api/package.json +++ b/packages/ripple-tide-api/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-tide-api", "description": "Ripple API endpoints for Tide Drupal backend", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "./dist/index.js", diff --git a/packages/ripple-tide-event/package.json b/packages/ripple-tide-event/package.json index ad1e0c48a0..4f54834039 100644 --- a/packages/ripple-tide-event/package.json +++ b/packages/ripple-tide-event/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-tide-event", "description": "Ripple mappings and components for Tide Event Content type", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "main": "./nuxt.config.ts", "repository": "https://github.com/dpc-sdp/ripple-framework", diff --git a/packages/ripple-tide-grant/package.json b/packages/ripple-tide-grant/package.json index 0a6bf1dc13..f1892573f6 100644 --- a/packages/ripple-tide-grant/package.json +++ b/packages/ripple-tide-grant/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-tide-grant", "description": "Ripple mappings and components for Tide Grant Content type", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "./nuxt.config.ts", diff --git a/packages/ripple-tide-landing-page/package.json b/packages/ripple-tide-landing-page/package.json index a4e7ac8a69..8ed05c4895 100644 --- a/packages/ripple-tide-landing-page/package.json +++ b/packages/ripple-tide-landing-page/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-tide-landing-page", "description": "Ripple mappings and components for Tide landing-page Content type", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "./nuxt.config.ts", diff --git a/packages/ripple-tide-media/package.json b/packages/ripple-tide-media/package.json index a88b4d617c..88319670c8 100644 --- a/packages/ripple-tide-media/package.json +++ b/packages/ripple-tide-media/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-tide-media", "description": "Ripple mappings and components for Tide media", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "./nuxt.config.ts", diff --git a/packages/ripple-tide-news/package.json b/packages/ripple-tide-news/package.json index 43ff78e63a..17ad367c62 100644 --- a/packages/ripple-tide-news/package.json +++ b/packages/ripple-tide-news/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-tide-news", "description": "Ripple mappings and components for Tide News content type", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "./nuxt.config.ts", diff --git a/packages/ripple-tide-publication/package.json b/packages/ripple-tide-publication/package.json index fa5934eb69..f6cfdad12a 100644 --- a/packages/ripple-tide-publication/package.json +++ b/packages/ripple-tide-publication/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-tide-publication", "description": "Ripple mappings and components for Tide Publication Content type", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "./nuxt.config.ts", diff --git a/packages/ripple-tide-search/package.json b/packages/ripple-tide-search/package.json index 3f1e1782de..1857a433c8 100644 --- a/packages/ripple-tide-search/package.json +++ b/packages/ripple-tide-search/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-tide-search", "description": "Ripple search UI and services for connecting to Tide search", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "./nuxt.config.ts", diff --git a/packages/ripple-tide-topic/package.json b/packages/ripple-tide-topic/package.json index 72019c6adb..f9372c752e 100644 --- a/packages/ripple-tide-topic/package.json +++ b/packages/ripple-tide-topic/package.json @@ -9,7 +9,7 @@ "./mapping": "./mapping/index.ts", "./types": "./types.ts" }, - "version": "2.17.0", + "version": "2.17.1", "dependencies": { "@dpc-sdp/nuxt-ripple": "workspace:*", "@dpc-sdp/ripple-tide-api": "workspace:*", diff --git a/packages/ripple-tide-webform/package.json b/packages/ripple-tide-webform/package.json index da32294ccf..fcdacfadd3 100644 --- a/packages/ripple-tide-webform/package.json +++ b/packages/ripple-tide-webform/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-tide-webform", "description": "Ripple mappings and components for Tide webforms", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "./nuxt.config.ts", diff --git a/packages/ripple-ui-core/package.json b/packages/ripple-ui-core/package.json index deb40170db..9cf514936b 100644 --- a/packages/ripple-ui-core/package.json +++ b/packages/ripple-ui-core/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-ui-core", "description": "Ripple UI Core component library", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "files": [ diff --git a/packages/ripple-ui-forms/package.json b/packages/ripple-ui-forms/package.json index ee7fa0d6cb..4784ce25b1 100644 --- a/packages/ripple-ui-forms/package.json +++ b/packages/ripple-ui-forms/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-ui-forms", "description": "A form component library built with Formkit", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "./dist/rpl-forms.umd.js", diff --git a/packages/ripple-ui-maps/package.json b/packages/ripple-ui-maps/package.json index 6144c091c1..65e86b7a79 100644 --- a/packages/ripple-ui-maps/package.json +++ b/packages/ripple-ui-maps/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/ripple-ui-maps", "description": "Ripple UI Core component library", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "files": [ diff --git a/packages/stylelint-config-ripple/package.json b/packages/stylelint-config-ripple/package.json index d674fe90c1..8b10847954 100644 --- a/packages/stylelint-config-ripple/package.json +++ b/packages/stylelint-config-ripple/package.json @@ -1,7 +1,7 @@ { "name": "@dpc-sdp/stylelint-config-ripple", "description": "ESLint config for Ripple projects", - "version": "2.17.0", + "version": "2.17.1", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "index.js",