Skip to content

Commit

Permalink
Merge pull request #138 from Mr-Nobody99/feature/select_deselect_all
Browse files Browse the repository at this point in the history
Implemented select/deselect option for tags dropup in graph editor
  • Loading branch information
drewbanin authored Sep 28, 2020
2 parents 1caa287 + 7e41be9 commit a2871c7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## dbt 0.19.0 (Release TBD)
- Add select/deselect option in DAG view dropups. ([docs#98](https://github.com/fishtown-analytics/dbt-docs/issues/98))
- Fixed issue where sources with tags were not showing up in graph viz ([docs#93](https://github.com/fishtown-analytics/dbt-docs/issues/93))

Contributors:
- [@Mr-Nobody99](https://github.com/Mr-Nobody99) ([docs#138](https://github.com/fishtown-analytics/dbt-docs/pull/138))
- [@jplynch77](https://github.com/jplynch77) ([docs#139](https://github.com/fishtown-analytics/dbt-docs/pull/139))

## dbt 0.18.1 (Unreleased)
Expand Down
18 changes: 18 additions & 0 deletions src/app/components/graph/graph-launcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ <h6>
<ul
class="dropdown-menu"
ng-show="isVisible('resource_types')">
<li ng-click="onSelectAll('resource_types', !allSelected, $event)">
<strong class="text-dark">Select All</strong>
<span ng-show="allSelected">
<svg class="checked" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z"/></svg>
</span>
</li>
<li
class='text-dark'
ng-repeat="item in selectorService.options.resource_types"
Expand Down Expand Up @@ -144,6 +150,12 @@ <h6>
<ul
class="dropdown-menu"
ng-show="isVisible('packages')">
<li ng-click="onSelectAll('packages', !allSelected, $event)">
<strong class="text-dark">Select All</strong>
<span ng-show="allSelected">
<svg class="checked" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z"/></svg>
</span>
</li>
<li
class='text-dark'
ng-repeat="item in selectorService.options.packages"
Expand Down Expand Up @@ -173,6 +185,12 @@ <h6>
<ul
class="dropdown-menu"
ng-show="isVisible('tags')">
<li ng-click="onSelectAll('tags', !allSelected, $event)">
<strong class="text-dark">Select All</strong>
<span ng-show="allSelected">
<svg class="checked" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z"/></svg>
</span>
</li>
<li
class='text-dark'
ng-repeat="item in selectorService.options.tags"
Expand Down
13 changes: 13 additions & 0 deletions src/app/components/graph/graph-launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ angular

scope.graphService = graph;
scope.selectorService = selectorService;
scope.allSelected = true;

var forms = {
tags: {
Expand Down Expand Up @@ -79,6 +80,18 @@ angular
return dirty.indexOf(item) != -1;
}

scope.onSelectAll = function(form, mode, e) {
var dirty = selectorService.selection.dirty;
if (mode) {
dirty[form] = [...selectorService.options[form]];
} else {
dirty[form] = [];
}

scope.allSelected = !scope.allSelected;
e.preventDefault();
}

scope.onItemSelect = function(form, item, e) {
var dirty = selectorService.selection.dirty;
if (scope.isSelected(form, item)) {
Expand Down

0 comments on commit a2871c7

Please sign in to comment.