Skip to content

JS Refactor and Code Cleanup#282

Open
klpoland wants to merge 24 commits into
masterfrom
feature-kpoland-cleanup-refactor-deprecated-js
Open

JS Refactor and Code Cleanup#282
klpoland wants to merge 24 commits into
masterfrom
feature-kpoland-cleanup-refactor-deprecated-js

Conversation

@klpoland
Copy link
Copy Markdown
Collaborator

No description provided.

@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com Bot commented May 11, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  gateway/sds_gateway/templates/users/partials/share_modal.html  80% smaller
  gateway/sds_gateway/static/js/tests-config/jest.config.js  47% smaller
  gateway/package.json  40% smaller
  gateway/sds_gateway/static/js/core/APIClient.js  32% smaller
  gateway/sds_gateway/templates/users/components/dataset_list_modals.html  31% smaller
  gateway/sds_gateway/static/js/search/AssetSearchHandler.js  31% smaller
  gateway/sds_gateway/static/js/actions/VersioningActionManager.js  28% smaller
  gateway/sds_gateway/static/js/search/__tests__/DatasetSearchHandler.test.js  27% smaller
  gateway/sds_gateway/users/views/datasets.py  24% smaller
  gateway/sds_gateway/static/js/core/__tests__/DOMUtils.test.js  24% smaller
  gateway/sds_gateway/static/js/tests-config/jest.setup.js  22% smaller
  gateway/sds_gateway/static/js/actions/QuickAddToDatasetManager.js  22% smaller
  gateway/sds_gateway/templates/allauth/layouts/entrance.html  22% smaller
  gateway/sds_gateway/static/js/dataset/__tests__/DatasetCreationHandler.test.js  21% smaller
  gateway/sds_gateway/static/js/core/PageLifecycleManager.js  15% smaller
  gateway/sds_gateway/static/js/actions/__tests__/ShareActionManager.test.js  12% smaller
  gateway/sds_gateway/templates/users/components/message.html  12% smaller
  gateway/sds_gateway/static/js/core/__tests__/APIClient.test.js  11% smaller
  gateway/sds_gateway/templates/users/dataset_list.html  11% smaller
  gateway/sds_gateway/static/js/dataset/__tests__/DatasetEditingHandler.test.js  11% smaller
  gateway/sds_gateway/static/js/actions/__tests__/VersioningActionManager.test.js  11% smaller
  gateway/sds_gateway/static/js/actions/PublishActionManager.js  10% smaller
  gateway/sds_gateway/static/js/dataset/DatasetCreationHandler.js  9% smaller
  gateway/sds_gateway/static/js/actions/__tests__/PublishActionManager.test.js  9% smaller
  gateway/sds_gateway/static/js/core/DOMUtils.js  8% smaller
  gateway/sds_gateway/users/views/files.py  8% smaller
  gateway/sds_gateway/static/js/share/__tests__/ShareGroupManager.test.js  7% smaller
  gateway/sds_gateway/static/js/dataset/DatasetModeManager.js  7% smaller
  gateway/sds_gateway/static/js/search/__tests__/AssetSearchHandler.test.js  7% smaller
  gateway/sds_gateway/static/js/upload/FilesBrowserManager.js  7% smaller
  gateway/sds_gateway/static/js/dataset/__tests__/DatasetModeManager.test.js  7% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallVisualization.js  6% smaller
  gateway/sds_gateway/static/js/actions/__tests__/DownloadActionManager.test.js  6% smaller
  gateway/sds_gateway/static/js/share/ShareGroupManager.js  4% smaller
  gateway/sds_gateway/static/js/dataset/DatasetEditingHandler.js  4% smaller
  gateway/sds_gateway/static/js/actions/DetailsActionManager.js  4% smaller
  gateway/sds_gateway/static/js/visualizations/spectrogram/SpectrogramVisualization.js  4% smaller
  gateway/sds_gateway/static/js/actions/__tests__/DetailsActionManager.test.js  3% smaller
  gateway/sds_gateway/static/js/actions/DownloadActionManager.js  2% smaller
  gateway/sds_gateway/users/views/captures.py  2% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/WaterfallRenderer.js  1% smaller
  gateway/sds_gateway/static/js/actions/DownloadInstructionsManager.js  1% smaller
  .cursor/rules/django_javascript_implementation.mdc Unsupported file format
  .cursor/skills/jest-test-writing/SKILL.md Unsupported file format
  .cursor/skills/jest-test-writing/reference.md Unsupported file format
  .github/workflows/gwy-code-quality.yaml  0% smaller
  .github/workflows/sdk-code-quality.yaml  0% smaller
  .pre-commit-config.yaml  0% smaller
  gateway/.fallowrc.json  0% smaller
  gateway/.gitignore Unsupported file format
  gateway/package-lock.json  0% smaller
  gateway/scripts/fallow-cross-file-dupes.sh Unsupported file format
  gateway/scripts/fallow-static-js-dead-code.cjs  0% smaller
  gateway/sds_gateway/api_methods/serializers/capture_serializers.py  0% smaller
  gateway/sds_gateway/static/css/file-list.css  0% smaller
  gateway/sds_gateway/static/js/__tests__/file-list.test.js  0% smaller
  gateway/sds_gateway/static/js/__tests__/helpers/actionTestMocks.js  0% smaller
  gateway/sds_gateway/static/js/actions/ShareActionManager.js Unsupported file format
  gateway/sds_gateway/static/js/actions/__tests__/DownloadInstructionsManager.test.js  0% smaller
  gateway/sds_gateway/static/js/actions/__tests__/QuickAddToDatasetManager.test.js  0% smaller
  gateway/sds_gateway/static/js/actions/__tests__/quickAddApi.test.js  0% smaller
  gateway/sds_gateway/static/js/actions/details/AssetDetailsModalLoader.js  0% smaller
  gateway/sds_gateway/static/js/actions/details/CaptureDetailsModalBehavior.js  0% smaller
  gateway/sds_gateway/static/js/actions/details/__tests__/AssetDetailsModalLoader.test.js  0% smaller
  gateway/sds_gateway/static/js/actions/details/__tests__/CaptureDetailsModalBehavior.test.js  0% smaller
  gateway/sds_gateway/static/js/actions/download/captureDownloadSlider.js  0% smaller
  gateway/sds_gateway/static/js/actions/quickAdd/quickAddApi.js  0% smaller
  gateway/sds_gateway/static/js/components.js  0% smaller
  gateway/sds_gateway/static/js/constants/FileListConfig.js  0% smaller
  gateway/sds_gateway/static/js/constants/__tests__/detailsModalConfig.test.js  0% smaller
  gateway/sds_gateway/static/js/constants/detailsModalConfig.js  0% smaller
  gateway/sds_gateway/static/js/core/BaseManager.js  0% smaller
  gateway/sds_gateway/static/js/core/ModalManager.js  0% smaller
  gateway/sds_gateway/static/js/core/PageController.js  0% smaller
  gateway/sds_gateway/static/js/core/PageGate.js  0% smaller
  gateway/sds_gateway/static/js/core/UserInputController.js  0% smaller
  gateway/sds_gateway/static/js/core/__tests__/ListRefreshManager.test.js  0% smaller
  gateway/sds_gateway/static/js/core/__tests__/ModalManager.test.js  0% smaller
  gateway/sds_gateway/static/js/core/__tests__/PageController.test.js  0% smaller
  gateway/sds_gateway/static/js/core/__tests__/PageLifecycleManager.test.js  0% smaller
  gateway/sds_gateway/static/js/dataset/AuthorsManager.js  0% smaller
  gateway/sds_gateway/static/js/dataset/DatasetAuthorsUI.js  0% smaller
  gateway/sds_gateway/static/js/dataset/DatasetPendingChanges.js  0% smaller
  gateway/sds_gateway/static/js/dataset/datasetFormSnapshot.js  0% smaller
  gateway/sds_gateway/static/js/deprecated/captureGroupingComponents.js  0% smaller
  gateway/sds_gateway/static/js/deprecated/dataset-list.js  0% smaller
  gateway/sds_gateway/static/js/deprecated/datasetDetailsModal.js  0% smaller
  gateway/sds_gateway/static/js/deprecated/permission-levels.js  0% smaller
  gateway/sds_gateway/static/js/deprecated/project.js  0% smaller
  gateway/sds_gateway/static/js/deprecated/shareGroupManager.js  0% smaller
  gateway/sds_gateway/static/js/deprecated/userSearchComponent.js  0% smaller
  gateway/sds_gateway/static/js/file-list.js  0% smaller
  gateway/sds_gateway/static/js/file_list_upload_capture_modal.js  0% smaller
  gateway/sds_gateway/static/js/files-ui.js  0% smaller
  gateway/sds_gateway/static/js/files-upload.js  0% smaller
  gateway/sds_gateway/static/js/search/ConfiguredSearchElements.js  0% smaller
  gateway/sds_gateway/static/js/search/DatasetSearchHandler.js  0% smaller
  gateway/sds_gateway/static/js/search/DebouncedSearchManager.js  0% smaller
  gateway/sds_gateway/static/js/share/UserSearchDropdown.js  0% smaller
  gateway/sds_gateway/static/js/share/__tests__/UserSearchDropdown.test.js  0% smaller
  gateway/sds_gateway/static/js/tests-config/testHelpers.js  0% smaller
  gateway/sds_gateway/static/js/theme.js  0% smaller
  gateway/sds_gateway/static/js/upload/CaptureTypeSelector.js  0% smaller
  gateway/sds_gateway/static/js/upload/CaptureUploadController.js  0% smaller
  gateway/sds_gateway/static/js/upload/FileUploadHandler.js  0% smaller
  gateway/sds_gateway/static/js/upload/UploadUtils.js  0% smaller
  gateway/sds_gateway/static/js/upload/__tests__/CaptureUploadController.test.js  0% smaller
  gateway/sds_gateway/static/js/upload/__tests__/UploadUtils.test.js  0% smaller
  gateway/sds_gateway/static/js/upload/uploadBootstrap.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/common/asyncJobPolling.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/errorHandler.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/processingErrorMessages.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/__tests__/WaterfallRenderer.test.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/__tests__/WaterfallVisualization.test.js  0% smaller
  gateway/sds_gateway/static/js/visualizations/waterfall/waterfallColorMaps.js Unsupported file format
  gateway/sds_gateway/templates/base.html  0% smaller
  gateway/sds_gateway/templates/pages/home.html Unsupported file format
  gateway/sds_gateway/templates/users/capture_list.html  0% smaller
  gateway/sds_gateway/templates/users/components/asset_list_table.html Unsupported file format
  gateway/sds_gateway/templates/users/components/asset_list_table_thead.html  0% smaller
  gateway/sds_gateway/templates/users/components/badge.html  0% smaller
  gateway/sds_gateway/templates/users/components/button.html  0% smaller
  gateway/sds_gateway/templates/users/components/capture_details_modal_body.html  0% smaller
  gateway/sds_gateway/templates/users/components/capture_files_summary_fragment.html  0% smaller
  gateway/sds_gateway/templates/users/components/capture_list_modals.html  0% smaller
  gateway/sds_gateway/templates/users/components/capture_list_table_row.html  0% smaller
  gateway/sds_gateway/templates/users/components/dataset_details_modal_body.html  0% smaller
  gateway/sds_gateway/templates/users/components/dataset_list_table.html Unsupported file format
  gateway/sds_gateway/templates/users/components/dataset_list_table_row.html Unsupported file format
  gateway/sds_gateway/templates/users/components/dropdown_menu.html  0% smaller
  gateway/sds_gateway/templates/users/components/loading_spinner.html  0% smaller
  gateway/sds_gateway/templates/users/components/modal_permissions.html  0% smaller
  gateway/sds_gateway/templates/users/components/modal_technical_details.html  0% smaller
  gateway/sds_gateway/templates/users/components/toast.html  0% smaller
  gateway/sds_gateway/templates/users/file_list.html  0% smaller
  gateway/sds_gateway/templates/users/files.html Unsupported file format
  gateway/sds_gateway/templates/users/group_captures.html  0% smaller
  gateway/sds_gateway/templates/users/partials/asset_details_modal.html Unsupported file format
  gateway/sds_gateway/templates/users/partials/captures_page_table.html Unsupported file format
  gateway/sds_gateway/templates/users/partials/dataset_details_modal.html  0% smaller
  gateway/sds_gateway/templates/users/partials/search_published_datasets_tab.html Unsupported file format
  gateway/sds_gateway/templates/users/partials/upload_capture_modal.html  0% smaller
  gateway/sds_gateway/templates/users/partials/upload_capture_modal_files_extras.html  0% smaller
  gateway/sds_gateway/templates/users/partials/upload_result_modal.html  0% smaller
  gateway/sds_gateway/templates/users/partials/web_download_modal.html Unsupported file format
  gateway/sds_gateway/templates/users/published_datasets_list.html  0% smaller
  gateway/sds_gateway/templates/users/search_datasets.html Unsupported file format
  gateway/sds_gateway/templates/users/share_group_list.html  0% smaller
  gateway/sds_gateway/users/tests/test_details_modal_registry.py  0% smaller
  gateway/sds_gateway/users/tests/test_views.py  0% smaller
  gateway/sds_gateway/users/urls.py  0% smaller
  gateway/sds_gateway/users/views/__init__.py  0% smaller
  gateway/sds_gateway/users/views/details_modal.py  0% smaller
  gateway/sds_gateway/users/views/details_modal_registry.py  0% smaller

