Skip to content

Commit 7dffda7

Browse files
maneframeevizitei
authored andcommitted
show more than 20 feature flags
test plan: * visit the site admin feature flags * should show all of the feature flags (particularly "Differentiated Assignments") closes #CNVS-19721 Change-Id: Ibf5d864986713cc7aff6f5d4bdc88a608916fe90 Reviewed-on: https://gerrit.instructure.com/51882 Tested-by: Jenkins Reviewed-by: Jeremy Stanley <jeremy@instructure.com> Product-Review: Jeremy Stanley <jeremy@instructure.com> QA-Review: Clare Strong <clare@instructure.com>
1 parent 7c42465 commit 7dffda7

7 files changed

Lines changed: 28 additions & 7 deletions

File tree

app/coffeescripts/bundles/account_settings.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ require [
44
'compiled/bundles/modules/account_quota_settings'
55
], (FeatureFlagAdminView) ->
66
featureFlags = new FeatureFlagAdminView(el: '#tab-features')
7-
featureFlags.collection.fetch()
7+
featureFlags.collection.fetchAll()

app/coffeescripts/bundles/course_settings.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require [
1313
el: $('#tab-navigation')
1414

1515
featureFlagView = new FeatureFlagAdminView(el: '#tab-features')
16-
featureFlagView.collection.fetch()
16+
featureFlagView.collection.fetchAll()
1717

1818
$ ->
1919
nav_view.render()

app/coffeescripts/bundles/profile.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ require [
88
], (FeatureFlagAdminView) ->
99

1010
view = new FeatureFlagAdminView(el: '.feature-flag-wrapper')
11-
view.collection.fetch()
11+
view.collection.fetchAll()
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
define [
22
'underscore',
33
'Backbone',
4+
'compiled/collections/PaginatedCollection'
45
'compiled/models/FeatureFlag'
5-
], (_, Backbone, FeatureFlag) ->
6+
], (_, Backbone, PaginatedCollection, FeatureFlag) ->
67

7-
class FeatureFlagCollection extends Backbone.Collection
8+
class FeatureFlagCollection extends PaginatedCollection
89

910
model: FeatureFlag
1011

12+
fetchAll: ->
13+
@fetch(success: @fetchNext)
14+
15+
fetchNext: =>
16+
if @canFetch 'next'
17+
@fetch(page: 'next', success: @fetchNext)
18+
else
19+
@trigger('finish')
20+
1121
fetch: (options = {}) ->
1222
options.data = _.extend per_page: 20, options.data || {}
1323
super options

app/coffeescripts/views/feature_flags/FeatureFlagAdminView.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ define [
3434
@attachEvents()
3535

3636
attachEvents: ->
37-
@collection.on('sync', @onSync)
37+
@collection.on('finish', @onSync)
3838

3939
onSync: (collection, response, xhr) =>
4040
# only listen for the first sync event; others are updates to existing flags

app/views/jst/feature_flags/featureFlag.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="row-fluid">
1+
<div class="row-fluid feature {{id}}">
22
<div class="span4">
33
<span
44
class="element_toggler"

spec/selenium/admin/admin_settings_tab_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,4 +467,15 @@ def set_checkbox(checkbox, checked)
467467
expect(f("#account_external_integration_keys_external_key0").attribute('value')).to eq ''
468468
end
469469
end
470+
471+
it "should show all the feature flags" do
472+
course_with_admin_logged_in(:account => Account.site_admin)
473+
get "/accounts/#{Account.site_admin.id}/settings"
474+
f("#tab-features-link").click
475+
wait_for_ajaximations
476+
477+
Feature.applicable_features(Account.site_admin).each do |feature|
478+
expect(f(".feature.#{feature.feature}")).to be_displayed
479+
end
480+
end
470481
end

0 commit comments

Comments
 (0)