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

fetch restricted runs in publisher #964

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

zawan-ila
Copy link
Contributor

PROD-4088

This PR adds adds the restriction params to the API calls in Publisher to ensure that restricted runs are always fetched/updated properly in Publisher.

Testing

  1. Check out this branch
  2. Open/Create an executive education course in publisher
  3. Add a restriction type. Then change it. Finally remove it.
  4. Verify that the behavior is as expected.

Copy link
Contributor

@AfaqShuaib09 AfaqShuaib09 left a comment

Choose a reason for hiding this comment

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

Looks good to me, better to have a unittest for this usecase

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.76%. Comparing base (5252f68) to head (0472c9d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #964   +/-   ##
=======================================
  Coverage   67.75%   67.76%           
=======================================
  Files         128      128           
  Lines        3228     3229    +1     
  Branches      913      935   +22     
=======================================
+ Hits         2187     2188    +1     
  Misses        996      996           
  Partials       45       45           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zawan-ila
Copy link
Contributor Author

Looks good to me, better to have a unittest for this usecase

I don't see many tests for discoveryApiService. I could add a test that asserts that the include_restricted param is included in the url, but I am not sure how helpful that would be. If you think that would be good enough, I am happy to add it. Or if you have ideas for a different test, please let me know about that too.

@@ -10,6 +11,7 @@ class DiscoveryDataApiService {
const queryParams = {
editable: 1,
exclude_utm: 1,
include_restricted: restrictionTypeValues,
Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm, do we not need any test updates for this?

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. There are virtually no tests for this file.

{ value: 'custom-b2c', label: 'Custom B2C' },
];

const RESTRICTION_TYPE_VALUES = RESTRICTION_TYPE_OPTIONS.map(opt => opt.value).filter(Boolean).join(',');
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏽 on that Boolean filter

@zawan-ila zawan-ila merged commit 7b1f22b into openedx:master Jun 25, 2024
7 checks passed
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.

3 participants