Skip to content

Commit

Permalink
Merge branch 'develop' into feature/R20-1709-data-table-additional-co…
Browse files Browse the repository at this point in the history
…ntent
  • Loading branch information
lambry authored Jan 25, 2024
2 parents e8f53e4 + 8e175b9 commit 2aa01e9
Show file tree
Hide file tree
Showing 32 changed files with 212 additions and 51 deletions.
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,52 @@
# Changelog

## v2.6.0...release/v2.6.1

[compare changes](https://github.com/dpc-sdp/ripple-framework/compare/v2.6.0...release/v2.6.1)


### 🚀 Enhancements

- **@dpc-sdp/ripple-tide-search:** Add checkbox support ([18734846b](https://github.com/dpc-sdp/ripple-framework/commit/18734846b))

### 🩹 Fixes

- **@dpc-sdp/ripple-tide-search:** Add lost class to dependent filter ([ec4ab5f4f](https://github.com/dpc-sdp/ripple-framework/commit/ec4ab5f4f))
- **@dpc-sdp/ripple-tide-api:** 🐛 regression in cheerio srcset ([c655dead3](https://github.com/dpc-sdp/ripple-framework/commit/c655dead3))
- **nuxt-ripple:** 🐛 filter incomplete related links ([5709351b2](https://github.com/dpc-sdp/ripple-framework/commit/5709351b2))
- **@dpc-sdp/ripple-tide-search:** Don't clear suggestions after selecting a suburb ([5240eaa78](https://github.com/dpc-sdp/ripple-framework/commit/5240eaa78))
- **@dpc-sdp/ripple-ui-maps:** Fixed icon not changing when exiting fullscreen map via keyboard ([3e79adc3a](https://github.com/dpc-sdp/ripple-framework/commit/3e79adc3a))
- **@dpc-sdp/ripple-tide-search:** Improved suburb autocomplete suggestions ([a60805757](https://github.com/dpc-sdp/ripple-framework/commit/a60805757))
- **@dpc-sdp/ripple-ui-core:** Fix svg sprite breaking in svgo 3.2.0 ([d8b78de5e](https://github.com/dpc-sdp/ripple-framework/commit/d8b78de5e))
- **@dpc-sdp/ripple-tide-search:** Fixed search logic firing after user navigated to a new page ([ab4eae4b0](https://github.com/dpc-sdp/ripple-framework/commit/ab4eae4b0))
- **@dpc-sdp/nuxt-ripple:** Wrap navigateTo to get redirects working again ([70a7f0caf](https://github.com/dpc-sdp/ripple-framework/commit/70a7f0caf))
- **@dpc-sdp/ripple-ui-core:** Return slug value ([5147533ae](https://github.com/dpc-sdp/ripple-framework/commit/5147533ae))

### 💅 Refactors

- **@dpc-sdp/nuxt-ripple-analytics:** ♻️ move release to datalayer root ([9178fabc2](https://github.com/dpc-sdp/ripple-framework/commit/9178fabc2))

### ✅ Tests

- **@dpc-sdp/ripple-tide-api:** ✅ increase unit test coverage ([e9561c08b](https://github.com/dpc-sdp/ripple-framework/commit/e9561c08b))
- **@dpc-sdp/ripple-tide-api:** ✅ add unit test ([bcc882fa0](https://github.com/dpc-sdp/ripple-framework/commit/bcc882fa0))
- **@dpc-sdp/ripple-tide-api:** ✅ add unit test ([3c770a7cb](https://github.com/dpc-sdp/ripple-framework/commit/3c770a7cb))
- **@dpc-sdp/ripple-tide-api:** ✅ increase unit test coverage ([3c4bb013b](https://github.com/dpc-sdp/ripple-framework/commit/3c4bb013b))
- ✅ fix landing page regression ([d5e40f422](https://github.com/dpc-sdp/ripple-framework/commit/d5e40f422))
- **nuxt-app:** ✅ fix test ([c072a2e0e](https://github.com/dpc-sdp/ripple-framework/commit/c072a2e0e))

### 🎨 Styles

- 🔊 rename for consistency ([d7f923f1e](https://github.com/dpc-sdp/ripple-framework/commit/d7f923f1e))
- 🔥 remove deprecated ([8e6adcc75](https://github.com/dpc-sdp/ripple-framework/commit/8e6adcc75))
- **@dpc-sdp/ripple-tide-api:** 🏷️ move function decl to types ([1fe5bd6f6](https://github.com/dpc-sdp/ripple-framework/commit/1fe5bd6f6))

### ❤️ Contributors

- David Featherston <[email protected]>
- Jeffrey Dowdle <[email protected]>
- Jason Smith <[email protected]>

## v2.6.0

[compare changes](https://github.com/dpc-sdp/ripple-framework/compare/v2.5.3...v2.6.0)
Expand Down
53 changes: 34 additions & 19 deletions examples/nuxt-app/test/features/search-listing/filters.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ Feature: Search listing - Filter
And the search network request is stubbed with fixture "/search-listing/filters/response" and status 200
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT"

When I visit the page "/filters?termFilter=Green&singleTermFilter=Aqua"
When I visit the page "/filters?termFilter=Green&singleTermFilter=Aqua&checkboxFilter=Archived"
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/filters/request-term-single" fixture

Then the filters toggle should show 2 applied filters
Then the filters toggle should show 3 applied filters

When I toggle the search listing filters section
Then the search listing dropdown field labelled "Term filter example" should have the value "Green"
Then the search listing dropdown field labelled "Single term filter example" should have the value "Aqua"
And the search listing dropdown field labelled "Single term filter example" should have the value "Aqua"
And the search listing checkbox field labelled "Show archived content" should be checked

@mockserver
Example: Term filter - Should reflect an array from the URL
Expand Down Expand Up @@ -113,27 +114,29 @@ Feature: Search listing - Filter
And the search network request is stubbed with fixture "/search-listing/filters/response" and status 200
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT"

When I visit the page "/filters?q=test123&page=2&functionFilter=open&termsFilter=Purple&termFilter=Green&rawFilter=Birds"
When I visit the page "/filters?q=test123&page=2&functionFilter=open&termsFilter=Purple&termFilter=Green&rawFilter=Birds&checkboxFilter=Archived"
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/filters/request-clear-filled" fixture

Then the filters toggle should show 4 applied filters
Then the filters toggle should show 5 applied filters
Then the URL should reflect that the current page number is 2
Then the URL should reflect that the current search term is "test123"

When I toggle the search listing filters section
Then the search input should have the value "test123"
Then the URL should reflect that the current active filters are as follows:
| id | value |
| rawFilter | Birds |
| termFilter | Green |
| termsFilter | Purple |
| functionFilter | open |
| id | value |
| rawFilter | Birds |
| termFilter | Green |
| termsFilter | Purple |
| functionFilter | open |
| checkboxFilter | Archived |

Then the search listing dropdown field labelled "Raw filter example" should have the value "Birds"
Then the search listing dropdown field labelled "Term filter example" should have the value "Green"
Then the search listing dropdown field labelled "Terms filter example" should have the value "Purple"
Then the search listing dropdown field labelled "Custom function filter example" should have the value "Open"
And the search listing checkbox field labelled "Show archived content" should be checked

When I clear the search filters

Expand All @@ -146,36 +149,48 @@ Feature: Search listing - Filter
| termFilter |
| termsFilter |
| functionFilter |
| checkboxFilter |

Then the search input should have the value ""
Then the search listing dropdown field labelled "Raw filter example" should have the value "Select a pet"
Then the search listing dropdown field labelled "Term filter example" should have the value "Select a colour"
Then the search listing dropdown field labelled "Terms filter example" should have the value "Select a colour"
Then the search listing dropdown field labelled "Custom function filter example" should have the value "Select a status"
And the search listing checkbox field labelled "Show archived content" should not be checked

@mockserver
Example: Should update the URL when the filters are applied
Given the page endpoint for path "/filters" returns fixture "/search-listing/filters/page" with status 200
And the search network request is stubbed with fixture "/search-listing/filters/response" and status 200
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT"

When I visit the page "/filters?termsFilter=Purple&termsFilter=Orange"
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/filters/request-terms-array" fixture
And the search listing results should have following items:
| title |
| Apples |
| Oranges |

When I type "the" into the search input
Then I toggle the search listing filters section
And I click the search listing dropdown field labelled "Term filter example"
Then I click the option labelled "Blue" in the selected dropdown
And I click the search listing dropdown field labelled "Term filter example"

When I toggle the search listing filters section
Then the search listing dropdown field labelled "Terms filter example" should have the value "Orange, Purple"
When I click the search listing dropdown field labelled "Terms filter example"
Then the selected dropdown field should have the items:
| Orange |
| Purple |
| Yellow |
# Close the dropdown
When I click the search listing dropdown field labelled "Terms filter example"
And the search listing results should have following items:
| title |
| Apples |
| Oranges |
Then I click the option labelled "Purple" in the selected dropdown
And I click the search listing checkbox field labelled "Show archived content"
And I submit the search filters
Then the URL should reflect that the current active filters are as follows:
| id | value |
| q | the |
| termFilter | Blue |
| termsFilter | Orange |
| checkboxFilter | Archived |

@mockserver
Example: Dependent filter - Should reflect the value from the URL
Expand Down
15 changes: 15 additions & 0 deletions examples/nuxt-app/test/fixtures/search-listing/filters/page.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,21 @@
}
]
}
},
{
"id": "checkboxFilter",
"component": "TideSearchFilterCheckbox",
"filter": {
"type": "terms",
"value": "checkboxFilter.keyword",
"multiple": false
},
"props": {
"id": "checkboxFilter",
"label": "Checkbox example",
"checkboxLabel": "Show archived content",
"onValue": "Archived"
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
"ids": {
"values": ["Birds"]
}
},
{
"terms": {
"checkboxFilter.keyword": ["Archived"]
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
"terms": {
"singleTermFilter.keyword": ["Aqua"]
}
},
{
"terms": {
"checkboxFilter.keyword": ["Archived"]
}
}
]
}
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.6.0",
"version": "2.6.1",
"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.6.0",
"version": "2.6.1",
"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.6.0",
"version": "2.6.1",
"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.6.0",
"version": "2.6.1",
"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.6.0",
"version": "2.6.1",
"license": "Apache-2.0",
"main": "./nuxt.config.ts",
"repository": "https://github.com/dpc-sdp/ripple-framework",
Expand Down
23 changes: 13 additions & 10 deletions packages/nuxt-ripple/composables/use-tide-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const isCacheTimeExpired = (date: number, expiryInMinutes = 5) => {
return date < timePlusExpiry
}

const checkForRedirect = async (page: TidePageBase, debugLogger) => {
const checkForRedirect = async (page: TidePageBase, debugLogger, nuxt) => {
// Redirect on the 6 codes that Drupal supplies
if (page?.type === 'redirect') {
switch (page.status_code) {
Expand All @@ -31,11 +31,13 @@ const checkForRedirect = async (page: TidePageBase, debugLogger) => {
pageStatusCode: page?.status_code
})

await navigateTo(page.redirect_url, {
replace: true,
redirectCode: page.status_code,
external: page.redirect_type === 'external'
})
await nuxt.runWithContext(() =>
navigateTo(page.redirect_url, {
replace: true,
redirectCode: page.status_code,
external: page.redirect_type === 'external'
})
)
break
default:
}
Expand Down Expand Up @@ -80,7 +82,9 @@ export const useTidePage = async (
)

if (Object.keys(nuxt.payload.data).length > maxCacheItems + 1) {
debugLogger(`Cache is larger than max ${maxCacheItems} items, clearing...`)
debugLogger(
`Cache is larger than max ${maxCacheItems} items, clearing...`
)
clearNuxtData()
}
}
Expand All @@ -90,7 +94,6 @@ export const useTidePage = async (
// Refresh data so it doesnt go stale whilst client side nav
if (pageData.value && pageData.value._fetched) {
if (isCacheTimeExpired(pageData.value._fetched)) {

debugLogger(
'Cached data for this page is stale, clearing nuxt cache just for this page...',
{
Expand Down Expand Up @@ -156,7 +159,7 @@ export const useTidePage = async (
pageNodeId: data.value.nid
})

await checkForRedirect(data.value, debugLogger)
await checkForRedirect(data.value, debugLogger, nuxt)

return data.value
}
Expand All @@ -166,7 +169,7 @@ export const useTidePage = async (
pageNodeId: pageData.value.nid
})

await checkForRedirect(pageData.value, debugLogger)
await checkForRedirect(pageData.value, debugLogger, nuxt)

return pageData.value
}
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.6.0",
"version": "2.6.1",
"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.6.0",
"version": "2.6.1",
"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.6.0",
"version": "2.6.1",
"license": "Apache-2.0",
"type": "module",
"main": "./dist/config/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,39 @@ Then(
}
)

Then(
`the search listing checkbox field labelled {string} should be checked`,
(label: string) => {
cy.get(`label`)
.contains(label)
.parent('label')
.invoke('attr', 'for')
.then((checkboxId) => {
cy.get(`#${checkboxId}`).should('be.checked')
})
}
)

Then(
`the search listing checkbox field labelled {string} should not be checked`,
(label: string) => {
cy.get(`label`)
.contains(label)
.parent('label')
.invoke('attr', 'for')
.then((checkboxId) => {
cy.get(`#${checkboxId}`).should('not.be.checked')
})
}
)

When(
`I click the search listing checkbox field labelled {string}`,
(label: string) => {
cy.get(`label`).contains(label).click()
}
)

When(
`I click the search listing dropdown field labelled {string}`,
(label: string) => {
Expand All @@ -188,6 +221,10 @@ When(`I clear the search filters`, () => {
cy.get(`button`).contains('Clear search filters').click()
})

When(`I submit the search filters`, () => {
cy.get(`button`).contains('Apply search filters').click()
})

Then(
'the filters toggle should show {int} applied filters',
(filterCount: number) => {
Expand Down
Loading

0 comments on commit 2aa01e9

Please sign in to comment.