Revert "fetch all outcomes on modal load"

This reverts commit ada94bf70d.

refs OUT-1600

Change-Id: I1e99926da820038433ed8b383b15adb81700f4fd
Reviewed-on: https://gerrit.instructure.com/132844
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Leo Abner <rabner@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
This commit is contained in:
Simon Williams 2017-11-14 15:41:49 -07:00
parent af717ee428
commit a5bc4460f0
4 changed files with 8 additions and 22 deletions

View File

@ -89,19 +89,6 @@ define [
dfd.error = dfd.fail
dfd
fetchAll: ->
@fetchAllDriver(success: @fetchNext)
fetchNext: =>
if @canFetch 'next'
@fetch(page: 'next', success: @fetchNext)
else
@trigger('finish')
fetchAllDriver: (options = {}) ->
options.data = Object.assign per_page: 20, options.data || {}
@fetch options
canFetch: (page) ->
@urls? and @urls[page]?

View File

@ -184,8 +184,7 @@ define [
fetchOutcomes: ->
@collection = @outcomes
@bindPaginationEvents()
@outcomes.fetchAll()
@outcomes.on("finish", => @loadDfd.resolve(this))
@outcomes.fetch(success: => @loadDfd.resolve(this))
@startPaginationListener()
@showPaginationLoader()

View File

@ -163,6 +163,13 @@ define [
@selectedDir().makeFocusable()
@goingBack = false
# if @selectedModel() instanceof OutcomeGroup
# parentDir = @selectedDir().parent
## @selectDir @selectedDir(), @selectedDir().parent?.selectedModel
# else
# i = _.indexOf @directories, @selectedDir()
# @selectDir @directories[i - 1]
# @goingBack = false
updateSidebarWidth: ->
sidebarWidth = if @directories.length is 1 then @directoryWidth else (@directoryWidth * 2)

View File

@ -42,13 +42,6 @@ describe "outcomes as a student" do
expect(f('.outcomes-content .title')).to include_text "outcome 0"
end
it "should load all outcomes on initial load" do
course_outcome 20
get outcome_url
expect(f('.outcomes-content .title')).to include_text "outcome 0"
expect(ff('.outcome-level li').count).to be 20
end
it "should select the first outcome group from the list if there are outcome groups" do
course_bulk_outcome_groups_course(2, 2)
get outcome_url