Skip to content

Commit

Permalink
works for filtering _v literally (re getredash#31)
Browse files Browse the repository at this point in the history
but don’t name a table abcdefghijklmnop.
  • Loading branch information
alison985 authored and Allen Short committed Jan 8, 2018
1 parent 953c5d8 commit f280d48
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/app/components/queries/schema-browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
ng-click="$ctrl.onRefresh()">
<span class="zmdi zmdi-refresh"></span>
</button>

<button class="btn btn-default"
title="Toggle Versioned Tables"
ng-click="$ctrl.flipToggleVersionedTables($ctrl.versionToggle)">
<span class="fa " ng-class="{'fa-toggle-on': $ctrl.versionToggle == true, 'fa-toggle-off': !$ctrl.versionToggle}">
<input type="checkbox" id="versioned-tables-toggle" ng-model="$ctrl.versionToggle" hidden/>
</span>
</button>
</div>

<div class="schema-browser" vs-repeat vs-size="$ctrl.getSize(table)">
<div ng-repeat="table in $ctrl.schema | filter:$ctrl.schemaFilter track by table.name">
<div ng-repeat="table in $ctrl.schema | filter:$ctrl.schemaFilter | filter:'!'+$ctrl.versionFilter">
<div class="table-name" ng-click="$ctrl.showTable(table)">
<i class="fa fa-table"></i>
<strong>
Expand Down
14 changes: 14 additions & 0 deletions client/app/components/queries/schema-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import template from './schema-browser.html';
function SchemaBrowserCtrl($scope) {
'ngInject';

this.versionToggle = false;
this.versionFilter = 'abcdefghijklmnop';

this.showTable = (table) => {
table.collapsed = !table.collapsed;
$scope.$broadcast('vsRepeatTrigger');
Expand All @@ -17,12 +20,23 @@ function SchemaBrowserCtrl($scope) {

return size;
};

this.flipToggleVersionedTables = (versionToggle) => {
if (versionToggle === false) {
this.versionToggle = true;
this.versionFilter = '_v';
} else {
this.versionToggle = false;
this.versionFilter = 'abcdefghijklmnop';
}
};
}

const SchemaBrowser = {
bindings: {
schema: '<',
onRefresh: '&',
flipToggleVersionedTables: '&',
},
controller: SchemaBrowserCtrl,
template,
Expand Down

0 comments on commit f280d48

Please sign in to comment.