Skip to content

Commit

Permalink
Merge pull request #444 from jay-hodgson/PORTALS-2789
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-hodgson authored Aug 28, 2023
2 parents 05dbb62 + 2fbd96d commit 715196f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 11 additions & 1 deletion apps/portals/src/ComponentRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ import { scrollToWithOffset } from './utils'
import { SynapseComponent } from './SynapseComponent'
import Layout from './portal-components/Layout'

const ignoreSearchParamsSet: Set<string> = new Set([
'utm_source',
'utm_campaign',
'utm_medium',
'utm_term',
'utm_content',
])

export function ComponentRenderer(props: { config: SynapseConfig }) {
const {
containerClassName,
Expand All @@ -23,7 +31,9 @@ export function ComponentRenderer(props: { config: SynapseConfig }) {
// https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams -- needs polyfill for ie11
const searchParams = new URLSearchParams(search)
searchParams.forEach((value, key) => {
searchParamsProps[key] = value
if (!ignoreSearchParamsSet.has(key)) {
searchParamsProps[key] = value
}
})
}
const scrollToRef = React.useRef(null)
Expand Down
1 change: 0 additions & 1 deletion apps/portals/src/types/portal-util-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export type DetailsPageContent =

export type DetailsPageProps = DetailsPageContent & {
showMenu?: boolean // default to true
/** Note, to exclude from processing, use the suffix "NotAQueryFilterKey" */
searchParams?: {
[index: string]: string
}
Expand Down

0 comments on commit 715196f

Please sign in to comment.