Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(ui): show Nixpacks deprecation notice in application heading

Andras Bacsai56c7c9c685e9
diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php
index e507da7897..4e80a80bfe 100644
--- a/resources/views/livewire/project/application/general.blade.php
+++ b/resources/views/livewire/project/application/general.blade.php
@@ -193,9 +193,6 @@
]" x-bind:disabled="!canUpdate" />
@endif
</div>
- @if ($buildPack === 'nixpacks')
- <x-nixpacks-deprecated-callout class="mt-4" />
- @endif
</div>
@endif
@if ($application->could_set_build_commands() || ($isStatic && $buildPack !== 'static'))
diff --git a/resources/views/livewire/project/application/heading.blade.php b/resources/views/livewire/project/application/heading.blade.php
index c5de603e0a..6d8f21e7bd 100644
--- a/resources/views/livewire/project/application/heading.blade.php
+++ b/resources/views/livewire/project/application/heading.blade.php
@@ -1,5 +1,14 @@
<nav wire:poll.10000ms="checkStatus" class="w-full max-w-none pb-4 md:pb-6 lg:pb-0">
<div>
+ @if ($application->build_pack === 'nixpacks')
+ <x-callout type="warning" title="Nixpacks is deprecated" class="mb-4">
+ {{ config('deprecations.nixpacks') }}
+ <a class="underline" href="{{ route('project.application.configuration', $parameters) }}" {{ wireNavigate() }}>
+ Switch to Railpack in General settings.
+ </a>
+ </x-callout>
+ @endif
+
<div class="mb-3 w-full xl:hidden">
<div class="flex min-w-0 flex-col items-start gap-2">
<h1 class="min-w-0 max-w-full truncate text-[24px]! leading-7! font-semibold! tracking-tight! text-black dark:text-fg">
@@ -113,15 +122,6 @@
</div>
</div>
- @if ($application->build_pack === 'nixpacks' && $activeRouteName !== 'project.application.configuration')
- <x-callout type="warning" title="Nixpacks is deprecated" class="mb-4">
- {{ config('deprecations.nixpacks') }}
- <a class="underline" href="{{ route('project.application.configuration', $parameters) }}" {{ wireNavigate() }}>
- Switch to Railpack in General settings.
- </a>
- </x-callout>
- @endif
-
{{-- Desktop actions live in the fixed top bar so they cannot overlap page content. --}}
@teleport('#resource-action-hud-slot')
<div class="hidden w-full items-center xl:flex xl:w-auto">
diff --git a/tests/Feature/NixpacksDeprecationTest.php b/tests/Feature/NixpacksDeprecationTest.php
index ba468ffd4f..15245bd7b2 100644
--- a/tests/Feature/NixpacksDeprecationTest.php
+++ b/tests/Feature/NixpacksDeprecationTest.php
@@ -48,12 +48,12 @@ uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
?? StandaloneDocker::factory()->create(['server_id' => $this->server->id, 'network' => 'coolify-test']);
});
-test('the application page shows the nixpacks deprecation notice only for nixpacks', function (string $buildPack, bool $showsNotice) {
+test('the general page does not repeat the nixpacks deprecation notice from the heading', function () {
$application = Application::factory()->create([
'environment_id' => $this->environment->id,
'destination_id' => $this->destination->id,
'destination_type' => StandaloneDocker::class,
- 'build_pack' => $buildPack,
+ 'build_pack' => 'nixpacks',
'static_image' => 'nginx:alpine',
'base_directory' => '/',
'ports_exposes' => '3000',
@@ -61,33 +61,25 @@ test('the application page shows the nixpacks deprecation notice only for nixpac
'redirect' => 'no',
]);
- $component = Livewire::test(General::class, ['application' => $application])->assertSuccessful();
-
- $showsNotice
- ? $component->assertSee(config('deprecations.nixpacks'))
- : $component->assertDontSee(config('deprecations.nixpacks'));
-})->with([
- 'nixpacks' => ['nixpacks', true],
- 'railpack' => ['railpack', false],
-]);
+ Livewire::test(General::class, ['application' => $application])
+ ->assertSuccessful()
+ ->assertDontSee(config('deprecations.nixpacks'));
+});
-test('switching the build pack to railpack hides the nixpacks deprecation notice', function () {
+test('switching the build pack to railpack hides the nixpacks deprecation notice in the heading', function () {
$application = Application::factory()->create([
'environment_id' => $this->environment->id,
'destination_id' => $this->destination->id,
'destination_type' => StandaloneDocker::class,
'build_pack' => 'nixpacks',
- 'static_image' => 'nginx:alpine',
- 'base_directory' => '/',
- 'ports_exposes' => '3000',
- 'is_http_basic_auth_enabled' => false,
- 'redirect' => 'no',
]);
- Livewire::test(General::class, ['application' => $application])
- ->assertSee(config('deprecations.nixpacks'))
- ->set('buildPack', 'railpack')
- ->assertDontSee(config('deprecations.nixpacks'));
+ $component = Livewire::test(Heading::class, ['application' => $application])
+ ->assertSee(config('deprecations.nixpacks'));
+
+ $application->update(['build_pack' => 'railpack']);
+
+ $component->call('$refresh')->assertDontSee(config('deprecations.nixpacks'));
});
test('the application heading shows the nixpacks deprecation notice only for nixpacks', function (string $buildPack, bool $showsNotice) {