Skip to content

Commit

Permalink
lock sylius 1.7 version
Browse files Browse the repository at this point in the history
  • Loading branch information
bigboss86 committed May 14, 2021
1 parent 11cedc9 commit 3e72e5f
Show file tree
Hide file tree
Showing 39 changed files with 436 additions and 261 deletions.
171 changes: 171 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
name: Build

on:
push: ~
pull_request: ~
release:
types: [created]
schedule:
-
cron: "0 1 * * 6" # Run at 1am every Saturday

jobs:
tests:
runs-on: ubuntu-latest

name: "PHP ${{ matrix.php }}, MySQL ${{ matrix.mysql }}"

strategy:
fail-fast: false
matrix:
php: [7.4, 7.3]
node: [10.x]
mysql: [5.7, 8.0]

exclude:
- # PHP 7.3 does not support "caching_sha2_password" authentication plugin which is a default one in MySQL 8.0
php: 7.3
mysql: 8.0

env:
APP_ENV: test
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}"

steps:
-
uses: actions/checkout@v2

-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
extensions: intl
tools: symfony
coverage: none

-
name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "${{ matrix.node }}"

-
name: Shutdown default MySQL
run: sudo service mysql stop

-
name: Setup MySQL
uses: mirromutth/[email protected]
with:
mysql version: "${{ matrix.mysql }}"
mysql root password: "root"

-
name: Output PHP version for Symfony CLI
run: php -v | head -n 1 | awk '{ print $2 }' > .php-version

-
name: Install certificates
run: symfony server:ca:install

-
name: Run Chrome Headless
run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 &

-
name: Run webserver
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon)

-
name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

-
name: Cache Composer
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-
-
name: Install PHP dependencies
run: composer install --no-interaction

-
name: Get Yarn cache directory
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

-
name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-yarn-
-
name: Install JS dependencies
run: (cd tests/Application && yarn install)

-
name: Prepare test application database
run: |
(cd tests/Application && bin/console doctrine:database:create -vvv)
(cd tests/Application && bin/console doctrine:schema:create -vvv)
-
name: Prepare test application assets
run: |
(cd tests/Application && bin/console assets:install public -vvv)
(cd tests/Application && yarn build)
-
name: Prepare test application cache
run: (cd tests/Application && bin/console cache:warmup -vvv)

-
name: Load fixtures in test application
run: (cd tests/Application && bin/console sylius:fixtures:load -n)

-
name: Validate composer.json
run: composer validate --ansi --strict

-
name: Validate database schema
run: (cd tests/Application && bin/console doctrine:schema:validate)

-
name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/

-
name: Run Psalm
run: vendor/bin/psalm

-
name: Run PHPSpec
run: vendor/bin/phpspec run --ansi -f progress --no-interaction

-
name: Run PHPUnit
run: vendor/bin/phpunit --colors=always

-
name: Run Behat
run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun

-
name: Upload Behat logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: Behat logs
path: etc/build/
if-no-files-found: ignore
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
/vendor/
/node_modules/
/composer.lock
/.php_cs.cache
/.phpunit.result.cache

