Skip to content

Commit

Permalink
Merge branch 'master' into jci/issue#35245
Browse files Browse the repository at this point in the history
  • Loading branch information
jciasenza authored Dec 6, 2024
2 parents e92d60b + 3196ceb commit cab629a
Show file tree
Hide file tree
Showing 38 changed files with 655 additions and 1,903 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class StudioHomeSerializer(serializers.Serializer):
request_course_creator_url = serializers.CharField()
rerun_creator_status = serializers.BooleanField()
show_new_library_button = serializers.BooleanField()
show_new_library_v2_button = serializers.BooleanField()
split_studio_home = serializers.BooleanField()
studio_name = serializers.CharField()
studio_short_name = serializers.CharField()
Expand Down
1 change: 1 addition & 0 deletions cms/djangoapps/contentstore/rest_api/v1/views/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def get(self, request: Request):
"request_course_creator_url": "/request_course_creator",
"rerun_creator_status": true,
"show_new_library_button": true,
"show_new_library_v2_button": true,
"split_studio_home": false,
"studio_name": "Studio",
"studio_short_name": "Studio",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def setUp(self):
"request_course_creator_url": "/request_course_creator",
"rerun_creator_status": True,
"show_new_library_button": True,
"show_new_library_v2_button": True,
"split_studio_home": False,
"studio_name": settings.STUDIO_NAME,
"studio_short_name": settings.STUDIO_SHORT_NAME,
Expand Down
8 changes: 8 additions & 0 deletions cms/djangoapps/contentstore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1552,6 +1552,9 @@ def get_library_context(request, request_is_json=False):
from cms.djangoapps.contentstore.views.library import (
user_can_view_create_library_button,
)
from openedx.core.djangoapps.content_libraries.api import (
user_can_create_library,
)

libraries = _accessible_libraries_iter(request.user) if libraries_v1_enabled() else []
data = {
Expand All @@ -1565,6 +1568,7 @@ def get_library_context(request, request_is_json=False):
'courses': [],
'libraries_enabled': libraries_v1_enabled(),
'show_new_library_button': user_can_view_create_library_button(request.user) and request.user.is_active,
'show_new_library_v2_button': user_can_create_library(request.user),
'user': request.user,
'request_course_creator_url': reverse('request_course_creator'),
'course_creator_status': _get_course_creator_status(request.user),
Expand Down Expand Up @@ -1686,6 +1690,9 @@ def get_home_context(request, no_course=False):
from cms.djangoapps.contentstore.views.library import (
user_can_view_create_library_button,
)
from openedx.core.djangoapps.content_libraries.api import (
user_can_create_library,
)

active_courses = []
archived_courses = []
Expand Down Expand Up @@ -1714,6 +1721,7 @@ def get_home_context(request, no_course=False):
'taxonomy_list_mfe_url': get_taxonomy_list_url(),
'libraries': libraries,
'show_new_library_button': user_can_view_create_library_button(user),
'show_new_library_v2_button': user_can_create_library(user),
'user': user,
'request_course_creator_url': reverse('request_course_creator'),
'course_creator_status': _get_course_creator_status(user),
Expand Down
24 changes: 12 additions & 12 deletions cms/djangoapps/contentstore/views/tests/test_course_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,13 @@ def check_index_page(self, separate_archived_courses, org):
@override_settings(FEATURES=FEATURES_WITHOUT_HOME_PAGE_COURSE_V2_API)
@ddt.data(
# Staff user has course staff access
(True, 'staff', None, 0, 21),
(False, 'staff', None, 0, 21),
(True, 'staff', None, 0, 23),
(False, 'staff', None, 0, 23),
# Base user has global staff access
(True, 'user', ORG, 2, 21),
(False, 'user', ORG, 2, 21),
(True, 'user', None, 2, 21),
(False, 'user', None, 2, 21),
(True, 'user', ORG, 2, 23),
(False, 'user', ORG, 2, 23),
(True, 'user', None, 2, 23),
(False, 'user', None, 2, 23),
)
@ddt.unpack
def test_separate_archived_courses(self, separate_archived_courses, username, org, mongo_queries, sql_queries):
Expand All @@ -464,13 +464,13 @@ def test_separate_archived_courses(self, separate_archived_courses, username, or
@override_settings(FEATURES=FEATURES_WITH_HOME_PAGE_COURSE_V2_API)
@ddt.data(
# Staff user has course staff access
(True, 'staff', None, 0, 21),
(False, 'staff', None, 0, 21),
(True, 'staff', None, 0, 23),
(False, 'staff', None, 0, 23),
# Base user has global staff access
(True, 'user', ORG, 0, 21),
(False, 'user', ORG, 0, 21),
(True, 'user', None, 0, 21),
(False, 'user', None, 0, 21),
(True, 'user', ORG, 0, 23),
(False, 'user', ORG, 0, 23),
(True, 'user', None, 0, 23),
(False, 'user', None, 0, 23),
)
@ddt.unpack
def test_separate_archived_courses_with_home_page_course_v2_api(
Expand Down
26 changes: 14 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,21 @@
'sphinx_design',
'code_annotations.contrib.sphinx.extensions.featuretoggles',
'code_annotations.contrib.sphinx.extensions.settings',
'autoapi.extension',
# 'autoapi.extension', # Temporarily disabled
]

autoapi_type = 'python'
autoapi_dirs = ['../lms', '../openedx']

autoapi_ignore = [
'*/migrations/*',
'*/tests/*',
'*.pyc',
'__init__.py',
'**/xblock_serializer/data.py',
]
# Temporarily disabling autoapi_dirs and the AutoAPI extension due to performance issues.
# This will unblock ReadTheDocs builds and will be revisited for optimization.
# autoapi_type = 'python'
# autoapi_dirs = ['../lms/djangoapps', '../openedx/core/djangoapps', "../openedx/features"]
#
# autoapi_ignore = [
# '*/migrations/*',
# '*/tests/*',
# '*.pyc',
# '__init__.py',
# '**/xblock_serializer/data.py',
# ]

# Rediraffe related settings.
rediraffe_redirects = "redirects.txt"
Expand Down Expand Up @@ -285,7 +287,7 @@

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'django': ('https://docs.djangoproject.com/en/1.11/', 'https://docs.djangoproject.com/en/1.11/_objects/'),
'django': ('https://docs.djangoproject.com/en/4.2/', 'https://docs.djangoproject.com/en/4.2/_objects/'),
}

# Start building a map of the directories relative to the repository root to
Expand Down
144 changes: 135 additions & 9 deletions docs/lms-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5847,7 +5847,7 @@ paths:
operationId: grades_v1_submission_history_read
description: |-
Get submission history details. This submission history is related to only
ProblemBlock and it doesn't support LibraryContentBlock or ContentLibraries
ProblemBlock and it doesn't support LegacyLibraryContentBlock or ContentLibraries
as of now.
**Usecases**:
Expand Down Expand Up @@ -7047,6 +7047,25 @@ paths:
in: path
required: true
type: string
/mobile/{api_version}/users/{username}/enrollments_status/:
get:
operationId: mobile_users_enrollments_status_list
description: Gets user's enrollments status.
parameters: []
responses:
'200':
description: ''
tags:
- mobile
parameters:
- name: api_version
in: path
required: true
type: string
- name: username
in: path
required: true
type: string
/notifications/:
get:
operationId: notifications_list
Expand Down Expand Up @@ -9868,7 +9887,94 @@ paths:
required: true
type: string
pattern: ^[a-zA-Z0-9\-_]*$
/xblock/v2/xblocks/{usage_key_str}/:
/xblock/v2/xblocks/{usage_key}/:
get:
operationId: xblock_v2_xblocks_read
summary: Get metadata about the specified block.
description: |-
Accepts the following query parameters:
* "include": a comma-separated list of keys to include.
Valid keys are "index_dictionary" and "student_view_data".
parameters: []
responses:
'200':
description: ''
tags:
- xblock
parameters:
- name: usage_key
in: path
required: true
type: string
/xblock/v2/xblocks/{usage_key}/fields/:
get:
operationId: xblock_v2_xblocks_fields_list
description: retrieves the xblock, returning display_name, data, and metadata
parameters: []
responses:
'200':
description: ''
tags:
- xblock
post:
operationId: xblock_v2_xblocks_fields_create
description: edits the xblock, saving changes to data and metadata only (display_name
included in metadata)
parameters: []
responses:
'201':
description: ''
tags:
- xblock
parameters:
- name: usage_key
in: path
required: true
type: string
/xblock/v2/xblocks/{usage_key}/handler_url/{handler_name}/:
get:
operationId: xblock_v2_xblocks_handler_url_read
summary: |-
Get an absolute URL which can be used (without any authentication) to call
the given XBlock handler.
description: The URL will expire but is guaranteed to be valid for a minimum
of 2 days.
parameters: []
responses:
'200':
description: ''
tags:
- xblock
parameters:
- name: usage_key
in: path
required: true
type: string
- name: handler_name
in: path
required: true
type: string
/xblock/v2/xblocks/{usage_key}/view/{view_name}/:
get:
operationId: xblock_v2_xblocks_view_read
description: Get the HTML, JS, and CSS needed to render the given XBlock.
parameters: []
responses:
'200':
description: ''
tags:
- xblock
parameters:
- name: usage_key
in: path
required: true
type: string
- name: view_name
in: path
required: true
type: string
/xblock/v2/xblocks/{usage_key}@{version}/:
get:
operationId: xblock_v2_xblocks_read
summary: Get metadata about the specified block.
Expand All @@ -9884,11 +9990,15 @@ paths:
tags:
- xblock
parameters:
- name: usage_key_str
- name: usage_key
in: path
required: true
type: string
/xblock/v2/xblocks/{usage_key_str}/fields/:
- name: version
in: path
required: true
type: string
/xblock/v2/xblocks/{usage_key}@{version}/fields/:
get:
operationId: xblock_v2_xblocks_fields_list
description: retrieves the xblock, returning display_name, data, and metadata
Expand All @@ -9909,11 +10019,15 @@ paths:
tags:
- xblock
parameters:
- name: usage_key_str
- name: usage_key
in: path
required: true
type: string
/xblock/v2/xblocks/{usage_key_str}/handler_url/{handler_name}/:
- name: version
in: path
required: true
type: string
/xblock/v2/xblocks/{usage_key}@{version}/handler_url/{handler_name}/:
get:
operationId: xblock_v2_xblocks_handler_url_read
summary: |-
Expand All @@ -9928,15 +10042,19 @@ paths:
tags:
- xblock
parameters:
- name: usage_key_str
- name: usage_key
in: path
required: true
type: string
- name: version
in: path
required: true
type: string
- name: handler_name
in: path
required: true
type: string
/xblock/v2/xblocks/{usage_key_str}/view/{view_name}/:
/xblock/v2/xblocks/{usage_key}@{version}/view/{view_name}/:
get:
operationId: xblock_v2_xblocks_view_read
description: Get the HTML, JS, and CSS needed to render the given XBlock.
Expand All @@ -9947,7 +10065,11 @@ paths:
tags:
- xblock
parameters:
- name: usage_key_str
- name: usage_key
in: path
required: true
type: string
- name: version
in: path
required: true
type: string
Expand Down Expand Up @@ -10158,6 +10280,7 @@ definitions:
- can_view_certificate
- course_modes
- is_new_discussion_sidebar_view_enabled
- has_course_author_access
type: object
properties:
can_show_upgrade_sock:
Expand Down Expand Up @@ -10237,6 +10360,9 @@ definitions:
is_new_discussion_sidebar_view_enabled:
title: Is new discussion sidebar view enabled
type: boolean
has_course_author_access:
title: Has course author access
type: boolean
DateSummary:
required:
- complete
Expand Down
Loading

0 comments on commit cab629a

Please sign in to comment.