Skip to content

Commit

Permalink
Merge pull request #873 from dpc-sdp/feat/r20-1544-search-listing-sec…
Browse files Browse the repository at this point in the history
…ondary-campaign

[R20-1544] Add secondary campaign to search listing
  • Loading branch information
waitingallday authored Oct 1, 2023
2 parents ab73e65 + cae72da commit 8f1f641
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/ripple-tide-landing-page/mapping/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,5 @@ const tideLandingPageModule: IRplTideModuleMapping = {
}

export default tideLandingPageModule

export { secondaryCampaignIncludes, secondaryCampaignMapping }
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import type {
TideSearchListingResultLayout,
TideSearchListingSortOption
} from './../types'
import type { ITideSecondaryCampaign } from '@dpc-sdp/ripple-tide-landing-page/mapping/secondary-campaign/secondary-campaign-mapping'
import { useRippleEvent } from '@dpc-sdp/ripple-ui-core'
import type { rplEventPayload } from '@dpc-sdp/ripple-ui-core'
import { watch } from 'vue'
interface TideContentPage extends TidePageBase {
afterResults: string
secondaryCampaign: ITideSecondaryCampaign
}
interface Props {
Expand Down Expand Up @@ -426,6 +428,11 @@ watch(
></RplContent>
</RplPageComponent>
</template>
<template #belowBody>
<RplPageComponent v-if="contentPage.secondaryCampaign">
<RplSecondaryCampaign v-bind="contentPage.secondaryCampaign" />
</RplPageComponent>
</template>
</TideBaseLayout>
</template>

Expand Down
8 changes: 7 additions & 1 deletion packages/ripple-tide-search/mapping/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { getBodyFromField } from '@dpc-sdp/ripple-tide-api'
import type { IRplTideModuleMapping } from '@dpc-sdp/ripple-tide-api/types'
import { ApplicationError } from '@dpc-sdp/ripple-tide-api/errors'
import { getUniqueListBy, parseJSONField } from './../mapping/utils'
import {
secondaryCampaignIncludes,
secondaryCampaignMapping
} from '@dpc-sdp/ripple-tide-landing-page/mapping'

const getProcessedSearchListingConfig = async (src, tidePageApi) => {
let rawConfig = null
Expand Down Expand Up @@ -185,14 +189,16 @@ const tideCollectionModule: IRplTideModuleMapping = {
afterResults: (src: string) =>
getBodyFromField(src, 'field_below_results_content'),
introText: 'field_landing_page_intro_text',
config: getProcessedSearchListingConfig
config: getProcessedSearchListingConfig,
secondaryCampaign: secondaryCampaignMapping
},
includes: [
...tidePageBaseIncludes({
withSidebarContacts: false,
withSidebarRelatedLinks: false,
withSidebarSocialShare: false
}),
...secondaryCampaignIncludes,
'field_listing_global_filters',
'field_listing_user_filters',
'field_listing_user_filters.field_field',
Expand Down
1 change: 1 addition & 0 deletions packages/ripple-tide-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@dpc-sdp/ripple-tide-api": "workspace:*",
"@dpc-sdp/ripple-tide-landing-page": "workspace:*",
"@dpc-sdp/ripple-ui-core": "workspace:*",
"@dpc-sdp/ripple-ui-forms": "workspace:*",
"@elastic/search-ui": "^1.19.1",
Expand Down
9 changes: 6 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8f1f641

Please sign in to comment.