From 103f677a937d62ce7f1dbf571196c47934909869 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 31 May 2024 12:55:14 +0200 Subject: [PATCH] Update StackForm to sort fields by name --- app/Livewire/Project/Service/StackForm.php | 2 +- app/Models/Service.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Livewire/Project/Service/StackForm.php b/app/Livewire/Project/Service/StackForm.php index 232e0ee3f..7eca5bf2d 100644 --- a/app/Livewire/Project/Service/StackForm.php +++ b/app/Livewire/Project/Service/StackForm.php @@ -42,7 +42,7 @@ class StackForm extends Component $this->validationAttributes["fields.$key.value"] = $fieldKey; } } - //$this->fields = $this->fields->sortDesc(); + $this->fields = $this->fields->sortBy('name'); } public function saveCompose($raw) { diff --git a/app/Models/Service.php b/app/Models/Service.php index 6a54729ae..ac7c15dcf 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -477,7 +477,7 @@ class Service extends BaseModel $DATABASE_URL = $this->environment_variables()->where('key', 'DATABASE_URL')->first(); $ADMIN_TOKEN = $this->environment_variables()->where('key', 'SERVICE_PASSWORD_64_ADMIN')->first(); - + $SIGNUP_ALLOWED = $this->environment_variables()->where('key', 'SIGNUP_ALLOWED')->first(); $PUSH_ENABLED = $this->environment_variables()->where('key', 'PUSH_ENABLED')->first(); $PUSH_INSTALLATION_ID = $this->environment_variables()->where('key', 'PUSH_SERVICE_ID')->first(); $PUSH_INSTALLATION_KEY = $this->environment_variables()->where('key', 'PUSH_SERVICE_KEY')->first(); @@ -499,6 +499,15 @@ class Service extends BaseModel ], ]); } + if ($SIGNUP_ALLOWED) { + $data = $data->merge([ + 'Signup Allowed' => [ + 'key' => data_get($SIGNUP_ALLOWED, 'key'), + 'value' => data_get($SIGNUP_ALLOWED, 'value'), + 'rules' => 'required|string|in:true,false', + ], + ]); + } if ($PUSH_ENABLED) { $data = $data->merge([