Skip to content

Commit

Permalink
Merge branch 'release/2.20.0' into bugfix/content-collection-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dylankelly authored Oct 29, 2024
2 parents a944778 + aa7f7c8 commit 80eaa67
Show file tree
Hide file tree
Showing 32 changed files with 86 additions and 40 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,19 @@ jobs:
run: |
git config --global user.email "sdp.devs@dpc.vic.gov.au"
git config --global user.name "SDP Deploy"
git fetch origin ${{ github.event.release.target_commitish }}
git checkout ${{ github.event.release.target_commitish }}
- name: Commit changes
if: ${{ !github.event.release.prerelease }}
run: |
git add .
git commit -m "chore: release ${{ !github.event.release.name }}"
git commit -m "chore: release ${{ github.event.release.name }}"
- name: Push changes
if: ${{ !github.event.release.prerelease }}
run: |
git push origin ${{ github.ref }} # Pushes back to the same branch
git push origin ${{ github.event.release.target_commitish }} # Pushes back to target branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v2.19.0

[compare changes](https://github.com/dpc-sdp/ripple-framework/compare/2.19.0...v2.19.0)

## v2.18.0

[compare changes](https://github.com/dpc-sdp/ripple-framework/compare/2.17.2...v2.18.0)
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.18.0",
"version": "2.19.0",
"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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/eslint-config-ripple",
"description": "ESLint config for Ripple projects",
"version": "2.18.0",
"version": "2.19.0",
"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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/nuxt-ripple-analytics",
"description": "Nuxt module for handling event tracking.",
"version": "2.18.0",
"version": "2.19.0",
"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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/nuxt-ripple-cli",
"description": "A CLI for simplifying common setup and scaffolding tasks",
"version": "2.18.0",
"version": "2.19.0",
"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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/nuxt-ripple-preview",
"description": "Adds support for drupal preview links in Ripple frontend sites",
"version": "2.18.0",
"version": "2.19.0",
"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/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/nuxt-ripple",
"description": "Nuxt module for integrating Ripple and Tide",
"version": "2.18.0",
"version": "2.19.0",
"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-sdp-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-sdp-core",
"description": "SDP core content types",
"version": "2.18.0",
"version": "2.19.0",
"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-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ripple-storybook",
"description": "Ripple Storybook instance",
"version": "2.18.0",
"version": "2.19.0",
"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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-test-utils",
"description": "Test utils for Ripple sites",
"version": "2.18.0",
"version": "2.19.0",
"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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-api",
"description": "Ripple API endpoints for Tide Drupal backend",
"version": "2.18.0",
"version": "2.19.0",
"license": "Apache-2.0",
"repository": "https://github.com/dpc-sdp/ripple-framework",
"main": "./dist/index.js",
Expand Down
9 changes: 9 additions & 0 deletions packages/ripple-tide-api/src/utils/mapping-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
getSiteSection,
humanizeFilesize,
getPlainText,
getPlainTextFromField,
getBoolFromString
} from './mapping-utils.js'

Expand Down Expand Up @@ -231,6 +232,14 @@ describe('ripple-tide-api/mapping utils', () => {
)
})

it(`returns the plain text value of a field`, () => {
expect(
getPlainTextFromField(field, 'field_acknowledgement_to_country')
).toEqual(
'We acknowledge Aboriginal and Torres Strait Islander people as the First People and traditional owners and custodians of the lands, seas and waters of Australia. We pay our respect to Elders past and present.'
)
})

