mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 17:21:04 +00:00
refactor(ui): improve styling and consistency in environment variable warning and docker cleanup components
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
}
|
}
|
||||||
}" x-if="showWarning">
|
}" x-if="showWarning">
|
||||||
<x-callout type="warning" title="Caution">
|
<x-callout type="warning" title="Caution">
|
||||||
<div class="text-sm text-yellow-700 dark:text-yellow-300" x-text="warningMessage"></div>
|
<div class="text-sm" x-text="warningMessage"></div>
|
||||||
<div class="text-sm text-yellow-700 dark:text-yellow-300" x-text="recommendation"></div>
|
<div class="text-sm" x-text="recommendation"></div>
|
||||||
</x-callout>
|
</x-callout>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -41,11 +41,11 @@
|
|||||||
helper="The Docker cleanup tasks will run when the disk usage exceeds this threshold." />
|
helper="The Docker cleanup tasks will run when the disk usage exceeds this threshold." />
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div class="w-96">
|
<div class="w-full sm:w-96">
|
||||||
<x-forms.checkbox canGate="update" :canResource="$server"
|
<x-forms.checkbox canGate="update" :canResource="$server"
|
||||||
helper="Enabling Force Docker Cleanup or manually triggering a cleanup will perform the following actions:
|
helper="Enabling Force Docker Cleanup or manually triggering a cleanup will perform the following actions:
|
||||||
<ul class='list-disc pl-4 mt-2'>
|
<ul class='list-disc pl-4 mt-2'>
|
||||||
<li>Removes stopped containers managed by Coolify (as containers are none persistent, no data will be lost).</li>
|
<li>Removes stopped containers managed by Coolify (as containers are non-persistent, no data will be lost).</li>
|
||||||
<li>Deletes unused images.</li>
|
<li>Deletes unused images.</li>
|
||||||
<li>Clears build cache.</li>
|
<li>Clears build cache.</li>
|
||||||
<li>Removes old versions of the Coolify helper image.</li>
|
<li>Removes old versions of the Coolify helper image.</li>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
<x-callout type="warning" title="Caution">
|
<x-callout type="warning" title="Caution">
|
||||||
<p>These options can cause permanent data loss and functional issues. Only enable if you fully understand the consequences</p>
|
<p>These options can cause permanent data loss and functional issues. Only enable if you fully understand the consequences</p>
|
||||||
</x-callout>
|
</x-callout>
|
||||||
<div class="w-96">
|
<div class="w-full sm:w-96">
|
||||||
<x-forms.checkbox canGate="update" :canResource="$server" instantSave id="deleteUnusedVolumes"
|
<x-forms.checkbox canGate="update" :canResource="$server" instantSave id="deleteUnusedVolumes"
|
||||||
label="Delete Unused Volumes"
|
label="Delete Unused Volumes"
|
||||||
helper="This option will remove all unused Docker volumes during cleanup.<br><br><strong>Warning: Data from stopped containers will be lost!</strong><br><br>Consequences include:<br>
|
helper="This option will remove all unused Docker volumes during cleanup.<br><br><strong>Warning: Data from stopped containers will be lost!</strong><br><br>Consequences include:<br>
|
||||||
|
|||||||
@@ -1,63 +1,55 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Feature;
|
|
||||||
|
|
||||||
use App\Models\Team;
|
use App\Models\Team;
|
||||||
use App\Models\TeamInvitation;
|
use App\Models\TeamInvitation;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
use Tests\TestCase;
|
|
||||||
|
|
||||||
class TeamInvitationEmailNormalizationTest extends TestCase
|
uses(RefreshDatabase::class);
|
||||||
{
|
|
||||||
use RefreshDatabase;
|
|
||||||
|
|
||||||
public function test_team_invitation_normalizes_email_to_lowercase()
|
test('team invitation normalizes email to lowercase', function () {
|
||||||
{
|
// Create a team
|
||||||
// Create a team
|
$team = Team::factory()->create();
|
||||||
$team = Team::factory()->create();
|
|
||||||
|
|
||||||
// Create invitation with mixed case email
|
// Create invitation with mixed case email
|
||||||
$invitation = TeamInvitation::create([
|
$invitation = TeamInvitation::create([
|
||||||
'team_id' => $team->id,
|
'team_id' => $team->id,
|
||||||
'uuid' => 'test-uuid-123',
|
'uuid' => 'test-uuid-123',
|
||||||
'email' => 'Test@Example.com', // Mixed case
|
'email' => 'Test@Example.com', // Mixed case
|
||||||
'role' => 'member',
|
'role' => 'member',
|
||||||
'link' => 'https://example.com/invite/test-uuid-123',
|
'link' => 'https://example.com/invite/test-uuid-123',
|
||||||
'via' => 'link'
|
'via' => 'link',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Verify email was normalized to lowercase
|
// Verify email was normalized to lowercase
|
||||||
$this->assertEquals('test@example.com', $invitation->email);
|
expect($invitation->email)->toBe('test@example.com');
|
||||||
}
|
});
|
||||||
|
|
||||||
public function test_team_invitation_works_with_existing_user_email()
|
test('team invitation works with existing user email', function () {
|
||||||
{
|
// Create a team
|
||||||
// Create a team
|
$team = Team::factory()->create();
|
||||||
$team = Team::factory()->create();
|
|
||||||
|
|
||||||
// Create a user with lowercase email
|
// Create a user with lowercase email
|
||||||
$user = User::factory()->create([
|
$user = User::factory()->create([
|
||||||
'email' => 'test@example.com',
|
'email' => 'test@example.com',
|
||||||
'name' => 'Test User'
|
'name' => 'Test User',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Create invitation with mixed case email
|
// Create invitation with mixed case email
|
||||||
$invitation = TeamInvitation::create([
|
$invitation = TeamInvitation::create([
|
||||||
'team_id' => $team->id,
|
'team_id' => $team->id,
|
||||||
'uuid' => 'test-uuid-123',
|
'uuid' => 'test-uuid-123',
|
||||||
'email' => 'Test@Example.com', // Mixed case
|
'email' => 'Test@Example.com', // Mixed case
|
||||||
'role' => 'member',
|
'role' => 'member',
|
||||||
'link' => 'https://example.com/invite/test-uuid-123',
|
'link' => 'https://example.com/invite/test-uuid-123',
|
||||||
'via' => 'link'
|
'via' => 'link',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Verify the invitation email matches the user email (both normalized)
|
// Verify the invitation email matches the user email (both normalized)
|
||||||
$this->assertEquals($user->email, $invitation->email);
|
expect($invitation->email)->toBe($user->email);
|
||||||
|
|
||||||
// Verify user lookup works
|
// Verify user lookup works
|
||||||
$foundUser = User::whereEmail($invitation->email)->first();
|
$foundUser = User::whereEmail($invitation->email)->first();
|
||||||
$this->assertNotNull($foundUser);
|
expect($foundUser)->not->toBeNull();
|
||||||
$this->assertEquals($user->id, $foundUser->id);
|
expect($foundUser->id)->toBe($user->id);
|
||||||
}
|
});
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user