From 94ff54ddc665aec1946f701f9c260f0e18a183dc Mon Sep 17 00:00:00 2001 From: JTran-IDM Date: Thu, 7 Aug 2025 00:13:50 -0700 Subject: [PATCH 01/19] design --- .kiro/specs/papers-library-importer/design.md | 14 +++--- .../papers-library-importer/requirements.md | 47 +++++++++++++------ .kiro/specs/papers-library-importer/tasks.md | 32 +++++++++++++ .kiro/steering/structure.md | 5 ++ 4 files changed, 77 insertions(+), 21 deletions(-) diff --git a/.kiro/specs/papers-library-importer/design.md b/.kiro/specs/papers-library-importer/design.md index f2b60a543..19cde09e3 100644 --- a/.kiro/specs/papers-library-importer/design.md +++ b/.kiro/specs/papers-library-importer/design.md @@ -2,9 +2,11 @@ ## Overview -The Papers Library Importer feature enables researchers to import their existing reference libraries from .bib files and PDF folders into Extralit workspaces. The system leverages the existing document upload endpoint (`POST /documents`) and job queue system to process bibliographic metadata from .bib files, match PDF files to references, and provide a user-friendly interface for reviewing and confirming imports before executing bulk operations. +The Papers Library Importer feature enables researchers to import their existing reference libraries from bibliography files (.bib or .csv) and PDF folders into Extralit workspaces. The system leverages the existing document upload endpoint (`POST /documents`) and job queue system to process bibliographic metadata from various formats, match PDF files to references using advanced path matching algorithms, and provide a user-friendly interface for reviewing and confirming imports before executing bulk operations. -**Generalized Tabular Import Support**: The import system is designed to handle tabular data beyond just BibTeX files. The core functionality supports CSV imports and other structured data formats by storing imported data as dataframes with schema information. This enables future expansion to support various research data import formats while maintaining consistent processing workflows. +**Generalized Tabular Import Support**: The import system is designed to handle multiple tabular data formats including BibTeX (.bib) and CSV files. The core functionality supports flexible column mapping for CSV imports and stores imported data as dataframes with schema information. This enables consistent processing workflows across different research data import formats. + +**Enhanced PDF Matching**: The system uses sophisticated file matching algorithms including maximum prefix path matching, exact filename matching, and fuzzy string matching to associate PDF files with bibliography entries. Users can import references with or without associated PDF files. The design follows Extralit's existing patterns: context-based backend architecture, FastAPI endpoints with proper authorization, Vue.js frontend components, and the existing RQ-based asynchronous job processing system for bulk operations. @@ -12,7 +14,7 @@ The design follows Extralit's existing patterns: context-based backend architect ### High-Level Flow -1. **Frontend Processing Phase**: User uploads .bib file and PDFs to frontend, which parses BibTeX entries into generic dataframe format and matches files to references +1. **Frontend Processing Phase**: User uploads bibliography file (.bib or .csv) and PDFs to frontend, which parses entries into generic dataframe format and matches files to references using advanced path matching 2. **Analysis Phase**: Frontend sends file metadata (not file contents) to backend for add/update/skip status analysis 3. **Preview Phase**: Frontend displays import preview with status for each document based on server analysis 4. **Bulk Upload Phase**: User confirms import, frontend sends paginated requests to bulk upload endpoint with actual file contents @@ -23,8 +25,8 @@ The design follows Extralit's existing patterns: context-based backend architect ```mermaid graph TD - A[Frontend Upload Component] --> B[Frontend BibTeX Parser] - A --> C[Frontend File Matcher] + A[Frontend Upload Component] --> B[Frontend Bibliography Parser (.bib/.csv)] + A --> C[Frontend Advanced File Matcher] B --> D[File Metadata Analysis Request] B --> E[Generic Dataframe Conversion] C --> D @@ -434,7 +436,7 @@ class ImportHistoryResponse(BaseModel): """Response schema for import history creation and retrieval.""" id: UUID = Field(..., description="Import history record ID") workspace_id: UUID = Field(..., description="Workspace ID") - user_id: UUID = Field(..., description="User ID who created the import") + username: str = Field(..., description="User who created the import") filename: str = Field(..., description="Import filename") created_at: datetime = Field(..., description="Creation timestamp") data: Optional[Dict] = Field(None, description="Tabular dataframe data (only in detailed view)") diff --git a/.kiro/specs/papers-library-importer/requirements.md b/.kiro/specs/papers-library-importer/requirements.md index 88c921ed3..5fccb89c2 100644 --- a/.kiro/specs/papers-library-importer/requirements.md +++ b/.kiro/specs/papers-library-importer/requirements.md @@ -10,20 +10,22 @@ The feature consists of two main components: a backend import service that proce ### Requirement 1 -**User Story:** As a researcher, I want to upload a .bib file and folder of PDFs to import my reference library into an Extralit workspace, so that I can use my existing document collection for extraction workflows and reference the documents in during the annotation process. +**User Story:** As a researcher, I want to upload a bibliography file (.bib or .csv) and folder of PDFs to import my reference library into an Extralit workspace, so that I can use my existing document collection for extraction workflows and reference the documents in during the annotation process. #### Acceptance Criteria 1. WHEN I upload a .bib file THEN the system SHALL parse the bibliographic entries and extract metadata (title, authors, venue, year, DOI, PMID, reference) -2. WHEN I upload a folder of PDF files THEN the system SHALL process each PDF and attempt to match it with bibliographic entries -3. WHEN a PDF filename matches a .bib entry reference THEN the system SHALL associate the PDF with that bibliographic entry -4. WHEN I provide a collection tag THEN the system SHALL add this tag to all imported documents' metadata -5. WHEN documents are processed THEN the system SHALL store the reference as the unique identifier for deduplication -6. IF a PDF cannot be matched to a .bib entry THEN the system SHALL mark it as "failed" and provide error details +2. WHEN I upload a .csv file THEN the system SHALL parse the tabular data and allow me to select the reference column and files column for PDF matching +3. WHEN I upload a folder of PDF files THEN the system SHALL process each PDF and attempt to match it with bibliographic entries using maximum prefix path matching +4. WHEN a PDF file path has a maximum prefix match with a bibliography entry file path THEN the system SHALL associate the PDF with that bibliographic entry +5. WHEN I provide a collection tag THEN the system SHALL add this tag to all imported documents' metadata +6. WHEN documents are processed THEN the system SHALL store the reference as the unique identifier for deduplication +7. WHEN I upload files in any order (bibliography first or PDFs first) THEN the system SHALL allow me to proceed to the next step +8. IF a PDF cannot be matched to a bibliography entry THEN the system SHALL mark it as unmatched but still allow import ### Requirement 2 -**User Story:** As a researcher, I want to see a preview of all documents to be imported with their import status, so that I can review and confirm the import before committing changes. +**User Story:** As a researcher, I want to see a preview of all documents to be imported with their import status and choose whether to import references without PDFs, so that I can review and confirm the import before committing changes. #### Acceptance Criteria @@ -32,8 +34,10 @@ The feature consists of two main components: a backend import service that proce 3. WHEN a document has a new reference THEN the system SHALL mark it as "add" 4. WHEN a document has an existing reference but new/updated files THEN the system SHALL mark it as "update" 5. WHEN a document already exists with no changes THEN the system SHALL mark it as "skip" -6. WHEN a .bib entry has no matching PDF files THEN the system SHALL mark it as "failed" -7. WHEN I review the preview THEN the system SHALL allow me to change the action for individual documents (add/update/skip) +6. WHEN a bibliography entry has no matching PDF files THEN the system SHALL mark it as "no files" but still allow import +7. WHEN I review the preview THEN the system SHALL allow me to change the action for individual documents (add/update/skip/ignore) +8. WHEN I review the preview THEN the system SHALL provide an option to import only references with matched PDFs or import all references including those without PDFs +9. WHEN I select "only with PDFs" THEN the system SHALL automatically set references without PDFs to "ignore" status ### Requirement 3 @@ -70,11 +74,12 @@ The feature consists of two main components: a backend import service that proce #### Acceptance Criteria 1. WHEN .bib file parsing fails THEN the system SHALL provide specific error messages about malformed entries -2. WHEN PDF files are corrupted or unreadable THEN the system SHALL mark them as failed with detailed error information -3. WHEN file uploads fail due to size or network issues THEN the system SHALL provide retry mechanisms -4. WHEN duplicate references exist in the .bib file THEN the system SHALL handle them appropriately and warn the user -5. WHEN the workspace storage quota is exceeded THEN the system SHALL provide clear error messages and stop the import -6. IF the import process is interrupted THEN the system SHALL allow users to resume or restart the import +2. WHEN .csv file parsing fails THEN the system SHALL provide specific error messages about malformed data and allow column selection +3. WHEN PDF files are corrupted or unreadable THEN the system SHALL mark them as failed with detailed error information +4. WHEN file upload jobs fail due to size or network issues THEN the system SHALL provide retry mechanisms +5. WHEN duplicate references exist in the bibliography file THEN the system SHALL handle them appropriately and warn the user +6. WHEN the workspace storage quota is exceeded THEN the system SHALL provide clear error messages and stop the import +7. IF the import process is interrupted THEN the system SHALL allow users to resume or restart the import ### Requirement 6 @@ -87,4 +92,16 @@ The feature consists of two main components: a backend import service that proce 3. WHEN storing files THEN the system SHALL use the existing secure S3 storage infrastructure 4. WHEN parsing .bib files THEN the system SHALL sanitize input to prevent injection attacks 5. WHEN handling file uploads THEN the system SHALL implement proper virus scanning and validation -6. WHEN processing fails THEN the system SHALL clean up temporary files and partial uploads$$ \ No newline at end of file +6. WHEN processing fails THEN the system SHALL clean up temporary files and partial uploads$$ + +### Requirement 7 + +**User Story:** As a researcher, I want the import modal to have proper flow control and not require confirmation to close after successful completion, so that I have a smooth user experience. + +#### Acceptance Criteria + +1. WHEN the import process is in progress THEN the system SHALL require confirmation before allowing me to close the modal +2. WHEN the import process has completed successfully THEN the system SHALL not require confirmation to close the modal +3. WHEN I navigate between steps during the import process THEN the system SHALL preserve my uploaded data +4. WHEN I return to a previous step THEN the system SHALL show my previously uploaded files and selections5. W +HEN I close the import modal after successful completion THEN the system SHALL refresh the recent import list on the home screen \ No newline at end of file diff --git a/.kiro/specs/papers-library-importer/tasks.md b/.kiro/specs/papers-library-importer/tasks.md index 1c6f5690d..f89fbdaab 100644 --- a/.kiro/specs/papers-library-importer/tasks.md +++ b/.kiro/specs/papers-library-importer/tasks.md @@ -80,6 +80,15 @@ - Use DataframeData type from ~/v1/domain/entities/import/ImportAnalysis.ts - _Requirements: 1.1, 5.1_ +- [ ] 4.1.1 Add CSV parser component with column selection + - Add performant CSV parser library dependency (papaparse or similar) + - Implement CSV file parsing in ImportFileUpload.vue component + - Allow user to select reference column and files column for PDF matching + - Convert CSV entries to generic dataframe format (preserve all columns) + - Add validation for required columns and data types + - Handle CSV parsing errors gracefully with user feedback + - _Requirements: 1.2, 5.2_ + - [x] 4.2 Implement file-to-reference matching logic - Create file matching algorithm based on filepath or filename patterns - Implement exact match, partial match, and fuzzy matching strategies @@ -87,6 +96,14 @@ - Add validation for PDF file types and sizes - _Requirements: 1.3, 1.6_ +- [ ] 4.2.1 Enhance PDF matching with maximum prefix path matching + - Implement maximum prefix path matching algorithm for better file association + - Improve matching to handle multiple PDFs per reference correctly + - Add progressive file addition with proper deduplication + - Clean up redundant matching information and improve matching accuracy + - Ensure correct handling when reference matches multiple PDF files + - _Requirements: 1.4, 1.8_ + - [x] 5. Create home page integration and modal workflow - [x] 5.1 Add Import Documents button to home page and modify workspace selection - Add "Import Documents" button above ImportFromHub and ImportFromPython components in pages/index.vue @@ -106,6 +123,14 @@ - Pass workspace ID to ImportAnalysisTable component - _Requirements: 2.1, 4.3_ +- [ ] 5.2.1 Improve modal flow control and closing behavior + - Update ImportModal.vue to disable confirm-close after successful completion + - Ensure confirm-close is only active during import process, not after completion + - Allow flexible upload order (bibliography first or PDFs first) + - Improve step navigation to preserve data when moving between steps + - Add event emission to refresh recent import list on home screen after modal closes + - _Requirements: 7.1, 7.2, 7.3, 7.4, 7.5_ + - [ ] 6. Implement upload step components - [x] 6.1 Create ImportBibUpload.vue component (Step 1) - Implement .bib file upload with drag-and-drop interface @@ -146,6 +171,13 @@ - Fix workspaceId reference in useImportAnalysisViewModel.ts to properly access workspace from parent component - _Requirements: 2.1, 2.2, 2.7_ +- [ ] 7.2.1 Add option to import references without PDFs + - Add toggle option to import entire table including references without matched PDFs + - Add toggle option to import only references with at least one matched PDF file + - Update table filtering to show/hide references without PDFs based on user selection + - Modify import confirmation logic to respect user's choice about references without PDFs + - _Requirements: 2.6, 2.8, 2.9_ + - [x] 7.3 Fix ImportModal step navigation and data persistence - Update ImportFileUpload.vue to accept initialBibData and initialPdfData props - Add initializeWithExistingData() method to restore component state when navigating back diff --git a/.kiro/steering/structure.md b/.kiro/steering/structure.md index 724a8d1b8..c214b75df 100644 --- a/.kiro/steering/structure.md +++ b/.kiro/steering/structure.md @@ -62,6 +62,11 @@ extralit-frontend/ └── package.json # npm configuration ``` +### Existing Auto-Imported Components + +, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , + + ### Key Frontend Patterns - **Components**: Base components in `components/base/`, feature components in `components/features/` - **Pages**: Nuxt.js file-based routing in `pages/` From bc7c5973a7aeba4d75ab3c63ccff66387880251a Mon Sep 17 00:00:00 2001 From: JTran-IDM Date: Thu, 7 Aug 2025 00:15:48 -0700 Subject: [PATCH 02/19] updated steering --- .kiro/specs/papers-library-importer/tasks.md | 4 +- .kiro/steering/tech.md | 193 +++++++++++-------- 2 files changed, 114 insertions(+), 83 deletions(-) diff --git a/.kiro/specs/papers-library-importer/tasks.md b/.kiro/specs/papers-library-importer/tasks.md index f89fbdaab..d77042345 100644 --- a/.kiro/specs/papers-library-importer/tasks.md +++ b/.kiro/specs/papers-library-importer/tasks.md @@ -33,7 +33,7 @@ - Enable easy testing of backend import analysis before building frontend - _Requirements: 1.1, 2.1, 2.2_ -- [ ] 3. Create bulk document upload endpoint +- [x] 3. Create bulk document upload endpoint - [x] 3.1 Implement bulk upload API handler - Create POST /documents/bulk endpoint in documents.py handler - Handle multipart form data with documents_metadata and files @@ -63,7 +63,7 @@ - Remove import history creation from bulk upload (moved to separate endpoint) - _Requirements: 3.2, 3.5, 4.1, 4.6_ -- [ ] 4. Create frontend domain architecture and implement BibTeX parsing +- [x] 4. Create frontend domain architecture and implement BibTeX parsing - [x] 4.0 Create frontend domain entities and use cases - Create ImportAnalysis.ts in ~/v1/domain/entities/import/ with backend API data structures - Create get-import-analysis-use-case.ts in ~/v1/domain/usecases/ for API communication diff --git a/.kiro/steering/tech.md b/.kiro/steering/tech.md index 7b625a169..1de5b217e 100644 --- a/.kiro/steering/tech.md +++ b/.kiro/steering/tech.md @@ -1,99 +1,130 @@ -# Technology Stack +--- +inclusion: always +--- + +# Technology Stack & Development Guidelines ## Architecture Overview -Extralit is a multi-component system with 5 core components: -- **Python SDK**: Client library (`pip install extralit`) -- **FastAPI Server**: Backend API handling users, storage, and data management -- **Web UI**: Vue.js/Nuxt.js frontend for data visualization and annotation -- **Vector Database**: ElasticSearch or AWS OpenSearch for scalable search -- **Database**: PostgreSQL for application data storage - -## Backend (extralit-server/) -- **Framework**: FastAPI ~0.115.0 -- **Database**: SQLAlchemy 2.0 with PostgreSQL (asyncpg) or SQLite (aiosqlite) -- **Search**: ElasticSearch 8.x or OpenSearch 2.x -- **Background Jobs**: Redis Queue (RQ) with Redis -- **Authentication**: python-jose with JWT tokens, OAuth2 support -- **Build System**: PDM (Python Dependency Management) -- **Python**: >=3.9 - -### Key Dependencies -- Pydantic 2.9 for data validation -- Alembic for database migrations -- Uvicorn for ASGI server -- Typer for CLI interface - -## Frontend (extralit-frontend/) -- **Framework**: Nuxt.js 2.17 (Vue.js 2.7) -- **Component Import**: Nuxt automatically scans the ~/components directory and makes all .vue files -- **Build System**: npm/yarn -- **UI Components**: Custom component library with SCSS -- **State Management**: Pinia + Vuex -- **Testing**: Jest (unit), Playwright (e2e) -- **Node**: >=18.16.1 -- **TypeScript**: Use ` + + diff --git a/extralit-frontend/components/features/import/CsvColumnSelection.vue b/extralit-frontend/components/features/import/CsvColumnSelection.vue new file mode 100644 index 000000000..7e499757a --- /dev/null +++ b/extralit-frontend/components/features/import/CsvColumnSelection.vue @@ -0,0 +1,301 @@ + + + + + diff --git a/extralit-frontend/components/features/import/ImportAnalysisTable.vue b/extralit-frontend/components/features/import/ImportAnalysisTable.vue index ef0ace5d7..265028580 100644 --- a/extralit-frontend/components/features/import/ImportAnalysisTable.vue +++ b/extralit-frontend/components/features/import/ImportAnalysisTable.vue @@ -51,10 +51,10 @@

