Skip to content

Commit

Permalink
Merge branch 'develop' into feature/data-driven-map
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdowdle committed Oct 30, 2023
2 parents 0cd9355 + c998784 commit 8a99d56
Show file tree
Hide file tree
Showing 25 changed files with 44 additions and 32 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>

## v2.4.3

[compare changes](https://github.com/dpc-sdp/ripple-framework/compare/v2.4.2...v2.4.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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.4",
"license": "Apache-2.0",
"main": "./nuxt.config.ts",
"repository": "https://github.com/dpc-sdp/ripple-framework",
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt-ripple/mapping/base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.4",
"license": "Apache-2.0",
"repository": "https://github.com/dpc-sdp/ripple-framework",
"main": "./dist/index.js",
Expand Down
3 changes: 2 additions & 1 deletion packages/ripple-tide-api/src/services/lib/default-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
}
14 changes: 6 additions & 8 deletions packages/ripple-tide-api/src/services/tide-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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
Expand All @@ -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 }
)
}

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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.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-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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.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-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.4.3",
"version": "2.4.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-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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.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.4.3",
"version": "2.4.4",
"license": "Apache-2.0",
"repository": "https://github.com/dpc-sdp/ripple-framework",
"main": "index.js",
Expand Down

0 comments on commit 8a99d56

Please sign in to comment.