Skip to content
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

feat(medusa): Align product import and export #2471

Merged
merged 14 commits into from
Oct 20, 2022

Conversation

adrien2p
Copy link
Member

@adrien2p adrien2p commented Oct 19, 2022

What

Create a data structure that facilitate the addition of new column descriptor for both export and import and ensure that the column name is shared between bother import and export to facilitate the import with an exported file.

Tests

Add an additional integration tests that export a file, update the data, and re import the same file

FIXES CORE-716
FIXES CORE-713

@changeset-bot
Copy link

changeset-bot bot commented Oct 19, 2022

🦋 Changeset detected

Latest commit: 3e2738c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@medusajs/medusa Minor
medusa-react Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@adrien2p adrien2p force-pushed the feat/export-import-alignment branch from 453c4e2 to 4e20f83 Compare October 19, 2022 16:25
@adrien2p adrien2p marked this pull request as ready for review October 20, 2022 09:57
@adrien2p adrien2p requested a review from a team as a code owner October 20, 2022 09:57
Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

Great work so far @adrien2p!

I've identified a couple of things to change. Also, I am faced with the following error upon exporting products, changing product title, and import the same file again:

Error: The csv file parsing failed due to: Unable to treat column Sales channel 1 Name from the csv file. No target column found in the provided schema
    at ProductImportStrategy.<anonymous> (/Users/oliverjuhl/Desktop/medusa/medusa-import/node_modules/@medusajs/medusa/dist/strategies/batch-jobs/product/import.js:349:31)
    at step (/Users/oliverjuhl/Desktop/medusa/medusa-import/node_modules/@medusajs/medusa/dist/strategies/batch-jobs/product/import.js:59:23)
    at Object.throw (/Users/oliverjuhl/Desktop/medusa/medusa-import/node_modules/@medusajs/medusa/dist/strategies/batch-jobs/product/import.js:40:53)
    at rejected (/Users/oliverjuhl/Desktop/medusa/medusa-import/node_modules/@medusajs/medusa/dist/strategies/batch-jobs/product/import.js:32:65)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  type: 'invalid_data',
  code: undefined,
  date: 2022-10-20T11:10:07.886Z
}

My server has Sales Channel feature enabled, which might be the culprit to the issue.

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

Lgtm!

@adrien2p adrien2p closed this Oct 20, 2022
@adrien2p adrien2p reopened this Oct 20, 2022
Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

Nice addition! Spotted a bit of clean up to be done

package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

Should be good to merge when tests are passing 💪

@olivermrbl
Copy link
Contributor

Oh actually, can I get you to add a changeset 😅 @adrien2p

@kodiakhq kodiakhq bot merged commit 299c4ae into develop Oct 20, 2022
@kodiakhq kodiakhq bot deleted the feat/export-import-alignment branch October 20, 2022 14:48
@github-actions github-actions bot mentioned this pull request Oct 20, 2022
ymaheshwari1 pushed a commit to ymaheshwari1/medusa that referenced this pull request Oct 26, 2022
**What**

Create a data structure that facilitate the addition of new column descriptor for both export and import and ensure that the column name is shared between bother import and export to facilitate the import with an exported file. 

**Tests**

Add an additional integration tests that export a file, update the data, and re import the same file

FIXES CORE-716
FIXES CORE-713
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