File tree Expand file tree Collapse file tree 5 files changed +26
-2
lines changed Expand file tree Collapse file tree 5 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 4
4
<a id =" filter_toggle" {{ action ' toggleFilters' target =' view' }} ><i class =" fa fa-caret-right" ></i >{{ t ' admin.stats.filter_results' }} </a >
5
5
</div >
6
6
<div class =" span8 filter-times" >
7
- <label class =" checkbox" style =" display: inline-block; font-size: 12px; margin: 0px 40px 0px 0px; color: #666; position: relative; top: 2px;" >{{ view Ember.Checkbox checkedBinding =" view.isBetaAnalytics" action =" toggleBetaAnalytics" target =" view" }} Beta Analytics</label >
7
+ {{ #if view.enableBetaAnalytics }}
8
+ <label class =" checkbox" style =" display: inline-block; font-size: 12px; margin: 0px 40px 0px 0px; color: #666; position: relative; top: 2px;" >{{ view Ember.Checkbox checkedBinding =" view.isBetaAnalytics" action =" toggleBetaAnalytics" target =" view" }} Beta Analytics</label >
9
+ {{ /if }}
8
10
9
11
{{ #if view.enableInterval }}
10
12
<div id =" interval_buttons" class =" btn-group" data-toggle =" buttons-radio" >
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ Admin.StatsQueryFormView = Ember.View.extend({
3
3
4
4
enableInterval : false ,
5
5
6
+ enableBetaAnalytics : enableBetaAnalytics ,
7
+
6
8
datePickerRanges : {
7
9
'Today' : [
8
10
moment ( ) . startOf ( 'day' ) ,
Original file line number Diff line number Diff line change 6
6
<%= stylesheet_link_tag "admin" %>
7
7
<%= javascript_tag do %>
8
8
webAdminAjaxApiKey = <%= web_admin_ajax_api_user . api_key . to_json . html_safe %> ;
9
- currentAdmin = <%= current_admin . attributes . slice ( "username" , "superuser" ) . to_json . html_safe %>
9
+ currentAdmin = <%= current_admin . attributes . slice ( "username" , "superuser" ) . to_json . html_safe %> ;
10
+ enableBetaAnalytics = <%= ( ApiUmbrellaConfig [ :analytics ] [ :adapter ] == "kylin" || ( ApiUmbrellaConfig [ :analytics ] [ :outputs ] && ApiUmbrellaConfig [ :analytics ] [ :outputs ] . include? ( "kylin" ) ) ) . to_json . html_safe %> ;
10
11
<% end %>
11
12
< link href ='//fonts.googleapis.com/css?family=Oswald:400,700 ' rel ='stylesheet ' type ='text/css '>
12
13
<%= javascript_include_tag "admin/locales/#{ I18n . locale } " %>
Original file line number Diff line number Diff line change 36
36
"CommonValidations" ,
37
37
"currentAdmin" ,
38
38
"Ember" ,
39
+ "enableBetaAnalytics" ,
39
40
"google" ,
40
41
"ic" ,
41
42
"inflection" ,
Original file line number Diff line number Diff line change 141
141
page . response_headers [ "Content-Type" ] . should eql ( "text/csv" )
142
142
end
143
143
end
144
+
145
+ describe "beta analytics option" do
146
+ it "doesn't show the beta analytics option by default" do
147
+ visit "/admin/#/stats/logs/tz=America%2FDenver&search=&start_at=2015-01-12&end_at=2015-01-18&interval=day"
148
+ page . should_not have_content ( "Beta Analytics" )
149
+ end
150
+
151
+ it "shows the beta analytics toggle if kylin analytics are enabled" do
152
+ original = ApiUmbrellaConfig [ :analytics ] [ :outputs ]
153
+ begin
154
+ ApiUmbrellaConfig [ :analytics ] [ :outputs ] = [ "kylin" ]
155
+ visit "/admin/#/stats/logs/tz=America%2FDenver&search=&start_at=2015-01-12&end_at=2015-01-18&interval=day"
156
+ page . should have_content ( "Beta Analytics" )
157
+ ensure
158
+ ApiUmbrellaConfig [ :analytics ] [ :outputs ] = original
159
+ end
160
+ end
161
+ end
144
162
end
You can’t perform that action at this time.
0 commit comments