Skip to content

Commit

Permalink
removed bot middleware (#403)
Browse files Browse the repository at this point in the history
* removed bot middleware

* set all isBot check to false

* fixed lint errors
  • Loading branch information
bklaing2 authored Oct 21, 2024
1 parent ec94fa3 commit 35e8fc6
Show file tree
Hide file tree
Showing 8 changed files with 1,083 additions and 1,222 deletions.
8 changes: 4 additions & 4 deletions src/app/doi.org/[...doi]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function mapSearchparams(searchParams: Props['searchParams']) {
fieldOfScience: searchParams['field-of-science'],
registrationAgency: searchParams['registration-agency'],
connectionType: searchParams['connection-type'],
isBot: searchParams.isBot
isBot: false
}
}

Expand Down Expand Up @@ -150,12 +150,12 @@ export default async function Page({ params, searchParams }: Props) {

return <>
<Suspense fallback={<Loading />}>
<Content variables={variables} isBot={JSON.parse(isBot)} />
<Content variables={variables} isBot={false} />
</Suspense>
<Suspense>
<RelatedAggregateGraph doi={doi} isBot={JSON.parse(isBot)} />
<RelatedAggregateGraph doi={doi} isBot={false} />
</Suspense>
<RelatedContent variables={variables} showSankey={showSankey} connectionType={connectionType} isBot={JSON.parse(isBot)} />
<RelatedContent variables={variables} showSankey={showSankey} connectionType={connectionType} isBot={isBot} />
<Script type="application/ld+json" id="schemaOrg">{data.work.schemaOrg}</Script>
</>
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/orcid.org/[orcid]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function mapSearchparams(searchParams: Props['searchParams']) {
license: searchParams.license,
fieldOfScience: searchParams['field-of-science'],
registrationAgency: searchParams['registration-agency'],
isBot: searchParams.isBot
isBot: false
}
}

Expand All @@ -126,9 +126,9 @@ export default async function Page({ params, searchParams }: Props) {

return <>
<Suspense fallback={<Loading />}>
<Content variables={variables} isBot={JSON.parse(isBot)} />
<Content variables={variables} isBot={isBot} />
</Suspense>
<RelatedContent orcid={params.orcid} variables={variables} isBot={JSON.parse(isBot)} />
<RelatedContent orcid={params.orcid} variables={variables} isBot={isBot} />
</>
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/ror.org/[rorid]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function mapSearchparams(searchParams: Props['searchParams']) {
license: searchParams.license,
registrationAgency: searchParams['registration-agency'],

isBot: searchParams.isBot
isBot: false
}
}

Expand All @@ -115,9 +115,9 @@ export default async function Page({ params, searchParams }: Props) {

return <Container fluid>
<Suspense fallback={<Loading />}>
<Content variables={variables} isBot={JSON.parse(isBot)} />
<Content variables={variables} isBot={isBot} />
</Suspense>
<RelatedContent variables={variables} isBot={JSON.parse(isBot)} />
<RelatedContent variables={variables} isBot={isBot} />
</Container>
}

Expand Down
1 change: 0 additions & 1 deletion src/app/statistics/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default function RelatedContent(props: Props) {
}
)

console.log(loading, isBot)
if (isBot) return null
if (loading) return <Row><Loading /></Row>

Expand Down
8 changes: 2 additions & 6 deletions src/app/statistics/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import React from 'react'
import Content from './Content'

interface Props {
searchParams: { isBot: string }
}

export default async function StatisticsPage({ searchParams }: Props) {
export default async function StatisticsPage() {

return (
<Content isBot={JSON.parse(searchParams.isBot)} />
<Content isBot={false} />
)
}
19 changes: 0 additions & 19 deletions src/middleware.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/utils/apolloClient/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default function apolloClientBuilder(getToken: () => string) {
})

return new ApolloClient({
ssrMode: true,
link: authLink.concat(httpLink),
cache: new InMemoryCache({
typePolicies: {
Expand Down
2,256 changes: 1,071 additions & 1,185 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 35e8fc6

Please sign in to comment.