Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
069a9051
Commit
069a9051
authored
7 years ago
by
Diana Huang
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #15671 from edx/diana/tabs-issues
Handle tab hiding at a different level.
parents
91ad611f
482b63ba
No related branches found
Branches containing commit
Tags
release-2021-02-03-12.16
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/courseware/tabs.py
+4
-4
4 additions, 4 deletions
lms/djangoapps/courseware/tabs.py
lms/djangoapps/courseware/tests/test_tabs.py
+8
-0
8 additions, 0 deletions
lms/djangoapps/courseware/tests/test_tabs.py
with
12 additions
and
4 deletions
lms/djangoapps/courseware/tabs.py
+
4
−
4
View file @
069a9051
...
...
@@ -70,10 +70,7 @@ class CourseInfoTab(CourseTab):
@classmethod
def
is_enabled
(
cls
,
course
,
user
=
None
):
"""
The
"
Home
"
tab is not shown for the new unified course experience.
"""
return
not
UNIFIED_COURSE_TAB_FLAG
.
is_enabled
(
course
.
id
)
return
True
class
SyllabusTab
(
EnrolledTab
):
...
...
@@ -326,6 +323,9 @@ def get_course_tab_list(request, course):
if
tab
.
type
!=
'
courseware
'
:
continue
tab
.
name
=
_
(
"
Entrance Exam
"
)
# TODO: LEARNER-611 - once the course_info tab is removed, remove this code
if
UNIFIED_COURSE_TAB_FLAG
.
is_enabled
(
course
.
id
)
and
tab
.
type
==
'
course_info
'
:
continue
if
tab
.
type
==
'
static_tab
'
and
tab
.
course_staff_only
and
\
not
bool
(
user
and
has_access
(
user
,
'
staff
'
,
course
,
course
.
id
)):
continue
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/courseware/tests/test_tabs.py
+
8
−
0
View file @
069a9051
...
...
@@ -792,6 +792,14 @@ class CourseInfoTabTestCase(TabTestCase):
tabs
=
get_course_tab_list
(
self
.
request
,
self
.
course
)
self
.
assertEqual
(
tabs
[
0
].
type
,
'
courseware
'
)
# TODO: LEARNER-611 - remove once course_info is removed.
@override_waffle_flag
(
UNIFIED_COURSE_TAB_FLAG
,
active
=
True
)
def
test_default_tab_for_displayable
(
self
):
tabs
=
xmodule_tabs
.
CourseTabList
.
iterate_displayable
(
self
.
course
,
self
.
user
)
for
i
,
tab
in
enumerate
(
tabs
):
if
i
==
0
:
self
.
assertEqual
(
tab
.
type
,
'
course_info
'
)
@attr
(
shard
=
1
)
class
DiscussionLinkTestCase
(
TabTestCase
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment