mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-23 08:23:54 +00:00
fix(ui): prefer Compose env values and polish error pages
When a managed variable shares a Compose-defined key, show the hardcoded Compose value as read-only and exclude it from managed rows. Render Contact support as a button, use the collapsible component for 419 proxy help, and style its list/code markers.
This commit is contained in:
@@ -182,6 +182,34 @@ YAML,
|
||||
->toBe(['API_TOKEN']);
|
||||
});
|
||||
|
||||
it('shows a Compose-defined value as read-only when a managed variable has the same key', function () {
|
||||
$service = Service::factory()->create([
|
||||
'environment_id' => $this->environment->id,
|
||||
'docker_compose_raw' => <<<'YAML'
|
||||
services:
|
||||
app:
|
||||
image: nginx
|
||||
environment:
|
||||
- API_TOKEN=from-compose
|
||||
YAML,
|
||||
]);
|
||||
|
||||
EnvironmentVariable::create([
|
||||
'key' => 'API_TOKEN',
|
||||
'value' => 'from-environment-tab',
|
||||
'resourceable_type' => Service::class,
|
||||
'resourceable_id' => $service->id,
|
||||
]);
|
||||
|
||||
$component = Livewire::test(All::class, ['resource' => $service])
|
||||
->call('loadEnvironmentVariables');
|
||||
|
||||
expect($component->instance()->environmentVariablePageRows)
|
||||
->toHaveCount(1)
|
||||
->and($component->instance()->environmentVariablePageRows->first()['kind'])->toBe('hardcoded')
|
||||
->and($component->instance()->environmentVariablePageRows->first()['environmentVariable']['value'])->toBe('from-compose');
|
||||
});
|
||||
|
||||
it('searches service environment variables without requiring preview variables', function () {
|
||||
$service = Service::factory()->create([
|
||||
'environment_id' => $this->environment->id,
|
||||
|
||||
Reference in New Issue
Block a user