-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(#4848) - Return only isVisible Tags, unless admin #4879
Merged
mikemurray
merged 22 commits into
develop
from
4848-feat-machikoyasuda-only-return-isVisible-tags
Jan 2, 2019
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
d80a122
feat(tag): add isVisible to Tag's graphql query
machikoyasuda a48be9b
feat(tags): query only isVisible tags by default
machikoyasuda ce29f8c
feat(tags): add shouldIncludeInvisible to query
machikoyasuda 7a12da7
docs(tags): add gql query docs
machikoyasuda 22f41d8
feat(tags): check for whether a user is Admin before returning invisi…
machikoyasuda ce93d1d
tests(tags): update tag fixture to include isActive as true by default
machikoyasuda b0c9e72
chore: lint
machikoyasuda 60b7ca3
tests(tags): update tag unit tests
machikoyasuda 95251ae
tests(tags): add a test to query invisible tags
machikoyasuda b7c0efa
tests: oops - isVisible, not isActive
machikoyasuda 53513d7
chore: lint
machikoyasuda 9ac766f
tests(tags): add isVisible to Tag fixture
machikoyasuda 5a3b28b
fix: refactor tags query to check for admin status first
machikoyasuda c093f0f
fix(tag): add admin check to Tag query
machikoyasuda ede1591
fix(tags): a non-Admin can only fetch tags that are not Deleted and a…
machikoyasuda b5f5c49
chore: lint
machikoyasuda ad0ab90
fix: fix tests
machikoyasuda 6514ddd
tests: update tests - still failin though
machikoyasuda e43f9e3
chore: lint fix
machikoyasuda 303525a
tests: check for whether isAdmin is called
machikoyasuda 99dc700
docs: jsdoc
machikoyasuda fb7f2d2
tests: fix tests. make sure to mock admin method
machikoyasuda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
shouldIncludeInvisible === true
but you're not an admin user, you will end up getting theinvisible
andvisible
tags.What's even more interesting, if
shouldIncludeDeleted = true
you can see deleted tags as well.The logic in the function needs a bit of a rework. I think you should check if the user is an admin or not, then decide if they get to see
isVisible:true
orisDeleted:true
tags. Then for everyone else, they don't get to see invisible or deleted products.