Skip to content

:chores: Moved dataset import/export to its own feature folder #249

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jpggvilaca
Copy link
Contributor

@jpggvilaca jpggvilaca commented May 20, 2025

📝 Description

Before:
pages/landing-page/landing-page-workspace/components/dataset-import-to-new-project
shared/components/dataset-import-deletion-dialog
project-details/components/project-dataset/dataset-imports
...other scattered folders

After:
Screenshot 2025-05-20 at 13 42 47

OPENS:

  1. Should we move services?
  2. Should we move providers?

✨ Type of Change

Select the type of change your PR introduces:

  • 🐞 Bug fix – Non-breaking change which fixes an issue
  • 🚀 New feature – Non-breaking change which adds functionality
  • 🔨 Refactor – Non-breaking change which refactors the code base
  • 💥 Breaking change – Changes that break existing functionality
  • 📚 Documentation update
  • 🔒 Security update
  • 🧪 Tests

🧪 Testing Scenarios

Describe how the changes were tested and how reviewers can test them too:

  • ✅ Tested manually
  • 🤖 Run automated end-to-end tests

✅ Checklist

Before submitting the PR, ensure the following:

  • 🔍 PR title is clear and descriptive
  • 📝 For internal contributors: If applicable, include the JIRA ticket number (e.g., ITEP-123456) in the PR title. Do not include full URLs
  • 💬 I have commented my code, especially in hard-to-understand areas
  • 📄 I have made corresponding changes to the documentation
  • ✅ I have added tests that prove my fix is effective or my feature works

@jpggvilaca jpggvilaca force-pushed the jvilaca/chores-dataset-import-feature branch from 192a253 to 94db4d3 Compare May 20, 2025 11:24
@jpggvilaca jpggvilaca requested a review from Copilot May 20, 2025 11:53
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.scss to dataset-export.module.scss and removed an unsafe className on a divider
  • Moved IntervalJobHandlers type 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

@@ -185,7 +185,7 @@ export const ExportDatasetDialog = ({ triggerState, datasetName }: ExportDataset
Convert frames to individual images
</Radio>
</RadioGroup>
<Divider size='S' UNSAFE_className={classes.divider} />
<Divider size='S' />
Copy link
Preview

Copilot AI May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the UNSAFE_className={classes.divider} likely drops intended styling for the divider. Consider re-adding the CSS class or moving styling to a safer prop if needed.

Suggested change
<Divider size='S' />
<Divider size='S' UNSAFE_className={classes.divider} />

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

@jpggvilaca jpggvilaca May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

divider class styles did not exist in the scss module.

@@ -5,6 +5,7 @@ import { AxiosError } from 'axios';
import { StatusCodes } from 'http-status-codes';
import { isFunction } from 'lodash-es';

import { IntervalJobHandlers } from '../../../features/dataset-import/types/dataset-import.interface';
Copy link
Preview

Copilot AI May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. We don't want to import anything from features/pages to core.

import { getIntervalJobHandlers } from '../../../core/datasets/hooks/utils';
import { JobExportStatus, JobStatusIdentifier } from '../../../core/jobs/jobs.interface';
import { ExportDatasetIdentifier, ExportDatasetStatusIdentifier } from '../../../core/projects/dataset.interface';
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';
Copy link
Preview

Copilot AI May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Copilot uses AI. Check for mistakes.

@dwesolow
Copy link
Contributor

dwesolow commented May 21, 2025

OPENS:

  1. Should we move services?
  2. Should we move providers?
  1. I don't think so, we want to have core that contains services and is reusable (e.g. for testing contracts etc).
  2. IMO it's good idea to move related providers to their feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants