From 380640641341abe90315b89ca5d5b2467c49e814 Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Thu, 18 Jun 2026 03:50:34 +0300 Subject: [PATCH] refactor(import): remove non-functional DOCX/PDF/Confluence import buttons DOCX, PDF and Confluence import relied on a private EE module that was dropped from this build, so those code paths only threw "enterprise license" errors (DOCX/PDF) or silently did nothing (Confluence) while the UI still presented them as working options. - page-import-modal: drop the Word (DOCX), PDF and Confluence FileButtons - remove the now-dead icon imports (IconFileTypeDocx, IconFileTypePdf, ConfluenceIcon), the docx/pdf/confluence file refs and their input-reset branches in handleFileUpload/handleZipUpload - delete the orphaned confluence-icon.tsx component (no remaining importers) Markdown, HTML, Notion and the generic zip upload remain unchanged. --- .../src/components/icons/confluence-icon.tsx | 20 ------ .../page/components/page-import-modal.tsx | 71 ------------------- 2 files changed, 91 deletions(-) delete mode 100644 apps/client/src/components/icons/confluence-icon.tsx diff --git a/apps/client/src/components/icons/confluence-icon.tsx b/apps/client/src/components/icons/confluence-icon.tsx deleted file mode 100644 index 499f18da..00000000 --- a/apps/client/src/components/icons/confluence-icon.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { rem } from "@mantine/core"; - -interface Props { - size?: number | string; -} - -export function ConfluenceIcon({ size }: Props) { - return ( - - - - ); -} diff --git a/apps/client/src/features/page/components/page-import-modal.tsx b/apps/client/src/features/page/components/page-import-modal.tsx index d9ea5189..b9a54193 100644 --- a/apps/client/src/features/page/components/page-import-modal.tsx +++ b/apps/client/src/features/page/components/page-import-modal.tsx @@ -10,8 +10,6 @@ import { IconBrandNotion, IconCheck, IconFileCode, - IconFileTypeDocx, - IconFileTypePdf, IconFileTypeZip, IconMarkdown, IconX, @@ -27,7 +25,6 @@ import { buildTree } from "@/features/page/tree/utils"; import { IPage } from "@/features/page/types/page.types.ts"; import React, { useEffect, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; -import { ConfluenceIcon } from "@/components/icons/confluence-icon.tsx"; import { getFileImportSizeLimit } from "@/lib/config.ts"; import { formatBytes } from "@/lib"; import { getFileTaskById } from "@/features/file-task/services/file-task-service.ts"; @@ -86,10 +83,7 @@ function ImportFormatSelection({ spaceId, onClose }: ImportFormatSelection) { const markdownFileRef = useRef<() => void>(null); const htmlFileRef = useRef<() => void>(null); - const docxFileRef = useRef<() => void>(null); - const pdfFileRef = useRef<() => void>(null); const notionFileRef = useRef<() => void>(null); - const confluenceFileRef = useRef<() => void>(null); const zipFileRef = useRef<() => void>(null); const handleZipUpload = async (selectedFile: File, source: string) => { @@ -137,8 +131,6 @@ function ImportFormatSelection({ spaceId, onClose }: ImportFormatSelection) { // Reset file input after successful upload if (source === "notion" && notionFileRef.current) { notionFileRef.current(); - } else if (source === "confluence" && confluenceFileRef.current) { - confluenceFileRef.current(); } else if (source === "generic" && zipFileRef.current) { zipFileRef.current(); } @@ -291,8 +283,6 @@ function ImportFormatSelection({ spaceId, onClose }: ImportFormatSelection) { // Reset file inputs after successful upload if (markdownFileRef.current) markdownFileRef.current(); if (htmlFileRef.current) htmlFileRef.current(); - if (docxFileRef.current) docxFileRef.current(); - if (pdfFileRef.current) pdfFileRef.current(); const pageCountText = pageCount === 1 ? `1 ${t("page")}` : `${pageCount} ${t("pages")}`; @@ -365,48 +355,6 @@ function ImportFormatSelection({ spaceId, onClose }: ImportFormatSelection) { )} - - {(props) => ( - - )} - - - - {(props) => ( - - )} - - handleZipUpload(file, "notion")} accept="application/zip" @@ -426,25 +374,6 @@ function ImportFormatSelection({ spaceId, onClose }: ImportFormatSelection) { )} - handleZipUpload(file, "confluence")} - accept="application/zip" - resetRef={confluenceFileRef} - inputProps={{ - "aria-label": t("Choose {{format}} file", { format: "Confluence" }), - }} - > - {(props) => ( - - )} -