Skip to content
Open
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
14 changes: 3 additions & 11 deletions components/Moderators/PendingModerationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Button } from '@/components/ui/Button';
import { DeclineModal } from '@/components/Moderators/DeclineModal';
import { FeedItemGrantWithApplicants } from '@/components/Feed/items/FeedItemGrantWithApplicants';
import { FeedItemPost } from '@/components/Feed/items/FeedItemPost';
import { FeedItemPaper } from '@/components/Feed/items/FeedItemPaper';
import {
PendingModerationService,
PENDING_MODULE_CONFIG,
Expand Down Expand Up @@ -69,16 +68,9 @@ function renderPendingGrantItem(entry: FeedEntry, footer: ReactNode): ReactNode

function renderFeedItem(module: PendingModule, entry: FeedEntry, footer: ReactNode): ReactNode {
const commonProps = { entry, showActions: false, footer };
switch (module) {
case 'funding_opportunities':
return renderPendingGrantItem(entry, footer);
case 'journal_entries':
return <FeedItemPaper {...commonProps} />;
case 'proposals':
case 'posts':
default:
return <FeedItemPost {...commonProps} showHeader={false} />;
}
if (module === 'funding_opportunities') return renderPendingGrantItem(entry, footer);

return <FeedItemPost {...commonProps} showHeader={false} />;
}

export function PendingModerationList({ module }: Readonly<PendingModerationListProps>) {
Expand Down
21 changes: 2 additions & 19 deletions services/content-moderation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { GrantModerationService, type PendingWorksResponse } from './grant-moder

export type { PendingWorksResponse };

export type PendingModule = 'funding_opportunities' | 'proposals' | 'posts' | 'journal_entries';
export type PendingModule = 'funding_opportunities' | 'proposals';

/** Number of pending items per module, as shown on the tab badges. */
export type PendingModuleCounts = Record<PendingModule, number>;
Expand All @@ -24,12 +24,7 @@ interface PendingModuleConfig {
resourcePath?: string;
}

export const PENDING_MODULES: PendingModule[] = [
'funding_opportunities',
'proposals',
'posts',
'journal_entries',
];
export const PENDING_MODULES: PendingModule[] = ['funding_opportunities', 'proposals'];

/** Module shown when none is specified in the URL (the first tab). */
export const DEFAULT_PENDING_MODULE: PendingModule = PENDING_MODULES[0];
Expand All @@ -56,18 +51,6 @@ export const PENDING_MODULE_CONFIG: Record<PendingModule, PendingModuleConfig> =
feedContentType: 'PREREGISTRATION',
resourcePath: '/api/researchhubpost',
},
posts: {
tabLabel: 'Posts',
itemLabel: 'Post',
feedContentType: 'POST',
resourcePath: '/api/researchhubpost',
},
journal_entries: {
tabLabel: 'Journal Entries',
itemLabel: 'Journal entry',
feedContentType: 'PAPER',
resourcePath: '/api/paper',
},
};

export class PendingModerationError extends Error {
Expand Down