Show notification on course outline reorder.
This commit is contained in:
@@ -63,3 +63,10 @@ Feature: Course Overview
|
|||||||
When I navigate to the course overview page
|
When I navigate to the course overview page
|
||||||
And I change an assignment's grading status
|
And I change an assignment's grading status
|
||||||
Then I am shown a notification
|
Then I am shown a notification
|
||||||
|
|
||||||
|
Scenario: Notification is shown on subsection reorder
|
||||||
|
Given I have opened a new course section in Studio
|
||||||
|
And I have added a new subsection
|
||||||
|
And I have added a new subsection
|
||||||
|
When I reorder subsections
|
||||||
|
Then I am shown a notification
|
||||||
|
|||||||
@@ -124,3 +124,14 @@ def all_sections_are_collapsed(step):
|
|||||||
def change_grading_status(step):
|
def change_grading_status(step):
|
||||||
world.css_find('a.menu-toggle').click()
|
world.css_find('a.menu-toggle').click()
|
||||||
world.css_find('.menu li').first.click()
|
world.css_find('.menu li').first.click()
|
||||||
|
|
||||||
|
|
||||||
|
@step(u'I reorder subsections')
|
||||||
|
def reorder_subsections(_step):
|
||||||
|
draggable_css = 'a.drag-handle'
|
||||||
|
ele = world.css_find(draggable_css).first
|
||||||
|
ele.action_chains.drag_and_drop_by_offset(
|
||||||
|
ele._element,
|
||||||
|
30,
|
||||||
|
0
|
||||||
|
).perform()
|
||||||
|
|||||||
@@ -225,12 +225,19 @@ function _handleReorder(event, ui, parentIdField, childrenSelector) {
|
|||||||
ui.draggable.attr("style", "position:relative;"); // STYLE hack too
|
ui.draggable.attr("style", "position:relative;"); // STYLE hack too
|
||||||
children.push(ui.draggable.data('id'));
|
children.push(ui.draggable.data('id'));
|
||||||
}
|
}
|
||||||
|
var saving = new CMS.Views.Notification.Mini({
|
||||||
|
title: gettext('Saving') + '…'
|
||||||
|
});
|
||||||
|
saving.show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/save_item",
|
url: "/save_item",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
data:JSON.stringify({ 'id' : subsection_id, 'children' : children})
|
data:JSON.stringify({ 'id' : subsection_id, 'children' : children}),
|
||||||
|
success: function() {
|
||||||
|
saving.hide();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user