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

Add account details to queue #260

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

Expand All @@ -40,5 +37,7 @@ next-env.d.ts
cypress/videos
cypress/screenshots

# local env files
.env
.env.*
.ozone.env
3 changes: 3 additions & 0 deletions app/reports/page-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ export const ReportsPageContent = () => {
<div className="md:flex mt-2 mb-2 flex-row justify-between px-4 sm:px-6 lg:px-8">
<div className="flex flex-row items-center gap-2">
<QueueFilterPanel />
<button onClick={() => refetch()}>refetch</button>
</div>
<ResolvedFilters />
</div>
Expand Down Expand Up @@ -311,6 +312,8 @@ function useModerationQueueQuery() {
useFluentReportSearchParams()

return useInfiniteQuery({
// lighten load on the server
refetchOnWindowFocus: false,
queryKey: [
'events',
{
Expand Down
17 changes: 3 additions & 14 deletions components/common/PreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,13 @@ import { CollectionId, getCollectionName } from '@/reports/helpers/subject'
import { ReactNode } from 'react'
import { RecordCard, RepoCard } from './RecordCard'

const PreviewTitleMap = {
[CollectionId.Post]: 'Reported post',
[CollectionId.FeedGenerator]: 'Reported feed',
[CollectionId.List]: 'Reported list',
[CollectionId.Profile]: 'Reported profile',
[CollectionId.StarterPack]: 'Reported starter pack',
}

const getPreviewTitleForAtUri = (uri: string): string => {
const { collection } = parseAtUri(uri) || {}

// If the collection is not in the map or collection isn't available, default to post
return (
PreviewTitleMap[collection || CollectionId.Post] ||
(collection
? `Reported ${getCollectionName(collection)}`
: PreviewTitleMap[CollectionId.Post])
)
return collection
? `Reported ${getCollectionName(collection).toLowerCase() || collection}`
: 'Reported user'
}

export function PreviewCard({
Expand Down
6 changes: 5 additions & 1 deletion components/reports/helpers/subject.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useLabelerAgent } from '@/shell/ConfigurationContext'
import { ToolsOzoneModerationDefs } from '@atproto/api'
import { AppBskyGraphList, ToolsOzoneModerationDefs } from '@atproto/api'
import { useCallback } from 'react'

export const isIdRecord = (id: string) => id.startsWith('at://')
Expand Down Expand Up @@ -70,6 +70,7 @@ export enum CollectionId {
FeedGenerator = 'app.bsky.feed.generator',
Profile = 'app.bsky.actor.profile',
List = 'app.bsky.graph.list',
Like = 'app.bsky.feed.like',
Post = 'app.bsky.feed.post',
LabelerService = 'app.bsky.labeler.service',
StarterPack = 'app.bsky.graph.starterpack',
Expand All @@ -87,6 +88,9 @@ export const getCollectionName = (collection: string) => {
if (collection === CollectionId.List) {
return 'List'
}
if (collection === CollectionId.Like) {
return 'Like'
}
if (collection === CollectionId.FeedGenerator) {
return 'Feed'
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@
},
"volta": {
"node": "20.9.0"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
39 changes: 6 additions & 33 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -213,31 +213,9 @@
"@atproto/lexicon" "^0.4.3"
zod "^3.23.8"

"@babel/runtime@^7.1.2":
version "7.20.7"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.7.tgz#fcb41a5a70550e04a7b708037c7c32f7f356d8fd"
integrity sha512-UF0tvkUtxwAgZ5W/KrkHf0Rn0fdnLDU9ScxBrEVNUprE/MzirjK4MJUX1/BVDv00Sv8cljtukVK1aky++X1SjQ==
dependencies:
regenerator-runtime "^0.13.11"

"@babel/runtime@^7.13.10":
version "7.22.3"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.3.tgz#0a7fce51d43adbf0f7b517a71f4c3aaca92ebcbb"
integrity sha512-XsDuspWKLUsxwCp6r7EhsExHtYfbe5oAGQ19kqngTdCPUoPQzOPdUbD/pB9PJiwb2ptYKQDjSJT3R6dC+EPqfQ==
dependencies:
regenerator-runtime "^0.13.11"

"@babel/runtime@^7.14.6", "@babel/runtime@^7.17.2":
version "7.22.15"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.15.tgz#38f46494ccf6cf020bd4eed7124b425e83e523b8"
integrity sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==
dependencies:
regenerator-runtime "^0.14.0"

"@babel/runtime@^7.20.13":
version "7.24.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.0.tgz#584c450063ffda59697021430cb47101b085951e"
integrity sha512-Chk32uHMg6TnQdvw2e9IlqPpFX/6NLuK0Ys2PqLb7/gL5uFn9mXvK715FGLlOLQrcO4qIkNHkvPGktzzXexsFw==
"@babel/runtime@^7.1.2", "@babel/runtime@^7.13.10", "@babel/runtime@^7.14.6", "@babel/runtime@^7.17.2", "@babel/runtime@^7.20.13":
version "7.26.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.0.tgz"
dependencies:
regenerator-runtime "^0.14.0"

Expand Down Expand Up @@ -4619,15 +4597,10 @@ refractor@^4.8.0:
hastscript "^7.0.0"
parse-entities "^4.0.0"

regenerator-runtime@^0.13.11:
version "0.13.11"
resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz"
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==

regenerator-runtime@^0.14.0:
version "0.14.0"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45"
integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==
version "0.14.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"
integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==

regexp.prototype.flags@^1.4.3:
version "1.4.3"
Expand Down
Loading