Skip to content

Refactor file extension extraction and consolidate test helpers#1896

Open
Mbeaulne wants to merge 1 commit into03-04-bulk_argument_upload_-_template_selectionfrom
03-04-bulk_argument_upload_-_clean_up
Open

Refactor file extension extraction and consolidate test helpers#1896
Mbeaulne wants to merge 1 commit into03-04-bulk_argument_upload_-_template_selectionfrom
03-04-bulk_argument_upload_-_clean_up

Conversation

@Mbeaulne
Copy link
Collaborator

@Mbeaulne Mbeaulne commented Mar 4, 2026

Description

Refactored file import functionality by extracting a reusable getFileExtension utility function and consolidating duplicate test helper functions. The getFileExtension function replaces inline file extension parsing logic in both OasisSubmitter and SubmitTaskArgumentsDialog components. Additionally, created a shared FileImportResult interface to unify the return types between CSV and JSON import functions, and moved common test helper functions (makeSecretArg and makeInput) to a dedicated testHelpers.ts file.

Type of Change

  • Cleanup/Refactor

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Test Instructions

  1. Test file import functionality in the Oasis submitter by dragging and dropping CSV/JSON files
  2. Verify that the import file button in the task arguments dialog works correctly
  3. Ensure that file extension detection works properly for various file types
  4. Run the existing test suites to confirm no regressions

Additional Comments

This refactoring improves code maintainability by eliminating duplicate logic and providing better type safety through shared interfaces. The changes are purely structural and should not affect the user-facing functionality.

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

🎩 To tophat this PR:

You can add the following URL parameter to your browser to tophat this PR:

`?tophat_location=03-04-bulk_argument_upload_-_clean_up/d9f2238`

Copy link
Collaborator Author

Mbeaulne commented Mar 4, 2026

@Mbeaulne Mbeaulne changed the title bulk argument upload - clean up Refactor file extension extraction and consolidate test helpers Mar 4, 2026
@Mbeaulne Mbeaulne marked this pull request as ready for review March 5, 2026 16:35
@Mbeaulne Mbeaulne requested a review from a team as a code owner March 5, 2026 16:35
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.

1 participant