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 2 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## dbt 0.19.0 (Release TBD)
- Add select/deselect option in tags dropup in graph editor. ([docs#98](https://github.com/fishtown-analytics/dbt-docs/issues/98))

Contributors:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you just add yourself as a contributor in the existing section below? Looks like we have two contributor sections for the 0.19.0 release now :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, yep just corrected it thanks.

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

## dbt 0.18.1 (Unreleased)
- Add Exposure nodes ([docs#135](https://github.com/fishtown-analytics/dbt-docs/issues/135), [docs#136](https://github.com/fishtown-analytics/dbt-docs/pull/136), [docs#137](https://github.com/fishtown-analytics/dbt-docs/pull/137))
Expand Down
6 changes: 6 additions & 0 deletions src/app/components/graph/graph-launcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ <h6>
<ul
class="dropdown-menu"
ng-show="isVisible('tags')">
<li ng-click="onItemSelect('tags', 'select_all', $event)">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by treating this as a regular item that can be selected, we can find ourselves in some funky states! Check this example out, for instance:

Screen Shot 2020-09-25 at 2 00 47 PM

Instead, I think we might just want to add a new method in the scope called something like toggleSelectAll('tags'). This method would either unselect all tags, or make all tags selected depending on the state. I think that would help clean up some of the logic added in graph-launcher.js too!

Let me know if you have any thoughts or questions about an approach like this one :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely see your point, I can change it to a separate function. That is what I had considered at first, I thought the current was just less intrusive.

<span>Select All</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can make this bold/black text instead of light blue? How about something like

Suggested change
<span>Select All</span>
<strong class="text-dark">Select All</strong>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure that's no problem, I left it as default link color with the thought that that might distinguish it a bit from the rest of the list. But I think just doing bold is good as well.

<span ng-show="!isSelected('tags', 'select_all')">
<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
4 changes: 2 additions & 2 deletions src/app/components/graph/graph-launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ angular
scope.onItemSelect = function(form, item, e) {
var dirty = selectorService.selection.dirty;
if (scope.isSelected(form, item)) {
dirty[form] = _.without(dirty[form], item);
dirty[form] = item === 'select_all' ? [...selectorService.options[form]] : _.without(dirty[form], item);
} else {
dirty[form] = _.union(dirty[form], [item]);
dirty[form] = item === 'select_all' ? [item] : _.union(dirty[form], [item]);
}

e.preventDefault();
Expand Down