Skip to content

Commit

Permalink
Merge pull request #14 from bmaziere/clean-up
Browse files Browse the repository at this point in the history
chore(clean): clean up namespaces, docs & folder structure
  • Loading branch information
qsomazzi authored Apr 18, 2018
2 parents 13cba06 + f895c15 commit f8155aa
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 24 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# sonata
# SonataHelpers

## Immutable tabs form type
WIP

- [Immutable Tabs Form Type](./docs/10-immutable-tabs-type.md)
## Documentation

## Test helpers

- [Test Helpers](docs/Tests/TestHelperTraits.md)
- [Documentation](./docs/00-docs.md)
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"symfony/phpunit-bridge": "^4.0"
},
"autoload": {
"psr-4": { "Sonata\\SonataHelpersBundle\\": "src/" }
"psr-4": { "Sonata\\HelpersBundle\\": "src/" }
},
"autoload-dev": {
"psr-4": { "Sonata\\SonataHelpersBundle\\Tests\\": "tests/" }
"psr-4": { "Sonata\\HelpersBundle\\Tests\\": "tests/" }
},
"config": {
"sort-packages": true
Expand Down
4 changes: 4 additions & 0 deletions docs/00-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
## Immutable tabs form type

- [Immutable Tabs Form Type](./10-immutable-tabs-type.md)

## Test helpers

- [Test Helpers](./20-test-helper-traits.md)
12 changes: 6 additions & 6 deletions docs/10-immutable-tabs-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ To get tabs into a block of page or admin form.

It extends the `Sonata\CoreBundle\Form\Type\ImmutableArrayType`

And use a specific widget defined in `src/AdminBundle/Ressources/Views/form_admin_fields.html.twig` so you must add it to your admin sonata config
And use a specific widget defined in `SonataHelpersBundle/Ressources/views/From/form_admin_fields.html.twig` so you must add it to your admin sonata config

```
sonata_admin:
admin_services:
canalplus.awaken.admin.item:
app.admin.item:
templates:
form: ['CanalPlusAwakenAdminBundle:Form:form_admin_fields.html.twig']
form: ['SonataHelpersBundle:Form:form_admin_fields.html.twig']
```

Don't forget to add the css `src/AdminBundle/Ressources/public/css/immutableTabsType.css` to have cute tabs
Don't forget to add the css `SonataHelpersBundle/Ressources/public/css/immutableTabsType.css` to have cute tabs

An array of tabs must be set
key : key of tab that will be used to record value in database
Expand Down Expand Up @@ -98,7 +98,7 @@ data are a json with the key of the immutableTabsType then the key of tabs as su

### Exemple of data

````
```
{
"settings": {
"fr": {
Expand All @@ -112,4 +112,4 @@ data are a json with the key of the immutableTabsType then the key of tabs as su
}
}
}
````
```
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Form/Type/ImmutableTabsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

namespace Sonata\SonataHelpersBundle\Form\Type;
namespace Sonata\HelpersBundle\Form\Type;

use Sonata\CoreBundle\Form\Type\ImmutableArrayType;
use Symfony\Component\Form\FormBuilderInterface;
Expand Down
25 changes: 25 additions & 0 deletions src/SonataHelpersBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/*
*
* This file is part of the Sonata for Ekino project.
*
* (c) 2018 - Ekino
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
*/

namespace Sonata\HelpersBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* Class SonataHelpersBundle.
*
* @author Benoit Mazière <[email protected]>
*/
class SonataHelpersBundle extends Bundle
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

namespace SonataHelpers\Tests\Admin;
namespace Sonata\HelpersBundle\Tests\Admin;

use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\AdminBundle\Form\FormMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

namespace SonataHelpers\Tests\Admin;
namespace Sonata\HelpersBundle\Tests\Admin;

use Doctrine\Common\Inflector\Inflector;
use Knp\Menu\FactoryInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

namespace SonataHelpers\Tests\Common;
namespace Sonata\HelpersBundle\Tests\Common;

/**
* Class ClassTestHelper.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

namespace SonataHelpers\Tests\Common;
namespace Sonata\HelpersBundle\Tests\Common;

/**
* Class TranslationTestHelper.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/

namespace SonataHelpers\Tests\FragmentService;
namespace Sonata\HelpersBundle\Tests\FragmentService;

use Sonata\AdminBundle\Admin\AdminInterface;
use Sonata\AdminBundle\Form\FormMapper;
Expand Down
4 changes: 2 additions & 2 deletions Tests/MockBuilderTrait.php → src/Tests/MockBuilderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
*
*/

namespace SonataHelpers\Tests;
namespace Sonata\HelpersBundle\Tests;

use SonataHelpers\Tests\Common\TranslationTestHelper;
use Sonata\HelpersBundle\Tests\Common\TranslationTestHelper;
use Symfony\Component\Translation\TranslatorInterface;

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Form/Type/ImmutableTabsTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
*
*/

namespace Sonata\SonataHelpersBundle\Tests\Form\Type;
namespace Sonata\HelpersBundle\Tests\Form\Type;

use Sonata\CoreBundle\Form\Type\ImmutableArrayType;
use Sonata\SonataHelpersBundle\Form\Type\ImmutableTabsType;
use Sonata\HelpersBundle\Form\Type\ImmutableTabsType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\Test\TypeTestCase;

Expand Down

0 comments on commit f8155aa

Please sign in to comment.