Update StackForm to sort fields by name

This commit is contained in:
Andras Bacsai 2024-05-31 12:55:14 +02:00
parent cb6bf78595
commit 103f677a93
2 changed files with 11 additions and 2 deletions

View File

@ -42,7 +42,7 @@ public function mount()
$this->validationAttributes["fields.$key.value"] = $fieldKey;
}
}
//$this->fields = $this->fields->sortDesc();
$this->fields = $this->fields->sortBy('name');
}
public function saveCompose($raw)
{

View File

@ -477,7 +477,7 @@ public function extraFields()
$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 @@ public function extraFields()
],
]);
}
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([