Commit 0b067126 by Ben McMorran Committed by cahrens

Remove specific wording for live content warning

parent e4635aaa
...@@ -519,37 +519,25 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin ...@@ -519,37 +519,25 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin
describe("Message Area", function() { describe("Message Area", function() {
var messageSelector = '.container-message .warning', 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.', warningMessage = 'Caution: The last published version of this unit is live. By publishing changes you will change the student experience.';
hasChangesWarningMessage = '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() { it('is empty for a unit that is not currently visible to students', function() {
renderContainerPage(this, mockContainerXBlockHtml, { renderContainerPage(this, mockContainerXBlockHtml, {
currently_visible_to_students: false, currently_visible_to_students: false
has_changes: false
}); });
expect(containerPage.$(messageSelector).text().trim()).toBe(''); 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, { renderContainerPage(this, mockContainerXBlockHtml, {
currently_visible_to_students: true, currently_visible_to_students: true
has_changes: false
}); });
expect(containerPage.$(messageSelector).text().trim()).toBe(unchangedWarningMessage); expect(containerPage.$(messageSelector).text().trim()).toBe(warningMessage);
});
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);
}); });
it('hides the message when the unit is hidden from students', function() { it('hides the message when the unit is hidden from students', function() {
renderContainerPage(this, mockContainerXBlockHtml, { renderContainerPage(this, mockContainerXBlockHtml, {
currently_visible_to_students: true, currently_visible_to_students: true
has_changes: false
}); });
fetch({ currently_visible_to_students: false }); fetch({ currently_visible_to_students: false });
expect(containerPage.$(messageSelector).text().trim()).toBe(''); expect(containerPage.$(messageSelector).text().trim()).toBe('');
...@@ -557,11 +545,10 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin ...@@ -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() { it('shows a message when a unit is made visible', function() {
renderContainerPage(this, mockContainerXBlockHtml, { renderContainerPage(this, mockContainerXBlockHtml, {
currently_visible_to_students: false, currently_visible_to_students: false
has_changes: false
}); });
fetch({ currently_visible_to_students: true }); 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/ ...@@ -38,13 +38,12 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/
}, },
shouldRefresh: function(model) { shouldRefresh: function(model) {
return ViewUtils.hasChangedAttributes(model, ['currently_visible_to_students', 'has_changes']); return ViewUtils.hasChangedAttributes(model, ['currently_visible_to_students']);
}, },
render: function() { render: function() {
this.$el.html(this.template({ this.$el.html(this.template({
currentlyVisibleToStudents: this.model.get('currently_visible_to_students'), currentlyVisibleToStudents: this.model.get('currently_visible_to_students')
hasChanges: this.model.get('has_changes')
})); }));
return this; return this;
} }
......
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
<div class="message has-warnings"> <div class="message has-warnings">
<p class="warning"> <p class="warning">
<i class="icon-warning-sign"></i> <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.") %>
<%= 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.") %>
<% } %>
</p> </p>
</div> </div>
<% } %> <% } %>
...@@ -122,8 +122,7 @@ class ContainerPage(PageObject): ...@@ -122,8 +122,7 @@ class ContainerPage(PageObject):
if not warnings.is_present(): if not warnings.is_present():
return False return False
warning_text = warnings.first.text[0] warning_text = warnings.first.text[0]
return (warning_text == "This unit is visible to students. If you edit the unit, you must re-publish it for students to see your changes." return warning_text == "Caution: The last published version of this unit is live. By publishing changes you will change the student experience."
or warning_text == "Caution: The last published version of this unit is live. By publishing changes you will change the student experience.")
@property @property
def publish_action(self): def publish_action(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment