disco_app 0.8.9 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/disco_app/icons.svg +0 -0
  3. data/app/assets/javascripts/disco_app/components/{filterable_shop_list.js.jsx → custom/filterable_shop_list.js.jsx} +1 -1
  4. data/app/assets/javascripts/disco_app/components/custom/inline-radio-options.es6.jsx +59 -0
  5. data/app/assets/javascripts/disco_app/components/custom/rules-editor.es6.jsx +360 -0
  6. data/app/assets/javascripts/disco_app/components/{shop_list.js.jsx → custom/shop_list.js.jsx} +9 -11
  7. data/app/assets/javascripts/disco_app/components/custom/shop_row.js.jsx +43 -0
  8. data/app/assets/javascripts/disco_app/components/ui-kit/cards/card-section.es6.jsx +30 -0
  9. data/app/assets/javascripts/disco_app/components/ui-kit/cards/card.es6.jsx +9 -0
  10. data/app/assets/javascripts/disco_app/components/ui-kit/cards/cart-section-title.es6.jsx +7 -0
  11. data/app/assets/javascripts/disco_app/components/ui-kit/forms/base_form.es6.jsx +72 -0
  12. data/app/assets/javascripts/disco_app/components/ui-kit/forms/base_input.es6.jsx +20 -0
  13. data/app/assets/javascripts/disco_app/components/ui-kit/forms/button.es6.jsx +13 -0
  14. data/app/assets/javascripts/disco_app/components/ui-kit/forms/input-radio.es6.jsx +30 -0
  15. data/app/assets/javascripts/disco_app/components/ui-kit/forms/input-select.es6.jsx +39 -0
  16. data/app/assets/javascripts/disco_app/components/ui-kit/forms/input-text.es6.jsx +59 -0
  17. data/app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx +48 -0
  18. data/app/assets/javascripts/disco_app/components/ui-kit/icons/icon-chevron.es6.jsx +33 -0
  19. data/app/assets/javascripts/disco_app/components/ui-kit/icons/next-icon.es6.jsx +18 -0
  20. data/app/assets/javascripts/disco_app/components/ui-kit/input_select.es6.jsx +21 -0
  21. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-annotated-section.es6.jsx +29 -0
  22. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-empty-state.es6.jsx +35 -0
  23. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-footer-help.es6.jsx +13 -0
  24. data/app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-page-actions.es6.jsx +39 -0
  25. data/app/assets/javascripts/disco_app/components.js +1 -4
  26. data/app/assets/javascripts/disco_app/disco_app.js +3 -0
  27. data/app/assets/javascripts/disco_app/ui-kit.js +1 -0
  28. data/app/assets/stylesheets/disco_app/admin/_header.scss +66 -0
  29. data/app/assets/stylesheets/disco_app/admin/_layout.scss +40 -0
  30. data/app/assets/stylesheets/disco_app/admin/_nav.scss +172 -0
  31. data/app/assets/stylesheets/disco_app/admin.scss +11 -0
  32. data/app/assets/stylesheets/disco_app/disco_app.scss +12 -12
  33. data/app/assets/stylesheets/disco_app/{disco/mixins → mixins}/_flexbox.scss +6 -0
  34. data/app/assets/stylesheets/disco_app/ui-kit/_ui-empty-state.scss +94 -0
  35. data/app/assets/stylesheets/disco_app/ui-kit/_ui-footer-help.scss +25 -0
  36. data/app/assets/stylesheets/disco_app/ui-kit/_ui-icons.scss +28 -0
  37. data/app/assets/stylesheets/disco_app/ui-kit/_ui-kit.scss +5086 -0
  38. data/app/assets/stylesheets/disco_app/ui-kit/_ui-layout.scss +10 -0
  39. data/app/assets/stylesheets/disco_app/ui-kit/_ui-page-actions.scss +21 -0
  40. data/app/assets/stylesheets/disco_app/{disco/_tabs.scss → ui-kit/_ui-tabs.scss} +3 -1
  41. data/app/assets/stylesheets/disco_app/ui-kit/_ui-type.scss +13 -0
  42. data/app/controllers/disco_app/admin/concerns/plans_controller.rb +8 -5
  43. data/app/controllers/disco_app/admin/concerns/subscriptions_controller.rb +32 -0
  44. data/app/controllers/disco_app/admin/subscriptions_controller.rb +3 -0
  45. data/app/helpers/disco_app/application_helper.rb +22 -0
  46. data/app/models/disco_app/concerns/plan.rb +2 -2
  47. data/app/models/disco_app/concerns/shop.rb +0 -4
  48. data/app/models/disco_app/concerns/subscription.rb +12 -0
  49. data/app/resources/disco_app/admin/resources/concerns/shop_resource.rb +40 -3
  50. data/app/views/disco_app/admin/plans/_form.html.erb +18 -21
  51. data/app/views/disco_app/admin/plans/_plan_code_fields.html.erb +15 -0
  52. data/app/views/disco_app/admin/plans/index.html.erb +2 -0
  53. data/app/views/disco_app/admin/shops/index.html.erb +2 -1
  54. data/app/views/disco_app/admin/subscriptions/edit.html.erb +33 -0
  55. data/app/views/disco_app/shared/_icons.html.erb +3 -0
  56. data/app/views/layouts/admin/_nav_items.erb +20 -0
  57. data/app/views/layouts/admin.html.erb +53 -9
  58. data/app/views/layouts/embedded_app.html.erb +2 -0
  59. data/app/views/layouts/embedded_app_modal.html.erb +11 -0
  60. data/config/routes.rb +4 -2
  61. data/lib/disco_app/engine.rb +2 -1
  62. data/lib/disco_app/version.rb +1 -1
  63. data/lib/generators/disco_app/disco_app_generator.rb +35 -2
  64. data/lib/generators/disco_app/templates/assets/javascripts/components.js +3 -0
  65. data/lib/generators/disco_app/templates/config/database.yml.tt +20 -0
  66. data/lib/tasks/database.rake +8 -0
  67. data/test/controllers/disco_app/charges_controller_test.rb +9 -2
  68. data/test/fixtures/api/widget_store/charges/create_recurring_application_charge_request.json +1 -1
  69. data/test/fixtures/api/widget_store/charges/create_second_recurring_application_charge_request.json +1 -1
  70. data/test/fixtures/disco_app/subscriptions.yml +1 -0
  71. data/test/models/disco_app/subscription_test.rb +19 -0
  72. data/test/services/disco_app/charges_service_test.rb +9 -2
  73. data/test/test_helper.rb +3 -0
  74. metadata +80 -21
  75. data/app/assets/javascripts/disco_app/components/shop_row.js.jsx +0 -27
  76. data/app/assets/stylesheets/disco_app/bootstrap/_custom.scss +0 -54
  77. data/app/assets/stylesheets/disco_app/bootstrap/_variables.scss +0 -872
  78. data/app/assets/stylesheets/disco_app/disco/_buttons.scss +0 -31
  79. data/app/assets/stylesheets/disco_app/disco/_cards.scss +0 -52
  80. data/app/assets/stylesheets/disco_app/disco/_forms.scss +0 -23
  81. data/app/assets/stylesheets/disco_app/disco/_grid.scss +0 -58
  82. data/app/assets/stylesheets/disco_app/disco/_sections.scss +0 -61
  83. data/app/assets/stylesheets/disco_app/disco/_tables.scss +0 -57
  84. data/app/assets/stylesheets/disco_app/disco/_type.scss +0 -39
  85. data/app/views/layouts/admin/_navbar.html.erb +0 -25
  86. data/lib/generators/disco_app/adminify/adminify_generator.rb +0 -35
  87. data/lib/generators/disco_app/reactify/reactify_generator.rb +0 -45
  88. /data/app/assets/javascripts/disco_app/components/{shop_filter_tab.js.jsx → custom/shop_filter_tab.js.jsx} +0 -0
  89. /data/app/assets/javascripts/disco_app/components/{shop_filter_tabs.js.jsx → custom/shop_filter_tabs.js.jsx} +0 -0
  90. /data/app/assets/javascripts/disco_app/components/{shopify_admin_link.js.jsx → custom/shopify_admin_link.js.jsx} +0 -0
