implerhq / impler.io

Powerful CSV & Excel Import experience for SaaS 🚀 Save months building data import experience from scratch 💰
https://impler.io
MIT License
198 stars 32 forks source link

File with empty mapping should not show empty records #727

Open chavda-bhavik opened 3 months ago

chavda-bhavik commented 3 months ago

Describe the bug Impler validates empty files at first. But none of the columns are required, and the user doesn't do any mapping. The review step shows a table with empty records.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://web.impler.io
  2. Create Import with following schema,
    [
    {
    "key": "Email",
    "name": "Email",
    "type": "Email",
    "alternateKeys": [],
    "isRequired": false,
    "isUnique": false,
    "isFrozen": false,
    "dateFormats": [
      "DD/MM/YYYY"
    ],
    "selectValues": []
    },
    {
    "key": "First Name",
    "name": "First Name",
    "type": "String",
    "alternateKeys": [],
    "isRequired": false,
    "isUnique": false,
    "isFrozen": false,
    "dateFormats": [
      "DD/MM/YYYY"
    ],
    "selectValues": []
    },
    {
    "key": "Last Name",
    "name": "Last Name",
    "type": "String",
    "alternateKeys": [],
    "isRequired": false,
    "isUnique": false,
    "isFrozen": false,
    "dateFormats": [
      "DD/MM/YYYY"
    ],
    "selectValues": []
    },
    {
    "key": "Company Name",
    "name": "Company Name",
    "type": "String",
    "alternateKeys": [],
    "isRequired": false,
    "isUnique": false,
    "isFrozen": false,
    "dateFormats": [
      "DD/MM/YYYY"
    ],
    "selectValues": []
    },
    {
    "key": "Twitter Handle",
    "name": "Twitter Handle",
    "type": "String",
    "alternateKeys": [],
    "isRequired": false,
    "isUnique": false,
    "isFrozen": false,
    "dateFormats": [
      "DD/MM/YYYY"
    ],
    "selectValues": []
    },
    {
    "key": "LinkedIn Handle",
    "name": "LinkedIn Handle",
    "type": "String",
    "alternateKeys": [],
    "isRequired": false,
    "isUnique": false,
    "isFrozen": false,
    "dateFormats": [
      "DD/MM/YYYY"
    ],
    "selectValues": []
    },
    {
    "key": "Lead Status",
    "name": "Lead Status",
    "type": "String",
    "alternateKeys": [],
    "isRequired": false,
    "isUnique": false,
    "isFrozen": false,
    "dateFormats": [
      "DD/MM/YYYY"
    ],
    "selectValues": []
    }
    ]
  3. Import data with the following file. Ma Contacts (sample).xlsx
  4. Do not map any columns.
  5. The review step will show empty records, image

Expected behavior The review step should exclude these empty records.

Additional context We can add check here for empty records, https://github.com/implerhq/impler.io/blob/next/apps/api/src/app/review/usecases/do-review/base-review.usecase.ts#L335

ChinmoyDn commented 2 months ago

Hi @chavda-bhavik, I would like to make an attempt at this. Could you please assign the issue to me?

chavda-bhavik commented 2 months ago

Sure @ChinmoyDn Feel free to ask any questions here or in discord

rothardo commented 3 weeks ago

Hi @chavda-bhavik is this issue up for grabs?