diff --git a/.gitignore b/.gitignore index 6099118..701a87b 100644 --- a/.gitignore +++ b/.gitignore @@ -26,9 +26,6 @@ yarn-debug.log* yarn-error.log* .pnpm-debug.log* -# local env files -.env*.local - # vercel .vercel @@ -40,5 +37,7 @@ next-env.d.ts cypress/videos cypress/screenshots +# local env files .env +.env.* .ozone.env diff --git a/app/reports/page-content.tsx b/app/reports/page-content.tsx index ff77036..b16c386 100644 --- a/app/reports/page-content.tsx +++ b/app/reports/page-content.tsx @@ -248,6 +248,7 @@ export const ReportsPageContent = () => {
+
@@ -311,6 +312,8 @@ function useModerationQueueQuery() { useFluentReportSearchParams() return useInfiniteQuery({ + // lighten load on the server + refetchOnWindowFocus: false, queryKey: [ 'events', { diff --git a/components/common/PreviewCard.tsx b/components/common/PreviewCard.tsx index ca77ad7..79451b2 100644 --- a/components/common/PreviewCard.tsx +++ b/components/common/PreviewCard.tsx @@ -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({ diff --git a/components/reports/helpers/subject.ts b/components/reports/helpers/subject.ts index 0ccf412..1d0c2fb 100644 --- a/components/reports/helpers/subject.ts +++ b/components/reports/helpers/subject.ts @@ -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://') @@ -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', @@ -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' } diff --git a/package.json b/package.json index 31a0042..0dbc7f3 100644 --- a/package.json +++ b/package.json @@ -61,5 +61,6 @@ }, "volta": { "node": "20.9.0" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/yarn.lock b/yarn.lock index 105d29f..1e59e9d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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"