feat(EnvironmentVariable): add handling for Redis credentials in the environment variable component

This commit is contained in:
Andras Bacsai
2025-04-06 21:13:11 +02:00
parent 96929603eb
commit d383344ab9
2 changed files with 36 additions and 25 deletions

View File

@@ -40,6 +40,8 @@ class Show extends Component
public bool $is_really_required = false;
public bool $is_redis_credential = false;
protected $listeners = [
'refreshEnvs' => 'refresh',
'refresh',
@@ -65,7 +67,9 @@ class Show extends Component
}
$this->parameters = get_route_parameters();
$this->checkEnvs();
if ($this->type === 'standalone-redis' && ($this->env->key === 'REDIS_PASSWORD' || $this->env->key === 'REDIS_USERNAME')) {
$this->is_redis_credential = true;
}
}
public function refresh()
@@ -171,6 +175,11 @@ class Show extends Component
public function delete()
{
try {
if ($this->is_redis_credential) {
$this->dispatch('error', 'Cannot delete Redis credentials.');
return;
}
$this->env->delete();
$this->dispatch('environmentVariableDeleted');
$this->dispatch('success', 'Environment variable deleted successfully.');