/etc/build/*
!/etc/build/.gitignore
Expand All @@ -12,3 +14,4 @@

/behat.yml
/phpspec.yml
/phpunit.xml
1 change: 0 additions & 1 deletion .php_cs.cache

This file was deleted.

76 changes: 0 additions & 76 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2019 Diego D'amico
Copyright (c) 2018-2020 Diego D'amico

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
78 changes: 9 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<a href="https://packagist.org/packages/odiseoteam/sylius-report-plugin" title="Version" target="_blank">
<img src="https://img.shields.io/packagist/v/odiseoteam/sylius-report-plugin.svg" />
</a>
<a href="http://travis-ci.org/odiseoteam/SyliusReportPlugin" title="Build status" target="_blank">
<img src="https://img.shields.io/travis/odiseoteam/SyliusReportPlugin/master.svg" />
</a>
<a href="https://scrutinizer-ci.com/g/odiseoteam/SyliusReportPlugin/" title="Scrutinizer" target="_blank">
<img src="https://img.shields.io/scrutinizer/g/odiseoteam/SyliusReportPlugin.svg" />
</a>
Expand All @@ -23,93 +20,36 @@

## Description

This plugin add data reports to the Sylius administration interface.
This plugin adds data reports to the Sylius administration interface.
It's highly inspired on the old [SyliusReportBundle](https://github.com/Sylius/SyliusReportBundle) and
[Report](https://github.com/Sylius/Report) component using it's good architecture.

Now supporting Sylius 1.4+ and Symfony 4.
[Report](https://github.com/Sylius/Report) component using its good architecture.

Support Sylius version 1.6+.

#### Premium features!
Do you want advanced features? Take a look at our [Report Pro Plugin](https://odiseo.com.ar/plugins-and-bundles/premium/sylius-report-pro-plugin), an extended version of this one.

### Architecture

Basically you have a **DataFetcherInterface** and **RendererInterface** interfaces. The first one defines how to fetch the **Data**
according on a configuration provided. And the second one uses the **Data** returned by the fetcher and returns a rendered view.
according to a configuration provided. And the second one uses the **Data** returned by the fetcher and returns a rendered view.

Some DataFetchers and Renderers come with this plugin but you can create your own by implementing their interfaces.
Some DataFetchers and Renderers come with this plugin, but you can create your own by implementing their interfaces.

<img src="https://github.com/odiseoteam/SyliusReportPlugin/blob/master/screenshot_1.png" alt="Reports admin">

## Demo

You can see this plugin in action in our Sylius Demo application.

- Frontend: [sylius-demo.odiseo.com.ar](https://sylius-demo.odiseo.com.ar).
- Frontend: [sylius-demo.odiseo.com.ar](https://sylius-demo.odiseo.com.ar).
- Administration: [sylius-demo.odiseo.com.ar/admin](https://sylius-demo.odiseo.com.ar/admin) with `odiseo: odiseo` credentials.
Next, you can enter to the [reports](https://sylius-demo.odiseo.com.ar/admin/reports/) page.

## Installation

1. Run `composer require odiseoteam/sylius-report-plugin`

2. Enable the plugin in bundles.php but add it before SyliusResourceBundle like follows:

```php
<?php

return [
// ...
Odiseo\SyliusReportPlugin\OdiseoSyliusReportPlugin::class => ['all' => true],
Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
// ...
];
```

3. Import the plugin configurations

```yml
imports:
- { resource: "@OdiseoSyliusReportPlugin/Resources/config/config.yml" }
```
This plugin use [DoctrineExtensions](https://github.com/beberlei/DoctrineExtensions) to create the different DataFetcher's queries.
For example you will need to add the Doctrine DQL functions as follows if you are using Mysql:
```yml
doctrine:
orm:
# ...
dql:
datetime_functions:
date: DoctrineExtensions\Query\Mysql\Date
month: DoctrineExtensions\Query\Mysql\Month
year: DoctrineExtensions\Query\Mysql\Year
numeric_functions:
round: DoctrineExtensions\Query\Mysql\Round
```
4. Add the admin routes
```yml
odiseo_sylius_report_plugin_admin:
resource: "@OdiseoSyliusReportPlugin/Resources/config/routing/admin.yml"
prefix: /admin
```

5. Finish the installation updating the database schema and installing assets
```
php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate
php bin/console sylius:theme:assets:install --symlink
```
## Documentation

## Test the plugin
- [Installation](doc/installation.md)
- [Tests](doc/tests.md)

You can follow the instructions to test this plugins in the proper documentation page: [Test the plugin](doc/tests.md).

## Credits

This plugin is maintained by <a href="https://odiseo.io">Odiseo</a>. Want us to help you with this plugin or any Sylius project? Contact us on <a href="mailto:[email protected]">[email protected]</a>.
Loading

0 comments on commit 3e72e5f

Please sign in to comment.