@@ -5,6 +5,7 @@ require 'turbolinks'
5
5
  require 'activerecord/session_store'
6
6
  require 'disco_app/session'
7
7
  require 'jsonapi-resources'
8
+ require 'react-rails'
8
9
 
9
10
  module DiscoApp
10
11
  class Engine < ::Rails::Engine
@@ -19,7 +20,7 @@ module DiscoApp
19
20
 
20
21
  # Ensure our frame assets are included for precompilation.
21
22
  initializer 'disco_app.assets.precompile' do |app|
22
- app.config.assets.precompile += %w(disco_app/icon.svg disco_app/frame.css disco_app/frame.js)
23
+ app.config.assets.precompile += %w(disco_app/icon.svg disco_app/admin.css disco_app/frame.css disco_app/frame.js)
23
24
  end
24
25
 
25
26
  end
@@ -1,3 +1,3 @@
1
1
  module DiscoApp
2
- VERSION = '0.8.9'
2
+ VERSION = '0.9.0'
3
3
  end
@@ -35,10 +35,13 @@ class DiscoAppGenerator < Rails::Generators::Base
35
35
  gem 'activeresource', github: 'shopify/activeresource', tag: '4.2-threadsafe'
36
36
  gem 'rails-bigint-pk', '~> 1.2.0'
