diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fabb75acb..1ac4646107 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## v2.4.4 + +[compare changes](https://github.com/dpc-sdp/ripple-framework/compare/v2.4.3...v2.4.4) + + +### 🩹 Fixes + + - **@dpc-sdp/ripple-tide-api:** Changed the way sectionId is passed to mapping functions ([e113b1c2](https://github.com/dpc-sdp/ripple-framework/commit/e113b1c2)) + +### ❤️ Contributors + +- Dylan Kelly + ## v2.4.3 [compare changes](https://github.com/dpc-sdp/ripple-framework/compare/v2.4.2...v2.4.3) diff --git a/lerna.json b/lerna.json index 370dc54fea..753552d980 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.4.3", + "version": "2.4.4", "npmClient": "pnpm", "exact": true, "command": { diff --git a/packages/eslint-config-ripple/package.json b/packages/eslint-config-ripple/package.json index d2493c52a1..de8b9cbef0 100644 --- a/packages/eslint-config-ripple/package.json +++ b/packages/eslint-config-ripple/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/eslint-config-ripple", "description": "ESLint config for Ripple projects", - "version": "2.4.3", + "version": "2.4.4", "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 36d5623fea..526e6bcbca 100644 --- a/packages/nuxt-ripple-analytics/package.json +++ b/packages/nuxt-ripple-analytics/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/nuxt-ripple-analytics", "description": "Nuxt module for handling event tracking.", - "version": "2.4.3", + "version": "2.4.4", "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 8837bfdaf3..5e27794b7a 100644 --- a/packages/nuxt-ripple-cli/package.json +++ b/packages/nuxt-ripple-cli/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/nuxt-ripple-cli", "description": "A CLI for simplifying common setup and scaffolding tasks", - "version": "2.4.3", + "version": "2.4.4", "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 f9365bedb1..16fd98747c 100644 --- a/packages/nuxt-ripple-preview/package.json +++ b/packages/nuxt-ripple-preview/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/nuxt-ripple-preview", "description": "Adds support for drupal preview links in Ripple frontend sites", - "version": "2.4.3", + "version": "2.4.4", "license": "Apache-2.0", "main": "./nuxt.config.ts", "repository": "https://github.com/dpc-sdp/ripple-framework", diff --git a/packages/nuxt-ripple/mapping/base/index.ts b/packages/nuxt-ripple/mapping/base/index.ts index 666ef70065..2009279d58 100644 --- a/packages/nuxt-ripple/mapping/base/index.ts +++ b/packages/nuxt-ripple/mapping/base/index.ts @@ -64,9 +64,9 @@ export const tidePageBaseMapping = ({ sidebar: sidebar, status: 'moderation_state', topicTags: topicTagsMapping, - siteSection: async (src, tidePageApi: TidePageApi) => { + siteSection: async (src) => { // With the correct site/section id, we can now choose the correct site data from 'field_node_site' - const siteData = getSiteSection(tidePageApi.sectionId, src) + const siteData = getSiteSection(src._sectionId, src) if (!siteData) { return null diff --git a/packages/nuxt-ripple/mapping/base/sidebar-site-section-nav/sidebar-site-section-nav-mapping.ts b/packages/nuxt-ripple/mapping/base/sidebar-site-section-nav/sidebar-site-section-nav-mapping.ts index 0d29d03b13..3397da6f99 100644 --- a/packages/nuxt-ripple/mapping/base/sidebar-site-section-nav/sidebar-site-section-nav-mapping.ts +++ b/packages/nuxt-ripple/mapping/base/sidebar-site-section-nav/sidebar-site-section-nav-mapping.ts @@ -6,7 +6,7 @@ export const map = async (src, tidePageApi: TidePageApi) => { } // With the correct site/section id, we can now choose the correct site data from 'field_node_site' - const siteData = getSiteSection(tidePageApi.sectionId, src) + const siteData = getSiteSection(src._sectionId, src) if (!siteData) { return null diff --git a/packages/nuxt-ripple/package.json b/packages/nuxt-ripple/package.json index 48bfbf20e0..83eb847bc8 100644 --- a/packages/nuxt-ripple/package.json +++ b/packages/nuxt-ripple/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/nuxt-ripple", "description": "Nuxt module for integrating Ripple and Tide", - "version": "2.4.3", + "version": "2.4.4", "license": "Apache-2.0", "main": "./nuxt.config.ts", "repository": "https://github.com/dpc-sdp/ripple-framework", diff --git a/packages/ripple-storybook/package.json b/packages/ripple-storybook/package.json index 2fd71a1286..8d48c4b969 100644 --- a/packages/ripple-storybook/package.json +++ b/packages/ripple-storybook/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "ripple-storybook", "description": "Ripple Storybook instance", - "version": "2.4.3", + "version": "2.4.4", "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 2a0101dc00..3b9b40d09f 100644 --- a/packages/ripple-test-utils/package.json +++ b/packages/ripple-test-utils/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.0.0", "name": "@dpc-sdp/ripple-test-utils", "description": "Test utils for Ripple sites", - "version": "2.4.3", + "version": "2.4.4", "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 c64bc7830f..f994c84f91 100644 --- a/packages/ripple-tide-api/package.json +++ b/packages/ripple-tide-api/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/ripple-tide-api", "description": "Ripple API endpoints for Tide Drupal backend", - "version": "2.4.3", + "version": "2.4.4", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "./dist/index.js", diff --git a/packages/ripple-tide-api/src/services/lib/default-mapping.ts b/packages/ripple-tide-api/src/services/lib/default-mapping.ts index ebcf695f46..84bf48d71e 100644 --- a/packages/ripple-tide-api/src/services/lib/default-mapping.ts +++ b/packages/ripple-tide-api/src/services/lib/default-mapping.ts @@ -4,7 +4,8 @@ export default { changed: 'changed', created: 'created', type: (data: any) => data.type && data.type.replace('node--', ''), - nid: 'drupal_internal__nid' + nid: 'drupal_internal__nid', + _sectionId: (data: any) => data._sectionId }, includes: [] } diff --git a/packages/ripple-tide-api/src/services/tide-page.ts b/packages/ripple-tide-api/src/services/tide-page.ts index d750159cf0..040da85d18 100644 --- a/packages/ripple-tide-api/src/services/tide-page.ts +++ b/packages/ripple-tide-api/src/services/tide-page.ts @@ -17,13 +17,11 @@ export default class TidePageApi extends TideApiBase { [key: string]: IRplTideDynamicComponentMapping } site: string - sectionId: string path: string constructor(tide: RplTideModuleConfig, logger: ILogger) { super(tide, logger) this.site = tide.site - this.sectionId = '' this.path = '' this.contentTypes = {} this.dynamicComponents = {} @@ -246,16 +244,12 @@ export default class TidePageApi extends TideApiBase { async getPageByRouteData(route, config) { if (route && route.entity_type && route.bundle && route.uuid) { - // The route response has a 'section' attribute, which is the site id used to - // determine which menu appears in the 'site section navigation' - // We capture it here so that it can be used in the mapping functions - this.sectionId = route.section - const nodeUrl = `/${route.entity_type}/${route.bundle}/${route.uuid}` return await this.get(nodeUrl, config).then(({ data, headers }) => { if (data.data) { const parsedData = jsonapiParse.parse(data).data || data.data + return { data: this.getTidePage(parsedData, route), headers @@ -281,9 +275,13 @@ export default class TidePageApi extends TideApiBase { `Unable to resolve content type - ${route.bundle}` ) } + + // The route response has a 'section' attribute, which is the site id used to + // determine which menu appears in the 'site section navigation' + // We capture it here so that it can be used in the mapping functions return this.getMappedData( { ...defaultMapping.mapping, ...contentTypeMapping }, - resource + { ...resource, _sectionId: route.section } ) } diff --git a/packages/ripple-tide-event/package.json b/packages/ripple-tide-event/package.json index 8ecd9991cb..ea44e94f6a 100644 --- a/packages/ripple-tide-event/package.json +++ b/packages/ripple-tide-event/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/ripple-tide-event", "description": "Ripple mappings and components for Tide Event Content type", - "version": "2.4.3", + "version": "2.4.4", "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 97ef2c620a..3436572d3d 100644 --- a/packages/ripple-tide-grant/package.json +++ b/packages/ripple-tide-grant/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/ripple-tide-grant", "description": "Ripple mappings and components for Tide Grant Content type", - "version": "2.4.3", + "version": "2.4.4", "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 1b4d21828f..fea76ac639 100644 --- a/packages/ripple-tide-landing-page/package.json +++ b/packages/ripple-tide-landing-page/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/ripple-tide-landing-page", "description": "Ripple mappings and components for Tide landing-page Content type", - "version": "2.4.3", + "version": "2.4.4", "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 d9ea22d04c..2f2fcdd4f6 100644 --- a/packages/ripple-tide-media/package.json +++ b/packages/ripple-tide-media/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/ripple-tide-media", "description": "Ripple mappings and components for Tide media", - "version": "2.4.3", + "version": "2.4.4", "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 9fe000c1a4..68bb0a197e 100644 --- a/packages/ripple-tide-news/package.json +++ b/packages/ripple-tide-news/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/ripple-tide-news", "description": "Ripple mappings and components for Tide News content type", - "version": "2.4.3", + "version": "2.4.4", "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 3495f2f554..f35807229a 100644 --- a/packages/ripple-tide-publication/package.json +++ b/packages/ripple-tide-publication/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/ripple-tide-publication", "description": "Ripple mappings and components for Tide Publication Content type", - "version": "2.4.3", + "version": "2.4.4", "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 af319273fa..16fbe40e68 100644 --- a/packages/ripple-tide-search/package.json +++ b/packages/ripple-tide-search/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/ripple-tide-search", "description": "Ripple search UI and services for connecting to Tide search", - "version": "2.4.3", + "version": "2.4.4", "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 0247b1a380..71c9184c35 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.4.3", + "version": "2.4.4", "dependencies": { "@dpc-sdp/nuxt-ripple": "workspace:*", "@dpc-sdp/ripple-tide-api": "workspace:*", diff --git a/packages/ripple-ui-core/package.json b/packages/ripple-ui-core/package.json index b1426e28c3..1c8ea4429d 100644 --- a/packages/ripple-ui-core/package.json +++ b/packages/ripple-ui-core/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/ripple-ui-core", "description": "Ripple UI Core component library", - "version": "2.4.3", + "version": "2.4.4", "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 f77cd149a1..824d0399d7 100644 --- a/packages/ripple-ui-forms/package.json +++ b/packages/ripple-ui-forms/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/ripple-ui-forms", "description": "A form component library built with Formkit", - "version": "2.4.3", + "version": "2.4.4", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "./dist/rpl-forms.umd.js", diff --git a/packages/stylelint-config-ripple/package.json b/packages/stylelint-config-ripple/package.json index 3b5777e2a4..e7c74080af 100644 --- a/packages/stylelint-config-ripple/package.json +++ b/packages/stylelint-config-ripple/package.json @@ -2,7 +2,7 @@ "packageManager": "pnpm@8.6.2", "name": "@dpc-sdp/stylelint-config-ripple", "description": "ESLint config for Ripple projects", - "version": "2.4.3", + "version": "2.4.4", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "index.js",