Remove specific wording for live content warning
This commit is contained in:
@@ -519,37 +519,25 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin
|
||||
|
||||
describe("Message Area", function() {
|
||||
var messageSelector = '.container-message .warning',
|
||||
unchangedWarningMessage = 'This unit is visible to students. If you edit the unit, you must re-publish it for students to see your changes.',
|
||||
hasChangesWarningMessage = 'Caution: The last published version of this unit is live. By publishing changes you will change the student experience.';
|
||||
warningMessage = 'Caution: The last published version of this unit is live. By publishing changes you will change the student experience.';
|
||||
|
||||
it('is empty for a unit that is not currently visible to students', function() {
|
||||
renderContainerPage(this, mockContainerXBlockHtml, {
|
||||
currently_visible_to_students: false,
|
||||
has_changes: false
|
||||
currently_visible_to_students: false
|
||||
});
|
||||
expect(containerPage.$(messageSelector).text().trim()).toBe('');
|
||||
});
|
||||
|
||||
it('shows a message for a unit that is currently visible to students and is unchanged', function() {
|
||||
it('shows a message for a unit that is currently visible to students', function() {
|
||||
renderContainerPage(this, mockContainerXBlockHtml, {
|
||||
currently_visible_to_students: true,
|
||||
has_changes: false
|
||||
currently_visible_to_students: true
|
||||
});
|
||||
expect(containerPage.$(messageSelector).text().trim()).toBe(unchangedWarningMessage);
|
||||
});
|
||||
|
||||
it('shows a message for a unit that is currently visible to students and has changes', function() {
|
||||
renderContainerPage(this, mockContainerXBlockHtml, {
|
||||
currently_visible_to_students: true,
|
||||
has_changes: true
|
||||
});
|
||||
expect(containerPage.$(messageSelector).text().trim()).toBe(hasChangesWarningMessage);
|
||||
expect(containerPage.$(messageSelector).text().trim()).toBe(warningMessage);
|
||||
});
|
||||
|
||||
it('hides the message when the unit is hidden from students', function() {
|
||||
renderContainerPage(this, mockContainerXBlockHtml, {
|
||||
currently_visible_to_students: true,
|
||||
has_changes: false
|
||||
currently_visible_to_students: true
|
||||
});
|
||||
fetch({ currently_visible_to_students: false });
|
||||
expect(containerPage.$(messageSelector).text().trim()).toBe('');
|
||||
@@ -557,11 +545,10 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin
|
||||
|
||||
it('shows a message when a unit is made visible', function() {
|
||||
renderContainerPage(this, mockContainerXBlockHtml, {
|
||||
currently_visible_to_students: false,
|
||||
has_changes: false
|
||||
currently_visible_to_students: false
|
||||
});
|
||||
fetch({ currently_visible_to_students: true });
|
||||
expect(containerPage.$(messageSelector).text().trim()).toBe(unchangedWarningMessage);
|
||||
expect(containerPage.$(messageSelector).text().trim()).toBe(warningMessage);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -38,13 +38,12 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/
|
||||
},
|
||||
|
||||
shouldRefresh: function(model) {
|
||||
return ViewUtils.hasChangedAttributes(model, ['currently_visible_to_students', 'has_changes']);
|
||||
return ViewUtils.hasChangedAttributes(model, ['currently_visible_to_students']);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
this.$el.html(this.template({
|
||||
currentlyVisibleToStudents: this.model.get('currently_visible_to_students'),
|
||||
hasChanges: this.model.get('has_changes')
|
||||
currentlyVisibleToStudents: this.model.get('currently_visible_to_students')
|
||||
}));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -2,11 +2,7 @@
|
||||
<div class="message has-warnings">
|
||||
<p class="warning">
|
||||
<i class="icon-warning-sign"></i>
|
||||
<% if (hasChanges) { %>
|
||||
<%= gettext("Caution: The last published version of this unit is live. By publishing changes you will change the student experience.") %>
|
||||
<% } else { %>
|
||||
<%= gettext("This unit is visible to students. If you edit the unit, you must re-publish it for students to see your changes.") %>
|
||||
<% } %>
|
||||
<%= gettext("Caution: The last published version of this unit is live. By publishing changes you will change the student experience.") %>
|
||||
</p>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
Reference in New Issue
Block a user