Make a todo a todid, closes #774
This commit is contained in:
parent
9ee503b3c1
commit
a710bdf457
|
@ -8,6 +8,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||||
* `[beta.2]` — Fixes a bug that would cause an endless exception message stream in the console when attemping to setup environment settings in certain instances.
|
* `[beta.2]` — Fixes a bug that would cause an endless exception message stream in the console when attemping to setup environment settings in certain instances.
|
||||||
* `[beta.2]` — Fixes a bug causing the dropdown menu for a server's egg to display the wrong selected value.
|
* `[beta.2]` — Fixes a bug causing the dropdown menu for a server's egg to display the wrong selected value.
|
||||||
* `[beta.2]` — Fixes a bug that would throw a red page of death when submitting an invalid egg variable value for a server in the Admin CP.
|
* `[beta.2]` — Fixes a bug that would throw a red page of death when submitting an invalid egg variable value for a server in the Admin CP.
|
||||||
|
* `[beta.2]` — Someone found a `@todo` that I never `@todid` and thus database hosts could not be created without being linked to a node. This is fixed...
|
||||||
|
|
||||||
## v0.7.0-beta.2 (Derelict Dermodactylus)
|
## v0.7.0-beta.2 (Derelict Dermodactylus)
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -18,6 +18,10 @@ class DatabaseHostFormRequest extends AdminFormRequest
|
||||||
*/
|
*/
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
|
if (! $this->has('node_id')) {
|
||||||
|
$this->merge(['node_id' => null]);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->method() !== 'POST') {
|
if ($this->method() !== 'POST') {
|
||||||
return DatabaseHost::getUpdateRulesForId($this->route()->parameter('host')->id);
|
return DatabaseHost::getUpdateRulesForId($this->route()->parameter('host')->id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,14 +63,13 @@ class DatabaseHost extends Model implements CleansAttributes, ValidableContract
|
||||||
'host' => 'required',
|
'host' => 'required',
|
||||||
'port' => 'required',
|
'port' => 'required',
|
||||||
'username' => 'required',
|
'username' => 'required',
|
||||||
'node_id' => 'sometimes|required',
|
'node_id' => 'sometimes',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validation rules to assign to this model.
|
* Validation rules to assign to this model.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @todo the node_id field doesn't validate correctly if no node is provided in request
|
|
||||||
*/
|
*/
|
||||||
protected static $dataIntegrityRules = [
|
protected static $dataIntegrityRules = [
|
||||||
'name' => 'string|max:255',
|
'name' => 'string|max:255',
|
||||||
|
@ -78,7 +77,7 @@ class DatabaseHost extends Model implements CleansAttributes, ValidableContract
|
||||||
'port' => 'numeric|between:1,65535',
|
'port' => 'numeric|between:1,65535',
|
||||||
'username' => 'string|max:32',
|
'username' => 'string|max:32',
|
||||||
'password' => 'nullable|string',
|
'password' => 'nullable|string',
|
||||||
'node_id' => 'nullable|exists:nodes,id',
|
'node_id' => 'nullable|integer|exists:nodes,id',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="pNodeId" class="form-label">Linked Node</label>
|
<label for="pNodeId" class="form-label">Linked Node</label>
|
||||||
<select name="node_id" id="pNodeId" class="form-control">
|
<select name="node_id" id="pNodeId" class="form-control">
|
||||||
<option value="null">None</option>
|
<option value="">None</option>
|
||||||
@foreach($locations as $location)
|
@foreach($locations as $location)
|
||||||
<optgroup label="{{ $location->short }}">
|
<optgroup label="{{ $location->short }}">
|
||||||
@foreach($location->nodes as $node)
|
@foreach($location->nodes as $node)
|
||||||
|
|
Loading…
Reference in New Issue