From 3c5cc6fffd0bf90cbf62bc4afee431a09e4151e0 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 23 Oct 2025 15:57:01 -0400 Subject: [PATCH] fix: Adding components to xblocks with children. Previously the container JS would remove the `add-xblock-component` for every component that was in an iframe that was not the split test component. We're changing the logic to say that we should not render the old buttons on pages where the authoring view provides an alternative set of buttons. Which in this case is just the unit/vertical page. All other containers should render the old buttons since the new authoring MFE does not provide them. --- cms/static/js/views/pages/container.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cms/static/js/views/pages/container.js b/cms/static/js/views/pages/container.js index e58c656003..1920a61eda 100644 --- a/cms/static/js/views/pages/container.js +++ b/cms/static/js/views/pages/container.js @@ -305,7 +305,9 @@ function($, _, Backbone, gettext, BasePage, renderAddXBlockComponents: function() { var self = this; - if (self.options.canEdit && (!self.options.isIframeEmbed || self.isSplitTestContentPage)) { + // If the container is the Unit element(aka Vertical), then we don't render the + // add buttons because those should get rendered by the authoring MFE + if (self.options.canEdit && (!self.options.isIframeEmbed || !self.model.isVertical())) { this.$('.add-xblock-component').each(function(index, element) { var component = new AddXBlockComponent({ el: element,