-
Notifications
You must be signed in to change notification settings - Fork 482
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
Hide course versions #26678
Merged
Merged
Hide course versions #26678
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1b3c81a
Test can_view_version? with no user
maddiedierker 3457983
Filter course dropdown to only versions that are viewable by user
maddiedierker 172d75d
Update CourseOverview unit tests to include can_view_version prop on …
maddiedierker 5f8e25d
Filter scripts from version dropdown where can_view_version is false
maddiedierker be6ade3
Update UI tests for filtering course/script versions from version dro…
maddiedierker 7d6a45b
Merge branch 'staging' into hide-course-versions
maddiedierker c2f55c8
Add comment
maddiedierker 329e761
Simplify course.can_view_version? logic
maddiedierker b457210
Simplify script.can_view_version? logic
maddiedierker 21917b0
Update course version UI test to assigned older script version
maddiedierker b7c4b70
Require course version title prop
maddiedierker a92097b
Refactor versions prop into array of type scriptVersionShape
maddiedierker 7d5ad3f
Add required version_title prop to CourseOverview component unit tests
maddiedierker File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,10 +121,10 @@ describe('CourseOverview', () => { | |
utils.navigateToHref.restore(); | ||
}); | ||
|
||
it('appears when two versions are present', () => { | ||
it('appears when two versions are present and viewable', () => { | ||
const versions = [ | ||
{name: 'csp', version_year: '2017'}, | ||
{name: 'csp-2018', version_year: '2018'}, | ||
{name: 'csp', version_year: '2017', version_title: 'csp 2017', can_view_version: true}, | ||
{name: 'csp-2018', version_year: '2018', version_title: 'csp 2018', can_view_version: true}, | ||
]; | ||
const wrapper = shallow( | ||
<CourseOverview | ||
|
@@ -143,9 +143,10 @@ describe('CourseOverview', () => { | |
expect(utils.navigateToHref).to.have.been.calledOnce; | ||
}); | ||
|
||
it('does not appear when only one version is present', () => { | ||
it('does not appear when only one version is viewable', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for keeping these test case names up to date! 💯 |
||
const versions = [ | ||
{name: 'csp', version_year: '2017'}, | ||
{name: 'csp', version_year: '2017', version_title: 'csp 2017', can_view_version: false}, | ||
{name: 'csp-2018', version_year: '2018', version_title: 'csp 2018', can_view_version: true}, | ||
]; | ||
const wrapper = shallow( | ||
<CourseOverview | ||
|
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.
while you are in here, please add
version_title
as a required part of this shape, because it is depended on below.