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

🐛 Only open action panel for subject author in subject overview #204

Merged
merged 1 commit into from
Sep 26, 2024
Merged
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
17 changes: 16 additions & 1 deletion components/reports/SubjectOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@ const OtherReportsForAuthorLink = ({
did,
repoText,
className,
omitQueryParams,
}: {
did: string
repoText: string
className?: string
omitQueryParams?: string[]
}) => {
const pathname = usePathname()
const searchParams = useSearchParams()
const newUrl = new URLSearchParams(searchParams)
newUrl.set('quickOpen', did)
if (omitQueryParams?.length) {
omitQueryParams.forEach((param) => newUrl.delete(param))
}
return (
<Link
prefetch={false}
Expand Down Expand Up @@ -52,6 +57,7 @@ const CollectionLink = ({
if (omitQueryParams?.length) {
omitQueryParams.forEach((param) => newUrl.delete(param))
}

return (
<>
<Link href={`/repositories/${repoUrl}`} target="_blank">
Expand Down Expand Up @@ -109,6 +115,7 @@ export function SubjectOverview(props: {
did={summary.did}
repoText={repoText}
className="ml-1"
omitQueryParams={props.omitQueryParamsInLinks}
/>
</>
)}
Expand All @@ -132,6 +139,7 @@ export function SubjectOverview(props: {
did={summary.did}
repoText={repoText}
className="ml-1"
omitQueryParams={props.omitQueryParamsInLinks}
/>
</>
)}
Expand All @@ -155,6 +163,7 @@ export function SubjectOverview(props: {
did={summary.did}
repoText={repoText}
className="ml-1"
omitQueryParams={props.omitQueryParamsInLinks}
/>
</>
)}
Expand All @@ -178,6 +187,7 @@ export function SubjectOverview(props: {
did={summary.did}
repoText={repoText}
className="ml-1"
omitQueryParams={props.omitQueryParamsInLinks}
/>
</>
)}
Expand All @@ -200,6 +210,7 @@ export function SubjectOverview(props: {
did={summary.did}
repoText={repoText}
className="ml-1"
omitQueryParams={props.omitQueryParamsInLinks}
/>
</>
)}
Expand All @@ -217,7 +228,11 @@ export function SubjectOverview(props: {
<ArrowTopRightOnSquareIcon className="inline-block h-4 w-4 mr-1" />
</Link>

<OtherReportsForAuthorLink did={summary.did} repoText={repoText} />
<OtherReportsForAuthorLink
did={summary.did}
repoText={repoText}
omitQueryParams={props.omitQueryParamsInLinks}
/>
</div>
)
}
Loading