Added validation to variable validation rules to validate that the validation rules are valid

closes #988
This commit is contained in:
Dane Everitt 2018-03-17 15:09:09 -05:00
parent 7a04a9f169
commit b96c2d16ee
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
9 changed files with 246 additions and 32 deletions

View file

@ -24,6 +24,7 @@ return [
'variables' => [
'env_not_unique' => 'The environment variable :name must be unique to this Egg.',
'reserved_name' => 'The environment variable :name is protected and cannot be assigned to a variable.',
'bad_validation_rule' => 'The validation rule ":rule" is not a valid rule for this application.',
],
'importer' => [
'json_error' => 'There was an error while attempting to parse the JSON file: :error.',

View file

@ -105,20 +105,20 @@
<div class="modal-body">
<div class="form-group">
<label class="control-label">Name <span class="field-required"></span></label>
<input type="text" name="name" class="form-control" />
<input type="text" name="name" class="form-control" value="{{ old('name') }}"/>
</div>
<div class="form-group">
<label class="control-label">Description</label>
<textarea name="description" class="form-control" rows="3"></textarea>
<textarea name="description" class="form-control" rows="3">{{ old('description') }}</textarea>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="control-label">Environment Variable <span class="field-required"></span></label>
<input type="text" name="env_variable" class="form-control" />
<input type="text" name="env_variable" class="form-control" value="{{ old('env_variable') }}" />
</div>
<div class="form-group col-md-6">
<label class="control-label">Default Value</label>
<input type="text" name="default_value" class="form-control" />
<input type="text" name="default_value" class="form-control" value="{{ old('default_value') }}" />
</div>
<div class="col-xs-12">
<p class="text-muted small">This variable can be accessed in the statup command by entering <code>@{{environment variable value}}</code>.</p>
@ -133,7 +133,7 @@
</div>
<div class="form-group">
<label class="control-label">Input Rules <span class="field-required"></span></label>
<input type="text" name="rules" class="form-control" value="required|string|max:20" placeholder="required|string|max:20" />
<input type="text" name="rules" class="form-control" value="{{ old('rules', 'required|string|max:20') }}" placeholder="required|string|max:20" />
<p class="text-muted small">These rules are defined using standard Laravel Framework validation rules.</p>
</div>
</div>