dashing-rails 2.5.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +1 -3
- data/Gemfile.lock +105 -109
- data/app/controllers/dashing/application_controller.rb +2 -2
- data/app/controllers/dashing/dashboards_controller.rb +1 -1
- data/app/controllers/dashing/widgets_controller.rb +3 -3
- data/lib/assets/javascripts/dashing.gridster.coffee +4 -22
- data/lib/dashing/configuration.rb +1 -5
- data/lib/dashing/version.rb +1 -1
- data/spec/controllers/dashing/application_controller_spec.rb +11 -6
- data/spec/controllers/dashing/dashboards_controller_spec.rb +1 -3
- data/spec/controllers/dashing/events_controller_spec.rb +1 -3
- data/spec/controllers/dashing/widgets_controller_spec.rb +1 -3
- data/spec/dummy/config/environments/test.rb +2 -2
- data/spec/lib/dashing/configuration_spec.rb +1 -30
- data/spec/lib/dashing_spec.rb +1 -3
- data/spec/lib/generators/widget_generator_spec.rb +1 -2
- data/spec/rails_helper.rb +61 -0
- data/spec/spec_helper.rb +82 -37
- data/spec/support/controller_spec_helpers.rb +2 -2
- data/vendor/assets/fonts/dashing/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/dashing/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/dashing/fontawesome-webfont.svg +210 -41
- data/vendor/assets/fonts/dashing/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/dashing/fontawesome-webfont.woff +0 -0
- data/vendor/assets/fonts/dashing/fontawesome-webfont.woff2 +0 -0
- data/vendor/assets/javascripts/dashing/default_widgets/number.coffee +0 -1
- data/vendor/assets/javascripts/dashing/jquery.gridster.js +4451 -3185
- data/vendor/assets/stylesheets/dashing/font-awesome.scss +808 -60
- data/vendor/assets/stylesheets/dashing/jquery.gridster.css +73 -85
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c4f2ac2b83de93b59cde2a8a721ff3c1da134ff
|
4
|
+
data.tar.gz: f5fcc3a0285c077218d15c4142e4389649b65ddf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88dc2c0fd8d2763013d8055edc89801283a0bbfb9ab8a694f026d253a49f077db7afb46cfe7bbfbb2ad1e95029928c6a728005f3369d199da5289dfe7930ae5b
|
7
|
+
data.tar.gz: 393ec5fc545d3a31a3feb0b84444847abe82ee9605af6cac7f0482b93e53882d2d5c10b049e9b794121e1cbc458946c2e8adcd08fb26c284ae65d6e6052f2792
|
data/.rspec
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dashing-rails (2.
|
4
|
+
dashing-rails (2.6.0)
|
5
5
|
coffee-script (>= 2.0)
|
6
6
|
connection_pool (~> 2.2)
|
7
7
|
jquery-rails (>= 3.0)
|
@@ -12,156 +12,151 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
|
16
|
-
actionpack (=
|
17
|
-
|
18
|
-
|
15
|
+
actioncable (5.0.1)
|
16
|
+
actionpack (= 5.0.1)
|
17
|
+
nio4r (~> 1.2)
|
18
|
+
websocket-driver (~> 0.6.1)
|
19
|
+
actionmailer (5.0.1)
|
20
|
+
actionpack (= 5.0.1)
|
21
|
+
actionview (= 5.0.1)
|
22
|
+
activejob (= 5.0.1)
|
19
23
|
mail (~> 2.5, >= 2.5.4)
|
20
|
-
rails-dom-testing (~>
|
21
|
-
actionpack (
|
22
|
-
actionview (=
|
23
|
-
activesupport (=
|
24
|
-
rack (~>
|
25
|
-
rack-test (~> 0.6.
|
26
|
-
rails-dom-testing (~>
|
24
|
+
rails-dom-testing (~> 2.0)
|
25
|
+
actionpack (5.0.1)
|
26
|
+
actionview (= 5.0.1)
|
27
|
+
activesupport (= 5.0.1)
|
28
|
+
rack (~> 2.0)
|
29
|
+
rack-test (~> 0.6.3)
|
30
|
+
rails-dom-testing (~> 2.0)
|
27
31
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
28
|
-
actionview (
|
29
|
-
activesupport (=
|
32
|
+
actionview (5.0.1)
|
33
|
+
activesupport (= 5.0.1)
|
30
34
|
builder (~> 3.1)
|
31
35
|
erubis (~> 2.7.0)
|
32
|
-
rails-dom-testing (~>
|
36
|
+
rails-dom-testing (~> 2.0)
|
33
37
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
34
|
-
activejob (
|
35
|
-
activesupport (=
|
36
|
-
globalid (>= 0.3.
|
37
|
-
activemodel (
|
38
|
-
activesupport (=
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
38
|
+
activejob (5.0.1)
|
39
|
+
activesupport (= 5.0.1)
|
40
|
+
globalid (>= 0.3.6)
|
41
|
+
activemodel (5.0.1)
|
42
|
+
activesupport (= 5.0.1)
|
43
|
+
activerecord (5.0.1)
|
44
|
+
activemodel (= 5.0.1)
|
45
|
+
activesupport (= 5.0.1)
|
46
|
+
arel (~> 7.0)
|
47
|
+
activesupport (5.0.1)
|
48
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
45
49
|
i18n (~> 0.7)
|
46
|
-
json (~> 1.7, >= 1.7.7)
|
47
50
|
minitest (~> 5.1)
|
48
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
49
51
|
tzinfo (~> 1.1)
|
50
|
-
arel (
|
51
|
-
better_errors (1.1
|
52
|
+
arel (7.1.4)
|
53
|
+
better_errors (2.1.1)
|
52
54
|
coderay (>= 1.0.0)
|
53
55
|
erubis (>= 2.6.6)
|
54
|
-
|
55
|
-
|
56
|
+
rack (>= 0.9.0)
|
57
|
+
builder (3.2.3)
|
58
|
+
coderay (1.1.1)
|
56
59
|
coffee-script (2.4.1)
|
57
60
|
coffee-script-source
|
58
61
|
execjs
|
59
|
-
coffee-script-source (1.
|
60
|
-
concurrent-ruby (1.0.
|
61
|
-
connection_pool (2.2.
|
62
|
-
coveralls (0.7.0)
|
63
|
-
multi_json (~> 1.3)
|
64
|
-
rest-client
|
65
|
-
simplecov (>= 0.7)
|
66
|
-
term-ansicolor
|
67
|
-
thor
|
62
|
+
coffee-script-source (1.12.2)
|
63
|
+
concurrent-ruby (1.0.4)
|
64
|
+
connection_pool (2.2.1)
|
68
65
|
diff-lcs (1.2.5)
|
69
|
-
docile (1.1.3)
|
70
66
|
erubis (2.7.0)
|
71
|
-
execjs (2.
|
72
|
-
generator_spec (0.9.
|
67
|
+
execjs (2.7.0)
|
68
|
+
generator_spec (0.9.3)
|
73
69
|
activesupport (>= 3.0.0)
|
74
70
|
railties (>= 3.0.0)
|
75
|
-
globalid (0.3.
|
71
|
+
globalid (0.3.7)
|
76
72
|
activesupport (>= 4.1.0)
|
77
73
|
i18n (0.7.0)
|
78
|
-
jquery-rails (4.
|
74
|
+
jquery-rails (4.2.2)
|
79
75
|
rails-dom-testing (>= 1, < 3)
|
80
76
|
railties (>= 4.2.0)
|
81
77
|
thor (>= 0.14, < 2.0)
|
82
|
-
|
83
|
-
loofah (2.0.2)
|
78
|
+
loofah (2.0.3)
|
84
79
|
nokogiri (>= 1.5.9)
|
85
80
|
mail (2.6.4)
|
86
81
|
mime-types (>= 1.16, < 4)
|
87
82
|
method_source (0.8.2)
|
88
|
-
mime-types (
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
83
|
+
mime-types (3.1)
|
84
|
+
mime-types-data (~> 3.2015)
|
85
|
+
mime-types-data (3.2016.0521)
|
86
|
+
mini_portile2 (2.1.0)
|
87
|
+
minitest (5.10.1)
|
88
|
+
nio4r (1.2.1)
|
89
|
+
nokogiri (1.7.0.1)
|
90
|
+
mini_portile2 (~> 2.1.0)
|
91
|
+
pry (0.10.4)
|
92
|
+
coderay (~> 1.1.0)
|
93
|
+
method_source (~> 0.8.1)
|
97
94
|
slop (~> 3.4)
|
98
|
-
pry-rails (0.3.
|
95
|
+
pry-rails (0.3.4)
|
99
96
|
pry (>= 0.9.10)
|
100
|
-
rack (
|
97
|
+
rack (2.0.1)
|
101
98
|
rack-test (0.6.3)
|
102
99
|
rack (>= 1.0)
|
103
|
-
rails (
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
100
|
+
rails (5.0.1)
|
101
|
+
actioncable (= 5.0.1)
|
102
|
+
actionmailer (= 5.0.1)
|
103
|
+
actionpack (= 5.0.1)
|
104
|
+
actionview (= 5.0.1)
|
105
|
+
activejob (= 5.0.1)
|
106
|
+
activemodel (= 5.0.1)
|
107
|
+
activerecord (= 5.0.1)
|
108
|
+
activesupport (= 5.0.1)
|
111
109
|
bundler (>= 1.3.0, < 2.0)
|
112
|
-
railties (=
|
113
|
-
sprockets-rails
|
114
|
-
rails-
|
115
|
-
activesupport (>= 4.2.0.
|
116
|
-
|
117
|
-
|
118
|
-
nokogiri (~> 1.6.0)
|
119
|
-
rails-deprecated_sanitizer (>= 1.0.1)
|
120
|
-
rails-html-sanitizer (1.0.2)
|
110
|
+
railties (= 5.0.1)
|
111
|
+
sprockets-rails (>= 2.0.0)
|
112
|
+
rails-dom-testing (2.0.2)
|
113
|
+
activesupport (>= 4.2.0, < 6.0)
|
114
|
+
nokogiri (~> 1.6)
|
115
|
+
rails-html-sanitizer (1.0.3)
|
121
116
|
loofah (~> 2.0)
|
122
|
-
railties (
|
123
|
-
actionpack (=
|
124
|
-
activesupport (=
|
117
|
+
railties (5.0.1)
|
118
|
+
actionpack (= 5.0.1)
|
119
|
+
activesupport (= 5.0.1)
|
120
|
+
method_source
|
125
121
|
rake (>= 0.8.7)
|
126
122
|
thor (>= 0.18.1, < 2.0)
|
127
|
-
rake (
|
128
|
-
redis (3.
|
129
|
-
|
130
|
-
|
131
|
-
rspec-
|
132
|
-
|
133
|
-
|
134
|
-
rspec-mocks (
|
135
|
-
|
123
|
+
rake (12.0.0)
|
124
|
+
redis (3.3.2)
|
125
|
+
rspec-core (3.5.4)
|
126
|
+
rspec-support (~> 3.5.0)
|
127
|
+
rspec-expectations (3.5.0)
|
128
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
129
|
+
rspec-support (~> 3.5.0)
|
130
|
+
rspec-mocks (3.5.0)
|
131
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
132
|
+
rspec-support (~> 3.5.0)
|
133
|
+
rspec-rails (3.5.2)
|
136
134
|
actionpack (>= 3.0)
|
137
|
-
activemodel (>= 3.0)
|
138
135
|
activesupport (>= 3.0)
|
139
136
|
railties (>= 3.0)
|
140
|
-
rspec-core (~>
|
141
|
-
rspec-expectations (~>
|
142
|
-
rspec-mocks (~>
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
slop (3.5.0)
|
150
|
-
sprockets (3.5.2)
|
137
|
+
rspec-core (~> 3.5.0)
|
138
|
+
rspec-expectations (~> 3.5.0)
|
139
|
+
rspec-mocks (~> 3.5.0)
|
140
|
+
rspec-support (~> 3.5.0)
|
141
|
+
rspec-support (3.5.0)
|
142
|
+
rufus-scheduler (3.3.2)
|
143
|
+
tzinfo
|
144
|
+
slop (3.6.0)
|
145
|
+
sprockets (3.7.1)
|
151
146
|
concurrent-ruby (~> 1.0)
|
152
147
|
rack (> 1, < 3)
|
153
|
-
sprockets-rails (3.0
|
148
|
+
sprockets-rails (3.2.0)
|
154
149
|
actionpack (>= 4.0)
|
155
150
|
activesupport (>= 4.0)
|
156
151
|
sprockets (>= 3.0.0)
|
157
|
-
sqlite3 (1.3.
|
158
|
-
|
159
|
-
tins (~> 1.0)
|
160
|
-
thor (0.19.1)
|
152
|
+
sqlite3 (1.3.13)
|
153
|
+
thor (0.19.4)
|
161
154
|
thread_safe (0.3.5)
|
162
|
-
tins (1.3.0)
|
163
155
|
tzinfo (1.2.2)
|
164
156
|
thread_safe (~> 0.1)
|
157
|
+
websocket-driver (0.6.4)
|
158
|
+
websocket-extensions (>= 0.1.0)
|
159
|
+
websocket-extensions (0.1.2)
|
165
160
|
|
166
161
|
PLATFORMS
|
167
162
|
ruby
|
@@ -169,10 +164,11 @@ PLATFORMS
|
|
169
164
|
DEPENDENCIES
|
170
165
|
better_errors
|
171
166
|
bundler (>= 1.8)
|
172
|
-
coveralls
|
173
167
|
dashing-rails!
|
174
168
|
generator_spec
|
175
169
|
pry-rails
|
176
|
-
rspec-rails (~>
|
177
|
-
simplecov
|
170
|
+
rspec-rails (~> 3.5)
|
178
171
|
sqlite3
|
172
|
+
|
173
|
+
BUNDLED WITH
|
174
|
+
1.11.2
|
@@ -1,13 +1,13 @@
|
|
1
1
|
module Dashing
|
2
2
|
class ApplicationController < ActionController::Base
|
3
3
|
|
4
|
-
|
4
|
+
before_action :authentication_with_devise
|
5
5
|
|
6
6
|
private
|
7
7
|
|
8
8
|
def authentication_with_devise
|
9
9
|
Dashing.config.devise_allowed_models.each do |model|
|
10
|
-
|
10
|
+
send("authenticate_#{model.to_s}!")
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module Dashing
|
2
2
|
class WidgetsController < ApplicationController
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
before_action :check_accessibility, only: :update
|
5
|
+
before_action :check_widget_name, only: [:show, :update]
|
6
|
+
before_action :prepend_view_paths, only: :show
|
7
7
|
|
8
8
|
rescue_from ActionView::MissingTemplate, with: :template_not_found
|
9
9
|
|
@@ -6,26 +6,10 @@ Dashing.gridsterLayout = (positions) ->
|
|
6
6
|
Dashing.customGridsterLayout = true
|
7
7
|
positions = positions.replace(/^"|"$/g, '')
|
8
8
|
positions = $.parseJSON(positions)
|
9
|
-
widgets = $("[data-row]")
|
10
|
-
maxRow = 1
|
11
|
-
maxCol = 1
|
12
|
-
numColumns = Dashing.numColumns || 1
|
9
|
+
widgets = $("[data-row^=]")
|
13
10
|
for widget, index in widgets
|
14
|
-
|
15
|
-
|
16
|
-
$(widget).attr('data-col', positions[index].col)
|
17
|
-
if positions[index].row > maxRow
|
18
|
-
maxRow = positions[index].row
|
19
|
-
maxCol = positions[index].col + 1
|
20
|
-
else if positions[index].row == maxRow and positions[index].col >= maxCol
|
21
|
-
maxCol = positions[index].col + 1
|
22
|
-
else
|
23
|
-
if maxCol > numColumns
|
24
|
-
maxRow += 1
|
25
|
-
maxCol = 1
|
26
|
-
$(widget).attr('data-row', maxRow)
|
27
|
-
$(widget).attr('data-col', maxCol)
|
28
|
-
maxCol += 1
|
11
|
+
$(widget).attr('data-row', positions[index].row)
|
12
|
+
$(widget).attr('data-col', positions[index].col)
|
29
13
|
|
30
14
|
Dashing.getWidgetPositions = ->
|
31
15
|
$(".gridster ul:first").gridster().data('gridster').serialize()
|
@@ -40,9 +24,7 @@ Dashing.showGridsterInstructions = ->
|
|
40
24
|
<script type='text/javascript'>\n
|
41
25
|
$(function() {\n
|
42
26
|
\ \ Dashing.gridsterLayout('#{JSON.stringify(Dashing.currentWidgetPositions)}')\n
|
43
|
-
});\n
|
44
|
-
</script>
|
45
|
-
")
|
27
|
+
});\n</script>")
|
46
28
|
|
47
29
|
$ ->
|
48
30
|
$('#save-gridster').leanModal()
|
@@ -53,11 +53,7 @@ module Dashing
|
|
53
53
|
private
|
54
54
|
|
55
55
|
def request_thread_count
|
56
|
-
|
57
|
-
::Puma.cli_config.options.fetch(:max_threads, 5).to_i
|
58
|
-
else
|
59
|
-
5
|
60
|
-
end
|
56
|
+
Integer(ENV['RAILS_MAX_THREADS'] || 5)
|
61
57
|
end
|
62
58
|
end
|
63
59
|
end
|
data/lib/dashing/version.rb
CHANGED
@@ -1,18 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
describe Dashing::ApplicationController do
|
1
|
+
RSpec.describe Dashing::ApplicationController do
|
4
2
|
|
5
3
|
describe '#authentication_with_devise' do
|
6
4
|
|
7
5
|
let(:models) { [:user, :admin] }
|
6
|
+
let!(:devise_instances) do
|
7
|
+
module DeviseInstances
|
8
|
+
def authenticate_user!; end
|
9
|
+
def authenticate_admin!; end
|
10
|
+
end
|
11
|
+
end
|
8
12
|
|
9
13
|
before do
|
10
|
-
|
14
|
+
controller.extend(DeviseInstances)
|
15
|
+
allow(Dashing).to receive_message_chain(:config, :devise_allowed_models).and_return(models)
|
11
16
|
end
|
12
17
|
|
13
18
|
it 'calls devise authenticate method' do
|
14
|
-
expect(controller).to receive("
|
15
|
-
expect(controller).to receive("
|
19
|
+
expect(controller).to receive("authenticate_user!")
|
20
|
+
expect(controller).to receive("authenticate_admin!")
|
16
21
|
controller.send(:authentication_with_devise)
|
17
22
|
end
|
18
23
|
|