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

Fix relatioship fieldset #236

Merged

Conversation

PhyberApex
Copy link
Contributor

This is the fix for #235

As mentioned there relationships should also be filtered by the sparse fieldset.

PhyberApex and others added 16 commits October 23, 2019 10:17

Verified

This commit was signed with the committer’s verified signature.
mbklein Michael B. Klein
Upstream

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was signed with the committer’s verified signature.
mbklein Michael B. Klein

Verified

This commit was signed with the committer’s verified signature.
mbklein Michael B. Klein

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was signed with the committer’s verified signature.
mbklein Michael B. Klein

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
* Allow for self link generation for custom routes

* Fix code standard error

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…maas#232)

* Fixed links.last when there are no any items in response

* Added a unit tests to cover scenarios when we have items in response for less than one page

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@PhyberApex
Copy link
Contributor Author

Sorry for all those commits in this again... we were using this internally and we needed the changes from both PRs and I did not know how to handle this better.

~Cheers

@PhyberApex
Copy link
Contributor Author

Any update on this?

@joukevandermaas
Copy link
Owner

I'm sorry, this completely slipped past me during the holidays. I will take a look at this very soon.

Copy link
Owner

@joukevandermaas joukevandermaas left a comment

Choose a reason for hiding this comment

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

Nice, simple PR 👍

The only small thingy is the asserts in the test, I think we should assert both positive (expected value is here) and negative (not expected values are not there), similar to what the attribute test does.

@@ -83,6 +83,22 @@ public void UsesQueryFieldsetExpressions()
Assert.NotNull(result["data"][0]["attributes"]["location"]);
Assert.Null(result["data"][0]["attributes"]["number-of-employees"]);
}

[Fact(DisplayName = "Uses query fieldset expressions also on relationships if specified")]
Copy link
Owner

Choose a reason for hiding this comment

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

I guess the "also" will lose its meaning pretty soon after this is merged 😄

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 do not quite get what you mean here, I hope I resolved the issue.

Copy link
Owner

Choose a reason for hiding this comment

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

You did, it wasn't really an issue just a stylistic thing 😄 if you read the test title by itself, the "also" didn't make sense, it only did in the context of the other tests. It was a very minor thing anyway.

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 I see. Didn't get it probably because english istn't my first language :)


var relationships = result["data"][0]["relationships"];

Assert.Null(relationships["family-members"]);
Copy link
Owner

Choose a reason for hiding this comment

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

Should you also assert that Job actually is there?

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 should and I will :)

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…here
@joukevandermaas joukevandermaas merged commit 1f8b0a9 into joukevandermaas:master Jan 20, 2020
@joukevandermaas
Copy link
Owner

Thanks very much!

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

Successfully merging this pull request may close these issues.

None yet

4 participants