From 6c0e4894984713543f7e55e80beffac4376fc846 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Fri, 6 Oct 2023 12:45:11 +1100 Subject: [PATCH 1/9] fix(nuxt-ripple): :bug: enable external redirects --- packages/nuxt-ripple/composables/use-tide-page.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nuxt-ripple/composables/use-tide-page.ts b/packages/nuxt-ripple/composables/use-tide-page.ts index 6e08354e1f..fbd58b47d8 100644 --- a/packages/nuxt-ripple/composables/use-tide-page.ts +++ b/packages/nuxt-ripple/composables/use-tide-page.ts @@ -88,7 +88,8 @@ export const useTidePage = async ( case '305': case '307': await navigateTo(data.value.redirect_url, { - redirectCode: data.value.status_code + redirectCode: data.value.status_code, + external: data.value.redirect_type === 'external' }) break default: From b8f94314a53a31e51166cb1863e7a85b4501ec9d Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Fri, 6 Oct 2023 10:28:15 +1100 Subject: [PATCH 2/9] fix(@dpc-sdp/nuxt-ripple): fixed console error when request event was being fetched client side nuxt doesn't expose the useRequestEvent on the client, only the server so it was failing --- packages/nuxt-ripple/composables/use-merge-section-tags.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nuxt-ripple/composables/use-merge-section-tags.ts b/packages/nuxt-ripple/composables/use-merge-section-tags.ts index e0bba9eb97..f1a6e4eb40 100644 --- a/packages/nuxt-ripple/composables/use-merge-section-tags.ts +++ b/packages/nuxt-ripple/composables/use-merge-section-tags.ts @@ -12,9 +12,11 @@ const mergeTags = (existingTags: string, newTags: string): string => { export const useMergeSectionTags = async ( sectionCacheTags: any ): Promise => { + // event will be undefined if the request is on the client side const event = useRequestEvent() + // Section.io cache tags must be set on the response header to invalidate the cache after a change in drupal - if (sectionCacheTags) { + if (event && sectionCacheTags) { const currentResponseHeaders = getResponseHeaders(event) const currentSectionTags: string = From aa657deb71cce2786f27b492d3bea0af0c8a9ad6 Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Fri, 6 Oct 2023 11:51:21 +1100 Subject: [PATCH 3/9] feat(@dpc-sdp/ripple-tide-publication): added proper publication header mapping --- packages/ripple-tide-landing-page/mapping/index.ts | 6 ++++++ .../mapping/publication-page.ts | 10 +++++----- .../ripple-tide-publication/mapping/publication.ts | 7 +++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/ripple-tide-landing-page/mapping/index.ts b/packages/ripple-tide-landing-page/mapping/index.ts index da6be7039a..dc5a731223 100644 --- a/packages/ripple-tide-landing-page/mapping/index.ts +++ b/packages/ripple-tide-landing-page/mapping/index.ts @@ -85,3 +85,9 @@ const tideLandingPageModule: IRplTideModuleMapping = { } export default tideLandingPageModule + +export { + secondaryCampaignIncludes, + secondaryCampaignMapping, + heroHeaderMapping +} diff --git a/packages/ripple-tide-publication/mapping/publication-page.ts b/packages/ripple-tide-publication/mapping/publication-page.ts index 79bac287ad..4102581f51 100644 --- a/packages/ripple-tide-publication/mapping/publication-page.ts +++ b/packages/ripple-tide-publication/mapping/publication-page.ts @@ -5,6 +5,7 @@ import { tidePageBaseIncludes } from '@dpc-sdp/nuxt-ripple/mapping' import type { IRplTideModuleMapping } from '@dpc-sdp/ripple-tide-api/types' +import { heroHeaderMapping } from '@dpc-sdp/ripple-tide-landing-page/mapping' const tidePublicationPageModule: IRplTideModuleMapping = { mapping: { @@ -22,10 +23,7 @@ const tidePublicationPageModule: IRplTideModuleMapping = { } return 'h2' }, - header: { - title: 'title', - summary: 'field_landing_page_intro_text' - }, + header: heroHeaderMapping, breadcrumbs: (src: string) => [ { text: 'Home', url: '/' }, { @@ -92,7 +90,9 @@ const tidePublicationPageModule: IRplTideModuleMapping = { 'field_landing_page_contact.field_paragraph_phones', 'field_landing_page_contact.field_paragraph_social_media', 'field_landing_page_component.field_paragraph_media.field_media_image', - 'field_landing_page_component.field_paragraph_topic' + 'field_landing_page_component.field_paragraph_topic', + 'field_landing_page_hero_image', + 'field_landing_page_hero_image.field_media_image' ] } diff --git a/packages/ripple-tide-publication/mapping/publication.ts b/packages/ripple-tide-publication/mapping/publication.ts index 985f73d94f..7d14dcf570 100644 --- a/packages/ripple-tide-publication/mapping/publication.ts +++ b/packages/ripple-tide-publication/mapping/publication.ts @@ -5,6 +5,7 @@ import { tidePageBaseIncludes } from '@dpc-sdp/nuxt-ripple/mapping' import type { IRplTideModuleMapping } from '@dpc-sdp/ripple-tide-api/types' +import { heroHeaderMapping } from '@dpc-sdp/ripple-tide-landing-page/mapping' const chapters = (src: string) => getField(src, 'publication_children') @@ -24,10 +25,7 @@ const tidePublicationModule: IRplTideModuleMapping = { withSidebarSocialShare: true }), url: 'path.url', - header: { - title: 'title', - summary: 'field_landing_page_intro_text' - }, + header: heroHeaderMapping, summary: 'field_landing_page_summary', showInPageNav: 'field_show_table_of_content', inPageNavHeadingLevel: (src) => { @@ -84,6 +82,7 @@ const tidePublicationModule: IRplTideModuleMapping = { 'field_node_documents.field_media_file', 'field_landing_page_contact.field_paragraph_phones', 'field_landing_page_contact.field_paragraph_social_media', + 'field_landing_page_hero_image', 'field_landing_page_hero_image.field_media_image', 'field_license_type', 'field_landing_page_component.field_complex_image_media.field_media_image', From b737e32b793f13fe9f317951959690f3349064d4 Mon Sep 17 00:00:00 2001 From: Dylan Kelly Date: Fri, 6 Oct 2023 13:20:59 +1100 Subject: [PATCH 4/9] chore(@dpc-sdp/ripple-tide-publication): :bug: [R20-1574] fix publication preview menu issue --- .../server/api/tide/publication-index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/ripple-tide-publication/server/api/tide/publication-index.ts b/packages/ripple-tide-publication/server/api/tide/publication-index.ts index 9294dae254..138fd59831 100644 --- a/packages/ripple-tide-publication/server/api/tide/publication-index.ts +++ b/packages/ripple-tide-publication/server/api/tide/publication-index.ts @@ -69,10 +69,8 @@ class TidePublicationIndexApi extends TideApiBase { ) return siteData } catch (error: any) { - // Could be 404? - throw new ApplicationError('Error fetching publication index', { - cause: error - }) + // Could be 404? publication could be in share or preview so need to ignore this error and render page anyway + logger.error(`Error fetching publication index`, error) } } } From a08742e47b43a78b3de60d7e88bc1e8eaad1ea6f Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Fri, 6 Oct 2023 13:31:41 +1100 Subject: [PATCH 5/9] fix(@dpc-sdp/ripple-tide-publication): fixed duplication side nav links --- .../utils/processMenu.ts | 52 ++++++++----------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/packages/ripple-tide-publication/utils/processMenu.ts b/packages/ripple-tide-publication/utils/processMenu.ts index 697da7d791..ced1940112 100644 --- a/packages/ripple-tide-publication/utils/processMenu.ts +++ b/packages/ripple-tide-publication/utils/processMenu.ts @@ -17,37 +17,27 @@ const parseChildren = (node: indexNode, route: RouteRecord): indexNode[] => { ) } -const transformNode = (node: indexNode, route: RouteRecord): indexNode[] => { - const parent: indexNode = { - text: node.text, - url: node.url, - id: node.id, - active: node.url === route.path, - items: undefined - } - - return [parent, ...parseChildren(node, route)] +const processMenu = (res: indexNode, route: RouteRecord): indexNode[] => { + return [ + { + text: res.text, + url: res.url, + id: res.id, + active: res.url === route.path, + items: undefined + }, + ...((res.items || []).map( + (child: indexNode): indexNode => ({ + text: child.text, + url: child.url, + id: child.id, + active: route.path.includes(child.url), + items: + // Group chapter together (child with its children) + child.items ? parseChildren(child, route) : undefined + }) + ) as any[]) + ] } -const processMenu = (res: indexNode, route: RouteRecord): indexNode[] => [ - { - text: res.text, - url: res.url, - id: res.id, - active: res.url === route.path, - items: undefined - }, - ...((res.items || []).map( - (child: indexNode): indexNode => ({ - text: child.text, - url: child.url, - id: child.id, - active: route.path.includes(child.url), - items: - // Group chapter together (child with its children) - child.items ? transformNode(child, route) : undefined - }) - ) as any[]) -] - export { type indexNode, processMenu } From acd09f34bee9fd567005917813099b9fb47b4b8d Mon Sep 17 00:00:00 2001 From: Dylan Kelly Date: Fri, 6 Oct 2023 13:36:11 +1100 Subject: [PATCH 6/9] chore(@dpc-sdp/ripple-tide-publication): :rotating_light: fix unused var --- .../server/api/tide/publication-index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/ripple-tide-publication/server/api/tide/publication-index.ts b/packages/ripple-tide-publication/server/api/tide/publication-index.ts index 138fd59831..33683fe71a 100644 --- a/packages/ripple-tide-publication/server/api/tide/publication-index.ts +++ b/packages/ripple-tide-publication/server/api/tide/publication-index.ts @@ -1,10 +1,7 @@ import jsonapiParse from 'jsonapi-parse' import { defineEventHandler, getQuery, H3Event } from 'h3' import { createHandler, TideApiBase, logger } from '@dpc-sdp/ripple-tide-api' -import { - ApplicationError, - BadRequestError -} from '@dpc-sdp/ripple-tide-api/errors' +import { BadRequestError } from '@dpc-sdp/ripple-tide-api/errors' import type { RplTideModuleConfig, IRplTideModuleMapping, From fad884b0abfe3a3456f4a663d00c2584688f8023 Mon Sep 17 00:00:00 2001 From: Dylan Kelly Date: Fri, 6 Oct 2023 13:54:24 +1100 Subject: [PATCH 7/9] chore: :bookmark: release Ripple 2.3.4 --- CHANGELOG.md | 26 +++++++++++++++++++ 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-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 +- .../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-ui-core/package.json | 2 +- packages/ripple-ui-forms/package.json | 2 +- packages/stylelint-config-ripple/package.json | 2 +- 21 files changed, 46 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41bdb83f52..bb1390c71c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## v2.3.4 + +[compare changes](https://github.com/dpc-sdp/ripple-framework/compare/v2.3.3...v2.3.4) + + +### 🚀 Enhancements + + - **@dpc-sdp/ripple-tide-publication:** Added proper publication header mapping ([aa657deb](https://github.com/dpc-sdp/ripple-framework/commit/aa657deb)) + +### 🩹 Fixes + + - **nuxt-ripple:** 🐛 enable external redirects ([6c0e4894](https://github.com/dpc-sdp/ripple-framework/commit/6c0e4894)) + - **@dpc-sdp/nuxt-ripple:** Fixed console error when request event was being fetched client side ([b8f94314](https://github.com/dpc-sdp/ripple-framework/commit/b8f94314)) + - **@dpc-sdp/ripple-tide-publication:** Fixed duplication side nav links ([a08742e4](https://github.com/dpc-sdp/ripple-framework/commit/a08742e4)) + +### 🏡 Chore + + - **@dpc-sdp/ripple-tide-publication:** 🐛 [R20-1574] fix publication preview menu issue ([b737e32b](https://github.com/dpc-sdp/ripple-framework/commit/b737e32b)) + - **@dpc-sdp/ripple-tide-publication:** 🚨 fix unused var ([acd09f34](https://github.com/dpc-sdp/ripple-framework/commit/acd09f34)) + +### ❤️ Contributors + +- Dylan Kelly +- Jeffrey Dowdle +- Jason Smith + ## v2.3.3 [compare changes](https://github.com/dpc-sdp/ripple-framework/compare/v2.3.2...v2.3.3) diff --git a/lerna.json b/lerna.json index c74a140f12..e259574294 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.3.3", + "version": "2.3.4", "npmClient": "pnpm", "exact": true, "command": { diff --git a/packages/eslint-config-ripple/package.json b/packages/eslint-config-ripple/package.json index adde4c8b03..2e77ad37d9 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.3.3", + "version": "2.3.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 ab8f492bc3..bb8bbadbf0 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.3.3", + "version": "2.3.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 30c0200383..21ff606a53 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.3.3", + "version": "2.3.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 e64ad642be..5e5f333395 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.3.3", + "version": "2.3.4", "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 0d9926a615..1161e67897 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.3.3", + "version": "2.3.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 0304509225..907b50041b 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.3.3", + "version": "2.3.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 27634a3547..7cb1d18a87 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.3.3", + "version": "2.3.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 7c9d19ece2..21c0c88269 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.3.3", + "version": "2.3.4", "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 7c415ebfe4..fc3fd6a94d 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.3.3", + "version": "2.3.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 fe676929ac..7eecd4a692 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.3.3", + "version": "2.3.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 21f28eb5d9..e79bb35b53 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.3.3", + "version": "2.3.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 7961663036..91a5c4cfd9 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.3.3", + "version": "2.3.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 6b38d7b4a7..0ae121928d 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.3.3", + "version": "2.3.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 68c0a4d727..2a99adaa27 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.3.3", + "version": "2.3.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 58a83e3272..089d40c913 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.3.3", + "version": "2.3.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 022059bba5..6cf927d0db 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.3.3", + "version": "2.3.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 a53bf3f8f1..fb98d73d0f 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.3.3", + "version": "2.3.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 11aeff120c..c75a753326 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.3.3", + "version": "2.3.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 3c21d7c9b2..1ad86a9c29 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.3.3", + "version": "2.3.4", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "index.js", From e760940d275f74aa3da19664f3ce1979ed5d7713 Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Tue, 10 Oct 2023 11:46:38 +1100 Subject: [PATCH 8/9] fix(@dpc-sdp/ripple-tide-api): passed headers to route, page and publication menu endpoints fixes publication menu and children not display in previews --- packages/nuxt-ripple/server/api/tide/page.ts | 10 +++------- packages/nuxt-ripple/server/api/tide/site.ts | 12 +++++++----- .../ripple-tide-api/src/services/tide-page.ts | 8 ++++---- .../server/api/tide/publication-index.ts | 15 ++++++++++++--- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/packages/nuxt-ripple/server/api/tide/page.ts b/packages/nuxt-ripple/server/api/tide/page.ts index 9b96b784d1..746d454690 100644 --- a/packages/nuxt-ripple/server/api/tide/page.ts +++ b/packages/nuxt-ripple/server/api/tide/page.ts @@ -9,10 +9,7 @@ import { import { createHandler, TidePageApi } from '@dpc-sdp/ripple-tide-api' import { BadRequestError } from '@dpc-sdp/ripple-tide-api/errors' import { useNitroApp } from '#imports' -import { - isPreviewPath, - AuthCookieNames -} from '@dpc-sdp/nuxt-ripple-preview/utils' +import { AuthCookieNames } from '@dpc-sdp/nuxt-ripple-preview/utils' export const createPageHandler = async ( event: H3Event, @@ -32,8 +29,7 @@ export const createPageHandler = async ( const tokenCookie = getCookie(event, AuthCookieNames.ACCESS_TOKEN) const headers = {} - // Only add the access token to the headers if the path is a preview path - if (isPreviewPath(query.path)) { + if (tokenCookie) { headers['X-OAuth2-Authorization'] = `Bearer ${tokenCookie}` } @@ -45,7 +41,7 @@ export const createPageHandler = async ( ) // Need to pass on the section cache tags to the nuxt app - if (pageResponse.headers) { + if (pageResponse.headers && pageResponse.headers['section-cache-tags']) { setResponseHeader( event, 'section-cache-tags', diff --git a/packages/nuxt-ripple/server/api/tide/site.ts b/packages/nuxt-ripple/server/api/tide/site.ts index 4140319f99..23013fd6f3 100644 --- a/packages/nuxt-ripple/server/api/tide/site.ts +++ b/packages/nuxt-ripple/server/api/tide/site.ts @@ -18,11 +18,13 @@ export const createSiteHandler = async ( const siteResponse = await tideSiteApi.getSiteData(query.id) // Need to pass on the section cache tags to the nuxt app - setResponseHeader( - event, - 'section-cache-tags', - siteResponse.headers['section-cache-tags'] - ) + if (siteResponse.headers && siteResponse.headers['section-cache-tags']) { + setResponseHeader( + event, + 'section-cache-tags', + siteResponse.headers['section-cache-tags'] + ) + } return siteResponse.data }) diff --git a/packages/ripple-tide-api/src/services/tide-page.ts b/packages/ripple-tide-api/src/services/tide-page.ts index 2bd4b160ba..d750159cf0 100644 --- a/packages/ripple-tide-api/src/services/tide-page.ts +++ b/packages/ripple-tide-api/src/services/tide-page.ts @@ -84,12 +84,12 @@ export default class TidePageApi extends TideApiBase { } } - async getRouteByPath(path: string, site: string = this.site) { + async getRouteByPath(path: string, site: string = this.site, headers = {}) { this.path = path const routeUrl = `/route?site=${site}&path=${path}` - return this.get(routeUrl) + return this.get(routeUrl, { headers }) .then((response) => response?.data?.data?.attributes) .catch((error) => { throw new NotFoundError( @@ -117,7 +117,7 @@ export default class TidePageApi extends TideApiBase { return this.getPageFromPreviewLink(path, site, params, headers) } - const route = await this.getRouteByPath(path, site) + const route = await this.getRouteByPath(path, site, headers) if (route && !route.error) { if (route.hasOwnProperty('redirect_type')) { return { @@ -135,7 +135,7 @@ export default class TidePageApi extends TideApiBase { if (includes !== '') { fullParams['include'] = includes } - return this.getPageByRouteData(route, { params: fullParams }) + return this.getPageByRouteData(route, { params: fullParams, headers }) } } diff --git a/packages/ripple-tide-publication/server/api/tide/publication-index.ts b/packages/ripple-tide-publication/server/api/tide/publication-index.ts index 33683fe71a..2e59d3e61d 100644 --- a/packages/ripple-tide-publication/server/api/tide/publication-index.ts +++ b/packages/ripple-tide-publication/server/api/tide/publication-index.ts @@ -9,6 +9,7 @@ import type { } from '@dpc-sdp/ripple-tide-api/types' import type { indexNode, apiNode } from '../../../types' import { useRuntimeConfig } from '#imports' +import { AuthCookieNames } from '@dpc-sdp/nuxt-ripple-preview/utils' /** * @description Recursively transform API response to match component props @@ -51,12 +52,13 @@ class TidePublicationIndexApi extends TideApiBase { this.logLabel = 'TidePublicationIndex' } - async getPublicationMenu(id: string) { + async getPublicationMenu(id: string, headers = {}) { try { const { data: response } = await this.get( `/node/publication/${id}/hierarchy`, { - params: { site: this.siteId } + params: { site: this.siteId }, + headers } ) const resource = jsonapiParse.parse(response).data.meta.hierarchy @@ -83,7 +85,14 @@ export const createPublicationIndexHandler = async ( throw new BadRequestError('Publication ID is required') } - return await publicationIndexApi.getPublicationMenu(query.id) + const tokenCookie = getCookie(event, AuthCookieNames.ACCESS_TOKEN) + const headers = {} + + if (tokenCookie) { + headers['X-OAuth2-Authorization'] = `Bearer ${tokenCookie}` + } + + return await publicationIndexApi.getPublicationMenu(query.id, headers) }) } From 3f85fa4c8bd95dc61037e2fc42e1bd29fcd8e3d8 Mon Sep 17 00:00:00 2001 From: Jeffrey Dowdle Date: Wed, 11 Oct 2023 10:11:30 +1100 Subject: [PATCH 9/9] =?UTF-8?q?chore:=20=F0=9F=94=96=20hotfix=20update=20t?= =?UTF-8?q?o=20ripple=202.3.5?= 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-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-ui-core/package.json | 2 +- packages/ripple-ui-forms/package.json | 2 +- packages/stylelint-config-ripple/package.json | 2 +- 21 files changed, 33 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb1390c71c..e87e5ad3ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## v2.3.5 + +[compare changes](https://github.com/dpc-sdp/ripple-framework/compare/v2.3.4...v2.3.5) + + +### 🩹 Fixes + + - **@dpc-sdp/ripple-tide-api:** Passed headers to route, page and publication menu endpoints ([e760940d](https://github.com/dpc-sdp/ripple-framework/commit/e760940d)) + +### ❤️ Contributors + +- Jeffrey Dowdle + ## v2.3.4 [compare changes](https://github.com/dpc-sdp/ripple-framework/compare/v2.3.3...v2.3.4) diff --git a/lerna.json b/lerna.json index e259574294..e32dcbec16 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.3.4", + "version": "2.3.5", "npmClient": "pnpm", "exact": true, "command": { diff --git a/packages/eslint-config-ripple/package.json b/packages/eslint-config-ripple/package.json index 2e77ad37d9..d760a63774 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.3.4", + "version": "2.3.5", "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 bb8bbadbf0..dd820a8a8e 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.3.4", + "version": "2.3.5", "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 21ff606a53..95c2b2a2d6 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.3.4", + "version": "2.3.5", "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 5e5f333395..190a6c40e7 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.3.4", + "version": "2.3.5", "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 1161e67897..9056bf42cc 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.3.4", + "version": "2.3.5", "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 907b50041b..b1677267ef 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.3.4", + "version": "2.3.5", "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 7cb1d18a87..93bda56112 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.3.4", + "version": "2.3.5", "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 21c0c88269..3db7f1ecb4 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.3.4", + "version": "2.3.5", "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 fc3fd6a94d..39c567694c 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.3.4", + "version": "2.3.5", "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 7eecd4a692..4fd0b083a5 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.3.4", + "version": "2.3.5", "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 e79bb35b53..c7c1546bd8 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.3.4", + "version": "2.3.5", "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 91a5c4cfd9..8310bcef64 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.3.4", + "version": "2.3.5", "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 0ae121928d..fd2f6593a8 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.3.4", + "version": "2.3.5", "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 2a99adaa27..6485a26398 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.3.4", + "version": "2.3.5", "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 089d40c913..967c0e4cf9 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.3.4", + "version": "2.3.5", "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 6cf927d0db..dc5598cfcf 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.3.4", + "version": "2.3.5", "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 fb98d73d0f..f8a84feec1 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.3.4", + "version": "2.3.5", "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 c75a753326..a90a16b07b 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.3.4", + "version": "2.3.5", "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 1ad86a9c29..a72a7c3c2e 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.3.4", + "version": "2.3.5", "license": "Apache-2.0", "repository": "https://github.com/dpc-sdp/ripple-framework", "main": "index.js",