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.17.4 #1367

Closed
wants to merge 5 commits into from
Closed
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
44 changes: 41 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,50 @@ jobs:
CYPRESS_INSTALL_BINARY: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: pnpm install --frozen-lockfile
- name: Publish release

- name: Bump versions for proper release
if: ${{ !github.event.release.prerelease }}
run: npm run release:version ${{ github.event.release.name }} -- --yes

- name: Run release:changelog script for proper release
if: ${{ !github.event.release.prerelease }}
run: npm run release:changelog

- name: Configure Git
if: ${{ !github.event.release.prerelease }}
run: |
git config --global user.email "[email protected]"
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 }}"

- name: Push changes
if: ${{ !github.event.release.prerelease }}
run: |
git push origin ${{ github.event.release.target_commitish }} # Pushes back to target branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish draft release as alpha
if: ${{ github.event.release.prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm config set access public
pnpm release:publish-alpha --yes

- name: Publish proper release
if: ${{ !github.event.release.prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "SDP Deploy"
pnpm config set access public
pnpm run release:publish --yes
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v2.17.4

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

## v2.17.3

[compare changes](https://github.com/dpc-sdp/ripple-framework/compare/2.17.2...v2.17.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.17.3",
"version": "2.17.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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/eslint-config-ripple",
"description": "ESLint config for Ripple projects",
"version": "2.17.3",
"version": "2.17.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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/nuxt-ripple-analytics",
"description": "Nuxt module for handling event tracking.",
"version": "2.17.3",
"version": "2.17.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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/nuxt-ripple-cli",
"description": "A CLI for simplifying common setup and scaffolding tasks",
"version": "2.17.3",
"version": "2.17.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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/nuxt-ripple-preview",
"description": "Adds support for drupal preview links in Ripple frontend sites",
"version": "2.17.3",
"version": "2.17.4",
"license": "Apache-2.0",
"main": "./nuxt.config.ts",
"repository": "https://github.com/dpc-sdp/ripple-framework",
Expand Down
11 changes: 11 additions & 0 deletions packages/nuxt-ripple/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ declare module '@nuxt/schema' {
string,
(map: any, results: any, location: any, mapDeadSpace: any) => void
>
onLocationSelectOverrideFns: Record<
string,
// Return true if behaviour was overridden, or false to use the default behaviour
(
map: any,
popup: any,
location: any,
userGeolocation: any,
mapDeadSpace: any
) => boolean | void
>
}
customInputs?: {
[key: string]: {
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.17.3",
"version": "2.17.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-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.17.3",
"version": "2.17.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-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.17.3",
"version": "2.17.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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-test-utils",
"description": "Test utils for Ripple sites",
"version": "2.17.3",
"version": "2.17.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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-api",
"description": "Ripple API endpoints for Tide Drupal backend",
"version": "2.17.3",
"version": "2.17.4",
"license": "Apache-2.0",
"repository": "https://github.com/dpc-sdp/ripple-framework",
"main": "./dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ const markup = {
callout: `<div class="callout-wrapper"><p>Hey it's a callout</p></div><div class="callout-wrapper"><p>And another callout</p></div>
<div class="wysiwyg-callout">This one is wysiwyg</div>`,
quotation: `<blockquote class="quotation"><p>It was the best of times, it was the blurst of times.</p><footer><span>Chimp 273</span></footer></blockquote>`,
document: `<div class="embedded-entity--media--file" data-last-updated="1704932250"><a class="file file--mime-application-zip" href="https://develop.content.reference.sdp.vic.gov.au/sites/default/files/file.zip">File</a></div>`,
document: [
`<div class="embedded-entity--media--file" data-last-updated="1704932250"><a class="file file--mime-application-zip" href="https://develop.content.reference.sdp.vic.gov.au/sites/default/files/file.zip">File</a></div>`,
`<div data-show-last-updated="1" class="embedded-entity embedded-entity--media embedded-entity--media--secure-file" data-last-updated="1727162281"><article class="media media--type-secure-file media--view-mode-embedded"><div class="field field--name-field-secure-file field--type-file field--label-visually_hidden"><div class="field__label visually-hidden">File</div><div class="field__item"><span class="file file--mime-application-pdf file--application-pdf"><a href="https://content.vic.gov.au/system/files/secure/2024-09/file-sample_150kB.pdf" class="application-pdf" aria-label="Secure document File type: PDF. Size: 139.44 KB."><span class="file--title">Secure document</span><span class="file--type">PDF</span><span class="file--size">139.44 KB</span></a> <span class="file__size">(139.44 KB)</span></span></div></div></article></div>`
],
video: `<figure class="embedded-entity--media--embedded-video"><iframe src="https://www.youtube.com/embed/1234" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe><figcaption>Caption goes here</figcaption</figure>`,
image: `<div class="embedded-entity--media--image"><img src="https://develop.content.reference.sdp.vic.gov.au/sites/default/files/image.jpg" alt="Image" title="Image" width="100" height="100"></div>`,
button: `<a class="button" href="https://example.com">Button</a>`,
Expand All @@ -36,7 +39,8 @@ const fixed = {
<figcaption class="rpl-blockquote__author rpl-type-label-small"><span class="rpl-blockquote__author-name">Chimp 273</span></figcaption>
</figure>
`,
document: `
document: [
`
<figure class="rpl-document">
<a class="rpl-document__link rpl-u-focusable-within" aria-label="undefined" href="/sites/default/files/file.zip" target="_blank">
<span class="rpl-document__icon rpl-icon rpl-icon--size-l rpl-icon--colour-default rpl-icon--icon-document-lined">
Expand All @@ -53,6 +57,24 @@ const fixed = {
</a>
</figure>
`,
`
<figure class="rpl-document">
<a class="rpl-document__link rpl-u-focusable-within" aria-label="Secure document File type: PDF. Size: 139.44 KB." href="https://content.vic.gov.au/system/files/secure/2024-09/file-sample_150kB.pdf" target="_blank">
<span class="rpl-document__icon rpl-icon rpl-icon--size-l rpl-icon--colour-default rpl-icon--icon-document-lined">
<svg role="presentation"><use xlink:href="#icon-document-lined"></use></svg>
</span>
<div class="rpl-document__content">
<span class="rpl-document__name rpl-type-p rpl-type-weight-bold rpl-u-focusable-inline">Secure document</span>
<div class="rpl-document__info rpl-type-label-small">
<span class="rpl-file__meta">PDF</span>
<span class="rpl-file__meta">139.44 KB</span>
<div class="rpl-file__updated">Updated 24 Sept 2024</div></div>
</div>
<span class="rpl-u-visually-hidden">(opens in a new window)</span>
</a>
</figure>
`
],
video: `
<div class="rpl-media-embed">
<figure class="rpl-media-embed__figure">
Expand All @@ -78,7 +100,13 @@ const fixed = {
describe('ripple-tide-api/utils/markup-transpiler/cheerio', () => {
for (const [label, html] of Object.entries(markup)) {
it(`runs ${label} plugin on markup`, () => {
expect(markupTranspiler(html)).toEqual(fixed[label])
if (Array.isArray(html)) {
html.forEach((entry, i) => {
expect(markupTranspiler(entry)).toEqual(fixed[label][i])
})
} else {
expect(markupTranspiler(html)).toEqual(fixed[label])
}
})
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,15 @@ const pluginDocuments = function (this: any) {
})
}

const mediaIcon = $element.hasClass('embedded-entity--media--secure-file')
? 'file-secure'
: 'document-lined'

return $element.replaceWith(`
<figure class="rpl-document">
<a class="rpl-document__link rpl-u-focusable-within" aria-label="${label}" href="${link}" target="_blank">
<span class="rpl-document__icon rpl-icon rpl-icon--size-l rpl-icon--colour-default rpl-icon--icon-document-lined">
<svg role="presentation"><use xlink:href="#icon-document-lined"></use></svg>
<span class="rpl-document__icon rpl-icon rpl-icon--size-l rpl-icon--colour-default rpl-icon--icon-${mediaIcon}">
<svg role="presentation"><use xlink:href="#icon-${mediaIcon}"></use></svg>
</span>
<div class="rpl-document__content">
<span class="rpl-document__name rpl-type-p rpl-type-weight-bold rpl-u-focusable-inline">${title}</span>
Expand Down
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.17.3",
"version": "2.17.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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-grant",
"description": "Ripple mappings and components for Tide Grant Content type",
"version": "2.17.3",
"version": "2.17.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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-landing-page",
"description": "Ripple mappings and components for Tide landing-page Content type",
"version": "2.17.3",
"version": "2.17.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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-media",
"description": "Ripple mappings and components for Tide media",
"version": "2.17.3",
"version": "2.17.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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-news",
"description": "Ripple mappings and components for Tide News content type",
"version": "2.17.3",
"version": "2.17.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
@@ -1,7 +1,7 @@
{
"name": "@dpc-sdp/ripple-tide-publication",
"description": "Ripple mappings and components for Tide Publication Content type",
"version": "2.17.3",
"version": "2.17.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
Expand Up @@ -82,6 +82,7 @@ interface Props {
function: string
args: Record<string, any>
}
onLocationSelectOverrideFn?: string | null
}

const props = withDefaults(defineProps<Props>(), {
Expand All @@ -95,7 +96,8 @@ const props = withDefaults(defineProps<Props>(), {
tagsComponent: undefined,
mapResultsFnName: '',
isGettingLocation: false,
userGeolocation: null
userGeolocation: null,
onLocationSelectOverrideFn: null
})

const results = ref([])
Expand All @@ -104,7 +106,7 @@ const emit = defineEmits<{
(e: 'update', payload: addressResultType): void
}>()

const { rplMapRef, deadSpace, defaultExtent } = inject('rplMapInstance')
const { rplMapRef, popup, deadSpace, defaultExtent } = inject('rplMapInstance')

const pendingZoomAnimation = ref(false)

Expand Down Expand Up @@ -217,6 +219,42 @@ async function centerMapOnLocation(
location: addressResultType,
animate: boolean
) {
// There is the option of overriding the default zoom behavior by passing in an app config function
//
// In app.config.ts:
// {
// ripple: {
// search: {
// onLocationSelectOverrideFns: <function>
// }
// }
// }
//
if (props.onLocationSelectOverrideFn) {
const overrideFn = useAppConfigFunction(
props.onLocationSelectOverrideFn,
'onLocationSelectOverrideFns'
)

const didOverride = overrideFn(
map,
popup,
location,
props.userGeolocation,
deadSpace
)

// Sometimes you only want to override the behavior for a specific behavior, and it would be
// annoying to have to reimplement everything else. For this reason, the function can return a
// boolean indicating whether the behavior was overridden. If false, the default behavior will
// still run.
//
// If the function doesn't return anything (i.e. undefined), the default behavior won't run
if (didOverride || typeof didOverride === undefined) {
return
}
}

if (!props.controlMapZooming) {
return
}
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.17.3",
"version": "2.17.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
Expand Up @@ -57,6 +57,7 @@ const getLGASuggestions = async (query, args) => {
return {
id: itm._id,
name,
lgaOfficialName: itm._source.lga_official_name,
bbox: itm._source.lga_bbox,
tag
}
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.17.3",
"version": "2.17.4",
"dependencies": {
"@dpc-sdp/nuxt-ripple": "workspace:*",
"@dpc-sdp/ripple-tide-api": "workspace:*",
Expand Down
Loading