Skip to content

Commit

Permalink
Merge branch 'main' into hats
Browse files Browse the repository at this point in the history
  • Loading branch information
ikuleshov authored Oct 3, 2024
2 parents 91238e3 + 9a7455f commit af11fc3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 84 deletions.
24 changes: 16 additions & 8 deletions functions/package-lock.json

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

13 changes: 10 additions & 3 deletions lib/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,11 @@ base64-js@^1.3.0, base64-js@^1.3.1:
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==

basic-auth-connect@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/basic-auth-connect/-/basic-auth-connect-1.0.0.tgz#fdb0b43962ca7b40456a7c2bb48fe173da2d2122"
integrity sha512-kiV+/DTgVro4aZifY/hwRwALBISViL5NP4aReaR2EVJEObpbUBHIkdJh/YpcoEiYt7nBodZ6U2ajZeZvSxUCCg==
version "1.1.0"
resolved "https://registry.yarnpkg.com/basic-auth-connect/-/basic-auth-connect-1.1.0.tgz#b44af37d5b3bd7561b56491e58cf26ae1578f0c7"
integrity sha512-rKcWjfiRZ3p5WS9e5q6msXa07s6DaFAMXoyowV+mb2xQG+oYdw2QEUyKi0Xp95JvXzShlM+oGy5QuqSK6TfC1Q==
dependencies:
tsscmp "^1.0.6"

basic-auth@~2.0.1:
version "2.0.1"
Expand Down Expand Up @@ -4042,6 +4044,11 @@ tslib@^2.0.1, tslib@^2.1.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913"
integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==

tsscmp@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb"
integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==

tunnel-agent@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
Expand Down
6 changes: 0 additions & 6 deletions src/components/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ const IndexPage: React.FC = () => {
. We encourage you to take a look if you'd like to see how anything is
done.
</Typography>
<Typography variant="h3">Support for UA & GA4</Typography>
<Typography variant="body1">
There is support for both Universal Analytics (UA) and Google Analytics
4 (GA4). Click the toggle in the nav bar to switch between the UA and
GA4 versions of the site.
</Typography>
<Typography variant="h3">Demos</Typography>
<Typography variant="body1">
Live demos to help you learn about Google Analytics features.
Expand Down
62 changes: 0 additions & 62 deletions src/components/ga4/DimensionsMetricsExplorer/Field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,68 +58,6 @@ const Root = styled('div')((
}
}));

const knownLinks: [string, JSX.Element][] = [
[
"<https://support.google.com/analytics/answer/9267568>",
<ExternalLink href="https://support.google.com/analytics/answer/9267568">
Set up and manage conversion events
</ExternalLink>,
],
[
"<https://support.google.com/google-ads/answer/6323>",
<ExternalLink href="https://support.google.com/google-ads/answer/6323">
Keywords: Definition
</ExternalLink>,
],
[
"<https://support.google.com/analytics/answer/9213390>",
<ExternalLink href="https://support.google.com/analytics/answer/9213390">
User-ID for cross-platform analysis
</ExternalLink>,
],
[
"<https://support.google.com/analytics/answer/10108813>",
<ExternalLink href="https://support.google.com/analytics/answer/10108813">
Data filters
</ExternalLink>,
],
]

const linkifyText = (
remainingString: string,
elements: (JSX.Element | string)[]
): [string, (JSX.Element | string)[]] => {
const firstMatch = knownLinks.reduce(
(acc, [inText], idx) => {
const { matchIndex } = acc
const currentMatchIndex = remainingString.indexOf(inText)
if (currentMatchIndex !== -1) {
if (currentMatchIndex < matchIndex || matchIndex === -1) {
return {
matchIndex: currentMatchIndex,
knownLinksIndex: idx,
}
}
}
return acc
},
{ knownLinksIndex: -1, matchIndex: -1 }
)
if (firstMatch.matchIndex === -1) {
elements.push(remainingString)
return ["", elements]
} else {
const [inText, link] = knownLinks[firstMatch.knownLinksIndex]
const before = remainingString.substring(0, firstMatch.matchIndex)
const after = remainingString.substring(
firstMatch.matchIndex + inText.length
)
elements.push(before)
elements.push(link)
return [after, elements]
}
}

interface FieldProps extends CompatibleHook {
field:
| { type: "dimension"; value: Dimension }
Expand Down
8 changes: 3 additions & 5 deletions src/components/ga4/DimensionsMetricsExplorer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ const RenderSuccessful: React.FC<Successful & { aps: AccountProperty }> = ({
d.apiName === c.apiName) === undefined &&
compatibility.incompatibleMetrics?.find(d =>
d.apiName === c.apiName) === undefined
return viewMode === 'all' || viewMode === 'compatible' &&
isCompatible || viewMode === 'incompatible' && !isCompatible;
return viewMode === 'all' || (viewMode === 'compatible' &&
isCompatible) || (viewMode === 'incompatible' && !isCompatible);
},
[viewMode,
compatibility.incompatibleDimensions,
Expand All @@ -97,9 +97,7 @@ const RenderSuccessful: React.FC<Successful & { aps: AccountProperty }> = ({
dimensions: c.dimensions.filter(fieldDisplayFilter),
metrics: c.metrics.filter(fieldDisplayFilter),
})),
[viewMode, compatibility.metrics,
compatibility.dimensions, compatibility.incompatibleDimensions,
compatibility.incompatibleMetrics, categories]
[categories, fieldDisplayFilter]
)

const resetAllCategoryAccordions = (expanded: boolean) =>
Expand Down

0 comments on commit af11fc3

Please sign in to comment.