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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Added the member context to the get, next-post and prev-post helpers #14256

Merged
merged 3 commits into from
Mar 3, 2022

Conversation

SimonBackx
Copy link
Contributor

refs https://github.com/TryGhost/Team/issues/1367

  • The {{access}}聽property of a post always returned false for non-public content
  • The get, next-post and prev-post helpers didn't add the member context to the internal API calls
  • Added the members context to these calls

Tests:

  • Added tests that check if the member context is passed to the API calls
  • Includes a refactor for both the next-post and prev-post helper tests to the async await syntax
  • Added const should = require('should'); to the next-post and prev-post helper tests to allow them to run on their own

@codecov
Copy link

codecov bot commented Mar 2, 2022

Codecov Report

Merging #14256 (7e00dda) into main (e97abec) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14256      +/-   ##
==========================================
+ Coverage   55.43%   55.44%   +0.01%     
==========================================
  Files         564      564              
  Lines       46725    46736      +11     
  Branches     3980     3980              
==========================================
+ Hits        25900    25915      +15     
+ Misses      20785    20781       -4     
  Partials       40       40              
Impacted Files Coverage 螖
core/frontend/helpers/get.js 92.71% <100.00%> (+0.03%) 猬嗭笍
core/frontend/helpers/prev_post.js 98.29% <100.00%> (+0.15%) 猬嗭笍
core/server/models/base/plugins/events.js 70.95% <0.00%> (+1.47%) 猬嗭笍

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update e97abec...7e00dda. Read the comment docs.

@matthanley
Copy link
Contributor

When this is squashed + merged, it would be great to update the commit title to communicate the problem that's fixed (access is incorrect when using get helper) rather than the fix itself so it makes sense to users who don't have context

@SimonBackx SimonBackx force-pushed the fix/get-helper-member-context branch from 66f3d8d to 6b91e63 Compare March 3, 2022 14:25
refs https://github.com/TryGhost/Team/issues/1367

- The {{access}}聽property of a post always returned false for non-public content
- The get, next-post and prev-post helpers didn't add the member context to the internal API calls
- Added the members context to these calls
- Added tests that check if the member context is passed to the API calls
@SimonBackx SimonBackx force-pushed the fix/get-helper-member-context branch from 6b91e63 to 7e00dda Compare March 3, 2022 14:56
@SimonBackx SimonBackx merged commit f389bab into TryGhost:main Mar 3, 2022
@SimonBackx SimonBackx deleted the fix/get-helper-member-context branch March 3, 2022 15:18
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

2 participants