Commit 6d7a5452 by Christina Roberts Committed by GitHub

Merge pull request #12932 from edx/christina/deprecated-components

Move deprecating of XBlocks to new XBlockConfiguration model
parents b6b79282 25bfd0a7
...@@ -91,6 +91,7 @@ from util.organizations_helpers import ( ...@@ -91,6 +91,7 @@ from util.organizations_helpers import (
organizations_enabled, organizations_enabled,
) )
from util.string_utils import _has_non_ascii_characters from util.string_utils import _has_non_ascii_characters
from xblock_django.api import deprecated_xblocks
from xmodule.contentstore.content import StaticContent from xmodule.contentstore.content import StaticContent
from xmodule.course_module import CourseFields from xmodule.course_module import CourseFields
from xmodule.course_module import DEFAULT_START_DATE from xmodule.course_module import DEFAULT_START_DATE
...@@ -599,7 +600,8 @@ def course_index(request, course_key): ...@@ -599,7 +600,8 @@ def course_index(request, course_key):
except (ItemNotFoundError, CourseActionStateItemNotFoundError): except (ItemNotFoundError, CourseActionStateItemNotFoundError):
current_action = None current_action = None
deprecated_blocks_info = _deprecated_blocks_info(course_module, settings.DEPRECATED_BLOCK_TYPES) deprecated_block_names = [block.name for block in deprecated_xblocks()]
deprecated_blocks_info = _deprecated_blocks_info(course_module, deprecated_block_names)
return render_to_response('course_outline.html', { return render_to_response('course_outline.html', {
'context_course': course_module, 'context_course': course_module,
......
...@@ -470,16 +470,15 @@ class TestCourseOutline(CourseTestCase): ...@@ -470,16 +470,15 @@ class TestCourseOutline(CourseTestCase):
) )
@ddt.data( @ddt.data(
{'publish': True}, [{'publish': True}, ['notes']],
{'publish': False}, [{'publish': False}, ['notes']],
[{'publish': True}, ['notes', 'lti']]
) )
@ddt.unpack @ddt.unpack
def test_verify_deprecated_warning_message_with_single_feature(self, publish): def test_verify_deprecated_warning_message(self, publish, block_types):
""" """
Verify deprecated warning info for single deprecated feature. Verify deprecated warning info.
""" """
block_types = ['notes']
with override_settings(DEPRECATED_BLOCK_TYPES=block_types):
course_module = modulestore().get_item(self.course.location) course_module = modulestore().get_item(self.course.location)
self._create_test_data(course_module, create_blocks=True, block_types=block_types, publish=publish) self._create_test_data(course_module, create_blocks=True, block_types=block_types, publish=publish)
info = _deprecated_blocks_info(course_module, block_types) info = _deprecated_blocks_info(course_module, block_types)
...@@ -490,18 +489,6 @@ class TestCourseOutline(CourseTestCase): ...@@ -490,18 +489,6 @@ class TestCourseOutline(CourseTestCase):
block_types block_types
) )
def test_verify_deprecated_warning_message_with_multiple_features(self):
"""
Verify deprecated warning info for multiple deprecated features.
"""
block_types = ['notes', 'lti']
with override_settings(DEPRECATED_BLOCK_TYPES=block_types):
course_module = modulestore().get_item(self.course.location)
self._create_test_data(course_module, create_blocks=True, block_types=block_types)
info = _deprecated_blocks_info(course_module, block_types)
self._verify_deprecated_info(course_module.id, course_module.advanced_modules, info, block_types)
@ddt.data( @ddt.data(
{'delete_vertical': True}, {'delete_vertical': True},
{'delete_vertical': False}, {'delete_vertical': False},
......
...@@ -104,9 +104,5 @@ ...@@ -104,9 +104,5 @@
"THEME_NAME": "", "THEME_NAME": "",
"TIME_ZONE": "America/New_York", "TIME_ZONE": "America/New_York",
"WIKI_ENABLED": true, "WIKI_ENABLED": true,
"OAUTH_OIDC_ISSUER": "https://www.example.com/oauth2", "OAUTH_OIDC_ISSUER": "https://www.example.com/oauth2"
"DEPRECATED_BLOCK_TYPES": [
"poll",
"survey"
]
} }
...@@ -96,9 +96,6 @@ FEATURES['ENABLE_VIDEO_BUMPER'] = True # Enable video bumper in Studio settings ...@@ -96,9 +96,6 @@ FEATURES['ENABLE_VIDEO_BUMPER'] = True # Enable video bumper in Studio settings
# Enable partner support link in Studio footer # Enable partner support link in Studio footer
PARTNER_SUPPORT_EMAIL = 'partner-support@example.com' PARTNER_SUPPORT_EMAIL = 'partner-support@example.com'
# Disable some block types to test block deprecation logic
DEPRECATED_BLOCK_TYPES = ['poll', 'survey']
########################### Entrance Exams ################################# ########################### Entrance Exams #################################
FEATURES['ENTRANCE_EXAMS'] = True FEATURES['ENTRANCE_EXAMS'] = True
......
...@@ -1131,18 +1131,6 @@ XBLOCK_SETTINGS = { ...@@ -1131,18 +1131,6 @@ XBLOCK_SETTINGS = {
# The following settings are used for deprecating XBlocks. # The following settings are used for deprecating XBlocks.
# Adding an XBlock to this list does the following:
# 1. Shows a warning on the course outline if the XBlock is listed in
# "Advanced Module List" in "Advanced Settings" page.
# 2. List all instances of that XBlock on the top of the course outline page asking
# course authors to delete or replace the instances.
DEPRECATED_BLOCK_TYPES = [
'peergrading',
'combinedopenended',
'graphical_slider_tool',
'randomize',
]
# Adding components in this list will disable the creation of new problems for # Adding components in this list will disable the creation of new problems for
# those advanced components in Studio. Existing problems will work fine # those advanced components in Studio. Existing problems will work fine
# and one can edit them in Studio. # and one can edit them in Studio.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -35,7 +35,7 @@ CREATE TABLE `django_migrations` ( ...@@ -35,7 +35,7 @@ CREATE TABLE `django_migrations` (
`name` varchar(255) NOT NULL, `name` varchar(255) NOT NULL,
`applied` datetime(6) NOT NULL, `applied` datetime(6) NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=155 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB AUTO_INCREMENT=172 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
......
[
{
"pk": 1,
"model": "xblock_django.XBlockConfiguration",
"fields": {
"name": "poll",
"enabled": true,
"deprecated": true,
"change_date": "2016-07-06"
}
},
{
"pk": 2,
"model": "xblock_django.XBlockConfiguration",
"fields": {
"name": "survey",
"enabled": true,
"deprecated": true,
"change_date": "2016-07-06"
}
}
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment