Skip to content

feat(problem-data-upload): add client-side zipping for multiple files/folders upload#445

Open
whlongg wants to merge 3 commits intoVNOI-Admin:masterfrom
whlongg:feature/refactor-data-upload
Open

feat(problem-data-upload): add client-side zipping for multiple files/folders upload#445
whlongg wants to merge 3 commits intoVNOI-Admin:masterfrom
whlongg:feature/refactor-data-upload

Conversation

@whlongg
Copy link
Contributor

@whlongg whlongg commented Sep 20, 2025

Refactored the problem-data-upload template JavaScript for improved clarity and maintainability without altering functionality or server-side behavior.

Changes Made

  • Consolidated constants and regex patterns into clear sections for easier reference.
  • Grouped utility functions into logical namespaces (FileUtils, ZipUtils) to avoid clutter.
  • Removed repetitive code and replaced magic numbers with reusable helpers.
  • Added descriptive section comments (// === ZIP HANDLING ===, // === TABLE MANIPULATION ===, etc.) for better navigation.
  • Switched varconst/let for modern JavaScript best practices.
  • Preserved all existing functionality including JSZip client-side zipping and Django server-side pipeline.
  • Updated i18n messages for new labels and tooltips (Data file (file, folder, or zip archive), Hold Shift while clicking to select a folder).

Verification Steps

  1. Upload single ZIP → works as before.
  2. Upload multiple .in/.out files → client zips and submits successfully.
  3. Upload folder (Shift + Click) → folder is zipped and sent.
  4. Valid files are auto-filled in test cases table.
  5. Invalid or system files (__MACOSX, .DS_Store) are ignored.
  6. Checked cross-browser behavior (Chrome/Firefox latest).
image image

…bility

- Consolidated constants, regex patterns, and configuration into clear sections.
- Grouped utility functions into small namespaces (FileUtils, ZipUtils).
- Replaced repetitive code and magic numbers with reusable helpers.
- Added descriptive section comments for easier navigation.
- Switched var → const/let for modern JS practice.
- Preserved all existing functionality and server-side pipeline.
@magnified103 magnified103 linked an issue Dec 15, 2025 that may be closed by this pull request
@whlongg
Copy link
Contributor Author

whlongg commented Jan 24, 2026

@leduythuccs The branch has been updated.

@magnified103 magnified103 self-requested a review February 15, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow upload test as multiple files

1 participant