Skip to content

Commit

Permalink
Don't allow multiple-parameter computed columns with missing columns
Browse files Browse the repository at this point in the history
  • Loading branch information
texodus committed Sep 3, 2018
1 parent d2065eb commit fdedf8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/perspective-viewer/src/js/computed_column.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@ class ComputedColumn extends HTMLElement {
}

this.state['input_columns'] = inputs;
this._auto_column_name();
if (inputs.length === computation.num_params) {
this._auto_column_name();
}

this.dispatchEvent(new CustomEvent('perspective-computed-column-update', {
detail: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export default class State {

is_valid() {
const vals = values(this);
return !vals.includes(null) && !vals.includes(undefined) && !vals.includes('');
return !vals.includes(null) && !vals.includes(undefined) && !vals.includes('') && this.input_columns.length === this.computation.num_params;
}
}

0 comments on commit fdedf8a

Please sign in to comment.