bumbleworks-gui 0.0.3

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.
Files changed (79) hide show
  1. data/.gitignore +17 -0
  2. data/.rspec +3 -0
  3. data/.ruby-version +1 -0
  4. data/Gemfile +5 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +23 -0
  7. data/Rakefile +9 -0
  8. data/bumbleworks-gui.gemspec +31 -0
  9. data/config.ru +39 -0
  10. data/lib/bumbleworks/gui.rb +22 -0
  11. data/lib/bumbleworks/gui/assets/css/application.css +65 -0
  12. data/lib/bumbleworks/gui/assets/css/ruote-fluo.css +62 -0
  13. data/lib/bumbleworks/gui/assets/css/side-menu.css +203 -0
  14. data/lib/bumbleworks/gui/assets/js/application.js +36 -0
  15. data/lib/bumbleworks/gui/assets/js/fluo_helper.js +30 -0
  16. data/lib/bumbleworks/gui/assets/js/foolbox.min.js +3 -0
  17. data/lib/bumbleworks/gui/assets/js/jquery.js +26 -0
  18. data/lib/bumbleworks/gui/assets/js/list.min.js +1 -0
  19. data/lib/bumbleworks/gui/assets/js/list.pagination.min.js +1 -0
  20. data/lib/bumbleworks/gui/assets/js/ruote-fluo.min.js +3 -0
  21. data/lib/bumbleworks/gui/config/application.rb +9 -0
  22. data/lib/bumbleworks/gui/config/routes.rb +18 -0
  23. data/lib/bumbleworks/gui/controllers/application_controller.rb +15 -0
  24. data/lib/bumbleworks/gui/controllers/dashboards_controller.rb +17 -0
  25. data/lib/bumbleworks/gui/controllers/entities_controller.rb +26 -0
  26. data/lib/bumbleworks/gui/controllers/expressions_controller.rb +28 -0
  27. data/lib/bumbleworks/gui/controllers/processes_controller.rb +13 -0
  28. data/lib/bumbleworks/gui/controllers/tasks_controller.rb +13 -0
  29. data/lib/bumbleworks/gui/controllers/trackers_controller.rb +13 -0
  30. data/lib/bumbleworks/gui/version.rb +5 -0
  31. data/lib/bumbleworks/gui/views/dashboards/show.html.erb +21 -0
  32. data/lib/bumbleworks/gui/views/entities/index.html.erb +46 -0
  33. data/lib/bumbleworks/gui/views/entities/show.html.erb +9 -0
  34. data/lib/bumbleworks/gui/views/entities/types.html.erb +3 -0
  35. data/lib/bumbleworks/gui/views/expressions/actions.html.erb +11 -0
  36. data/lib/bumbleworks/gui/views/expressions/show.html.erb +32 -0
  37. data/lib/bumbleworks/gui/views/layouts/default.html.erb +58 -0
  38. data/lib/bumbleworks/gui/views/processes/index.html.erb +3 -0
  39. data/lib/bumbleworks/gui/views/processes/show.html.erb +46 -0
  40. data/lib/bumbleworks/gui/views/shared/entity_types.html.erb +23 -0
  41. data/lib/bumbleworks/gui/views/shared/expressions.html.erb +27 -0
  42. data/lib/bumbleworks/gui/views/shared/list_js_script.html.erb +29 -0
  43. data/lib/bumbleworks/gui/views/shared/processes.html.erb +45 -0
  44. data/lib/bumbleworks/gui/views/shared/tasks.html.erb +28 -0
  45. data/lib/bumbleworks/gui/views/shared/trackers.html.erb +25 -0
  46. data/lib/bumbleworks/gui/views/tasks/index.html.erb +3 -0
  47. data/lib/bumbleworks/gui/views/tasks/show.html.erb +13 -0
  48. data/lib/bumbleworks/gui/views/trackers/index.html.erb +3 -0
  49. data/lib/bumbleworks/gui/views/trackers/show.html.erb +13 -0
  50. data/spec/features/dashboard_display_spec.rb +18 -0
  51. data/spec/features/entity_administration_spec.rb +38 -0
  52. data/spec/features/expression_administration_spec.rb +48 -0
  53. data/spec/features/process_administration_spec.rb +24 -0
  54. data/spec/features/task_administration_spec.rb +22 -0
  55. data/spec/features/tracker_administration_spec.rb +23 -0
  56. data/spec/fixtures/bumbleworks_config.rb +10 -0
  57. data/spec/fixtures/entities/mock_entity.rb +38 -0
  58. data/spec/fixtures/entities/widget.rb +9 -0
  59. data/spec/fixtures/entities/widgety_fidget.rb +5 -0
  60. data/spec/fixtures/participants.rb +3 -0
  61. data/spec/fixtures/participants/naughty_participant.rb +8 -0
  62. data/spec/fixtures/processes/task_process.rb +9 -0
  63. data/spec/fixtures/processes/waiting_process.rb +8 -0
  64. data/spec/spec_helper.rb +41 -0
  65. data/spec/support/drivers/dashboard_detail.rb +5 -0
  66. data/spec/support/drivers/entity_detail.rb +9 -0
  67. data/spec/support/drivers/entity_index.rb +13 -0
  68. data/spec/support/drivers/entity_type_index.rb +11 -0
  69. data/spec/support/drivers/expression_detail.rb +11 -0
  70. data/spec/support/drivers/process_detail.rb +17 -0
  71. data/spec/support/drivers/process_index.rb +11 -0
  72. data/spec/support/drivers/task_detail.rb +5 -0
  73. data/spec/support/drivers/task_index.rb +11 -0
  74. data/spec/support/drivers/tracker_detail.rb +5 -0
  75. data/spec/support/drivers/tracker_index.rb +11 -0
  76. data/spec/support/drivers/window_driver.rb +9 -0
  77. data/spec/support/path_helpers.rb +10 -0
  78. data/spec/support/process_testing_helpers.rb +9 -0
  79. metadata +288 -0
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --format=nested
3
+ --require spec_helper
@@ -0,0 +1 @@
1
+ 1.9.3-p484
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bumbleworks-redis.gemspec
4
+
5
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Bumbleworks
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,23 @@
1
+ # Bumbleworks::Gui
2
+
3
+ A rack-based web GUI (using [Rory](http://github.com/ravigadad/rory)) for your [Bumbleworks](http://github.com/bumbleworks/bumbleworks) instance.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'bumbleworks-gui'
10
+
11
+ ## Usage
12
+
13
+ There are quite a few ways to use this - the most common, if you're using Bumbleworks in a Rails app, would probably be to mount Bumbleworks::Gui::RackApp at some path in your Rails routing - see the [Rails routing guide](http://guides.rubyonrails.org/routing.html#routing-to-rack-applications) for more info.
14
+
15
+ Or you can run it standalone using a Rack server - basically, Bumbleworks just needs to be configured, and then you can `run Bumbleworks::Gui::RackApp`.
16
+
17
+ ## Contributing
18
+
19
+ 1. Fork it
20
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
21
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
22
+ 4. Push to the branch (`git push origin my-new-feature`)
23
+ 5. Create new Pull Request
@@ -0,0 +1,9 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require 'rspec/core/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task :default => [:spec]
8
+
9
+ Rake::TaskManager.record_task_metadata = true
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'bumbleworks/gui/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "bumbleworks-gui"
8
+ spec.version = Bumbleworks::Gui::VERSION
9
+ spec.authors = ["Ravi Gadad"]
10
+ spec.email = ["ravi@renewfund.com"]
11
+ spec.description = %q{Bumbleworks web GUI for viewing/administering processes}
12
+ spec.summary = %q{This gem enables a Rory application (mountable in your own app)
13
+ to make it easier to administer your Bumbleworks instance.}
14
+ spec.homepage = ""
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files`.split($/)
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_runtime_dependency "bumbleworks", ">= 0.0.73"
23
+ spec.add_runtime_dependency "rory", ">= 0.3.11"
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.3"
26
+ spec.add_development_dependency "rake"
27
+ spec.add_development_dependency 'shotgun'
28
+ spec.add_development_dependency 'rspec'
29
+ spec.add_development_dependency 'capybara'
30
+ spec.add_development_dependency 'simplecov'
31
+ end
@@ -0,0 +1,39 @@
1
+ ENV['RORY_STAGE'] ||= ENV['RACK_ENV'] || 'development'
2
+
3
+ require 'bumbleworks/gui'
4
+
5
+ require File.expand_path(File.join('spec', 'fixtures', 'bumbleworks_config.rb'))
6
+ require File.expand_path(File.join('spec', 'support', 'process_testing_helpers.rb'))
7
+
8
+ Bumbleworks.start_worker!
9
+
10
+ Widget.truncate!
11
+ WidgetyFidget.truncate!
12
+
13
+ widget_processes = 20.times.collect do |i|
14
+ Widget.new(i).launch_process('task_process')
15
+ end
16
+
17
+ 5.times do |i|
18
+ WidgetyFidget.new(i)
19
+ end
20
+
21
+ wp = Bumbleworks.launch!('waiting_process')
22
+
23
+ wait_until { wp.reload.trackers.count == 4 }
24
+
25
+ widget_processes.first.tasks.each do |t|
26
+ t.complete
27
+ end
28
+
29
+ if ENV['MOUNT_AT']
30
+ app = Rack::Builder.new do
31
+ map ENV['MOUNT_AT'] do
32
+ run Bumbleworks::Gui::RackApp
33
+ end
34
+ end
35
+ run app
36
+ else
37
+ run Bumbleworks::Gui::RackApp
38
+ end
39
+
@@ -0,0 +1,22 @@
1
+ require "rory"
2
+ require "rack"
3
+ require 'bumbleworks'
4
+ require "bumbleworks/gui/version"
5
+ require "bumbleworks/gui/controllers/application_controller"
6
+ require 'json'
7
+
8
+ Rufus::Json.detect_backend
9
+
10
+ module Bumbleworks
11
+ module Gui
12
+ end
13
+ end
14
+
15
+ require_relative "gui/config/application"
16
+
17
+ Bumbleworks::Gui::RackApp = Rack::Builder.new {
18
+ run Bumbleworks::Gui::Application.instance
19
+ map '/assets' do
20
+ run Rack::File.new(File.join(File.dirname(__FILE__), 'gui', 'assets'))
21
+ end
22
+ }
@@ -0,0 +1,65 @@
1
+ .sort:hover {
2
+ background-color: rgb(151, 196, 241);
3
+ }
4
+ .sort:after {
5
+ width: 0;
6
+ height: 0;
7
+ border-left: 5px solid transparent;
8
+ border-right: 5px solid transparent;
9
+ border-bottom: 5px solid transparent;
10
+ content: "";
11
+ position: relative;
12
+ top: -10px;
13
+ right: -5px;
14
+ }
15
+ .sort.asc:after {
16
+ width: 0;
17
+ height: 0;
18
+ border-left: 5px solid transparent;
19
+ border-right: 5px solid transparent;
20
+ border-top: 5px solid #000;
21
+ content: "";
22
+ position: relative;
23
+ top: 13px;
24
+ right: -5px;
25
+ }
26
+ .sort.desc:after {
27
+ width: 0;
28
+ height: 0;
29
+ border-left: 5px solid transparent;
30
+ border-right: 5px solid transparent;
31
+ border-bottom: 5px solid #000;
32
+ content: "";
33
+ position: relative;
34
+ top: -10px;
35
+ right: -5px;
36
+ }
37
+
38
+ /* Definition Lists */
39
+
40
+ dt {
41
+ font-weight: bold;
42
+ font-size: 1.2em;
43
+ }
44
+
45
+ dd {
46
+ margin: 0px 0px 15px 0px;
47
+ }
48
+
49
+ /* Colored buttons */
50
+
51
+ .button-success, .button-error, .button-warning, .button-secondary {
52
+ color: white;
53
+ font-size: 0.8em;
54
+ border-radius: 4px;
55
+ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
56
+ }
57
+
58
+ .button-success { background: rgb(28, 184, 65); } /* green */
59
+ .button-error { background: rgb(202, 60, 60); } /* red */
60
+ .button-warning { background: rgb(223, 117, 20); } /* orange */
61
+ .button-secondary { background: rgb(66, 184, 221); } /* lt. blue */
62
+
63
+ .action-button-group {
64
+ width: 7.5em;
65
+ }
@@ -0,0 +1,62 @@
1
+
2
+ svg.ruote_fluo {
3
+ padding: 10px;
4
+ }
5
+
6
+ svg rect.fluo {
7
+ fill: none;
8
+ stroke: black;
9
+ stroke-width: 1.1px;
10
+ /*
11
+ rx: 14;
12
+ ry: 14;
13
+ */
14
+ }
15
+
16
+ svg path.fluo {
17
+ stroke: black;
18
+ stroke-width: 0.7px;
19
+ }
20
+
21
+ svg text {
22
+ font-family: Helvetica Neue;
23
+ font-size: 12px;
24
+ /*
25
+ fill: blue;
26
+ */
27
+ }
28
+ svg text.text_exp {
29
+ font-size: 14px;
30
+ }
31
+ svg text.expname {
32
+ font-size: 14px;
33
+ font-weight: 500;
34
+ }
35
+
36
+ svg rect.fluo_highlight {
37
+ stroke: #dedede;
38
+ stroke-width: 3px;
39
+ fill: none;
40
+ }
41
+
42
+ p.fluo.expname {
43
+ margin-bottom: 1em;
44
+ }
45
+
46
+ svg path.fluo_pin {
47
+ height: 30px;
48
+ width: 20px;
49
+ stroke: black;
50
+ stroke-width: 0.7px;
51
+ fill: blue;
52
+ }
53
+ svg text.fluo_pin {
54
+ font-size: 12px;
55
+ }
56
+ svg path.fluo_pin_workitem {
57
+ fill: yellow;
58
+ }
59
+ svg path.fluo_pin_error {
60
+ fill: red;
61
+ }
62
+
@@ -0,0 +1,203 @@
1
+ body {
2
+ color: #333;
3
+ }
4
+
5
+ a {
6
+ text-decoration: none;
7
+ color: rgb(61, 146, 201);
8
+ }
9
+ a:hover,
10
+ a:focus {
11
+ text-decoration: underline;
12
+ }
13
+
14
+ /* Add transition to containers so they can push in and out. */
15
+ #layout,
16
+ #menu,
17
+ .menu-link {
18
+ -webkit-transition: all 0.2s ease-out;
19
+ -moz-transition: all 0.2s ease-out;
20
+ -ms-transition: all 0.2s ease-out;
21
+ -o-transition: all 0.2s ease-out;
22
+ transition: all 0.2s ease-out;
23
+ }
24
+
25
+ /* This div contains the menu and content divs. */
26
+ #layout {
27
+ position: relative;
28
+ padding-left: 0;
29
+ }
30
+ #layout.active {
31
+ position: relative;
32
+ left: 150px;
33
+ }
34
+ #layout.active #menu {
35
+ left: 150px;
36
+ width: 150px;
37
+ }
38
+
39
+ #layout.active .menu-link {
40
+ left: 150px;
41
+ }
42
+ /* The content div is where all your content goes. */
43
+ .content {
44
+ margin: 0 auto;
45
+ padding: 0 2em;
46
+ max-width: 800px;
47
+ margin-bottom: 50px;
48
+ line-height: 1.6em;
49
+ }
50
+
51
+ .header {
52
+ margin: 0;
53
+ color: #333;
54
+ text-align: center;
55
+ padding: 0.2em 2em 0;
56
+ border-bottom: 1px solid #eee;
57
+ margin-bottom: 1em;
58
+ }
59
+ .header h1 {
60
+ margin: 0.2em 0;
61
+ font-size: 3em;
62
+ font-weight: 300;
63
+ }
64
+ .header h2 {
65
+ font-weight: 300;
66
+ color: #ccc;
67
+ padding: 0;
68
+ margin-top: 0;
69
+ }
70
+
71
+ .content-subhead {
72
+ margin: 50px 0 20px 0;
73
+ font-weight: 300;
74
+ color: #888;
75
+ }
76
+
77
+ /* This div contains the sidebar .pure-menu div. */
78
+
79
+ #menu {
80
+ margin-left: -150px; /* "#menu" width */
81
+ width: 150px;
82
+ position: fixed;
83
+ top: 0;
84
+ left: 0;
85
+ bottom: 0;
86
+ z-index: 1000; /* so the menu or its navicon stays above all content */
87
+ background: #191818;
88
+ overflow-y: auto;
89
+ -webkit-overflow-scrolling: touch;
90
+ }
91
+ #menu a {
92
+ color: #bbb;
93
+ border: none;
94
+ padding: 0.6em 0 0.6em 0.6em;
95
+ }
96
+
97
+ #menu .pure-menu,
98
+ #menu .pure-menu ul {
99
+ border: none;
100
+ background: transparent;
101
+ }
102
+
103
+ #menu .pure-menu ul,
104
+ #menu .pure-menu .menu-item-divided {
105
+ border-top: 1px solid #333;
106
+ }
107
+
108
+ #menu .pure-menu li a:hover,
109
+ #menu .pure-menu li a:focus {
110
+ color: #eee;
111
+ background: #333;
112
+ }
113
+
114
+ #menu .pure-menu-selected,
115
+ #menu .pure-menu-heading {
116
+ background: rgb(61, 146, 201);
117
+ }
118
+ #menu .pure-menu-selected a {
119
+ color: #fff;
120
+ }
121
+
122
+ #menu .pure-menu-heading:hover {
123
+ background: rgb(71, 166, 221);
124
+ }
125
+
126
+ #menu .pure-menu-heading {
127
+ font-size: 90%;
128
+ color: #fff;
129
+ margin: 0;
130
+ }
131
+
132
+ /* The responsive menu toggle for small screens. */
133
+
134
+ .menu-link {
135
+ position: fixed;
136
+ display: block; /* show this only on small screens */
137
+ top: 0;
138
+ left: 0; /* "#menu width" */
139
+ background: #000;
140
+ background: rgba(0,0,0,0.7);
141
+ font-size: 9px; /* change this value to increase/decrease button size */
142
+ z-index: 10;
143
+ width: 2em;
144
+ height: auto;
145
+ padding: 2.1em 1.6em;
146
+ }
147
+
148
+ .menu-link:hover,
149
+ .menu-link:focus {
150
+ background: #000;
151
+ }
152
+
153
+ .menu-link span {
154
+ position: relative;
155
+ display: block;
156
+ }
157
+
158
+ .menu-link span,
159
+ .menu-link span:before,
160
+ .menu-link span:after {
161
+ background-color: #fff;
162
+ width: 100%;
163
+ height: 1px;
164
+ }
165
+
166
+ .menu-link span:before,
167
+ .menu-link span:after {
168
+ position: absolute;
169
+ margin-top: -0.6em;
170
+ content: " ";
171
+ }
172
+
173
+ .menu-link span:after {
174
+ margin-top: 0.6em;
175
+ }
176
+
177
+ /* Media queries */
178
+ /* Hides menu at 48em */
179
+ @media (min-width: 48em) {
180
+ .header,
181
+ .content {
182
+ padding-left: 2em;
183
+ padding-right: 2em;
184
+ }
185
+
186
+ #layout {
187
+ padding-left: 150px; /* width of menu */
188
+ left: 0;
189
+ }
190
+ #menu {
191
+ left: 150px;
192
+ }
193
+
194
+ .menu-link {
195
+ position: fixed;
196
+ left: 150px;
197
+ display: none;
198
+ }
199
+
200
+ #layout.active .menu-link {
201
+ left: 150px;
202
+ }
203
+ }