Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory & Naming Overhaul #221

Open
mahid797 opened this issue Feb 23, 2025 · 0 comments
Open

Directory & Naming Overhaul #221

mahid797 opened this issue Feb 23, 2025 · 0 comments
Assignees
Labels
🔥Critical Must be addressed immediately; blocking core functionality or major bug Frontend Frontend Related Issue New Feature New feature to be implemented Refactor Code Improvement
Milestone

Comments

@mahid797
Copy link
Collaborator

Goal

Migrate from the old /links/[linkId] layout to a cleaner /documentAccess/[linkId], ensuring all files are renamed and ephemeral styled components are removed or replaced. The new structure must accommodate dynamic, JSON‐based visitor fields alongside future expansions (e.g., more sub‐routes, analytics tracking).

Detailed Guidelines

  • Directory Structure:

    src/
    ├── app/
    │   ├── documentAccess/
    │   │   ├── [linkId]/
    │   │   │   ├── components/
    │   │   │   │   ├── AccessPage.tsx
    │   │   │   │   ├── VisitorInfoModal.tsx
    │   │   │   │   ├── AccessError.tsx
    │   │   │   │   └── FileDisplay.tsx
    │   │   │   ├── layout.tsx
    │   │   │   ├── loading.tsx
    │   │   │   └── page.tsx
    ├── components/
    │   ├── PDFViewer.tsx
    │   └── ...
    ├── hooks/
    │   ├── documentAccess/
    │   │   ├── useDocumentAccess.ts           // Hook for main doc link fetch logic
    │   │   ├── useVisitorSubmission.ts        // Hook for POST /access
    │   │   └── ... (any other hooks you create for analytics or events)
    │   └── ... (other domain-based folders, e.g. `auth`, `documents`, etc.)
    
  • Remove ephemeral styled components (e.g., styled(Box)(...)) unless absolutely needed. If a layout style is used multiple times, create a small local component (e.g., <RowBox />) or use inline sx props:

    <Box
    	sx={{
    		display: 'flex',
    		justifyContent: 'space-between',
    		alignItems: 'center',
    		gap: 2,
    	}}>
    	{/* content */}
    </Box>
  • JSON‐Based Fields:

    • The front end sees only the minimal keys from visitorFields. The actual labels or “required” logic come from the shared config.
  • Use Global Components:

    • Where possible, reuse existing global <FormInput>, <ModalWrapper>, or similar (in src/components/).
    • If no suitable global component exists, create one if it will be used frequently.

Tasks

  1. Rename /links/[linkId]/documentAccess/[linkId] and fix references in imports/routes.
  2. Rename files inside [linkId]/components:
    • FileAccessContainer.tsxAccessPage.tsx
    • FileAccessFormModal.tsxVisitorInfoModal.tsx
    • FileAccessMessage.tsxAccessError.tsx
  3. Remove or replace ephemeral styled components:
    • Inline sx or a small local <RowBox /> if reused frequently within the code.
  4. Verify final structure matches the new directory layout, including page.tsx for disclaimers/entry flow.
  5. Add or reuse any global components (<ModalWrapper>, <FormInput>, etc.) with minor tweaks, if needed.
@mahid797 mahid797 added Frontend Frontend Related Issue New Feature New feature to be implemented Refactor Code Improvement ⚡Important High-impact issue that needs to be resolved before the next release labels Feb 23, 2025
@mahid797 mahid797 added this to the v0.1 milestone Feb 23, 2025
@mahid797 mahid797 added 🔥Critical Must be addressed immediately; blocking core functionality or major bug and removed ⚡Important High-impact issue that needs to be resolved before the next release labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔥Critical Must be addressed immediately; blocking core functionality or major bug Frontend Frontend Related Issue New Feature New feature to be implemented Refactor Code Improvement
Projects
None yet
Development

No branches or pull requests

2 participants