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

Implemented select/deselect option for tags dropup in graph editor #138

Merged
merged 7 commits into from
Sep 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
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:/fishtown-analytics/dbt-docs/issues/98))
- Fixed issue where sources with tags were not showing up in graph viz ([docs#93](https:/fishtown-analytics/dbt-docs/issues/93))

Contributors:
- [@Mr-Nobody99](https:/Mr-Nobody99) ([docs#138](https:/fishtown-analytics/dbt-docs/pull/138))
- [@jplynch77](https:/jplynch77) ([docs#139](https:/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