Skip to content

Commit

Permalink
More validation improvements. Addresses #666
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsielicki committed Nov 18, 2016
1 parent 883827a commit 6445e0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web-server/plugins/slycat-timeseries-model/wizard-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,22 @@ define(['slycat-server-root', 'slycat-web-client', 'slycat-dialog', 'slycat-mark
var validated = true;
removeErrors();

if (!component.id_column().length) {
if (!component.id_column().trim().length) {
$('#form-id-column-name').addClass('has-error');
validated = false;
}

if (component.timeseries_type() === 'csv' && !component.inputs_file_delimiter().length) {
if (component.timeseries_type() === 'csv' && !component.inputs_file_delimiter().trim().length) {
$('#form-inputs-file-delimiter').addClass('has-error');
validated = false;
}

if (component.timeseries_type() === 'csv' && !component.timeseries_name().length) {
if (component.timeseries_type() === 'csv' && !component.timeseries_name().trim().length) {
$('#form-timeseries-name').addClass('has-error');
validated = false;
}

if (typeof component.cluster_sample_count() !== 'number' && !component.cluster_sample_count().length) {
if (Number(component.cluster_sample_count()) > 0) {
$('#form-cluster-sample-count').addClass('has-error');
validated = false;
}
Expand Down

0 comments on commit 6445e0a

Please sign in to comment.