Coder Social home page Coder Social logo

laravel-enso / data-import Goto Github PK

View Code? Open in Web Editor NEW
20.0 8.0 9.0 924 KB

Laravel Enso XLSX Data Import package, built around the box/spout library, with templating, easy validation and more, for painless imports

Home Page: https://docs.laravel-enso.com/packages/data-import.html

License: MIT License

PHP 99.32% Blade 0.68%
laravel laravel-enso laravel-package excel-importer laravel-excel laravel-xls excel-import

data-import's People

Contributors

abdullahiabdulkabir avatar aocneanu avatar codacy-badger avatar gandesc avatar gitmanuela avatar hirsty avatar jpractice avatar raftx24 avatar stylecibot avatar vmcvlad avatar y0net avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

data-import's Issues

Error listing previously imported files - main query syntax error

Error message (and empty table):

You have to add in the main query 'id as "dtRowId"' for the actions to work

Problematic query:
https://github.com/laravel-enso/DataImport/blob/60774e7dcfce34179d1476c44dbc0f7b86fab816/src/app/Tables/Builders/DataImportTable.php#L14-L17

It should be (please note the \" around dtRowId and created_by):

        return DataImport::select(\DB::raw("data_imports.id, data_imports.id as \"dtRowId\", data_imports.type,
                data_imports.original_name, data_imports.comment, data_imports.created_at,
                concat(users.first_name, ' ', users.last_name) as \"created_by\""))
            ->join('users', 'data_imports.created_by', '=', 'users.id');

Tests not running

This is a bug.

Prerequisites

  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you check the documentation?
  • Did you perform a cursory search?

Description

See screenshot:
screenshot 2019-01-26 17 37 05

Steps to Reproduce

./vendor/bin/phpunit --filter DataImportTest

Template validation fails with `Sentence cased` table headers

This is a bug.

Prerequisites

  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you check the documentation?
  • Did you perform a cursory search?

Description

After the latest update to the Data Import package, the field validation fails due to the fact that it no longer converts the table header to snake_case.

Steps to Reproduce

  1. Try to import any .xlsx file, having the table headers in Sentance case.

Expected behavior

The validator should convert the table header to snake_case before validating.

Actual behavior

The validator responds with errors, notifying that the snake_cased columns are missing while the Sentence cased columns are extra.

image

UploadedFile object

We need an object for the uploaded files.

After creating it we need to update all the dependent packages

  • avatarmanager
  • documentsmanager
  • dataimport

fix stuck imports

When an import failes with an exception, it remains in status Processing (status = 20 ) and the import cannot be re-attempted even if the application has been updated and the issue resolved.

We should think about a new mechanism - perhaps only available to admins - that resets the import status.

MaxExecutionTime setting not applying correctly

This is a bug.

Prerequisites

  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you check the documentation?
  • Did you perform a cursory search?

Description

MaxExecutionTime is being calculated incorrectly
image
(screenshot of tests passing after setting template->maxExecutionTime to 0)

Steps to Reproduce

  1. Run tests with coverage on a regular machine
  2. Note a max execution time of 60 being exceeded.

Expected behavior

As none of the individual tests got close to the 60second mark; the tests to just continue

Actual behavior

max execution timeout, roughly 60seconds after the first dataimport test got initialized (so it doesn't seem to reset when being redefined, most likely)

SQL Server concat

Hi.
SQL SERVER throws the following exception on the query method of the DataImportTableController

SQLSTATE[42S22]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid column name ' '. (SQL: select top 10 data_imports.id, data_imports.id as dtRowId, data_imports.type, data_imports.original_name, data_imports.comment, data_imports.created_at, concat(users.first_name, " ", users.last_name) as created_by from [data_imports] inner join [users] on [data_imports].[created_by] = [users].[id] where ([data_imports].[original_name] LIKE %% or [data_imports].[created_by] LIKE %% or [data_imports].[created_at] LIKE %%))

Changing the query like below solves the problem.

return DataImport::select(\DB::raw("data_imports.id, data_imports.id as dtRowId, data_imports.type, data_imports.original_name, data_imports.comment, data_imports.created_at, concat(users.first_name, ' ' , users.last_name) as created_by")) ->join('users', 'data_imports.created_by', '=', 'users.id');

XML

This is a feature request.

Prerequisites

  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you check the documentation?
  • Did you perform a cursory search?

Description

XML Import - would this be possible to abstract to import different file formats? I'm looking to use with Gramps XML.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.