37
37
  gem 'acts_as_singleton', '~> 0.0.8'
38
+ gem 'pg', '~> 0.18.3'
39
+ gem 'react-rails', '~> 1.6.0'
40
+ gem 'classnames-rails', '~> 2.1.5'
41
+ gem 'active_link_to', '~> 1.0.2'
38
42
 
39
43
  # Add gems for development and testing only.
40
44
  gem_group :development, :test do
41
- gem 'sqlite3', '~> 1.3.11'
42
45
  gem 'dotenv-rails', '~> 2.0.2'
43
46
  gem 'minitest-reporters', '~> 1.0.19'
44
47
  gem 'guard', '~> 2.13.0'
@@ -47,11 +50,15 @@ class DiscoAppGenerator < Rails::Generators::Base
47
50
 
48
51
  # Add gems for production only.
49
52
  gem_group :production do
50
- gem 'pg', '~> 0.18.3'
51
53
  gem 'rails_12factor', '~> 0.0.3'
52
54
  end
53
55
  end
54
56
 
57
+ # copy template for pg configuration
58
+ def update_database_config
59
+ template 'config/database.yml.tt'
60
+ end
61
+
55
62
  # Run bundle install to add our new gems before running tasks.
56
63
  def bundle_install
57
64
  Bundler.with_clean_env do
@@ -65,6 +72,10 @@ class DiscoAppGenerator < Rails::Generators::Base
65
72
  # Uncomment to ensure config.force_ssl = true in production.
66
73
  uncomment_lines 'config/environments/production.rb', /force_ssl/
67
74
 
75
+ # Set server side rendereing for components.js
76
+ application "config.react.server_renderer_options = {\nfiles: ['components.js'], # files to load for prerendering\n}"
77
+ application "# Enable server side react rendering"
78
+
68
79
  # Set defaults for various charge attributes.
69
80
  application "config.x.shopify_charges_default_trial_days = 14\n"
70
81
  application "config.x.shopify_charges_default_price = 10.00"
@@ -94,6 +105,12 @@ class DiscoAppGenerator < Rails::Generators::Base
94
105
  application "routes.default_url_options[:host] = ENV['DEFAULT_HOST']\n"
95
106
  application "# Set the default host for absolute URL routing purposes"
96
107
 
108
+ # Configure React in development and production.
109
+ application "config.react.variant = :development", env: :development
110
+ application "# Use development variant of React in development.", env: :development
111
+ application "config.react.variant = :production", env: :production
112
+ application "# Use production variant of React in production.", env: :production
113
+
97
114
  # Copy over the default puma configuration.
98
115
  copy_file 'config/puma.rb', 'config/puma.rb'
99
116
  end
@@ -108,6 +125,7 @@ class DiscoAppGenerator < Rails::Generators::Base
108
125
  generate 'shopify_app:install'
109
126
  generate 'shopify_app:home_controller'
110
127
  generate 'bigint_pk:install'
128
+ generate 'react:install'
111
129
  end
112
130
 
113
131
  # Copy template files to the appropriate location. In some cases, we'll be
@@ -125,6 +143,7 @@ class DiscoAppGenerator < Rails::Generators::Base
125
143
 
126
144
  # Copy assets
127
145
  copy_file 'assets/javascripts/application.js', 'app/assets/javascripts/application.js'
146
+ copy_file 'assets/javascripts/components.js', 'app/assets/javascripts/components.js'
128
147
  copy_file 'assets/stylesheets/application.scss', 'app/assets/stylesheets/application.scss'
129
148
 
130
149
  # Remove application.css
