feat: allow overriding unit icons (#21433)
This: 1. Introduces a new override using the `pluggable_override` decorator. It is now possible to specify a custom way of getting XBlock's icon by defining `GET_UNIT_ICON_IMPL` in settings. 2. Introduces a way to add custom `XBLOCK_MIXINS` by defining `XBLOCK_EXTRA_MIXINS` in settings. This allows, e.g. to add new fields to XBlocks.
This commit is contained in:
@@ -563,6 +563,7 @@ VIDEO_UPLOAD_PIPELINE:
|
||||
ROOT_PATH: ''
|
||||
WIKI_ENABLED: true
|
||||
WRITABLE_GRADEBOOK_URL: null
|
||||
XBLOCK_EXTRA_MIXINS: []
|
||||
XBLOCK_FS_STORAGE_BUCKET: null
|
||||
XBLOCK_FS_STORAGE_PREFIX: null
|
||||
XBLOCK_SETTINGS: {}
|
||||
|
||||
@@ -1424,6 +1424,7 @@ from xmodule.x_module import XModuleMixin
|
||||
# This should be moved into an XBlock Runtime/Application object
|
||||
# once the responsibility of XBlock creation is moved out of modulestore - cpennington
|
||||
XBLOCK_MIXINS = (LmsBlockMixin, InheritanceMixin, XModuleMixin, EditInfoMixin)
|
||||
XBLOCK_EXTRA_MIXINS = ()
|
||||
|
||||
# .. setting_name: XBLOCK_SELECT_FUNCTION
|
||||
# .. setting_default: prefer_xmodules
|
||||
|
||||
@@ -1047,3 +1047,6 @@ EXPLICIT_QUEUES = {
|
||||
}
|
||||
|
||||
LOGO_IMAGE_EXTRA_TEXT = ENV_TOKENS.get('LOGO_IMAGE_EXTRA_TEXT', '')
|
||||
|
||||
############## XBlock extra mixins ############################
|
||||
XBLOCK_MIXINS += tuple(XBLOCK_EXTRA_MIXINS)
|
||||
|
||||
Reference in New Issue
Block a user