@klpoland klpoland changed the title Feature-kpoland-cleanup-refactor-deprecated-js JS Refactor and Code Cleanup May 11, 2026
@klpoland klpoland force-pushed the feature-kpoland-cleanup-refactor-deprecated-js branch from 9a08e11 to 32e67a8 Compare May 21, 2026 19:23
@klpoland klpoland force-pushed the feature-kpoland-cleanup-refactor-deprecated-js branch from c29194d to e1c0cf9 Compare May 22, 2026 19:17
@klpoland
Copy link
Copy Markdown
Collaborator Author

klpoland commented May 22, 2026

Okay, so, basic outline of this to help guide review:

  • Pre-commit hooks are gonna fail for now because I ran them and it ended up creating 30k+ lines of indentation changes and I don't want that to add noise to the PR
  • Added more rules and skills for JS code and Jest testing setup
  • Deleted all the deprecated code I could find.
  • The "meat" of the actual code additions are as follows:
    • Reworked the details modal rendering to align the dataset and capture details modals more and follow the backend rendering through details_modal_registry.py and details_modal.py since there were a lot of in-line template strings in JS. Now JS only handles page triggers. (This shift probably counts for a majority of the added code)
    • Consolidated modal management and refactored downstream classes to reflect this
    • De-duplicated toast/message/alert rendering applications
    • Moved capture and file page methods into the new structure, most of the functionality could be merged with the existing dataset functionality and made type agnostic. capture/file upload helpers exist under /upload.
    • Adding and updating tests

Take your time, I know it's a lot, but there was a lot of technical debt that came due :/

@klpoland klpoland marked this pull request as ready for review May 22, 2026 19:50
@klpoland klpoland requested a review from lucaspar May 22, 2026 19:50
@lucaspar
Copy link
Copy Markdown
Member

Good, go ahead if you want to add more agentic guidance through the next days to e.g. prevent inline template strings in JS in the future; or open a separate PR if this one is already merged later next week.

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.

2 participants