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

Conversation

Mr-Nobody99
Copy link
Contributor

@Mr-Nobody99 Mr-Nobody99 commented Sep 25, 2020

resolves #98

Description

After seeing the open issue for a select/deselect all option for tags in the graph editor, I thought that makes a lot of sense.
So I implemented it, the changes are in the graph-launcher. I added a new list item in the html and some conditions in onItemSelect() to handle the change.

Checklist

  • I have signed the CLA
  • I have generated docs locally, and this change appears to resolve the stated issue
  • I have updated the CHANGELOG.md and added information about my change to the "dbt next" section.

@cla-bot cla-bot bot added the cla:yes label Sep 25, 2020
Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

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

Cool PR @Mr-Nobody99 - i like this a lot!

Couple of quick things:

  • When all tags are unselected, the select state shows select_all. I dropped a comment inline in the code about how I think we could resolve this, but curious to hear what you're thinking too.

Screen Shot 2020-09-25 at 1 51 42 PM

  • It probably makes sense to add this same component to the resources and packages selectors too! You think there's a straightforward way to this option available on each of the dropdowns in the DAG view?

Nice work so far!

@@ -173,6 +173,12 @@ <h6>
<ul
class="dropdown-menu"
ng-show="isVisible('tags')">
<li ng-click="onItemSelect('tags', 'select_all', $event)">
<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.

@@ -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.

…lect all option to resource_type and package dropup as well.
@@ -115,6 +115,12 @@ <h6>
<ul
class="dropdown-menu"
ng-show="isVisible('resource_types')">
<li ng-click="onSelectAll('resource_types', allSelected ? false : true, $event)">
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious - why do allSelected ? false : true instead of !allSelected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No particular reason I didn't think of that, but that is a bit cleaner I'll change it.

@drewbanin
Copy link
Contributor

This is really excellent! Thanks for making those changes - I think this works really well now. Can you just:

  1. Check out my latest comment
  2. Fix the merge conflicts in the changelog?

After that, this should be ready to merge!

@Mr-Nobody99
Copy link
Contributor Author

@drewbanin Thanks a lot happy to help, I just finished those changes.

Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

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

Approving this pending the tiniest of changes in the changelog. Nice work on this one!

CHANGELOG.md Outdated
@@ -1,4 +1,8 @@
## 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))

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.

Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

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

Merging! This will ship in dbt v0.19.0 :)

@drewbanin drewbanin merged commit a2871c7 into dbt-labs:master Sep 28, 2020
@Mr-Nobody99 Mr-Nobody99 deleted the feature/select_deselect_all branch September 28, 2020 20:44
@Mr-Nobody99
Copy link
Contributor Author

Woot! thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a select all/deselect all for tags
2 participants