@@ -145,6 +164,11 @@ class DiscoAppGenerator < Rails::Generators::Base
145
164
  rake 'disco_app:install:migrations'
146
165
  end
147
166
 
167
+ # Create PG database
168
+ def create_database
169
+ rake 'db:create'
170
+ end
171
+
148
172
  # Run migrations.
149
173
  def migrate
150
174
  rake 'db:migrate'
@@ -161,4 +185,13 @@ class DiscoAppGenerator < Rails::Generators::Base
161
185
  prepend_to_file 'Gemfile', "ruby '2.3.0'\n"
162
186
  end
163
187
 
188
+ private
189
+
190
+ # This method of finding the component.js manifest taken from the
191
+ # install generator in react-rails.
192
+ # See https://github.com/reactjs/react-rails/blob/3f0af13fa755d6e95969c17728d0354c234f3a37/lib/generators/react/install_generator.rb#L53-L55
193
+ def components
194
+ Pathname.new(destination_root).join('app/assets/javascripts', 'components.js')
195
+ end
196
+
164
197
  end
@@ -0,0 +1,3 @@
1
+ //= require react-server
2
+ //= require disco_app/components
3
+ //= require_tree ./components
@@ -0,0 +1,20 @@
1
+ default: &default
2
+ adapter: postgresql
3
+ encoding: unicode
4
+ pool: 5
5
+ timeout: 5000
6
+
7
+ development:
8
+ <<: *default
9
+ host: localhost
10
+ port: 5432
11
+ database: <%= Rails.application.class.parent_name.downcase %>
12
+
13
+ test:
14
+ <<: *default
15
+ host: localhost
16
+ port: 5432
17
+ database: <%= Rails.application.class.parent_name.downcase %>_test
18
+
19
+ production:
20
+ <<: *default
@@ -0,0 +1,8 @@
1
+ namespace :database do
2
+ desc "update postgres sequence numbers in case database has been migrated"
3
+ task update_sequences: :environment do
4
+ ActiveRecord::Base.connection.tables.each do |t|
5
+ ActiveRecord::Base.connection.reset_pk_sequence!(t)
6
+ end
7
+ end
8
+ end
@@ -43,8 +43,15 @@ class DiscoApp::ChargesControllerTest < ActionController::TestCase
43
43
  end
44
44
 
45
45
  test 'user with unpaid current subscription can create new charge and is redirected to confirmation url' do
46
- skip('some indeterminancy in this test')
47
- stub_api_request(:post, "#{@shop.admin_url}/recurring_application_charges.json", 'widget_store/charges/create_second_recurring_application_charge')
46
+ res = { "recurring_application_charge": { "name": "Basic",
47
+ "price": "9.99",
48
+ "trial_days": 14,
49
+ "return_url": /^https:\/\/test\.example\.com\/subscriptions\/304261385\/charges\/53297050(1|2)\/activate$/,
50
+ "test": true
51
+ } }
52
+ stub_request(:post, "#{@shop.admin_url}/recurring_application_charges.json")
53
+ .with(body: res
54
+ ).to_return(status: 201, body:api_fixture("widget_store/charges/create_second_recurring_application_charge_response").to_json)
48
55
 
49
56
  @current_subscription.active_charge.destroy
50
57
  post(:create, subscription_id: @current_subscription)
@@ -3,7 +3,7 @@
3
3
  "name": "Basic",
4
4
  "price": "9.99",
5
5
  "trial_days": 14,
6
- "return_url": "https://test.example.com/subscriptions/304261385/charges/532970501/activate",
6
+ "return_url": /^https:\/\/test\.example\.com\/subscriptions\/304261385\/charges\/53297050(1|2)\/activate$/,
7
7
  "test": true
8
8
  }
9
9
  }
@@ -3,7 +3,7 @@
3
3
  "name": "Basic",
4
4
  "price": "9.99",
5
5
  "trial_days": 14,
6
- "return_url": "https://test.example.com/subscriptions/304261385/charges/532970502/activate",
6
+ "return_url": /^https:\/\/test\.example\.com\/subscriptions\/304261385\/charges\/53297050(1|2)\/activate$/,
7
7
  "test": true
8
8
  }
9
9
  }
@@ -10,6 +10,7 @@ current_widget_store_subscription:
10
10
  shop: widget_store
11
11
  plan: basic
12
12
  amount: 999
13
+ trial_period_days: 14
13
14
  status: <%= DiscoApp::Subscription.statuses[:active] %>
