Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid filters #375

Merged
merged 15 commits into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated styling for invalid filters
  • Loading branch information
Ro4052 committed Jan 9, 2019
commit de8e9fbaebfa3ec43af1ad990d14b282d320f672
1 change: 1 addition & 0 deletions packages/perspective-viewer/src/html/row.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<select id="column_aggregate" class="string"></select>
<select id="filter_operator"></select>
<input id="filter_operand" placeholder="Value" />
<span id="row_exclamation" hidden>&#x26A0;</span>
<span id='row_close'>&#x2715;</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,18 @@ export class PerspectiveElement extends StateElement {
const filterNodes = this._get_view_filter_nodes();
for (let i = 0; i < filterNodes.length; i++) {
const node = filterNodes[i];
const operandNode = node.shadowRoot.getElementById("filter_operand");
const exclamation = node.shadowRoot.getElementById("row_exclamation");
const name = node.getAttribute("name");
const {operator, operand} = JSON.parse(node.getAttribute("filter"));
const filter = [name, operator, operand];
if (await this._table.valid_filter(filter)) {
filters.push(filter);
node.className = "";
operandNode.style.borderColor = "";
exclamation.hidden = true;
} else {
node.className = "invalid-filter";
operandNode.style.borderColor = "red";
exclamation.hidden = false;
}
}

Expand Down
6 changes: 0 additions & 6 deletions packages/perspective-viewer/src/less/column_labels.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
margin-top: 23px;
}

.invalid-filter {
border-style: dashed;
border-width: 0.1em;
border-color: red;
}

:host {
#app #top_panel {
#row_pivots label:before {
Expand Down
4 changes: 4 additions & 0 deletions packages/perspective-viewer/src/less/row.less
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@
padding: var(--sort_order-padding, 0);
}

#row_exclamation {
color: red;
}

#row_close {
color: #999;
font-family: Arial;
Expand Down