adminpanel 2.2.3 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1507bc64df02e756c6142e0222e98ebe33b1bf09
4
- data.tar.gz: 32e379878e099ac52116affe5515589d39f83e91
3
+ metadata.gz: ff642c29ef845dc25a183c0938386388fafc86ec
4
+ data.tar.gz: 37f3f7faaff4083b1d4c0d419f0169542bfbac5a
5
5
  SHA512:
6
- metadata.gz: 621fed57774947e6ab5aefbde93243d572bde6bb5fc26112e4c75ef0ca37a1e33ca7098ed5990e27c26d9d47f160f9f0437fb4d2871ba6514cb7a87b923d4dd1
7
- data.tar.gz: e71a1faf210481f8c792ffbf137ca4d70d6481119d6911b9f9f4b93f31c41998cbcb20ebcff0404c989c62e114835a003aef8becd8c173ca91cce3a1296f90c4
6
+ metadata.gz: 3565fd437af3f63447c81ecc50634003fddd70ce04c62d2e0745adcba165006fa0348ccd00b572f2df0b95cab482a13cf8a4e82192336a4f19d1eb14d3ba0b61
7
+ data.tar.gz: e6cb9fd9a770e247a1764b3eb8ec9337b2238d9831305cfe90fa6427c00c41c4033398d316a3a1fab7a5326548332c8b604a4e12ea25b41bdcc4254f90b53303
@@ -17,8 +17,8 @@ drawGraphic = ->
17
17
  .range [0, width]
18
18
 
19
19
  y = d3.scale.linear()
20
- .domain d3.extent data, (d) -> d.visits
21
- .range [height, 0]
20
+ .domain(d3.extent(data, (d) -> +d.visits))
21
+ .range([height, 0])
22
22
 
23
23
  xAxis = d3.svg.axis()
24
24
  .scale x
@@ -4,6 +4,7 @@ module Adminpanel
4
4
  include Adminpanel::Analytics::InstagramAnalytics
5
5
 
6
6
  skip_before_filter :set_model
7
+ before_action :check_if_fb_account, only:[:fb]
7
8
 
8
9
  API_VERSION = 'v3'
9
10
  CACHED_API_FILE = "#{Rails.root}/tmp/cache/analytics-#{API_VERSION}.cache"
@@ -82,14 +83,12 @@ module Adminpanel
82
83
 
83
84
  def fb
84
85
  authorize! :read, Adminpanel::Analytic
85
- auth = Adminpanel::Auth.find_by_key('facebook')
86
- redirect_via_turbolinks_to analytics_path if !auth.nil? && auth.value != '' # not nil & not void
87
86
  if params[:insight].present?
88
87
  period = params[:insight]
89
88
  else
90
89
  period = 'day' #default period
91
90
  end
92
- page_graph = Koala::Facebook::API.new(auth.value)
91
+ page_graph = Koala::Facebook::API.new(@auth.value)
93
92
  @impressions,
94
93
  @impressions_unique,
95
94
 
@@ -153,5 +152,13 @@ module Adminpanel
153
152
  @user = @instagram_client.user
154
153
  end
155
154
  end
155
+
156
+ private
157
+ def check_if_fb_account
158
+ @auth = Adminpanel::Auth.find_by_key('facebook')
159
+ if @auth.nil? || auth.value == ''
160
+ redirect_to analytics_path
161
+ end
162
+ end
156
163
  end
157
164
  end
@@ -1,3 +1,3 @@
1
1
  module Adminpanel
2
- VERSION = "2.2.3"
2
+ VERSION = "2.2.4"
3
3
  end
@@ -17,7 +17,7 @@ module Adminpanel
17
17
  end
18
18
 
19
19
  # def self.icon
20
- # "truck" # fa-{icon}
20
+ # 'truck' # fa-{icon}
21
21
  # end
22
22
  end
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adminpanel
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Ramon Camacho