14
15
  subscription_type: 0
15
16
 
@@ -0,0 +1,19 @@
1
+ require 'test_helper'
2
+
3
+ class DiscoApp::SubscriptionTest < ActiveSupport::TestCase
4
+
5
+ def setup
6
+ @shop = disco_app_shops(:widget_store)
7
+ end
8
+
9
+ def teardown
10
+ @shop = nil
11
+ end
12
+
13
+ test 'changing the amount on a subscription cancels its charge' do
14
+ assert @shop.current_subscription.active_charge?
15
+ @shop.current_subscription.update(amount: 1138)
16
+ assert_not @shop.current_subscription.active_charge?
17
+ end
18
+
19
+ end
@@ -30,8 +30,15 @@ class DiscoApp::ChargesServiceTest < ActiveSupport::TestCase
30
30
  end
31
31
 
32
32
  test 'creating a new charge for a recurring subscription is successful' do
33
- skip('some indeterminancy in this test')
34
- stub_api_request(:post, "#{@shop.admin_url}/recurring_application_charges.json", 'widget_store/charges/create_recurring_application_charge')
33
+ res = { "recurring_application_charge": { "name": "Basic",
34
+ "price": "9.99",
35
+ "trial_days": 14,
36
+ "return_url": /^https:\/\/test\.example\.com\/subscriptions\/304261385\/charges\/53297050(1|2)\/activate$/,
37
+ "test": true
38
+ } }
39
+ stub_request(:post, "#{@shop.admin_url}/recurring_application_charges.json")
40
+ .with(body: res
41
+ ).to_return(status: 201, body:api_fixture("widget_store/charges/create_recurring_application_charge_response").to_json)
35
42
 
36
43
  new_charge = DiscoApp::ChargesService.create(@shop, @subscription)
37
44
  assert_equal 654381179, new_charge.shopify_id
data/test/test_helper.rb CHANGED
@@ -1,3 +1,6 @@
1
+ # Prevent warnings from showing up during testing.
2
+ $VERBOSE=nil
3
+
1
4
  # Configure Rails Environment
2
5
  ENV['RAILS_ENV'] = 'test'
3
6
  ENV['DEFAULT_HOST'] = 'https://test.example.com'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: disco_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.9
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Ballard
@@ -192,6 +192,34 @@ dependencies:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
194
  version: 0.7.0
195
+ - !ruby/object:Gem::Dependency
196
+ name: react-rails
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: 1.6.0
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: 1.6.0
209
+ - !ruby/object:Gem::Dependency
210
+ name: classnames-rails
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: 2.1.5
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: 2.1.5
195
223
  - !ruby/object:Gem::Dependency
196
224
  name: sqlite3
197
225
  requirement: !ruby/object:Gem::Requirement
@@ -285,42 +313,67 @@ extra_rdoc_files: []
285
313
  files:
286
314
  - Rakefile
287
315
  - app/assets/images/disco_app/icon.svg
316
+ - app/assets/images/disco_app/icons.svg
288
317
  - app/assets/javascripts/disco_app/components.js
