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

[SD-527] add page detail to search, sitemap and print all pages #1402

Merged
merged 1 commit into from
Dec 9, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ Feature: Publication page
Example: Publication print all
Given the endpoint "/api/tide/publication-children" with query "?ids=4a6d9877-326a-4090-8f7d-51c79191c63b&ids=7f608818-51e5-4c42-831a-a51d46a41ff6&ids=3479556d-7daa-4bc4-985a-d0ec1d954713&ids=a805aea1-6b50-4327-b176-ff4468775ad6&ids=c17daa15-9ad8-412d-a049-aa1ef6c668c2&ids=f85fab41-8217-44c4-bb0d-29ab5bc2832c&ids=c83e001c-2429-4c87-a53c-62a96ee426c6&ids=d51a4112-fd63-42cb-91a6-c17057c25242&ids=095e703d-e8cc-4153-9cf4-13e8a4f095c9&ids=ad3fd4c8-60dc-4c0d-a55c-5137766a2056&ids=64d7c641-640d-46e9-9967-7ad49104d744&ids=463ebde6-f906-427e-adaa-e2c7dba9f875&ids=3218f7fa-e189-44a2-8fdb-fc750409c421&ids=c0bf3b7f-1819-4cdb-99e8-4fd50071adac&ids=bf8208e7-bbc7-40cf-b3c0-111e6caabd91&ids=e0ce9cb4-df4f-4ae9-84e6-b1589486cdc8&ids=03b2d101-d6d8-4e55-a3e4-cad2d08f625b&ids=181e7b7e-ad44-4451-843a-044d760aa18e&ids=9c4656a6-3294-4515-8a7e-e15cd32841b6&ids=fadb534c-9598-40d0-a211-ca4b8a7c140a&ids=556bcf1a-46d6-4565-87e5-79e1b4b31cc5&ids=133ddcfa-b7f7-431c-bc85-f59ba8f44eac&ids=ff6440cc-7605-4ff1-b8a1-f25a5797549f&ids=f197320e-e9e3-46c8-b402-43ddd409599a&ids=e6cdf8c8-c19a-419b-9bb1-22a0938bba58&ids=cf1bfe5d-929e-44e2-a542-18d8b9fcd234&ids=16ef10ae-d3e4-4217-9508-eb4981336a3e" returns fixture "/publication/sample-print-all" with status 200
When I visit the print all page "/victorian-skills-plan-2023-implementation-update/print-all"
Then the in page navigation should include
Then the dataLayer should include the following events
| event | page_title |
| routeChange | Print - Victorian Skills Plan Implementation Update |
And the in page navigation should include
| title | url |
| The Victorian Skills Plan 2022 into 2023 actions and initiatives | /victorian-skills-plan-2023-implementation-update/2022-victorian-skills-plan-actions-and-initiatives |
| Promoting post-secondary education skills and career pathways | /victorian-skills-plan-2023-implementation-update/promoting-post-secondary-education-skills-and-career |
Expand Down
3 changes: 3 additions & 0 deletions examples/nuxt-app/test/features/site/search.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Feature: Site search
Given the "/api/tide/search/**" network request is delayed by 500 milliseconds and stubbed with fixture "/site/search-response", status 200 and alias "siteSearchReq"
When I visit the page "/search?q=demo"
Then the search listing skeleton should display 10 items with the class "tide-search-result-skeleton"
And the dataLayer should include the following events
| event | page_title | search_term |
| routeChange | Search | demo |

When I wait 500 milliseconds
Then the search listing page should have 5 results
Expand Down
3 changes: 3 additions & 0 deletions examples/nuxt-app/test/features/sitemap/sitemap.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ Feature: Sitemap
| Level 4 - Item 2 |
| Level 2 - Item 2 |
| Level 1 - Item 2 |
And the dataLayer should include the following events
| event | page_title |
| routeChange | Sitemap |
5 changes: 3 additions & 2 deletions packages/nuxt-ripple/pages/sitemap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default {
import { useTideSite } from '#imports'

const site = await useTideSite()
const page = { title: 'Sitemap' }

const toc = computed(() => {
return site.menus.menuMain.map((item) => {
Expand All @@ -22,8 +23,8 @@ const toc = computed(() => {
<template>
<TideBaseLayout
:site="site"
:page="{}"
:pageTitle="`Sitemap - ${site.name}`"
:page="page"
:pageTitle="page.title"
pageLanguage="en-AU"
>
<template #aboveBody="{ hasBreadcrumbs }">
Expand Down
8 changes: 6 additions & 2 deletions packages/ripple-tide-publication/pages/[slug]/print-all.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const childPages = await useTidePublicationChildren(
flattenedChildIds
)

const page = computed(() => {
return { title: `Print - ${parentPage.title}` }
})

onMounted(() => {
window.print()
})
Expand All @@ -45,8 +49,8 @@ useHead({
<template>
<TideBaseLayout
:site="site"
:page="{}"
:pageTitle="`Print - ${parentPage.title}`"
:page="page"
:pageTitle="page.title"
pageLanguage="en-AU"
>
<template #breadcrumbs>
Expand Down
5 changes: 3 additions & 2 deletions packages/ripple-tide-search/components/TideSearchPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import { FormKit } from '@formkit/vue'
import { SearchDriverOptions } from '@elastic/search-ui'
import { useRippleEvent } from '@dpc-sdp/ripple-ui-core'
import type { rplEventPayload } from '@dpc-sdp/ripple-ui-core'
import type { TideSiteData } from '@dpc-sdp/ripple-tide-api/types'
import type { TideSiteData, TidePageBase } from '@dpc-sdp/ripple-tide-api/types'

interface Props {
id?: string
site: TideSiteData
page: TidePageBase
pageTitle: string
filtersConfig: AppSearchFilterConfigItem[]
searchDriverOptions: Omit<SearchDriverOptions, 'apiConnector'>
Expand Down Expand Up @@ -256,7 +257,7 @@ watch(
</script>

<template>
<TideBaseLayout :id="id" :site="site" :pageTitle="pageTitle">
<TideBaseLayout :id="id" :site="site" :page="page" :pageTitle="pageTitle">
<template #aboveBody>
<RplHeroHeader
:title="pageTitle"
Expand Down
4 changes: 3 additions & 1 deletion packages/ripple-tide-search/pages/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const appConfig = useAppConfig()
const runtimeConfig = useRuntimeConfig()
const site = await useTideSite()
const featureFlags = useFeatureFlags(site?.featureFlags)
const page = { title: 'Search' }

const getContentTypes = () => {
let contentTypes = appConfig.ripple?.search?.contentTypes
Expand Down Expand Up @@ -126,7 +127,8 @@ const searchResultsMappingFn = (item): MappedSearchResult<any> => {

<template>
<TideSearchPage
pageTitle="Search"
:pageTitle="page.title"
:page="page"
:site="site"
:searchDriverOptions="searchDriverOptions"
:filtersConfig="filtersConfig"
Expand Down
Loading