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/2.3.4 #887

Merged
12 commits merged 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
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
- Jeffrey Dowdle <[email protected]>
- Jason Smith <[email protected]>

## 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.4",
"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": "[email protected]",
"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",
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": "[email protected]",
"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",
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": "[email protected]",
"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",
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": "[email protected]",
"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",
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": "[email protected]",
"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",
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": "[email protected]",
"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",
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": "[email protected]",
"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",
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": "[email protected]",
"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",
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": "[email protected]",
"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",
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": "[email protected]",
"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",
Expand Down
6 changes: 6 additions & 0 deletions packages/ripple-tide-landing-page/mapping/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,9 @@ const tideLandingPageModule: IRplTideModuleMapping = {
}

export default tideLandingPageModule

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": "[email protected]",
"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",
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": "[email protected]",
"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",
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": "[email protected]",
"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",
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 @@ -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'
]
}

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": "[email protected]",
"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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -69,10 +66,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)
}
}
}
Expand Down
52 changes: 21 additions & 31 deletions packages/ripple-tide-publication/utils/processMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
2 changes: 1 addition & 1 deletion packages/ripple-tide-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packageManager": "[email protected]",
"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",
Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-tide-topic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-ui-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packageManager": "[email protected]",
"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": [
Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-ui-forms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packageManager": "[email protected]",
"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",
Expand Down
2 changes: 1 addition & 1 deletion packages/stylelint-config-ripple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packageManager": "[email protected]",
"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",
Expand Down
Loading