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 (
organizations_enabled,
)
from util.string_utils import _has_non_ascii_characters
from xblock_django.api import deprecated_xblocks
from xmodule.contentstore.content import StaticContent
from xmodule.course_module import CourseFields
from xmodule.course_module import DEFAULT_START_DATE
......@@ -599,7 +600,8 @@ def course_index(request, course_key):
except (ItemNotFoundError, CourseActionStateItemNotFoundError):
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', {
'context_course': course_module,
......
......@@ -470,37 +470,24 @@ class TestCourseOutline(CourseTestCase):
)
@ddt.data(
{'publish': True},
{'publish': False},
[{'publish': True}, ['notes']],
[{'publish': False}, ['notes']],
[{'publish': True}, ['notes', 'lti']]
)
@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)
self._create_test_data(course_module, create_blocks=True, block_types=block_types, publish=publish)
info = _deprecated_blocks_info(course_module, block_types)
self._verify_deprecated_info(
course_module.id,
course_module.advanced_modules,
info,
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)
course_module = modulestore().get_item(self.course.location)
self._create_test_data(course_module, create_blocks=True, block_types=block_types, publish=publish)
info = _deprecated_blocks_info(course_module, block_types)
self._verify_deprecated_info(
course_module.id,
course_module.advanced_modules,
info,
block_types
)
@ddt.data(
{'delete_vertical': True},
......
......@@ -104,9 +104,5 @@
"THEME_NAME": "",
"TIME_ZONE": "America/New_York",
"WIKI_ENABLED": true,
"OAUTH_OIDC_ISSUER": "https://www.example.com/oauth2",
"DEPRECATED_BLOCK_TYPES": [
"poll",
"survey"
]
"OAUTH_OIDC_ISSUER": "https://www.example.com/oauth2"
}
......@@ -96,9 +96,6 @@ FEATURES['ENABLE_VIDEO_BUMPER'] = True # Enable video bumper in Studio settings
# Enable partner support link in Studio footer
PARTNER_SUPPORT_EMAIL = 'partner-support@example.com'
# Disable some block types to test block deprecation logic
DEPRECATED_BLOCK_TYPES = ['poll', 'survey']
########################### Entrance Exams #################################
FEATURES['ENTRANCE_EXAMS'] = True
......
......@@ -1131,18 +1131,6 @@ XBLOCK_SETTINGS = {
# 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
# those advanced components in Studio. Existing problems will work fine
# 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` (
`name` varchar(255) NOT NULL,
`applied` datetime(6) NOT NULL,
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 */;
/*!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