Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d26e7d9
chore: Initial setup of JS files and webpack config
farhan Apr 16, 2025
99e118c
chore: Add more refactored code in the main.js
farhan Apr 16, 2025
df82bb2
chore: Adds poster.js
farhan Apr 16, 2025
1bb6642
chore: Adds video_accessible_menu
farhan Apr 16, 2025
1b9671d
feat: Group ora staff notifications (#36440)
hassan-raza-1 Apr 9, 2025
e15274d
feat: prevent sending goal reminder email to disabled users (#36505)
muhammadadeeltajamul Apr 9, 2025
97b7d8c
docs: Make the graph render correctly.
feanil Apr 7, 2025
b7b1f31
feat!: Remove the course sock and related APIs.
feanil Mar 24, 2025
4e48a11
fix: Remove Two Pointless Contentstore Waffle Flags
kdmccormick Apr 7, 2025
47bc2f4
refactor: Remove now-unused static asset Django settings
kdmccormick Mar 20, 2025
82efb8a
fix: Globally Enable Studio Content REST API (#36488)
kdmccormick Apr 9, 2025
f8b3784
feat: container support for tags [FC-0083] (#36484)
rpenido Apr 10, 2025
30b5577
fix: Enable ORA new submissions course notification preference (#36449)
hassan-raza-1 Apr 10, 2025
75d66b5
chore: fix cache content size calculation error (#36511)
mumarkhan999 Apr 10, 2025
53a2471
fix: duplicate rendering of instructions in annotatable xblock (#36445)
irtazaakram Apr 10, 2025
bedcee5
feat: add restore container API, delete index when deleting container…
ChrisChV Apr 10, 2025
6f2c21a
refactor!: use LibraryCollectionLocator and LibraryContainerLocator […
pomegranited Apr 11, 2025
528a3eb
feat: post component height to parent window [FC-0083] (#36477)
navinkarkera Apr 11, 2025
dc09b95
fix: Update ORA notification type for grouper (#36517)
hassan-raza-1 Apr 14, 2025
34d682e
feat: prevent sending course update, recurring nudge and upgrade remi…
muhammadadeeltajamul Apr 14, 2025
0a6078a
chore: Adds skip_control.js file
farhan Apr 17, 2025
4bfa224
chore: Adds VideoPlayPlaceholder
farhan Apr 17, 2025
c5874a7
chore: Adds play pause and play skip control js files
farhan Apr 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions cms/djangoapps/contentstore/rest_api/v0/tests/test_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,8 @@ def send_request(self, _url, _data):
}
),
)
@patch(
f"cms.djangoapps.contentstore.rest_api.{VERSION}.views.xblock.toggles.use_studio_content_api",
return_value=True,
)
def make_request(
self,
mock_use_studio_content_api,
mock_handle_assets,
run_assertions=None,
course_id=None,
Expand Down Expand Up @@ -125,13 +120,6 @@ def assert_assets_handler_called(self, *, mock_handle_assets, response):
def send_request(self, url, data):
return self.client.get(url)

def test_api_behind_feature_flag(self):
# should return 404 if the feature flag is not enabled
url = self.get_url()

response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)

def test_assets_handler_called_with_correct_arguments(self):
self.client.login(
username=self.course_instructor.username, password=self.password
Expand Down Expand Up @@ -182,13 +170,6 @@ def assert_assets_handler_called(self, *, mock_handle_assets, response):
def send_request(self, url, data):
return self.client.post(url, data=data, format="multipart")

def test_api_behind_feature_flag(self):
# should return 404 if the feature flag is not enabled
url = self.get_url()

response = self.client.post(url)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)

def test_assets_handler_called_with_correct_arguments(self):
self.client.login(
username=self.course_instructor.username, password=self.password
Expand Down Expand Up @@ -232,13 +213,6 @@ def assert_assets_handler_called(self, *, mock_handle_assets, response):
def send_request(self, url, data):
return self.client.put(url, data=data, format="json")

def test_api_behind_feature_flag(self):
# should return 404 if the feature flag is not enabled
url = self.get_url()

response = self.client.put(url)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)

def test_assets_handler_called_with_correct_arguments(self):
self.client.login(
username=self.course_instructor.username, password=self.password
Expand Down Expand Up @@ -277,13 +251,6 @@ def assert_assets_handler_called(self, *, mock_handle_assets, response):
def send_request(self, url, data):
return self.client.delete(url)

def test_api_behind_feature_flag(self):
# should return 404 if the feature flag is not enabled
url = self.get_url()

response = self.client.delete(url)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)

def test_assets_handler_called_with_correct_arguments(self):
self.client.login(
username=self.course_instructor.username, password=self.password
Expand Down
40 changes: 0 additions & 40 deletions cms/djangoapps/contentstore/rest_api/v0/tests/test_xblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,8 @@ def send_request(self, _url, _data):
}
),
)
@patch(
f"cms.djangoapps.contentstore.rest_api.{VERSION}.views.xblock.toggles.use_studio_content_api",
return_value=True,
)
def make_request(
self,
mock_use_studio_content_api,
mock_handle_xblock,
run_assertions=None,
course_id=None,
Expand Down Expand Up @@ -111,13 +106,6 @@ def assert_xblock_handler_called(self, *, mock_handle_xblock, response):
def send_request(self, url, data):
return self.client.get(url)

def test_api_behind_feature_flag(self):
# should return 404 if the feature flag is not enabled
url = self.get_url()

response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)

def test_xblock_handler_called_with_correct_arguments(self):
self.client.login(
username=self.course_instructor.username, password=self.password
Expand Down Expand Up @@ -167,13 +155,6 @@ def assert_xblock_handler_called(self, *, mock_handle_xblock, response):
def send_request(self, url, data):
return self.client.post(url, data=data, format="json")

def test_api_behind_feature_flag(self):
# should return 404 if the feature flag is not enabled
url = self.get_url()

response = self.client.post(url)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)

def test_xblock_handler_called_with_correct_arguments(self):
self.client.login(
username=self.course_instructor.username, password=self.password
Expand Down Expand Up @@ -218,13 +199,6 @@ def assert_xblock_handler_called(self, *, mock_handle_xblock, response):
def send_request(self, url, data):
return self.client.put(url, data=data, format="json")

def test_api_behind_feature_flag(self):
# should return 404 if the feature flag is not enabled
url = self.get_url()

response = self.client.put(url)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)

def test_xblock_handler_called_with_correct_arguments(self):
self.client.login(
username=self.course_instructor.username, password=self.password
Expand Down Expand Up @@ -269,13 +243,6 @@ def assert_xblock_handler_called(self, *, mock_handle_xblock, response):
def send_request(self, url, data):
return self.client.patch(url, data=data, format="json")

def test_api_behind_feature_flag(self):
# should return 404 if the feature flag is not enabled
url = self.get_url()

response = self.client.patch(url)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)

def test_xblock_handler_called_with_correct_arguments(self):
self.client.login(
username=self.course_instructor.username, password=self.password
Expand Down Expand Up @@ -310,13 +277,6 @@ def assert_xblock_handler_called(self, *, mock_handle_xblock, response):
def send_request(self, url, data):
return self.client.delete(url)

def test_api_behind_feature_flag(self):
# should return 404 if the feature flag is not enabled
url = self.get_url()

response = self.client.delete(url)
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)

def test_xblock_handler_called_with_correct_arguments(self):
self.client.login(
username=self.course_instructor.username, password=self.password
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from rest_framework.response import Response
from rest_framework import status
from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin, view_auth_classes
import cms.djangoapps.contentstore.toggles as toggles


class APIHeartBeatView(DeveloperErrorViewMixin, APIView):
Expand Down Expand Up @@ -43,6 +42,4 @@ def get(self, request: Request):
}
```
"""
if toggles.use_studio_content_api():
return Response({'status': 'heartbeat successful'}, status=status.HTTP_200_OK)
return Response(status=status.HTTP_403_FORBIDDEN)
return Response({'status': 'heartbeat successful'}, status=status.HTTP_200_OK)
25 changes: 0 additions & 25 deletions cms/djangoapps/contentstore/rest_api/v0/views/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,20 @@
import logging
from rest_framework.generics import CreateAPIView, RetrieveAPIView, UpdateAPIView, DestroyAPIView
from django.views.decorators.csrf import csrf_exempt
from django.http import Http404

from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin, view_auth_classes
from common.djangoapps.util.json_request import expect_json_in_class_view

from cms.djangoapps.contentstore.api import course_author_access_required

from cms.djangoapps.contentstore.asset_storage_handlers import handle_assets
import cms.djangoapps.contentstore.toggles as contentstore_toggles

from ..serializers.assets import AssetSerializer
from .utils import validate_request_with_serializer
from rest_framework.parsers import (MultiPartParser, FormParser, JSONParser)
from openedx.core.lib.api.parsers import TypedFileUploadParser

log = logging.getLogger(__name__)
toggles = contentstore_toggles


@view_auth_classes()
Expand All @@ -33,17 +30,6 @@ class AssetsCreateRetrieveView(DeveloperErrorViewMixin, CreateAPIView, RetrieveA
serializer_class = AssetSerializer
parser_classes = (JSONParser, MultiPartParser, FormParser, TypedFileUploadParser)

def dispatch(self, request, *args, **kwargs):
# TODO: probably want to refactor this to a decorator.
"""
The dispatch method of a View class handles HTTP requests in general
and calls other methods to handle specific HTTP methods.
We use this to raise a 404 if the content api is disabled.
"""
if not toggles.use_studio_content_api():
raise Http404
return super().dispatch(request, *args, **kwargs)

@csrf_exempt
@course_author_access_required
@validate_request_with_serializer
Expand All @@ -66,17 +52,6 @@ class AssetsUpdateDestroyView(DeveloperErrorViewMixin, UpdateAPIView, DestroyAPI
serializer_class = AssetSerializer
parser_classes = (JSONParser, MultiPartParser, FormParser, TypedFileUploadParser)

def dispatch(self, request, *args, **kwargs):
# TODO: probably want to refactor this to a decorator.
"""
The dispatch method of a View class handles HTTP requests in general
and calls other methods to handle specific HTTP methods.
We use this to raise a 404 if the content api is disabled.
"""
if not toggles.use_studio_content_api():
raise Http404
return super().dispatch(request, *args, **kwargs)

@course_author_access_required
@expect_json_in_class_view
@validate_request_with_serializer
Expand Down
58 changes: 0 additions & 58 deletions cms/djangoapps/contentstore/rest_api/v0/views/authoring_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
)
from rest_framework.parsers import (MultiPartParser, FormParser)
from django.views.decorators.csrf import csrf_exempt
from django.http import Http404

from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin, view_auth_classes
from openedx.core.lib.api.parsers import TypedFileUploadParser
Expand All @@ -27,12 +26,10 @@
VideoUploadSerializer,
VideoImageSerializer,
)
import cms.djangoapps.contentstore.toggles as contentstore_toggles
from .utils import validate_request_with_serializer


log = logging.getLogger(__name__)
toggles = contentstore_toggles


@view_auth_classes()
Expand All @@ -44,17 +41,6 @@ class VideosUploadsView(DeveloperErrorViewMixin, RetrieveAPIView, DestroyAPIView
"""
serializer_class = VideoUploadSerializer

def dispatch(self, request, *args, **kwargs):
# TODO: probably want to refactor this to a decorator.
"""
The dispatch method of a View class handles HTTP requests in general
and calls other methods to handle specific HTTP methods.
We use this to raise a 404 if the content api is disabled.
"""
if not toggles.use_studio_content_api():
raise Http404
return super().dispatch(request, *args, **kwargs)

@course_author_access_required
def retrieve(self, request, course_key, edx_video_id=None): # pylint: disable=arguments-differ
return handle_videos(request, course_key.html_id(), edx_video_id)
Expand All @@ -73,17 +59,6 @@ class VideosCreateUploadView(DeveloperErrorViewMixin, CreateAPIView):
"""
serializer_class = VideoUploadSerializer

def dispatch(self, request, *args, **kwargs):
# TODO: probably want to refactor this to a decorator.
"""
The dispatch method of a View class handles HTTP requests in general
and calls other methods to handle specific HTTP methods.
We use this to raise a 404 if the content api is disabled.
"""
if not toggles.use_studio_content_api():
raise Http404
return super().dispatch(request, *args, **kwargs)

@csrf_exempt
@course_author_access_required
@expect_json_in_class_view
Expand All @@ -102,17 +77,6 @@ class VideoImagesView(DeveloperErrorViewMixin, CreateAPIView):
serializer_class = VideoImageSerializer
parser_classes = (MultiPartParser, FormParser, TypedFileUploadParser)

def dispatch(self, request, *args, **kwargs):
# TODO: probably want to refactor this to a decorator.
"""
The dispatch method of a View class handles HTTP requests in general
and calls other methods to handle specific HTTP methods.
We use this to raise a 404 if the content api is disabled.
"""
if not toggles.use_studio_content_api():
raise Http404
return super().dispatch(request, *args, **kwargs)

@csrf_exempt
@course_author_access_required
@expect_json_in_class_view
Expand All @@ -133,17 +97,6 @@ class VideoEncodingsDownloadView(DeveloperErrorViewMixin, RetrieveAPIView):
# does not specify a serializer class.
swagger_schema = None

def dispatch(self, request, *args, **kwargs):
# TODO: probably want to refactor this to a decorator.
"""
The dispatch method of a View class handles HTTP requests in general
and calls other methods to handle specific HTTP methods.
We use this to raise a 404 if the content api is disabled.
"""
if not toggles.use_studio_content_api():
raise Http404
return super().dispatch(request, *args, **kwargs)

@csrf_exempt
@course_author_access_required
def retrieve(self, request, course_key): # pylint: disable=arguments-differ
Expand All @@ -161,17 +114,6 @@ class VideoFeaturesView(DeveloperErrorViewMixin, RetrieveAPIView):
# does not specify a serializer class.
swagger_schema = None

def dispatch(self, request, *args, **kwargs):
# TODO: probably want to refactor this to a decorator.
"""
The dispatch method of a View class handles HTTP requests in general
and calls other methods to handle specific HTTP methods.
We use this to raise a 404 if the content api is disabled.
"""
if not toggles.use_studio_content_api():
raise Http404
return super().dispatch(request, *args, **kwargs)

@csrf_exempt
def retrieve(self, request): # pylint: disable=arguments-differ
return enabled_video_features(request)
Loading