Skip to content

Commit

Permalink
Added validation on Number of clusters #431
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf4ood committed Jan 16, 2017
1 parent 3933ce2 commit 122d17b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {HttpModule} from '@angular/http';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';



import 'core-js';
import 'babel-polyfill';
import 'zone.js';
Expand Down
17 changes: 13 additions & 4 deletions src/components/schema/edge/newEdgeModal.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,19 @@ <h4 class="modal-title">Edge Class: {{$ctrl.property['name']}}</h4>
</div>
</div>

<div class="form-group">
<label class="control-label col-md-3"> Number of Clusters</label>
<div class="col-md-9">
<input type="number" class="form-control" ng-model="$ctrl.property['clusters']"/>
<div class="form-group"
ng-class="{ 'has-error' : (classForm.clusterNumber.$error.min || classForm.clusterNumber.$error.number)}">
<label class="control-label col-md-2"> Number of Clusters</label>
<div class="col-md-10">
<input type="number" name="clusterNumber" min="1" class="form-control"
ng-model="$ctrl.property['clusters']"/>
</div>
<div class="col-md-10 col-md-offset-2">
<span ng-show="classForm.clusterNumber.$error.min"
class="help-block help-block-sm ">Number of clusters should be >= 1</span>

<span ng-show="classForm.clusterNumber.$error.number"
class="help-block help-block-sm ">Invalid Number</span>
</div>
</div>
</form>
Expand Down
13 changes: 11 additions & 2 deletions src/components/schema/generic/newGenericModal.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,19 @@ <h4 class="modal-title">Generic Class: {{$ctrl.property['name']}}</h4>
</div>
</div>

<div class="form-group">
<div class="form-group"
ng-class="{ 'has-error' : (classForm.clusterNumber.$error.min || classForm.clusterNumber.$error.number)}">
<label class="control-label col-md-2"> Number of Clusters</label>
<div class="col-md-10">
<input type="number" class="form-control" ng-model="$ctrl.property['clusters']"/>
<input type="number" name="clusterNumber" min="1" class="form-control"
ng-model="$ctrl.property['clusters']"/>
</div>
<div class="col-md-10 col-md-offset-2">
<span ng-show="classForm.clusterNumber.$error.min"
class="help-block help-block-sm ">Number of clusters should be >= 1</span>

<span ng-show="classForm.clusterNumber.$error.number"
class="help-block help-block-sm ">Invalid Number</span>
</div>
</div>
</form>
Expand Down
13 changes: 11 additions & 2 deletions src/components/schema/vertex/newVertexModal.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,19 @@ <h4 class="modal-title">Vertex Class: {{$ctrl.property['name']}}</h4>
</div>
</div>

<div class="form-group">
<div class="form-group"
ng-class="{ 'has-error' : (classForm.clusterNumber.$error.min || classForm.clusterNumber.$error.number)}">
<label class="control-label col-md-2"> Number of Clusters</label>
<div class="col-md-10">
<input type="number" class="form-control" ng-model="$ctrl.property['clusters']"/>
<input type="number" name="clusterNumber" min="1" class="form-control"
ng-model="$ctrl.property['clusters']"/>
</div>
<div class="col-md-10 col-md-offset-2">
<span ng-show="classForm.clusterNumber.$error.min"
class="help-block help-block-sm ">Number of clusters should be >= 1</span>

<span ng-show="classForm.clusterNumber.$error.number"
class="help-block help-block-sm ">Invalid Number</span>
</div>
</div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = {
loader: "style-loader!css-loader"
},
{
test: /\.(eot|svg|ttf|gif|woff(2)?)(\?v=\d+\.\d+\.\d+)?/,
test: /\.(eot|svg|ttf|woff(2)?)(\?v=\d+\.\d+\.\d+)?/,
loader: 'url-loader'
},
{
Expand Down

0 comments on commit 122d17b

Please sign in to comment.