:chores: Moved dataset import/export to its own feature folder#249
:chores: Moved dataset import/export to its own feature folder#249jpggvilaca wants to merge 9 commits intomainfrom
Conversation
192a253 to
94db4d3
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the codebase by consolidating all dataset export functionality into a new features/dataset-export folder, updating import paths and module references accordingly. It centralizes export-related components, hooks, and utilities under one feature, and renames CSS modules to dataset-export.module.scss.
- Updated import paths in tests and components to reflect new feature directory structure
- Renamed styling modules from
project-dataset.module.scsstodataset-export.module.scssand removed an unsafe className on a divider - Moved
IntervalJobHandlerstype import from core datasets to feature dataset-import, creating a cross-feature dependency
Reviewed Changes
Copilot reviewed 75 out of 76 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| web_ui/src/features/dataset-export/utils/utils.test.ts | Adjusted import path for ExportFormats |
| web_ui/src/features/dataset-export/hooks/use-export-dataset.hook.ts | Updated IntervalJobHandlers import location |
| web_ui/src/features/dataset-export/components/export-import-dataset-dialog-provider.component.tsx | Adjusted provider import path |
| web_ui/src/features/dataset-export/components/export-import-dataset-buttons.test.tsx | Updated test imports and mocks paths |
| web_ui/src/features/dataset-export/components/export-import-dataset-buttons.component.tsx | Reordered imports and updated paths |
| web_ui/src/features/dataset-export/components/export-dataset-status-job.test.tsx | Updated import paths in tests |
| web_ui/src/features/dataset-export/components/export-dataset-status-job.component.tsx | Updated imports and CSS module reference |
| web_ui/src/features/dataset-export/components/export-dataset-notification.test.tsx | Adjusted import paths in tests |
| web_ui/src/features/dataset-export/components/export-dataset-notification.component.tsx | Updated import paths |
| web_ui/src/features/dataset-export/components/export-dataset-message.test.tsx | Fixed relative import for utils |
| web_ui/src/features/dataset-export/components/export-dataset-message.component.tsx | Updated imports and CSS module reference |
| web_ui/src/features/dataset-export/components/export-dataset-download.test.tsx | Adjusted import paths and mocks |
| web_ui/src/features/dataset-export/components/export-dataset-download.component.tsx | Updated imports and CSS module reference |
| web_ui/src/features/dataset-export/components/export-dataset-dialog.test.tsx | Updated test imports and mocks |
| web_ui/src/features/dataset-export/components/export-dataset-dialog.component.tsx | Adjusted imports, removed unsafe className on Divider |
| web_ui/src/features/dataset-export/components/dataset-statistics.test.tsx | Updated import paths in tests |
| web_ui/src/core/datasets/hooks/utils.ts | Changed IntervalJobHandlers import to feature |
Files not reviewed (1)
- web_ui/src/features/dataset-export/components/dataset-export.module.scss: Language not supported
web_ui/src/features/dataset-export/components/export-dataset-dialog.component.tsx
Show resolved
Hide resolved
| import { StatusCodes } from 'http-status-codes'; | ||
| import { isFunction } from 'lodash-es'; | ||
|
|
||
| import { IntervalJobHandlers } from '../../../features/dataset-import/types/dataset-import.interface'; |
There was a problem hiding this comment.
[nitpick] Core utilities should not depend on feature-level types to avoid cyclic or inverted dependencies. Consider moving IntervalJobHandlers to a shared core or common package.
There was a problem hiding this comment.
+1. We don't want to import anything from features/pages to core.
There was a problem hiding this comment.
Agree! Moved to shared
| import { isStateDone, isStateError } from '../../../core/projects/hooks/utils'; | ||
| import QUERY_KEYS from '../../../core/requests/query-keys'; | ||
| import { useApplicationServices } from '../../../core/services/application-services-provider.component'; | ||
| import { IntervalJobHandlers } from '../../../features/dataset-import/types/dataset-import.interface'; |
There was a problem hiding this comment.
[nitpick] Importing IntervalJobHandlers from the dataset-import feature couples export logic to import-specific types. It may be cleaner to define a shared type in core or a common folder.
|
edb0c54 to
60ceaeb
Compare
| projectLabels={mockProjectLabels} | ||
| activeDatasetImport={{ ...mockDatasetImportItem, labels: ['cat'] }} | ||
| /> | ||
| <Provider theme={defaultTheme}> |
There was a problem hiding this comment.
why do we need this provider?
There was a problem hiding this comment.
Good Q, i also dont know why ONLY this test started failing, but i didnt waste too much time going deep into this for now
web_ui/src/shared/utils.ts
Outdated
| export const getIntervalJobHandlers = | ||
| <T extends JobGeneralProps>({ | ||
| onSuccess, | ||
| onSettled, | ||
| onError, | ||
| onCancel, | ||
| onCancelOrFailed, | ||
| }: IntervalJobHandlers<T>) => | ||
| (jobResponse: T) => { | ||
| if (isJobDone(jobResponse)) { | ||
| onSuccess(jobResponse); | ||
| } | ||
|
|
||
| if (isJobFailed(jobResponse)) { | ||
| onError({ | ||
| message: getFailedJobMessage(jobResponse), | ||
| response: { status: StatusCodes.NOT_IMPLEMENTED }, | ||
| } as AxiosError); | ||
|
|
||
| isFunction(onCancelOrFailed) && onCancelOrFailed(); | ||
| } | ||
|
|
||
| if (isJobCancel(jobResponse)) { | ||
| isFunction(onCancel) && onCancel(); | ||
|
|
||
| isFunction(onCancelOrFailed) && onCancelOrFailed(); | ||
| } | ||
|
|
||
| if (isJobSettled(jobResponse)) { | ||
| isFunction(onSettled) && onSettled(jobResponse); | ||
| } | ||
| }; |
There was a problem hiding this comment.
There was a problem hiding this comment.
out of scope of this PR but yes, good reminder : )
f2e9653 to
0907ccb
Compare
📝 Description
Before:
pages/landing-page/landing-page-workspace/components/dataset-import-to-new-projectshared/components/dataset-import-deletion-dialogproject-details/components/project-dataset/dataset-imports...other scattered folders
After:

✨ Type of Change
Select the type of change your PR introduces:
🧪 Testing Scenarios
Describe how the changes were tested and how reviewers can test them too:
✅ Checklist
Before submitting the PR, ensure the following: