Baboo7 / strapi-plugin-import-export-entries

Import/Export data from and to your database in just few clicks.
175 stars 86 forks source link

[FEATURE] Being able to select import type in the code editor of the import modal #121

Open r0emek opened 1 year ago

r0emek commented 1 year ago

Importing other type than JSON via text editor import is impossible, There is no control to set type and no data check. Pasting other type results on server error during parsing.

To Reproduce

  1. Export data via any export button.
  2. select JSONv2 or csv format and "Fetch Data"
  3. copy content to clipboard
  4. Click export button (in same section where import was clicked)
  5. select Text Editor and paste data
  6. click "import"

Expected behavior Data is imported correctly

Screenshots image.

Additional context Data is always set as JSON when editor is opened: https://github.com/Baboo7/strapi-plugin-import-export-entries/blob/57c0870023425d2e8a25d4f02346bf9724c4ffcd/src/server/controllers/content-api/import-controller/import-data.js: const openCodeEditor = () => { setData('{\n\t\n}'); setDataFormat(dataFormats.JSON); };

It would be worth to add similar combo box with types like on export, or check type like in file import.

Baboo7 commented 1 year ago

@r0emek CSV is deprecated atm since I have limited resources to maintain this plugin. So JSON is the only supported type in the code editor. This issue is a feature request, not a bug

r0emek commented 1 year ago

Looked like a bug, because currently code editor supports only deprecated JSON not JSONv2

Baboo7 commented 1 year ago

It does support JSON V2, have a look at this section of the doc to format imported data