it(`returns a boolean value from supplied string`, () => {
expect(getBoolFromString('yes')).toEqual(true)
expect(getBoolFromString('no')).toEqual(false)
Expand Down
14 changes: 14 additions & 0 deletions packages/ripple-tide-api/src/utils/mapping-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,19 @@ export const getPlainText = (content: string): string => {
return content?.replace(/(\r\n|\n|\r)/g, '')?.trim()
}

/**
* @description gets the fields value as plain text
*/
export const getPlainTextFromField = (
field: {},
path: string | string[],
fallback = ''
) => {
const content = get(field, path, fallback)

return content ? getPlainText(content) : content
}

/**
* @description converts supplied string value i.e. 'yes', 'no' into true or false
*/
Expand All @@ -274,5 +287,6 @@ export default {
getSiteKeyValues,
getSiteSection,
getPlainText,
getPlainTextFromField,
getBoolFromString
}
12 changes: 12 additions & 0 deletions packages/ripple-tide-api/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,3 +344,15 @@ export function getLinkFromField(field: any, path: string | string[]): any
export function humanizeFilesize(fileSize: number): string
export function getSiteKeyValues(key: string, src: any): any
export function getSiteSection(sectionId: string, src: any): any
export function getMediaPath(field: any, path?: string | string[]): string
export function getDocumentFromField(
field: Record<string, any>,
path: string
): TideDocumentField
export function getPlainText(content: string): string
export function getPlainTextFromField(
field: string,
path: string | string[],
fallback?: any
): any
export function getBoolFromString(text: string): boolean | null
2 changes: 1 addition & 1 deletion packages/ripple-tide-event/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-event",
"description": "Ripple mappings and components for Tide Event Content type",
"version": "2.18.0",
"version": "2.19.0",
"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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-grant",
"description": "Ripple mappings and components for Tide Grant Content type",
"version": "2.18.0",
"version": "2.19.0",
"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,4 +1,8 @@
import { getField, getImageFromField } from '@dpc-sdp/ripple-tide-api'
import {
getField,
getImageFromField,
getPlainTextFromField
} from '@dpc-sdp/ripple-tide-api'
import { ITideCardCarouselItem } from './card-carousel-mapping'

export const baseIncludes = [
Expand All @@ -13,5 +17,5 @@ export const baseMapping = (field): ITideCardCarouselItem => ({
meta: {
topic: getField(field, 'field_topic.name', null)
},
summary: getField(field, 'field_landing_page_summary', '')
summary: getPlainTextFromField(field, 'field_landing_page_summary', '')
})
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {
getField,
getImageFromField,
getLinkFromField
getLinkFromField,
getPlainTextFromField
} from '@dpc-sdp/ripple-tide-api'

const getCardImage = (card) => {
Expand Down Expand Up @@ -30,7 +31,7 @@ export const mapping = (field) => {
dateStart: getField(field, 'field_paragraph_date_range.value', null),
dateEnd: getField(field, 'field_paragraph_date_range.end_value', null)
},
summary: getField(field, 'field_paragraph_summary', '')
summary: getPlainTextFromField(field, 'field_paragraph_summary', '')
}
break
case 'paragraph--card_event_auto':
Expand All @@ -52,7 +53,7 @@ export const mapping = (field) => {
null
)
},
summary: getField(
summary: getPlainTextFromField(
field,
'field_paragraph_reference.field_landing_page_summary',
''
Expand All @@ -67,7 +68,7 @@ export const mapping = (field) => {
keyDates: field.field_paragraph_keydates.map((date) => ({
title: getField(date, 'field_paragraph_keydate', ''),
subtitle: getField(date, 'field_paragraph_title', ''),
content: getField(date, 'field_paragraph_summary', '')
content: getPlainTextFromField(date, 'field_paragraph_summary', '')
}))
}
break
Expand All @@ -84,7 +85,7 @@ export const mapping = (field) => {
topic: getField(field, 'field_paragraph_topic.[0].name', null),
date: getField(field, 'field_paragraph_date', null)
},
summary: getField(field, 'field_paragraph_summary', '')
summary: getPlainTextFromField(field, 'field_paragraph_summary', '')
}
break
case 'paragraph--card_promotion_auto': {
Expand All @@ -110,7 +111,7 @@ export const mapping = (field) => {
? getField(field, 'field_paragraph_reference.created', null)
: null
},
summary: getField(
summary: getPlainTextFromField(
field,
'field_paragraph_reference.field_landing_page_summary',
''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const rawDataCustom = {
},
field_paragraph_location: null,
field_paragraph_summary:
'Adipisicing sint consectetur consequat excepteur exercitation et laboris cillum.',
'Adipisicing sint consectetur\r\n consequat excepteur exercitation et laboris cillum.',
field_paragraph_title: 'Test event',
field_paragraph_media: {
links: {
Expand Down Expand Up @@ -720,7 +720,7 @@ export const rawDataCustom = {
},
field_landing_page_show_contact: true,
field_landing_page_summary:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus.',
'Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\n Aliquam tincidunt sit amet ligula sit amet lacinia. In a leo nec tortor aliquet faucibus.',
field_news_intro_text:
'Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae',
field_node_author: 'Nulla ultricies',
Expand Down Expand Up @@ -1617,7 +1617,7 @@ export const rawDataCustom = {
revision_translation_affected: null,
field_paragraph_keydate: 'June 13th, 2023 and beyond',
field_paragraph_link: null,
field_paragraph_summary: 'Key Dates Card Summary',
field_paragraph_summary: 'Key Dates Card Summary\r\n',
field_paragraph_title: 'Key Dates Card',
id: '7865b901-e85b-47f0-adbc-1690ece4559c',
type: 'paragraph--keydates'
Expand Down Expand Up @@ -1691,7 +1691,7 @@ export const rawDataCustom = {
url: '/sdpta-promotion-card-landing-page-fixture',
origin_url: '/sdpta-promotion-card-landing-page-fixture'
},
field_paragraph_summary: 'Promotion Card summary',
field_paragraph_summary: 'Promotion Card summary\r\n',
field_paragraph_title: 'Promotion Card',
field_paragraph_media: {
links: {
Expand Down Expand Up @@ -3038,7 +3038,7 @@ export const rawDataNews = [
field_landing_page_nav_title: null,
field_landing_page_show_contact: false,
field_landing_page_summary:
'NP1 Etiam scelerisque lorem sit amet sapien iaculis, nec dignissim augue cursus. Mauris eu purus a neque tristique venenatis sit amet sed sem. Aenean viverra lectus ut tempus sollicitudin.',
'NP1 Etiam scelerisque lorem sit amet sapien iaculis,\r\n nec dignissim augue cursus. Mauris eu purus a neque tristique venenatis sit amet sed sem. Aenean viverra lectus ut tempus sollicitudin.',
field_metatags: null,
field_news_date: '2050-07-02T10:00:00+11:00',
field_news_intro_text:
Expand Down Expand Up @@ -5270,7 +5270,7 @@ export const rawDataEvent = [
},
field_landing_page_show_contact: true,
field_landing_page_summary:
'Tell me, O muse, of that ingenious hero who travelled far and wide after he had sacked the famous town of Troy. Many cities did he visit, and many were the nations with whose manners and customs END',
'Tell me, O muse\r\n, of that ingenious hero who travelled far and wide after he had sacked the famous town of Troy. Many cities did he visit, and many were the nations with whose manners and customs END',
field_news_intro_text:
'Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae',
field_node_author: 'Full Name',
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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-landing-page",
"description": "Ripple mappings and components for Tide landing-page Content type",
"version": "2.18.0",
"version": "2.19.0",
"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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-media",
"description": "Ripple mappings and components for Tide media",
"version": "2.18.0",
"version": "2.19.0",
"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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-news",
"description": "Ripple mappings and components for Tide News content type",
"version": "2.18.0",
"version": "2.19.0",
"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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-publication",
"description": "Ripple mappings and components for Tide Publication Content type",
"version": "2.18.0",
"version": "2.19.0",
"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
Expand Up @@ -443,7 +443,7 @@ watch(
<TideSearchFilters
:title="title"
:filter-form-values="filterForm"
:filterInputs="userFilters as any"
:filterInputs="uiFilters as any"
@reset="handleFilterReset"
@submit="handleFilterSubmit"
>
Expand Down
2 changes: 1 addition & 1 deletion packages/ripple-tide-search/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-search",
"description": "Ripple search UI and services for connecting to Tide search",
"version": "2.18.0",
"version": "2.19.0",
"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.18.0",
"version": "2.19.0",
"dependencies": {
"@dpc-sdp/nuxt-ripple": "workspace:*",
"@dpc-sdp/ripple-tide-api": "workspace:*",
Expand Down
Loading

0 comments on commit 80eaa67

Please sign in to comment.