) {
const { currentNote: note, editor } = useNotebookContext();
@@ -343,7 +319,7 @@ export function PublishingForm({
const articleType =
storedData?.articleType ??
(note.documentType ? mapDocumentTypeToArticleType(note.documentType) : null) ??
- resolveArticleType(searchParams, defaultArticleType)?.type;
+ resolveArticleType(searchParams);
if (articleType) {
methods.setValue('articleType', articleType);
@@ -385,7 +361,6 @@ export function PublishingForm({
const { watch, clearErrors } = methods;
const articleType = watch('articleType');
- const isJournalEnabled = watch('isJournalEnabled');
const selectedNonprofit = watch('selectedNonprofit');
const [{ isLoading: isLoadingUpsert }, upsertPost] = useUpsertPost();
@@ -394,6 +369,7 @@ export function PublishingForm({
const router = useRouter();
const isDeclined = note?.post?.grant?.status === 'DECLINED';
+ const isPreprint = articleType === 'discussion';
const isPublishing = isLoadingUpsert || isRedirecting || isLinkingNonprofit || isUploadingImage;
const canPublishRegisteredReport =
articleType !== 'registered_report' || currentUser?.isModerator === true;
@@ -409,6 +385,11 @@ export function PublishingForm({
const handlePublishClick = async () => {
if (readOnly) return;
+ if (isPreprint) {
+ toast.error('Preprints can no longer be created in the notebook.');
+ return;
+ }
+
if (!canPublishRegisteredReport) {
toast.error('Only moderators can publish Registered Reports.');
return;
@@ -438,7 +419,6 @@ export function PublishingForm({
if (
articleType !== 'preregistration' &&
- articleType !== 'discussion' &&
articleType !== 'grant' &&
articleType !== 'registered_report'
) {
@@ -510,6 +490,11 @@ export function PublishingForm({
const handleConfirmPublish = async (editedTitle: string) => {
if (readOnly || !note) return;
+ if (articleType === 'discussion') {
+ toast.error('Preprints can no longer be created in the notebook.');
+ return;
+ }
+
try {
setDocumentTitle(editor, editedTitle);
@@ -751,7 +736,6 @@ export function PublishingForm({
onBountyClick={onBountyClick ?? (() => {})}
/>
)}
- {FEATURE_FLAG_JOURNAL && articleType === 'discussion' && }
>
)}
@@ -762,12 +746,6 @@ export function PublishingForm({
{articleType === 'preregistration' && !methods.watch('workId') && (
)}
- {FEATURE_FLAG_JOURNAL && articleType === 'discussion' && isJournalEnabled && (
-
- Payment due:
- $1,000 USD
-
- )}
{articleType === 'registered_report' && !canPublishRegisteredReport && (
Only moderators can publish Registered Reports.
@@ -780,6 +758,7 @@ export function PublishingForm({
disabled={
!articleType ||
readOnly ||
+ isPreprint ||
isPublishing ||
isDeclined ||
showPrivateWarning ||
@@ -792,8 +771,6 @@ export function PublishingForm({
isLoadingUpsert: isLoadingUpsert || isUploadingImage,
isRedirecting,
isLinkingNonprofit,
- articleType,
- isJournalEnabled: isJournalEnabled ?? false,
hasWorkId: Boolean(methods.watch('workId')),
})}
diff --git a/components/Notebook/PublishingForm/schema.ts b/components/Notebook/PublishingForm/schema.ts
index 0d5962443..3bacdc33f 100644
--- a/components/Notebook/PublishingForm/schema.ts
+++ b/components/Notebook/PublishingForm/schema.ts
@@ -58,7 +58,6 @@ export const publishingFormSchema = z
})
.nullable()
.optional(),
- isJournalEnabled: z.boolean().optional(),
selectedNonprofit: z.any().nullable().optional(),
selectedGrant: z.any().nullable().optional(),
departmentLabName: z.string().optional(),