Commit Graph

258 Commits

Author SHA1 Message Date
Peter Fogg
e3e6fd2002 Remove commented-out code and add test. 2013-07-22 12:33:01 -04:00
Peter Fogg
925f0a5ee8 Remove @xhr.restore() to fix tests. 2013-07-22 11:37:09 -04:00
Brian Talbot
ec02a4f39f Studio: changed the copy and prompt type for unit + outline deletions 2013-07-22 11:37:09 -04:00
Peter Fogg
5029f460ec Use Backbone notifications for component delete. 2013-07-22 11:37:08 -04:00
Peter Fogg
9fe4cb734c Use Backbone notifications for course section delete. 2013-07-22 11:37:08 -04:00
Don Mitchell
3722685e1a No longer persist XModule templates
Instead, we use XModule field default values when creating an empty
XModule. Driven by this use case, we also allow for XModules to be
created in memory without being persisted to the database at all. This
necessitates a change to the Modulestore api, replacing clone_item with
create_draft and save_xmodule.
2013-07-16 14:33:58 -04:00
David Baumgold
a6f349dab9 Studio i18n 2013-07-12 16:25:39 -04:00
Peter Fogg
8b13ff3dff Merge pull request #376 from edx/peter-fogg/rename-notification-save
Rename CMS.Views.Notification.Saving to Mini.
2013-07-11 14:25:44 -07:00
Peter Fogg
5b4524d75e Merge pull request #301 from edx/peter-fogg/explicit-course-settings
Peter fogg/explicit course settings
2013-07-11 14:09:07 -07:00
Peter Fogg
6e94960488 Fix many validation bugs and failing tests. 2013-07-11 16:09:59 -04:00
Peter Fogg
9c8f63726f Rename CMS.Views.Notification.Saving to Mini, in line with its more diverse modern usage. 2013-07-11 13:13:08 -04:00
Peter Fogg
975e28e9dc Remove undefined variable. 2013-07-10 16:31:43 -04:00
Peter Fogg
66b73c861f Use new feedback notification when changing section release dates. 2013-07-10 16:07:25 -04:00
David Baumgold
8d809dbad6 Remove commented-out code 2013-07-09 19:16:43 -04:00
David Baumgold
cfa094e424 Validation tests for Backbone models 2013-07-09 19:16:43 -04:00
David Baumgold
fe8587566f All textbook chapters must have name and asset_path
Previously, for a textbook with only one chapter, we allowed that chapter to
not have a title -- under the assumption that it would be shown as a monolithic
textbook, instead of a chaptered textbook. However, the UI doesn't support that
idea, the code was getting a bit messy, and there was no real benefit to the idea
of not having to specify a chapter title. This commit removes that special case,
and ensures that all textbook chapters must have a name and an asset path.
2013-07-09 19:16:43 -04:00
David Baumgold
fa62f48e57 Fix Jasmine test failures 2013-07-09 19:16:11 -04:00
David Baumgold
a608d8a38d PDF Textbooks: handle model deletion
Previously, when a model was deleted, the entire collection would save itself
to the server again. Now, we just call model.destroy(), which doesn't affect
other models.
2013-07-09 19:16:08 -04:00
David Baumgold
8f2077b579 Test for Textbook.reset method 2013-07-09 19:16:08 -04:00
David Baumgold
70a011770e Show a warning if the user tries to leave the page with unsaved textbook changes 2013-07-09 19:16:08 -04:00
David Baumgold
fedbf4585b Prevent saving when textbook is in invalid state 2013-07-09 19:16:08 -04:00
David Baumgold
77ae9a6a78 PDF Textbooks: fetch/save individual textbooks
Created a few RESTful API endpoints, which required creating and assigning
arbitrary IDs to PDF textbooks. Changed the Backbone views to save individual
models, instead of saving a whole collection.
2013-07-09 19:16:07 -04:00
David Baumgold
307c6c1715 CMS.Views.Notification.Saving should have sensible defaults
minShown = 1250, closeIcon = false
2013-07-09 19:16:07 -04:00
David Baumgold
dc5123c836 Allow multiple textbook edit forms on the page simultaneously 2013-07-09 19:16:07 -04:00
David Baumgold
404c36b8f4 PDF textbooks: namespace JS variables for URLs 2013-07-09 19:16:07 -04:00
David Baumgold
696a795c12 Don't remove all chapters on closing EditTextbook view
Previously, the code would dynamically add a chapter on render() if the textbook
had no chapters, and would remove all empty chapters when the edit view was closed.
Now, the render method doesn't modify the model at all anymore (yay!) and when the
edit view is closed, remove all empty chapters but be sure to leave at least one
left.
2013-07-09 19:16:07 -04:00
David Baumgold
5836286fda PDF textbooks: unified naming conventions 2013-07-09 19:16:06 -04:00
David Baumgold
a861e01536 Reorganize Jasmine uploader tests 2013-07-09 19:16:06 -04:00
David Baumgold
c2ef6a53f5 PDF textbook upload: show success message for 2 seconds following successful upload 2013-07-09 19:16:06 -04:00
David Baumgold
cae5c324a6 modifications to Backbone textbook structure
Textbooks now have an empty chapterset by default, instead of one with one empty
chapter. The TextbookEdit view dynamically adds an empty chapter if the chapterset
is empty; the close button removes all empty chapters from the chapterset.
2013-07-09 19:16:06 -04:00
David Baumgold
7b02932fea Add tests for CMS.Views.ChapterEdit, save content before opening upload dialog 2013-07-09 19:16:06 -04:00
David Baumgold
e8b79dc696 PDF textbooks only accept PDF files
All other file types will trigger a validation error
2013-07-09 19:16:05 -04:00
David Baumgold
77db1f8a5a Fixups and test fixes post-rebase 2013-07-09 19:16:04 -04:00
David Baumgold
c59d515cdf Added unit tests for file upload widget 2013-07-09 19:16:04 -04:00
David Baumgold
7bb86b6cd2 Fix showSpies and editSpies resetting in tests 2013-07-09 19:16:04 -04:00
David Baumgold
27398a5c6f Added tests for CMS.Views.ListTextbooks 2013-07-09 19:16:04 -04:00
David Baumgold
8ba21ca34a More backbone view tests 2013-07-09 19:16:04 -04:00
David Baumgold
3f0efe70cf Added jasmine-stealth library, v0.0.12 2013-07-09 19:16:03 -04:00
David Baumgold
8227a8c3db Started adding tests for textbook backbone views 2013-07-09 19:16:03 -04:00
David Baumgold
609c299f48 Finished backbone model tests for textbooks 2013-07-09 19:16:03 -04:00
David Baumgold
207453a37c Further basic tests for Backbone models 2013-07-09 19:16:03 -04:00
David Baumgold
001cd5d004 First few unit tests 2013-07-09 19:16:03 -04:00
David Baumgold
e0eec89e09 Truncate AJAX error messages in notification 2013-07-09 19:15:59 -04:00
David Baumgold
ace8914a53 Set up Backbone models/views to construct logic of adding textbooks/chapters 2013-07-09 19:15:58 -04:00
David Baumgold
7824b8c8f2 Fix coffeescript issue on Linux
On Linux, coffeescript refuses to compile unless the `catch` keyword has an error
variable to bind to. On Mac, it works just fine either way. Go figure.
2013-07-01 15:09:41 -04:00
David Baumgold
1fee805c9a Adjust indentation to make coffeescript happy 2013-07-01 15:09:41 -04:00
David Baumgold
8bfcbb6675 Make notifyOnError handler try to parse response as JSON 2013-07-01 15:09:41 -04:00
David Baumgold
ddc986f775 Call event.preventDefault() on notification action buttons
But allow you to specify that the event should not be prevented
2013-06-25 11:29:42 -04:00
David Baumgold
72ffe2d8f2 Backbone notifications secondary actions
Handle secondary actions on notifications either specified as a single object,
or as a list of objects. Under the hood, the initialize method converts a single
object to a list containing a single object.
2013-06-24 13:44:50 -04:00
David Baumgold
02626ffda7 Removed unused test code 2013-06-18 11:27:13 -04:00