Skip to content

Commit

Permalink
Merge branch '5.0'
Browse files Browse the repository at this point in the history
* 5.0:
  recompile assets
  update changelog
  Remove id of nested form item containers (#2049)
  Fix empty url in admin list (#2071)
  [MediaBundle] fixed BackgroundFilterLoader issue (#2028)
  [MediaBundle] Skip test if ghostscript is not installed (#2066)
  [NodeBundle] Removed unused use of the VarDumper class (#2067)
  #2050 Fixed issue in refreshing ck editor (don't do a destroy if the instance is already initializing) (#2064)
  [KunstmaanTranslatorBundle]: export all translations, use correct locales (#2055)
  [AdminListBundle] fixed form options from AdaptSimpleFormEvent in admin list (#2056)
  [GeneratorBundle] Fix xpath for publish modal in behat tests (#2052)
  [AdminBundle] fixed BC break in CreateUserCommand (#2043)
  remove hardcopy of ckeditor (#2041)
  • Loading branch information
Devolicious committed Aug 7, 2018
2 parents 02fd494 + 073a27c commit e9e4103
Show file tree
Hide file tree
Showing 17 changed files with 130 additions and 1,166 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG-5.X.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 5.0.8 / 2018-08-07

* [AdminList] Fix admin list empty url [#2071](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/2071) ([@dannyvw](https://github.com/dannyvw))
* [NodeBundle] Remove unused vardumper use [#2067](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/2067) ([@acrobat](https://github.com/acrobat))
* [MediaBundle] Skip test if ghostscript is not installed [#2066](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/2066) ([@acrobat](https://github.com/acrobat))
* [AdminBundle] #2050 Fixed issue in refreshing ck editor (don't do a destroy if the … [#2064](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/2064) ([@janb87](https://github.com/janb87))
* [AdminListBundle] fixed form options source in admin list controller [#2056](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/2056) ([@mdxpl](https://github.com/mdxpl))
* [KunstmaanTranslatorBundle] export all translations, use correct locales [#2055](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/2055) ([@sandergo90](https://github.com/sandergo90))
* [GeneratorBundle] Fix xpath for publish modal in behat tests [#2052](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/2052) ([@acrobat](https://github.com/acrobat))
* [AdminBundle] Remove id of nested form item containers [#2049](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/2049) ([@SpadXIII](https://github.com/SpadXIII))
* [AdminBundle] fixed BC break in CreateUserCommand [#2043](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/2043) ([@deZinc](https://github.com/deZinc))
* [AdminBundle] remove hardcopy of ckeditor [#2041](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/2041) ([@FVKVN](https://github.com/FVKVN))
* [AdminBundle] added missing translations to main language [#2038](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/2038) ([@Devolicious](https://github.com/Devolicious))
* [MediaBundle] Fixed BackgroundFilterLoader issue [#2028](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/2028) ([@deZinc](https://github.com/deZinc))


## 5.0.7 / 2018-06-21

* [PagePartBundle] Refactor HeaderPagePart entity test [#2024](https://github.com/Kunstmaan/KunstmaanBundlesCMS/pull/2024) ([@Devolicious](https://github.com/Devolicious))
Expand Down
4 changes: 2 additions & 2 deletions groundcontrol/admin-bundle.tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ adminBundle.tasks.scripts = createScriptsTask({
adminBundle.config.srcPath + 'vendor_bower/Sortable/Sortable.js',
adminBundle.config.srcPath + 'vendor_bower/mjolnic-bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js',
adminBundle.config.srcPath + 'vendor_bower/jquery-typewatch/jquery.typewatch.js',
'./src/Kunstmaan/AdminBundle/Resources/public/default-theme/ckeditor/ckeditor.js',
'./src/Kunstmaan/AdminBundle/Resources/public/default-theme/ckeditor/adapters/jquery.js',
'./node_modules/ckeditor/ckeditor.js',
'./node_modules/ckeditor/adapters/jquery.js',
adminBundle.config.srcPath + 'js/**/*.js'
],
dest: adminBundle.config.distPath + 'js',
Expand Down
21 changes: 18 additions & 3 deletions src/Kunstmaan/AdminBundle/Command/CreateUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,27 @@ protected function execute(InputInterface $input, OutputInterface $output)
// Attach groups
$groupOutput = [];


foreach (explode(',', $groupOption) as $groupId) {
$group = $this->groups[$groupId];
$groupOutput[] = $group->getName();

if ($group instanceof Group) {
if ((int)$groupId === 0) {
foreach ($this->groups as $value) {
if ($groupId === $value->getName()) {
$group = $value;
break;
}
}
} else {
$group = $this->groups[$groupId];
}

if (isset($group) && $group instanceof Group) {
$groupOutput[] = $group->getName();
$user->getGroups()->add($group);
} else {
throw new \RuntimeException(
'The selected group(s) can\'t be found.'
);
}
}

Expand Down
1,067 changes: 0 additions & 1,067 deletions src/Kunstmaan/AdminBundle/Resources/public/default-theme/ckeditor/ckeditor.js

This file was deleted.

38 changes: 18 additions & 20 deletions src/Kunstmaan/AdminBundle/Resources/public/js/admin-bundle.min.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions src/Kunstmaan/AdminBundle/Resources/ui/js/_rich-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ kunstmaanbundles.richEditor = (function (window, undefined) {
a.setValue("");
}
}

this.allowOnChange = !0
};

Expand Down Expand Up @@ -298,12 +298,13 @@ kunstmaanbundles.richEditor = (function (window, undefined) {
destroyAllRichEditors = function () {
for (instance in CKEDITOR.instances) {
var $el = $('#' + CKEDITOR.instances[instance].name);
var ckEditorInstance = CKEDITOR.instances[instance];

if ($el.hasClass('js-rich-editor')) {
if (ckEditorInstance.instanceReady && $el.hasClass('js-rich-editor')) {
$el.removeClass('js-rich-editor--enabled');

CKEDITOR.instances[instance].updateElement();
CKEDITOR.instances[instance].destroy(true);
ckEditorInstance.updateElement();
ckEditorInstance.destroy(true);
}
;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@

{# Items #}
{% for obj in form %}
<div id="{% if obj.vars.value.id is defined %}{{ obj.vars.value.id }}{% else %}{{ obj.vars.value }}{% endif %}-pp-container" class="js-nested-form__item nested-form__item{% if sortable %} js-sortable-item sortable-item{% endif %}"
<div class="js-nested-form__item nested-form__item{% if sortable %} js-sortable-item sortable-item{% endif %}"
{% if attr['nested_deletable'] is not defined or attr['nested_deletable'] != false %}
data-delete-key="{{ form.vars.id|replace({'form_': 'delete_'}) }}_{% if obj.vars.value.id is defined %}{{ obj.vars.value.id }}{% else %}{{ obj.vars.value }}{% endif %}"
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ protected function doAddAction(AbstractAdminListConfigurator $configurator, $typ
$event = $this->container->get('event_dispatcher')->dispatch(Events::ADAPT_SIMPLE_FORM, $event);
$tabPane = $event->getTabPane();

$form = $this->createForm($formType, $helper, $configurator->getAdminTypeOptions());
$form = $this->createForm($formType, $helper, $event->getOptions());

if ($request->isMethod('POST')) {
if ($tabPane) {
Expand Down Expand Up @@ -266,7 +266,7 @@ protected function doEditAction(AbstractAdminListConfigurator $configurator, $en
$event = $this->container->get('event_dispatcher')->dispatch(Events::ADAPT_SIMPLE_FORM, $event);
$tabPane = $event->getTabPane();

$form = $this->createForm($formType, $helper, $configurator->getAdminTypeOptions());
$form = $this->createForm($formType, $helper, $event->getOptions());

if ($request->isMethod('POST')) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@
{% if itemAction.template is not null %}
{% include itemAction.template with {'itemAction': itemAction} %}
{% else %}
<a class="btn btn-default btn--raise-on-hover" href="{{ path(itemAction.getUrlFor(entity)["path"], itemAction.getUrlFor(entity)[("params")] ) }}">
{% if itemAction.getIconFor(entity) is not null %}
<i class="fa fa-{{ itemAction.getIconFor(entity) }}"></i>
{% endif %}
{{ itemAction.getLabelFor(entity) }}
</a>
{% set url = itemAction.getUrlFor(entity) %}
{% if url %}
<a class="btn btn-default btn--raise-on-hover" href="{{ path(url["path"], url[("params")] ) }}">
{% if itemAction.getIconFor(entity) is not null %}
<i class="fa fa-{{ itemAction.getIconFor(entity) }}"></i>
{% endif %}
{{ itemAction.getLabelFor(entity) }}
</a>
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
Expand Down
1 change: 0 additions & 1 deletion src/Kunstmaan/ArticleBundle/Router/TagCategoryRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\VarDumper\VarDumper;

class TagCategoryRouter extends SlugRouter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private function placePageInState($pageName, $state)
// Couldn't do this via xpath using : [contains(@class, 'modal') and contains(@class, 'in')]
foreach ($modals as $modal) {
if ($modal->hasClass('in')) {
$this->mainContext->findAndClickButton($modal, 'xpath', "//a[contains(@class, 'btn btn-danger btn--raise-on-hover')]");
$this->mainContext->findAndClickButton($modal, 'xpath', "//button[contains(@class, 'btn btn-danger btn--raise-on-hover')]");

return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,6 @@ class BackgroundFilterLoader extends \Liip\ImagineBundle\Imagine\Filter\Loader\B
*/
public function load(ImageInterface $image, array $options = array())
{
$background = new Color(
isset($options['color']) ? $options['color'] : '#fff',
isset($options['transparency']) ? $options['transparency'] : 0
);
$topLeft = new Point(0, 0);
$size = $image->getSize();

if (isset($options['size'])) {
list($width, $height) = $options['size'];

$size = new Box($width, $height);
$topLeft = new Point(($width - $image->getSize()->getWidth()) / 2, ($height - $image->getSize()->getHeight()) / 2);
}

$canvas = $this->imagine->create($size, $background);

return $canvas->paste($image, $topLeft);
parent::load($image, $options);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ protected function tearDown()

public function testApplyWritesJpg()
{
system('which gs > /dev/null', $returnCode);
if ($returnCode !== 0) {
$this->markTestSkipped('Ghostscript is not installed.');
}

$pdfFilename = $this->tempDir . '/sample.pdf';
$jpgFilename = $pdfFilename.'.jpg';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,11 @@ public function importForcedAction()
*/
public function exportAction()
{
$locales = explode('|', $this->getParameter('requiredlocales'));
$locales = $this->getParameter('kuma_translator.managed_locales');
$exportCommand = new ExportCommand();
$exportCommand
->setLocales($locales)
->setFormat('csv')
->setDomains('messages');
->setFormat('csv');

$response = $this->get('kunstmaan_translator.service.exporter.command_handler')->executeExportCSVCommand($exportCommand);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public function load(array $configs, ContainerBuilder $container)
$container->setParameter('kuma_translator.default_bundle', $config['default_bundle']);
$container->setParameter('kuma_translator.bundles', $config['bundles']);
$container->setParameter('kuma_translator.cache_dir', $config['cache_dir']);
if (empty($config['managed_locales']) && $container->hasParameter('requiredlocales')) {
$config['managed_locales'] = explode('|', $container->getParameter('requiredlocales'));
}
$container->setParameter('kuma_translator.managed_locales', $config['managed_locales']);
$container->setParameter('kuma_translator.file_formats', $config['file_formats']);
$container->setParameter('kuma_translator.storage_engine.type', $config['storage_engine']['type']);
Expand All @@ -58,12 +61,12 @@ public function setTranslationConfiguration($config, $container)
$this->registerTranslatorConfiguration($config, $container);

// overwrites everything
$translator->addMethodCall('addDatabaseResources', array());
$translator->addMethodCall('addDatabaseResources', []);

$translator->addMethodCall('setFallbackLocales', array(array('en')));
$translator->addMethodCall('setFallbackLocales', [['en']]);

if($container->hasParameter('defaultlocale')) {
$translator->addMethodCall('setFallbackLocales', array(array($container->getParameter('defaultlocale'))));
if ($container->hasParameter('defaultlocale')) {
$translator->addMethodCall('setFallbackLocales', [[$container->getParameter('defaultlocale')]]);
}
}

Expand All @@ -76,7 +79,7 @@ public function registerTranslatorConfiguration($config, $container)
{
$translator = $container->getDefinition('kunstmaan_translator.service.translator.translator');

$dirs = array();
$dirs = [];
if (class_exists('Symfony\Component\Validator\Validation')) {
$r = new \ReflectionClass('Symfony\Component\Validator\Validation');

Expand Down Expand Up @@ -110,16 +113,18 @@ public function registerTranslatorConfiguration($config, $container)
$finder = Finder::create();
$finder->files();

$finder->filter(function (\SplFileInfo $file) {
$finder->filter(
function (\SplFileInfo $file) {
return 2 === substr_count($file->getBasename(), '.') && preg_match('/\.\w+$/', $file->getBasename());
});
}
);

$finder->in($dirs);

foreach ($finder as $file) {
// filename is domain.locale.format
list($domain, $locale, $format) = explode('.', $file->getBasename());
$translator->addMethodCall('addResource', array($format, (string) $file, $locale, $domain));
$translator->addMethodCall('addResource', [$format, (string) $file, $locale, $domain]);
}
}
}
Expand Down
Loading

0 comments on commit e9e4103

Please sign in to comment.