Import Options

- + Import all references (including those without PDFs) - + Import only references with at least one PDF file
@@ -483,7 +483,7 @@ export default { } }, - handleImportModeChange() { + handleImportModeChange(): void { // When import mode changes, automatically set references without PDFs to ignore if mode is 'with-pdfs' if (this.importMode === 'with-pdfs') { this.allTableData.forEach(row => { @@ -672,7 +672,10 @@ export default { }, setup(props) { - return useImportAnalysisViewModel(props); + const viewModel = useImportAnalysisViewModel(props); + return { + ...viewModel, + }; } }; diff --git a/extralit-frontend/components/features/import/ImportFileUpload.vue b/extralit-frontend/components/features/import/ImportFileUpload.vue index fd2b7aa5d..47f52e9f0 100644 --- a/extralit-frontend/components/features/import/ImportFileUpload.vue +++ b/extralit-frontend/components/features/import/ImportFileUpload.vue @@ -8,251 +8,57 @@
-
-
-

Step 1: Upload Your Bibliography File

-

- Import your reference list to begin.
- We support .bib files exported from reference managers like Zotero, EndNote, or Mendeley, and .csv files with tabular data. -

-
- -
- - -
- -

- {{ getBibDropzoneText }} -

-

Supported formats: .bib, .bibtex, .csv

-
-
- - -
- - - Successfully uploaded {{ bibData.fileName }} ({{ bibData.parsedEntries.length }} entries found) - -
- - -
- -
-

Bibliography Parsing Error

-

{{ bibErrorMessage }}

-
-
- - -
-
-

Configure CSV Import

-

- Select the columns that contain reference identifiers and file paths for PDF matching. -

-
- -
-
- -

- Column containing unique identifiers for each reference (e.g., citation key, ID) -

-
- -
- -

- Column containing file paths or names for PDF matching (leave empty if not available) -

-
-
- -
-
Data Preview (first 3 rows):
-
- - - - - - - - - - - -
- {{ column }} - REF - FILES -
- {{ row[column] || '' }} -
-
-
- -
- - Process CSV Data - - - Cancel - -
-
-
+ -
-
-

Step 2: Upload Full-Text PDFs

-

- Upload the PDF files that correspond to the references in your .bib file.
- Extralit will match them automatically for extraction. -

-
- -
- - -
- -

- {{ getPdfDropzoneText }} -

-

Upload a folder containing your PDF files.

-
-
- - -
-
-

Processing PDF Files...

- {{ pdfProcessedFiles }}/{{ pdfTotalFiles }} files -
-
-
-
-
- - -
- - - {{ pdfData.totalFiles }} PDF files uploaded - - ({{ pdfData.matchedFiles.length }} matched) - - -
- - -
- -
-

PDF Processing Error

-

{{ pdfErrorMessage }}

-
-
-
+
-
-

Summary status:

- -
- -
- - {{ bibData.parsedEntries.length }} references - found -
- - -
- - {{ pdfData.totalFiles }} PDF files uploaded -
- - -
- - - {{ pdfData.matchedFiles.length }} matched, {{ pdfData.unmatchedFiles.length }} mismatch{{ - pdfData.unmatchedFiles.length === 1 ? "" : "es" - }} - detected - -
-
-
+
+ + diff --git a/extralit-frontend/components/features/import/PdfUpload.vue b/extralit-frontend/components/features/import/PdfUpload.vue new file mode 100644 index 000000000..2681cbf08 --- /dev/null +++ b/extralit-frontend/components/features/import/PdfUpload.vue @@ -0,0 +1,509 @@ + + + + + From 537f6db9924128d3574d81c6a6d566b1c50461c8 Mon Sep 17 00:00:00 2001 From: JonnyTran Date: Thu, 7 Aug 2025 13:03:10 -0700 Subject: [PATCH 09/19] Refactor import components and remove unused files - Updated BaseFlowModal.spec.js to correct the stub for BaseButton. - Improved formatting in ImportHistoryDataPreview.spec.js and other test files for consistency. --- .../base-flow-modal/BaseFlowModal.spec.js | 2 +- .../import/ImportHistoryDataPreview.spec.js | 20 +++--- .../features/import/RecentImportCard.spec.js | 2 +- .../{ => file-upload}/CsvColumnSelection.vue | 0 .../{ => file-upload}/ImportFileUpload.vue | 6 +- .../ImportSummarySidebar.vue | 0 .../import/{ => file-upload}/PdfUpload.vue | 0 .../TableUpload.vue} | 70 +++++++++---------- .../import/useRecentImportsViewModel.spec.js | 2 +- .../PdfMatchingService.integration.spec.js | 41 ++++++----- 10 files changed, 74 insertions(+), 69 deletions(-) rename extralit-frontend/components/features/import/{ => file-upload}/CsvColumnSelection.vue (100%) rename extralit-frontend/components/features/import/{ => file-upload}/ImportFileUpload.vue (99%) rename extralit-frontend/components/features/import/{ => file-upload}/ImportSummarySidebar.vue (100%) rename extralit-frontend/components/features/import/{ => file-upload}/PdfUpload.vue (100%) rename extralit-frontend/components/features/import/{BibliographyUpload.vue => file-upload/TableUpload.vue} (86%) diff --git a/extralit-frontend/components/base/base-flow-modal/BaseFlowModal.spec.js b/extralit-frontend/components/base/base-flow-modal/BaseFlowModal.spec.js index 69f70fe0d..d556235cd 100644 --- a/extralit-frontend/components/base/base-flow-modal/BaseFlowModal.spec.js +++ b/extralit-frontend/components/base/base-flow-modal/BaseFlowModal.spec.js @@ -23,7 +23,7 @@ describe("BaseFlowModal", () => { propsData: defaultProps, stubs: { "base-icon": true, - "BaseButton": { + BaseButton: { template: '', props: ["variant", "disabled", "loading"], }, diff --git a/extralit-frontend/components/features/import/ImportHistoryDataPreview.spec.js b/extralit-frontend/components/features/import/ImportHistoryDataPreview.spec.js index fff111c87..4f3f74d74 100644 --- a/extralit-frontend/components/features/import/ImportHistoryDataPreview.spec.js +++ b/extralit-frontend/components/features/import/ImportHistoryDataPreview.spec.js @@ -122,7 +122,7 @@ describe("ImportHistoryDataPreview", () => { stubs: { BaseIcon: true, BaseButton: { - template: '', + template: "", props: ["variant"], }, }, @@ -199,7 +199,7 @@ describe("ImportHistoryDataPreview", () => { expect(columns[0].field).toBe("reference"); expect(columns[0].frozen).toBe(true); - const titleColumn = columns.find(col => col.field === "title"); + const titleColumn = columns.find((col) => col.field === "title"); expect(titleColumn).toBeDefined(); expect(titleColumn.title).toBe("title"); }); @@ -293,15 +293,15 @@ describe("ImportHistoryDataPreview", () => { const mockCell = { getValue: () => true }; const result = wrapper.vm.booleanFormatter(mockCell); - expect(result).toContain('boolean-true'); - expect(result).toContain('✓'); + expect(result).toContain("boolean-true"); + expect(result).toContain("✓"); }); it("should format number cells correctly", () => { const mockCell = { getValue: () => 1234 }; const result = wrapper.vm.numberFormatter(mockCell); - expect(result).toContain('1,234'); + expect(result).toContain("1,234"); }); it("should format URL cells correctly", () => { @@ -315,8 +315,8 @@ describe("ImportHistoryDataPreview", () => { it("should handle null values in formatters", () => { const mockCell = { getValue: () => null }; - expect(wrapper.vm.numberFormatter(mockCell)).toBe('-'); - expect(wrapper.vm.urlFormatter(mockCell)).toBe('-'); + expect(wrapper.vm.numberFormatter(mockCell)).toBe("-"); + expect(wrapper.vm.urlFormatter(mockCell)).toBe("-"); }); }); @@ -348,7 +348,7 @@ describe("ImportHistoryDataPreview", () => { it("should enable pagination for large datasets", async () => { // Add more records to trigger pagination const manyRecords = Array.from({ length: 25 }, (_, i) => ({ - reference: `paper_${i.toString().padStart(3, '0')}`, + reference: `paper_${i.toString().padStart(3, "0")}`, title: `Paper Title ${i}`, })); @@ -377,7 +377,7 @@ describe("ImportHistoryDataPreview", () => { it("should clear filters", () => { wrapper.setData({ searchQuery: "test", - statusFilter: "add" + statusFilter: "add", }); wrapper.vm.clearFilters(); @@ -461,4 +461,4 @@ describe("ImportHistoryDataPreview", () => { expect(wrapper.vm.totalRecords).toBe(0); }); }); -}); \ No newline at end of file +}); diff --git a/extralit-frontend/components/features/import/RecentImportCard.spec.js b/extralit-frontend/components/features/import/RecentImportCard.spec.js index 93b13574b..bd5024a93 100644 --- a/extralit-frontend/components/features/import/RecentImportCard.spec.js +++ b/extralit-frontend/components/features/import/RecentImportCard.spec.js @@ -495,4 +495,4 @@ describe("RecentImportCard Component", () => { // The CSS should handle truncation, so we just verify the content is there }); }); -}); \ No newline at end of file +}); diff --git a/extralit-frontend/components/features/import/CsvColumnSelection.vue b/extralit-frontend/components/features/import/file-upload/CsvColumnSelection.vue similarity index 100% rename from extralit-frontend/components/features/import/CsvColumnSelection.vue rename to extralit-frontend/components/features/import/file-upload/CsvColumnSelection.vue diff --git a/extralit-frontend/components/features/import/ImportFileUpload.vue b/extralit-frontend/components/features/import/file-upload/ImportFileUpload.vue similarity index 99% rename from extralit-frontend/components/features/import/ImportFileUpload.vue rename to extralit-frontend/components/features/import/file-upload/ImportFileUpload.vue index 47f52e9f0..577cfd82b 100644 --- a/extralit-frontend/components/features/import/ImportFileUpload.vue +++ b/extralit-frontend/components/features/import/file-upload/ImportFileUpload.vue @@ -8,7 +8,7 @@
- @@ -31,7 +31,7 @@