Fix styling

This commit is contained in:
Thijmen
2024-06-10 20:43:34 +00:00
committed by github-actions[bot]
parent 41fb6a1fc9
commit d86274cc37
429 changed files with 5307 additions and 2831 deletions

View File

@@ -10,14 +10,21 @@ use Visus\Cuid2\Cuid2;
class Show extends Component
{
public $parameters;
public ModelsEnvironmentVariable|SharedEnvironmentVariable $env;
public ?string $modalId = null;
public bool $isDisabled = false;
public bool $isLocked = false;
public bool $isSharedVariable = false;
public string $type;
protected $listeners = [
"compose_loaded" => '$refresh',
'compose_loaded' => '$refresh',
];
protected $rules = [
@@ -29,6 +36,7 @@ class Show extends Component
'env.is_shown_once' => 'required|boolean',
'env.real_value' => 'nullable',
];
protected $validationAttributes = [
'env.key' => 'Key',
'env.value' => 'Value',
@@ -47,6 +55,7 @@ class Show extends Component
$this->parameters = get_route_parameters();
$this->checkEnvs();
}
public function checkEnvs()
{
$this->isDisabled = false;
@@ -57,6 +66,7 @@ class Show extends Component
$this->isLocked = true;
}
}
public function serialize()
{
data_forget($this->env, 'real_value');
@@ -64,6 +74,7 @@ class Show extends Component
data_forget($this->env, 'is_build_time');
}
}
public function lock()
{
$this->env->is_shown_once = true;
@@ -72,10 +83,12 @@ class Show extends Component
$this->checkEnvs();
$this->dispatch('refreshEnvs');
}
public function instantSave()
{
$this->submit();
}
public function submit()
{
try {
@@ -89,9 +102,10 @@ class Show extends Component
$this->validate();
}
if (str($this->env->value)->startsWith('{{') && str($this->env->value)->endsWith('}}')) {
$type = str($this->env->value)->after("{{")->before(".")->value;
if (!collect(SHARED_VARIABLE_TYPES)->contains($type)) {
$this->dispatch('error', 'Invalid shared variable type.', "Valid types are: team, project, environment.");
$type = str($this->env->value)->after('{{')->before('.')->value;
if (! collect(SHARED_VARIABLE_TYPES)->contains($type)) {
$this->dispatch('error', 'Invalid shared variable type.', 'Valid types are: team, project, environment.');
return;
}
}