mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-08 14:29:42 +00:00
Change locale back to current_locale and add changie
This commit is contained in:
6
.changes/unreleased/Feature-20251007-101949.yaml
Normal file
6
.changes/unreleased/Feature-20251007-101949.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Feature
|
||||||
|
body: Create environment banner that can be activated and configured depending on the image deployed
|
||||||
|
time: 2025-10-07T10:19:49.784462956+02:00
|
||||||
|
custom:
|
||||||
|
Issue: "423"
|
||||||
|
SchemaChange: No schema change
|
@@ -3,7 +3,7 @@
|
|||||||
{% set current_locale = app.request.locale %}
|
{% set current_locale = app.request.locale %}
|
||||||
|
|
||||||
{% if chill_main_config.top_banner.text[current_locale] is defined %}
|
{% if chill_main_config.top_banner.text[current_locale] is defined %}
|
||||||
{% set banner_text = chill_main_config.top_banner.text[nl] %}
|
{% set banner_text = chill_main_config.top_banner.text[current_locale] %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set banner_text = chill_main_config.top_banner.text|first %}
|
{% set banner_text = chill_main_config.top_banner.text|first %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -1,5 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\MainBundle\Tests\DependencyInjection;
|
namespace Chill\MainBundle\Tests\DependencyInjection;
|
||||||
|
|
||||||
use Chill\MainBundle\DependencyInjection\Configuration;
|
use Chill\MainBundle\DependencyInjection\Configuration;
|
||||||
@@ -7,6 +16,11 @@ use PHPUnit\Framework\TestCase;
|
|||||||
use Symfony\Component\Config\Definition\Processor;
|
use Symfony\Component\Config\Definition\Processor;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*
|
||||||
|
* @coversNothing
|
||||||
|
*/
|
||||||
class ConfigurationTest extends TestCase
|
class ConfigurationTest extends TestCase
|
||||||
{
|
{
|
||||||
public function testTopBannerConfiguration(): void
|
public function testTopBannerConfiguration(): void
|
||||||
@@ -21,12 +35,12 @@ class ConfigurationTest extends TestCase
|
|||||||
'top_banner' => [
|
'top_banner' => [
|
||||||
'text' => [
|
'text' => [
|
||||||
'fr' => 'Vous travaillez actuellement avec la version de pré-production de Chill.',
|
'fr' => 'Vous travaillez actuellement avec la version de pré-production de Chill.',
|
||||||
'nl' => 'Je werkte momenteel in de pré-productie versie van Chill.'
|
'nl' => 'Je werkte momenteel in de pré-productie versie van Chill.',
|
||||||
],
|
],
|
||||||
'color' => 'white',
|
'color' => 'white',
|
||||||
'background-color' => 'red'
|
'background-color' => 'red',
|
||||||
]
|
],
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
$processedConfig = $processor->processConfiguration($configuration, $config);
|
$processedConfig = $processor->processConfiguration($configuration, $config);
|
||||||
@@ -47,7 +61,7 @@ class ConfigurationTest extends TestCase
|
|||||||
|
|
||||||
// Test without top_banner configuration
|
// Test without top_banner configuration
|
||||||
$config = [
|
$config = [
|
||||||
'chill_main' => []
|
'chill_main' => [],
|
||||||
];
|
];
|
||||||
|
|
||||||
$processedConfig = $processor->processConfiguration($configuration, $config);
|
$processedConfig = $processor->processConfiguration($configuration, $config);
|
||||||
@@ -67,10 +81,10 @@ class ConfigurationTest extends TestCase
|
|||||||
'chill_main' => [
|
'chill_main' => [
|
||||||
'top_banner' => [
|
'top_banner' => [
|
||||||
'text' => [
|
'text' => [
|
||||||
'fr' => 'Test message'
|
'fr' => 'Test message',
|
||||||
]
|
],
|
||||||
]
|
],
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
$processedConfig = $processor->processConfiguration($configuration, $config);
|
$processedConfig = $processor->processConfiguration($configuration, $config);
|
||||||
|
Reference in New Issue
Block a user