Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Copyright © 2019-present Sylius Sp. z o.o. All rights reserved.
Copyright © 2025-present Sylius Sp. z o.o. All rights reserved.

Sylius B2B Kit is the proprietary software of Sylius, licensed under the commercial license. Its use requires Sylius' consent.
Sylius GridImportExport Bundle is the proprietary software of Sylius, licensed under the commercial license. Its use requires Sylius' consent.
In any case you may not copy, decompile, sell or otherwise distribute or use this software without Sylius' explicit consent granted in the License Agreement.
If you have not concluded the agreement with Sylius, granting you the license to use Sylius Plus please remove this software from your devices.
90 changes: 89 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,89 @@
# GridImportExportBundle
<p align="center">
<a href="https://sylius.com" target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://media.sylius.com/sylius-logo-800-dark.png">
<source media="(prefers-color-scheme: light)" srcset="https://media.sylius.com/sylius-logo-800.png">
<img alt="Sylius Logo." src="https://media.sylius.com/sylius-logo-800.png">
</picture>
</a>
</p>

<h1 align="center">Grid Import/Export Bundle</h1>

The GridImportExportBundle allows for easy and decoupled data migration to and from various mediums.<br>
It works by relying on the Sylius [Resource](https://github.com/sylius/syliusresourcebundle) and [Grid](https://github.com/Sylius/syliusgridbundle) systems for resolving and providing data.

## Export

### Functionality

The main and bulk grid actions get automatically injected into configured resources' grids.

Supported formats:
- json
- csv

#### Main export action

It respects currently applied filters when exporting resources.

![Screenshot showing order grid with main action focused](docs/images/screenshot_order_main_action.png)

#### Bulk export action

In cases when specifying filters is not enough, or you want just a subset of the resource, in comes the bulk action.

![Screenshot showing order grid with bulk action focused](docs/images/screenshot_order_bulk_action.png)

#### Processes

Here you can manage currently running and already processed exports as well as download the exported data.

![Screenshot showing processes index](docs/images/screenshot_process_index.png)

## Installation

#### Beware!

This installation instruction assumes that you're using Symfony Flex. If you don't, take a look at the
[legacy installation instruction](docs/legacy_installation.md). However, we strongly encourage you to use
Symfony Flex, it's much quicker!

1. Require plugin with composer:

```bash
composer require sylius/grid-import-export-bundle
```

> Remember to allow community recipes with `composer config extra.symfony.allow-contrib true` or during plugin installation process

2. Apply migrations to your database:

```bash
bin/console doctrine:migrations:migrate
```

3. Configure export for resources:

```yaml
# config/packages/sylius_grid_import_export.yaml
sylius_grid_import_export:
export:
resources:
sylius.order: ~
app.brand:
sections:
- 'Sylius\Bundle\AdminBundle\SectionResolver\AdminSection'
provider: 'sylius_import_export.provider.resource_data.dbal'
```
For a more detailed overview check the [configuration reference](docs/configuration_reference.md).

## Exported files

By default, when a resource gets exported, a file is saved on the server. The save directory is specified
with the `%sylius_grid_import_export.export_files_directory%` parameter, that can be overridden if needed.

## Security issues

If you think that you have found a security issue, please do not use the issue tracker and do not post it publicly.
Instead, all security issues must be sent to `security@sylius.com`.
50 changes: 50 additions & 0 deletions docs/configuration_reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
## Configuration reference

### Export

Minimal resource configuration:

```yaml
sylius_grid_import_export:
export:
resources:
app.brand: ~
```

Full resource configuration:

```yaml
sylius_grid_import_export:
export:
resources:
app.brand:
provider: 'sylius_import_export.provider.resource_data.dbal'
sections:
- 'admin'
- 'Sylius\Bundle\ShopBundle\SectionResolver\ShopCustomerAccountSubSection'
```

Reference:

```yaml
sylius_grid_import_export:
export:
# The provider used by default when none is configured on a specific resource;
# defaults to 'sylius_import_export.provider.resource_data.grid'.
default_provider: <service_id>
# The section in which the actions are added to the grid.
# Can be either an FQCN of a class implementing the Sylius\Bundle\CoreBundle\SectionResolver\SectionInterface,
# or a value of the '_sylius.section' routing attribute;
# Defaults to 'admin'
default_section: <string>
resources:
# The alias of a resource as configured within the ResourceBundle
# It can be retried by using the `console/bin sylius:debug:resource` console command.
<resource_alias>:
# Resource specific overwrite of the default_provider
provider: <service_id>
# Resource specific overwrite of the default section
sections:
- <string>
- ...
```
Binary file added docs/images/screenshot_order_bulk_action.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/screenshot_order_main_action.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/screenshot_process_index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.