Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v2.3.5 #892

Merged
merged 15 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
# 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 <jeffrey.dowdle@dpc.vic.gov.au>

## 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 <dylan.kelly@dpc.vic.gov.au>
- Jeffrey Dowdle <jeffrey.dowdle@dpc.vic.gov.au>
- Jason Smith <jason.smith@dpc.vic.gov.au>

## v2.3.3

[compare changes](https://github.com/dpc-sdp/ripple-framework/compare/v2.3.2...v2.3.3)
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.3.3",
"version": "2.3.5",
"npmClient": "pnpm",
"exact": true,
"command": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-ripple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
"license": "Apache-2.0",
"repository": "https://github.com/dpc-sdp/ripple-framework",
"main": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt-ripple-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
"license": "Apache-2.0",
"main": "./nuxt.config.ts",
"repository": "https://github.com/dpc-sdp/ripple-framework",
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt-ripple-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
"license": "Apache-2.0",
"repository": "https://github.com/dpc-sdp/ripple-framework",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt-ripple-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
"license": "Apache-2.0",
"main": "./nuxt.config.ts",
"repository": "https://github.com/dpc-sdp/ripple-framework",
Expand Down
4 changes: 3 additions & 1 deletion packages/nuxt-ripple/composables/use-merge-section-tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ const mergeTags = (existingTags: string, newTags: string): string => {
export const useMergeSectionTags = async (
sectionCacheTags: any
): Promise<void> => {
// 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 =
Expand Down
3 changes: 2 additions & 1 deletion packages/nuxt-ripple/composables/use-tide-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt-ripple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
"license": "Apache-2.0",
"main": "./nuxt.config.ts",
"repository": "https://github.com/dpc-sdp/ripple-framework",
Expand Down
10 changes: 3 additions & 7 deletions packages/nuxt-ripple/server/api/tide/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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}`
}

Expand All @@ -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',
Expand Down
12 changes: 7 additions & 5 deletions packages/nuxt-ripple/server/api/tide/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packageManager": "pnpm@8.6.2",
"name": "ripple-storybook",
"description": "Ripple Storybook instance",
"version": "2.3.3",
"version": "2.3.5",
"license": "Apache-2.0",
"private": true,
"repository": "https://github.com/dpc-sdp/ripple-framework",
Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
"license": "Apache-2.0",
"type": "module",
"main": "./dist/config/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-tide-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
"license": "Apache-2.0",
"repository": "https://github.com/dpc-sdp/ripple-framework",
"main": "./dist/index.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/ripple-tide-api/src/services/tide-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 {
Expand All @@ -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 })
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-tide-event/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
"license": "Apache-2.0",
"main": "./nuxt.config.ts",
"repository": "https://github.com/dpc-sdp/ripple-framework",
Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-tide-grant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
"license": "Apache-2.0",
"repository": "https://github.com/dpc-sdp/ripple-framework",
"main": "./nuxt.config.ts",
Expand Down
6 changes: 5 additions & 1 deletion packages/ripple-tide-landing-page/mapping/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,8 @@ const tideLandingPageModule: IRplTideModuleMapping = {

export default tideLandingPageModule

export { secondaryCampaignIncludes, secondaryCampaignMapping }
export {
secondaryCampaignIncludes,
secondaryCampaignMapping,
heroHeaderMapping
}
2 changes: 1 addition & 1 deletion packages/ripple-tide-landing-page/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
"license": "Apache-2.0",
"repository": "https://github.com/dpc-sdp/ripple-framework",
"main": "./nuxt.config.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-tide-media/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
"license": "Apache-2.0",
"repository": "https://github.com/dpc-sdp/ripple-framework",
"main": "./nuxt.config.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-tide-news/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
"license": "Apache-2.0",
"repository": "https://github.com/dpc-sdp/ripple-framework",
"main": "./nuxt.config.ts",
Expand Down
10 changes: 5 additions & 5 deletions packages/ripple-tide-publication/mapping/publication-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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: '/' },
{
Expand Down Expand Up @@ -90,7 +88,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'
]
}

Expand Down
7 changes: 3 additions & 4 deletions packages/ripple-tide-publication/mapping/publication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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) => {
Expand Down Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-tide-publication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.5",
"license": "Apache-2.0",
"repository": "https://github.com/dpc-sdp/ripple-framework",
"main": "./nuxt.config.ts",
Expand Down
Loading