289
- - app/assets/javascripts/disco_app/components/filterable_shop_list.js.jsx
290
- - app/assets/javascripts/disco_app/components/shop_filter_tab.js.jsx
291
- - app/assets/javascripts/disco_app/components/shop_filter_tabs.js.jsx
292
- - app/assets/javascripts/disco_app/components/shop_list.js.jsx
293
- - app/assets/javascripts/disco_app/components/shop_row.js.jsx
294
- - app/assets/javascripts/disco_app/components/shopify_admin_link.js.jsx
318
+ - app/assets/javascripts/disco_app/components/custom/filterable_shop_list.js.jsx
319
+ - app/assets/javascripts/disco_app/components/custom/inline-radio-options.es6.jsx
320
+ - app/assets/javascripts/disco_app/components/custom/rules-editor.es6.jsx
321
+ - app/assets/javascripts/disco_app/components/custom/shop_filter_tab.js.jsx
322
+ - app/assets/javascripts/disco_app/components/custom/shop_filter_tabs.js.jsx
323
+ - app/assets/javascripts/disco_app/components/custom/shop_list.js.jsx
324
+ - app/assets/javascripts/disco_app/components/custom/shop_row.js.jsx
325
+ - app/assets/javascripts/disco_app/components/custom/shopify_admin_link.js.jsx
326
+ - app/assets/javascripts/disco_app/components/ui-kit/cards/card-section.es6.jsx
327
+ - app/assets/javascripts/disco_app/components/ui-kit/cards/card.es6.jsx
328
+ - app/assets/javascripts/disco_app/components/ui-kit/cards/cart-section-title.es6.jsx
329
+ - app/assets/javascripts/disco_app/components/ui-kit/forms/base_form.es6.jsx
330
+ - app/assets/javascripts/disco_app/components/ui-kit/forms/base_input.es6.jsx
331
+ - app/assets/javascripts/disco_app/components/ui-kit/forms/button.es6.jsx
332
+ - app/assets/javascripts/disco_app/components/ui-kit/forms/input-radio.es6.jsx
333
+ - app/assets/javascripts/disco_app/components/ui-kit/forms/input-select.es6.jsx
334
+ - app/assets/javascripts/disco_app/components/ui-kit/forms/input-text.es6.jsx
335
+ - app/assets/javascripts/disco_app/components/ui-kit/forms/input-textarea.es6.jsx
336
+ - app/assets/javascripts/disco_app/components/ui-kit/icons/icon-chevron.es6.jsx
337
+ - app/assets/javascripts/disco_app/components/ui-kit/icons/next-icon.es6.jsx
338
+ - app/assets/javascripts/disco_app/components/ui-kit/input_select.es6.jsx
339
+ - app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-annotated-section.es6.jsx
340
+ - app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-empty-state.es6.jsx
341
+ - app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-footer-help.es6.jsx
342
+ - app/assets/javascripts/disco_app/components/ui-kit/ui-layout/ui-page-actions.es6.jsx
295
343
  - app/assets/javascripts/disco_app/disco_app.js
296
344
  - app/assets/javascripts/disco_app/frame.js
297
345
  - app/assets/javascripts/disco_app/shopify-turbolinks.js
298
- - app/assets/stylesheets/disco_app/bootstrap/_custom.scss
299
- - app/assets/stylesheets/disco_app/bootstrap/_variables.scss
300
- - app/assets/stylesheets/disco_app/disco/_buttons.scss
301
- - app/assets/stylesheets/disco_app/disco/_cards.scss
302
- - app/assets/stylesheets/disco_app/disco/_forms.scss
303
- - app/assets/stylesheets/disco_app/disco/_grid.scss
304
- - app/assets/stylesheets/disco_app/disco/_sections.scss
305
- - app/assets/stylesheets/disco_app/disco/_tables.scss
306
- - app/assets/stylesheets/disco_app/disco/_tabs.scss
307
- - app/assets/stylesheets/disco_app/disco/_type.scss
308
- - app/assets/stylesheets/disco_app/disco/mixins/_flexbox.scss
346
+ - app/assets/javascripts/disco_app/ui-kit.js
347
+ - app/assets/stylesheets/disco_app/admin.scss
348
+ - app/assets/stylesheets/disco_app/admin/_header.scss
349
+ - app/assets/stylesheets/disco_app/admin/_layout.scss
350
+ - app/assets/stylesheets/disco_app/admin/_nav.scss
309
351
  - app/assets/stylesheets/disco_app/disco_app.scss
310
352
  - app/assets/stylesheets/disco_app/frame.scss
311
353
  - app/assets/stylesheets/disco_app/frame/_buttons.scss
312
354
  - app/assets/stylesheets/disco_app/frame/_forms.scss
313
355
  - app/assets/stylesheets/disco_app/frame/_layout.scss
314
356
  - app/assets/stylesheets/disco_app/frame/_type.scss
357
+ - app/assets/stylesheets/disco_app/mixins/_flexbox.scss
358
+ - app/assets/stylesheets/disco_app/ui-kit/_ui-empty-state.scss
359
+ - app/assets/stylesheets/disco_app/ui-kit/_ui-footer-help.scss
360
+ - app/assets/stylesheets/disco_app/ui-kit/_ui-icons.scss
361
+ - app/assets/stylesheets/disco_app/ui-kit/_ui-kit.scss
362
+ - app/assets/stylesheets/disco_app/ui-kit/_ui-layout.scss
363
+ - app/assets/stylesheets/disco_app/ui-kit/_ui-page-actions.scss
364
+ - app/assets/stylesheets/disco_app/ui-kit/_ui-tabs.scss
365
+ - app/assets/stylesheets/disco_app/ui-kit/_ui-type.scss
315
366
  - app/controllers/disco_app/admin/app_settings_controller.rb
