csv-import icon indicating copy to clipboard operation
csv-import copied to clipboard

Dont wait for whole CSV file to get parsed

Open rajkumarwaghmare opened this issue 1 year ago • 1 comments

Why this change is needed?

  • In case of very large files, waiting time for parsing to finish is considerably long.
  • Instead, just complete the CSV headers to key mapping and return the mapping. This will fasten the process and reduce the waiting time
  • Also, Import Successful message is displayed too early and this wording will confuse user in thinking that the actual CSV file has been mapped, parsed and uploaded/imported. So we need some mechanism where we display Import Successful message only after the data is really "imported" and not just parsed.

Proposed changes

      case StepEnum.MapColumns:
        return (
          <MapColumns
            template={parsedTemplate}
            data={data}
            columnMapping={columnMapping}
            skipHeaderRowSelection={skipHeader}
            selectedHeaderRow={selectedHeaderRow}
            onSuccess={(columnMapping) => {
              setIsSubmitting(true);
              setColumnMapping(columnMapping);
              if (onCSVHeadersMapped) {
                onCSVHeadersMapped(columnMapping).then(() => {
                  setIsSubmitting(false);
                  goNext();
                });
                return;
              }

rajkumarwaghmare avatar Jun 03 '24 06:06 rajkumarwaghmare

Submitted a PR here https://github.com/tableflowhq/csv-import/pull/230

rajkumarwaghmare avatar Jun 03 '24 08:06 rajkumarwaghmare