[Moved to openedx/frontend-app-course-authoring] A library of high-level components for content handling (viewing, editing, etc. of HTML, video, problems, etc.), to be shared by multiple MFEs.
This PR improves the load time of the text editor, problem editor, and video editor. Previously all data that was required for any editor type at initialization was loaded, even if it was not necessary for the editor in-use. This means the text editor was loading course videos even it would never be using that data. Now the initialization function checks the editor and only calls the required APIs.
Reducing the need for all assets at load time
The need for all course assets to be fetched during initialization was removed. Now only the first fifty (50) images for a course are loaded for the text and problem editors. Previously all course assets were needed to update and write /static/ URLs, but assets all have a specific key pattern so the replace and set functions for the URLs are able to use a pattern matcher rather then copying data from the asset object.
Adding Lazy Load for SelectImageModal
To improve load time, the number of image assets fetched at load time was reduced to fifty (50), the default page size. However a course can have more than fifty images, so lazy loading was added to the SelectImageModal. This makes it quicker to load the editor and makes it easier for the user to scroll through the images. In the case that there are only fifty images or less for a course or the images are being filter are less than or equal to fifty, the load more button will not appear.
Lazy-Loading assets like images, transcripts, and handouts.
This is for blocks that have asset galleries that display all course assets (html, problem)
Should not impact loading of images that are directly referenced in a block already, nor should it impact the adding of static URLs in the source code view for html blocks
Testing
Open each of the editors and check the logs to see which actions have been called
The text and problem editors should call fetchBlock, fetchUnit, and fetchImages
The video editor should call fetchBlock, fetchUnit, fetchVideos, fetchCourseDetailsView, fetchStudioView
Add a new image to a html block
Click the "HTML" button
Confirm that all the images are relative URLS
Confirm that all the relative URLS follow asset-v1:{org}+{number+{run}+type@asset+block@{key_safe_name}
Click the "HTML" button
Update one of the relative URLs for an image to /static/{key_safe_name} (aka the Studio URL)
Click "Save"
Confirm that the image is still viewable in the editor
Click "Save"
Confirm that all links and images in html block are viewable on the unit page
Description
Remove unnecessary API calls
This PR improves the load time of the text editor, problem editor, and video editor. Previously all data that was required for any editor type at initialization was loaded, even if it was not necessary for the editor in-use. This means the text editor was loading course videos even it would never be using that data. Now the initialization function checks the editor and only calls the required APIs.
Reducing the need for all assets at load time
The need for all course assets to be fetched during initialization was removed. Now only the first fifty (50) images for a course are loaded for the text and problem editors. Previously all course assets were needed to update and write
/static/
URLs, but assets all have a specific key pattern so the replace and set functions for the URLs are able to use a pattern matcher rather then copying data from the asset object.Adding Lazy Load for
SelectImageModal
To improve load time, the number of image assets fetched at load time was reduced to fifty (50), the default page size. However a course can have more than fifty images, so lazy loading was added to the
SelectImageModal
. This makes it quicker to load the editor and makes it easier for the user to scroll through the images. In the case that there are only fifty images or less for a course or the images are being filter are less than or equal to fifty, the load more button will not appear.Supporting Information
JIRA Ticket: TNL-10869
Testing
fetchBlock
,fetchUnit
, andfetchImages
fetchBlock
,fetchUnit
,fetchVideos
,fetchCourseDetailsView
,fetchStudioView
asset-v1:{org}+{number+{run}+type@asset+block@{key_safe_name}
/static/{key_safe_name}
(aka the Studio URL)