316
367
  - app/controllers/disco_app/admin/application_controller.rb
317
368
  - app/controllers/disco_app/admin/concerns/app_settings_controller.rb
318
369
  - app/controllers/disco_app/admin/concerns/authenticated_controller.rb
319
370
  - app/controllers/disco_app/admin/concerns/plans_controller.rb
320
371
  - app/controllers/disco_app/admin/concerns/shops_controller.rb
372
+ - app/controllers/disco_app/admin/concerns/subscriptions_controller.rb
321
373
  - app/controllers/disco_app/admin/plans_controller.rb
322
374
  - app/controllers/disco_app/admin/resources/shops_controller.rb
323
375
  - app/controllers/disco_app/admin/shops_controller.rb
376
+ - app/controllers/disco_app/admin/subscriptions_controller.rb
324
377
  - app/controllers/disco_app/charges_controller.rb
325
378
  - app/controllers/disco_app/concerns/app_proxy_controller.rb
326
379
  - app/controllers/disco_app/concerns/authenticated_controller.rb
@@ -367,10 +420,12 @@ files:
367
420
  - app/services/disco_app/webhook_service.rb
368
421
  - app/views/disco_app/admin/app_settings/edit.html.erb
369
422
  - app/views/disco_app/admin/plans/_form.html.erb
423
+ - app/views/disco_app/admin/plans/_plan_code_fields.html.erb
370
424
  - app/views/disco_app/admin/plans/edit.html.erb
371
425
  - app/views/disco_app/admin/plans/index.html.erb
372
426
  - app/views/disco_app/admin/plans/new.html.erb
373
427
  - app/views/disco_app/admin/shops/index.html.erb
428
+ - app/views/disco_app/admin/subscriptions/edit.html.erb
374
429
  - app/views/disco_app/charges/activate.html.erb
375
430
  - app/views/disco_app/charges/create.html.erb
376
431
  - app/views/disco_app/charges/new.html.erb
@@ -379,10 +434,11 @@ files:
379
434
  - app/views/disco_app/install/uninstalling.html.erb
380
435
  - app/views/disco_app/proxy_errors/404.html.erb
381
436
  - app/views/disco_app/shared/_card.html.erb
437
+ - app/views/disco_app/shared/_icons.html.erb
382
438
  - app/views/disco_app/shared/_section.html.erb
383
439
  - app/views/disco_app/subscriptions/new.html.erb
384
440
  - app/views/layouts/admin.html.erb
385
- - app/views/layouts/admin/_navbar.html.erb
441
+ - app/views/layouts/admin/_nav_items.erb
386
442
  - app/views/layouts/application.html.erb
387
443
  - app/views/layouts/embedded_app.html.erb
388
444
  - app/views/layouts/embedded_app_modal.html.erb
@@ -419,15 +475,15 @@ files:
419
475
  - lib/disco_app/test_help.rb
420
476
  - lib/disco_app/version.rb
421
477
  - lib/generators/disco_app/USAGE
422
- - lib/generators/disco_app/adminify/adminify_generator.rb
423
478
  - lib/generators/disco_app/disco_app_generator.rb
424
479
  - lib/generators/disco_app/mailify/mailify_generator.rb
425
480
  - lib/generators/disco_app/monitorify/monitorify_generator.rb
426
481
  - lib/generators/disco_app/monitorify/templates/config/newrelic.yml
427
482
  - lib/generators/disco_app/monitorify/templates/initializers/rollbar.rb
428
- - lib/generators/disco_app/reactify/reactify_generator.rb
429
483
  - lib/generators/disco_app/templates/assets/javascripts/application.js
484
+ - lib/generators/disco_app/templates/assets/javascripts/components.js
430
485
  - lib/generators/disco_app/templates/assets/stylesheets/application.scss
486
+ - lib/generators/disco_app/templates/config/database.yml.tt
431
487
  - lib/generators/disco_app/templates/config/puma.rb
432
488
  - lib/generators/disco_app/templates/controllers/home_controller.rb
433
489
  - lib/generators/disco_app/templates/initializers/disco_app.rb
@@ -437,6 +493,7 @@ files:
437
493
  - lib/generators/disco_app/templates/root/Procfile
438
494
  - lib/generators/disco_app/templates/views/home/index.html.erb
