mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-07 13:59:43 +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 %}
|
||||
|
||||
{% 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 %}
|
||||
{% set banner_text = chill_main_config.top_banner.text|first %}
|
||||
{% endif %}
|
||||
|
@@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Chill\MainBundle\DependencyInjection\Configuration;
|
||||
@@ -7,6 +16,11 @@ use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Config\Definition\Processor;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
class ConfigurationTest extends TestCase
|
||||
{
|
||||
public function testTopBannerConfiguration(): void
|
||||
@@ -21,12 +35,12 @@ class ConfigurationTest extends TestCase
|
||||
'top_banner' => [
|
||||
'text' => [
|
||||
'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',
|
||||
'background-color' => 'red'
|
||||
]
|
||||
]
|
||||
'background-color' => 'red',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$processedConfig = $processor->processConfiguration($configuration, $config);
|
||||
@@ -47,7 +61,7 @@ class ConfigurationTest extends TestCase
|
||||
|
||||
// Test without top_banner configuration
|
||||
$config = [
|
||||
'chill_main' => []
|
||||
'chill_main' => [],
|
||||
];
|
||||
|
||||
$processedConfig = $processor->processConfiguration($configuration, $config);
|
||||
@@ -67,10 +81,10 @@ class ConfigurationTest extends TestCase
|
||||
'chill_main' => [
|
||||
'top_banner' => [
|
||||
'text' => [
|
||||
'fr' => 'Test message'
|
||||
]
|
||||
]
|
||||
]
|
||||
'fr' => 'Test message',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$processedConfig = $processor->processConfiguration($configuration, $config);
|
||||
|
Reference in New Issue
Block a user