mirror of
https://github.com/coollabsio/coolify.git
synced 2026-06-19 07:35:25 +00:00
fix: update success message logic to only show when changes are made
This commit is contained in:
@@ -193,8 +193,8 @@ class All extends Component
|
||||
}
|
||||
}
|
||||
|
||||
// Always show success message unless an error occurred
|
||||
if (! $errorOccurred) {
|
||||
// Only show success message if changes were actually made and no errors occurred
|
||||
if ($changesMade && ! $errorOccurred) {
|
||||
$this->dispatch('success', 'Environment variables updated.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,8 +166,8 @@ test('bulk update preserves existing comments when no inline comment provided',
|
||||
'resource' => $this->application,
|
||||
'type' => 'application',
|
||||
])
|
||||
->set('variablesInput', $bulkContent)
|
||||
->call('saveVariables');
|
||||
->set('variables', $bulkContent)
|
||||
->call('submit');
|
||||
|
||||
// Refresh the environment variable
|
||||
$env->refresh();
|
||||
@@ -196,8 +196,8 @@ test('bulk update overwrites existing comments when inline comment provided', fu
|
||||
'resource' => $this->application,
|
||||
'type' => 'application',
|
||||
])
|
||||
->set('variablesInput', $bulkContent)
|
||||
->call('saveVariables');
|
||||
->set('variables', $bulkContent)
|
||||
->call('submit');
|
||||
|
||||
// Refresh the environment variable
|
||||
$env->refresh();
|
||||
@@ -234,8 +234,8 @@ test('bulk update handles mixed inline and stored comments correctly', function
|
||||
'resource' => $this->application,
|
||||
'type' => 'application',
|
||||
])
|
||||
->set('variablesInput', $bulkContent)
|
||||
->call('saveVariables');
|
||||
->set('variables', $bulkContent)
|
||||
->call('submit');
|
||||
|
||||
// Refresh both variables
|
||||
$env1->refresh();
|
||||
@@ -258,8 +258,8 @@ test('bulk update creates new variables with inline comments', function () {
|
||||
'resource' => $this->application,
|
||||
'type' => 'application',
|
||||
])
|
||||
->set('variablesInput', $bulkContent)
|
||||
->call('saveVariables');
|
||||
->set('variables', $bulkContent)
|
||||
->call('submit');
|
||||
|
||||
// Check that variables were created with correct comments
|
||||
$var1 = EnvironmentVariable::where('key', 'NEW_VAR1')
|
||||
|
||||
Reference in New Issue
Block a user