From b19aa06540e2ecc002b68799d69ee477e6ee267f Mon Sep 17 00:00:00 2001 From: Jay Zoldak Date: Wed, 19 Dec 2012 11:26:36 -0500 Subject: [PATCH 1/4] Fix broken jasmine tests for CMS. All (11) specs are now passing. --- cms/static/coffee/files.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cms/static/coffee/files.json b/cms/static/coffee/files.json index 7b2719a047..b396bec944 100644 --- a/cms/static/coffee/files.json +++ b/cms/static/coffee/files.json @@ -3,6 +3,6 @@ "/static/js/vendor/jquery.min.js", "/static/js/vendor/json2.js", "/static/js/vendor/underscore-min.js", - "/static/js/vendor/backbone.js" + "/static/js/vendor/backbone-min.js" ] } From e21c17ffeb9fb0a1c7ec0ad00f67db3520680d2f Mon Sep 17 00:00:00 2001 From: Jay Zoldak Date: Wed, 19 Dec 2012 11:32:55 -0500 Subject: [PATCH 2/4] Fail the Jenkins build when CMS Jasmine tests fail. --- jenkins/test_edge.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/test_edge.sh b/jenkins/test_edge.sh index 14c3bd5f26..7c8ad8ed83 100755 --- a/jenkins/test_edge.sh +++ b/jenkins/test_edge.sh @@ -22,7 +22,7 @@ rake test_lms[false] || TESTS_FAILED=1 rake test_common/lib/capa || TESTS_FAILED=1 rake test_common/lib/xmodule || TESTS_FAILED=1 rake phantomjs_jasmine_lms || true -rake phantomjs_jasmine_cms || true +rake phantomjs_jasmine_cms || TESTS_FAILED=1 rake phantomjs_jasmine_common/lib/xmodule || true rake coverage:xml coverage:html From 91b0fddfcee435cb1f002d2e6e521daa396a1045 Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Wed, 19 Dec 2012 13:49:47 -0500 Subject: [PATCH 3/4] malformed url generation for User's tab --- cms/templates/widgets/header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cms/templates/widgets/header.html b/cms/templates/widgets/header.html index b173012e84..f7fc4722e0 100644 --- a/cms/templates/widgets/header.html +++ b/cms/templates/widgets/header.html @@ -29,7 +29,7 @@
  • Courseware
  • Course Info
  • Pages
  • -
  • Users
  • +
  • Users
  • Assets
  • Settings
  • Import
  • From 61c19dbc70b526718db3c90b4606f324081af4b4 Mon Sep 17 00:00:00 2001 From: cahrens Date: Wed, 19 Dec 2012 16:55:39 -0500 Subject: [PATCH 4/4] Fix for Studio #87, plus some cleanup. --- cms/static/js/base.js | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/cms/static/js/base.js b/cms/static/js/base.js index 8f2b822ece..9fa4489c36 100644 --- a/cms/static/js/base.js +++ b/cms/static/js/base.js @@ -2,8 +2,6 @@ var $body; var $modal; var $modalCover; var $newComponentItem; -var $newComponentStep1; -var $newComponentStep2; var $changedInput; var $spinner; @@ -111,15 +109,12 @@ $(document).ready(function() { $('.edit-section-start-cancel').bind('click', cancelSetSectionScheduleDate); $('.edit-section-start-save').bind('click', saveSetSectionScheduleDate); - // modal upload asset dialog. Bind it in the initializer otherwise multiple hanlders will get registered causing - // pretty wacky stuff to happen - $('.file-input').bind('change', startUpload); $('.upload-modal .choose-file-button').bind('click', showFileSelectionMenu); $body.on('click', '.section-published-date .edit-button', editSectionPublishDate); $body.on('click', '.section-published-date .schedule-button', editSectionPublishDate); $body.on('click', '.edit-subsection-publish-settings .save-button', saveSetSectionScheduleDate); - $body.on('click', '.edit-subsection-publish-settings .cancel-button', hideModal) + $body.on('click', '.edit-subsection-publish-settings .cancel-button', hideModal); $body.on('change', '.edit-subsection-publish-settings .start-date', function() { if($('.edit-subsection-publish-settings').find('.start-time').val() == '') { $('.edit-subsection-publish-settings').find('.start-time').val('12:00am'); @@ -314,7 +309,7 @@ function checkForNewValue(e) { this.saveTimer = setTimeout(function() { $changedInput = $(e.target); - saveSubsection() + saveSubsection(); this.saveTimer = null; }, 500); } @@ -327,7 +322,7 @@ function autosaveInput(e) { this.saveTimer = setTimeout(function() { $changedInput = $(e.target); - saveSubsection() + saveSubsection(); this.saveTimer = null; }, 500); } @@ -349,23 +344,22 @@ function saveSubsection() { // pull all 'normalized' metadata editable fields on page var metadata_fields = $('input[data-metadata-name]'); - metadata = {}; + var metadata = {}; for(var i=0; i< metadata_fields.length;i++) { - el = metadata_fields[i]; + var el = metadata_fields[i]; metadata[$(el).data("metadata-name")] = el.value; } // now add 'free-formed' metadata which are presented to the user as dual input fields (name/value) $('ol.policy-list > li.policy-list-element').each( function(i, element) { - name = $(element).children('.policy-list-name').val(); - val = $(element).children('.policy-list-value').val(); - metadata[name] = val; + var name = $(element).children('.policy-list-name').val(); + metadata[name] = $(element).children('.policy-list-value').val(); }); // now add any 'removed' policy metadata which is stored in a separate hidden div // 'null' presented to the server means 'remove' $("#policy-to-delete > li.policy-list-element").each(function(i, element) { - name = $(element).children('.policy-list-name').val(); + var name = $(element).children('.policy-list-name').val(); if (name != "") metadata[name] = null; }); @@ -401,7 +395,7 @@ function createNewUnit(e) { $.post('/clone_item', {'parent_location' : parent, 'template' : template, - 'display_name': 'New Unit', + 'display_name': 'New Unit' }, function(data) { // redirect to the edit page @@ -491,7 +485,7 @@ function displayFinishedUpload(xhr) { var template = $('#new-asset-element').html(); var html = Mustache.to_html(template, resp); - $('table > tbody > tr:first').before(html); + $('table > tbody').prepend(html); } @@ -504,6 +498,7 @@ function hideModal(e) { if(e) { e.preventDefault(); } + $('.file-input').unbind('change', startUpload); $modal.hide(); $modalCover.hide(); } @@ -680,7 +675,7 @@ function saveNewCourse(e) { 'template' : template, 'org' : org, 'number' : number, - 'display_name': display_name, + 'display_name': display_name }, function(data) { if (data.id != undefined) { @@ -709,7 +704,7 @@ function addNewSubsection(e) { var parent = $(this).parents("section.branch").data("id"); - $saveButton.data('parent', parent) + $saveButton.data('parent', parent); $saveButton.data('template', $(this).data('template')); $newSubsection.find('.new-subsection-form').bind('submit', saveNewSubsection); @@ -774,7 +769,7 @@ function saveEditSectionName(e) { $spinner.show(); if (display_name == '') { - alert("You must specify a name before saving.") + alert("You must specify a name before saving."); return; } @@ -811,13 +806,12 @@ function cancelSetSectionScheduleDate(e) { function saveSetSectionScheduleDate(e) { e.preventDefault(); - input_date = $('.edit-subsection-publish-settings .start-date').val(); - input_time = $('.edit-subsection-publish-settings .start-time').val(); + var input_date = $('.edit-subsection-publish-settings .start-date').val(); + var input_time = $('.edit-subsection-publish-settings .start-time').val(); - start = getEdxTimeFromDateTimeVals(input_date, input_time); + var start = getEdxTimeFromDateTimeVals(input_date, input_time); - id = $modal.attr('data-id'); - var $_this = $(this); + var id = $modal.attr('data-id'); // call into server to commit the new order $.ajax({