The access settings modal should not have an editable title. Also, the title of the modal was not being interpolated correctly.
This commit is contained in:
Dave St.Germain
2019-10-25 13:38:39 -04:00
parent 73564a04b0
commit 05e0de2956
4 changed files with 11 additions and 11 deletions

View File

@@ -61,7 +61,7 @@ describe('EditXBlockModal', function() {
it('shows the correct title', function() {
var requests = AjaxHelpers.requests(this);
modal = showModal(requests, mockXBlockEditorHtml);
expect(modal.$('.modal-window-title span.modal-button-title').text()).toBe('Editing: Component');
expect(modal.$('.modal-window-title').text()).toBe('Editing: Component');
});
it('does not show any editor mode buttons', function() {

View File

@@ -29,7 +29,7 @@ define(['jquery', 'common/js/spec_helpers/template_helpers', 'common/js/spec_hel
getModalTitle = function(modal) {
var modalElement = getModalElement(modal);
return modalElement.find('.modal-window-title span.modal-button-title').text();
return modalElement.find('.modal-window-title').text();
};
isShowingModal = function(modal) {

View File

@@ -90,16 +90,16 @@ define(['jquery', 'underscore', 'backbone', 'gettext', 'js/views/modals/base_mod
// Update the custom editor's title
editorView.$('.component-name').text(title);
} else {
} else if (editorView.getDataEditor() && editorView.getMetadataEditor()) {
this.createTitleEditor(title);
if (editorView.getDataEditor() && editorView.getMetadataEditor()) {
this.addDefaultModes();
// If the plugins content element exists, add a button to reveal it.
if (this.$('.wrapper-comp-plugins').length > 0) {
this.addModeButton('plugins', gettext('Plugins'));
}
this.selectMode(editorView.mode);
this.addDefaultModes();
// If the plugins content element exists, add a button to reveal it.
if (this.$('.wrapper-comp-plugins').length > 0) {
this.addModeButton('plugins', gettext('Plugins'));
}
this.selectMode(editorView.mode);
} else {
this.$('.modal-window-title').text(title);
}
// If the xblock is not using custom buttons then choose which buttons to show

View File

@@ -198,7 +198,7 @@ define(['jquery', 'underscore', 'backbone', 'gettext', 'js/views/pages/base_page
this.editXBlock(event, {
view: 'visibility_view',
// Translators: "title" is the name of the current component or unit being edited.
titleFormat: gettext('Editing access for: %(title)s'),
titleFormat: gettext('Editing access for: {title}'),
viewSpecificClasses: '',
modalSize: 'med'
});