439
495
  - lib/tasks/carrier_service.rake
496
+ - lib/tasks/database.rake
440
497
  - lib/tasks/sessions.rake
441
498
  - lib/tasks/start.rake
442
499
  - lib/tasks/webhooks.rake
@@ -533,6 +590,7 @@ files:
533
590
  - test/models/disco_app/plan_test.rb
534
591
  - test/models/disco_app/session_test.rb
535
592
  - test/models/disco_app/shop_test.rb
593
+ - test/models/disco_app/subscription_test.rb
536
594
  - test/services/disco_app/charges_service_test.rb
537
595
  - test/services/disco_app/subscription_service_test.rb
538
596
  - test/support/test_file_fixtures.rb
@@ -659,5 +717,6 @@ test_files:
659
717
  - test/models/disco_app/plan_test.rb
660
718
  - test/models/disco_app/shop_test.rb
661
719
  - test/models/disco_app/session_test.rb
720
+ - test/models/disco_app/subscription_test.rb
662
721
  - test/services/disco_app/charges_service_test.rb
663
722
  - test/services/disco_app/subscription_service_test.rb
@@ -1,27 +0,0 @@
1
- var ShopRow = (props) => {
2
-
3
- var shop = props.shop,
4
- editShopUrl = props.editShopUrl.replace(':id', shop.id),
5
- shopifyDomain = shop.attributes['shopify_domain'],
6
- countryName = shop.attributes['country_name'],
7
- currency = shop.attributes['currency'],
8
- domainName = shop.attributes['domain'],
9
- planName = shop.attributes['plan_display_name'],
10
- prettyCreatedDate = shop.attributes['pretty_created_at'],
11
- installedDuration = shop.attributes['installed_duration'];
12
-
13
- return (
14
- <tr>
15
- <td><a href={editShopUrl}>#{shop.id}</a></td>
16
- <td>{shopifyDomain}</td>
17
- <td>{shop.attributes.status}</td>
18
- <td>{shop.attributes.email}</td>
19
- <td>{countryName}</td>
20
- <td>{shop.attributes.currency}</td>
21
- <td>{shop.attributes.domain}</td>
22
- <td>{planName}</td>
23
- <td>{prettyCreatedDate}</td>
24
- <td>{installedDuration}</td>
25
- </tr>
26
- )
27
- };
@@ -1,54 +0,0 @@
1
- //
2
- // Select the Bootstrap components to pull in.
3
- // --------------------------------------------------
4
-
5
- // Core variables and mixins
6
- @import "bootstrap/variables";
7
- @import "bootstrap/mixins";
8
-
9
- // Reset and dependencies
10
- @import "bootstrap/normalize";
11
- //@import "bootstrap/print";
12
- //@import "bootstrap/glyphicons";
13
-
14
- // Core CSS
15
- @import "bootstrap/scaffolding";
16
- @import "bootstrap/type";
17
- //@import "bootstrap/code";
18
- @import "bootstrap/grid";
19
- //@import "bootstrap/tables";
20
- @import "bootstrap/forms";
21
- @import "bootstrap/buttons";
22
-
23
- // Components
24
- @import "bootstrap/component-animations";
25
- @import "bootstrap/dropdowns";
26
- @import "bootstrap/button-groups";
27
- @import "bootstrap/input-groups";
28
- @import "bootstrap/navs";
29
- @import "bootstrap/navbar";
30
- //@import "bootstrap/breadcrumbs";
31
- //@import "bootstrap/pagination";
32
- //@import "bootstrap/pager";
33
- @import "bootstrap/labels";
34
- @import "bootstrap/badges";
35
- //@import "bootstrap/jumbotron";
36
- @import "bootstrap/thumbnails";
37
- @import "bootstrap/alerts";
38
- @import "bootstrap/progress-bars";
39
- @import "bootstrap/media";
40
- @import "bootstrap/list-group";
41
- @import "bootstrap/panels";
42
- //@import "bootstrap/responsive-embed";
43
- //@import "bootstrap/wells";
44
- @import "bootstrap/close";
45
-
46
- // Components w/ JavaScript
47
- //@import "bootstrap/modals";
48
- //@import "bootstrap/tooltip";
49
- //@import "bootstrap/popovers";
50
- //@import "bootstrap/carousel";
51
-
52
- // Utility classes
53
- @import "bootstrap/utilities";
54
- @import "bootstrap/responsive-utilities";