disco_app 0.9.7 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2373fa9e2e7941ce1844f9a39013d2b8d776d14286e72bed6df579f106f6e9a
4
- data.tar.gz: 6c81ea01b83d76672f51351ac3ce48b306544b4009105fa00ab9221725c1146e
3
+ metadata.gz: b5066f1c6e2468ac501dbbba2a8d316bcf8004d6bd8ab91f9f7228e886018cd7
4
+ data.tar.gz: 63c6c47b149ecfc2070c0a61582e94ff95509c9caa0280e84174b6b5521211f2
5
5
  SHA512:
6
- metadata.gz: 1372f63725960c73e1b04f175a391c3c231c2fbb51ccdf2d8ad378bf95f3e276d7ad6b5395d2e2ae48a4c84bddf6bb0acfbe8ffb28fe4fe46e203554e172ca65
7
- data.tar.gz: d3903b077abe35f53643bfde624d7448d64775b1e84bb4ec80f7f940b5aaba093670f0104b4623091a3a3b5a9654d648da42053dd59ccec5f9ea5a609b6edc46
6
+ metadata.gz: c65fee2547a99e539d9b74c9e096893c619503a7ef1a74c7b5f5360fab9fa053925590156213c1579775fd2412d2b76e5ff714d13e299223a7e86df340800524
7
+ data.tar.gz: 053345110dbf0953f3b59d4b4840bd95c315fd120238b0315aee05a1343adfac10c9897eb8e40397916b9b48b5e87265e5ae1a42e895052c9bb282d2ea6b24af
@@ -42,7 +42,7 @@ module DiscoApp::Concerns::AuthenticatedController
42
42
  end
43
43
 
44
44
  def check_active_charge
45
- if @shop.current_subscription? and @shop.current_subscription.requires_active_charge? and not @shop.current_subscription.active_charge?
45
+ if @shop.current_subscription? and @shop.current_subscription.requires_active_charge? and not @shop.development? and not @shop.current_subscription.active_charge?
46
46
  redirect_if_not_current_path disco_app.new_subscription_charge_path(@shop.current_subscription)
47
47
  end
48
48
  end
@@ -23,6 +23,11 @@ module DiscoApp::Concerns::Shop
23
23
  # Alias 'with_shopify_session' as 'temp', as per our existing conventions.
24
24
  alias_method :temp, :with_shopify_session
25
25
 
26
+ # Return true if the shop is considered as in development mode.
27
+ def development?
28
+ ['staff', 'custom'].include?(plan_name)
29
+ end
30
+
26
31
  # Convenience method to check if this shop has a current subscription.
27
32
  def current_subscription?
28
33
  current_subscription.present?
@@ -3,10 +3,21 @@
3
3
  <p>
4
4
  Thanks for installing <%= DiscoApp.configuration.app_name %>!
5
5
  </p>
6
- <p>
7
- Before we start setting things up, we need you to authorize a charge for the application.
8
- </p>
6
+ <p id="account-warning"></p>
9
7
 
10
- <%= form_tag disco_app.subscription_charges_path(@subscription), method: 'POST', target: '_parent' do %>
8
+ <%= form_tag disco_app.subscription_charges_path(@subscription), id: 'install-ok', method: 'POST', target: '_parent' do %>
11
9
  <%= submit_tag 'Okay', class: 'form-input' %>
12
10
  <% end %>
11
+
12
+ <script>
13
+ ShopifyApp.ready(function(){
14
+ var container = document.getElementById('account-warning');
15
+ if (ShopifyApp.User.current.accountAccess === "Account owner") {
16
+ container.innerHTML = "Before we start setting things up, we need you to authorize a charge for the application."
17
+ } else {
18
+ container.innerHTML = "Since you're not the account owner, you won't be able to setup a charge. Ask the account owner to install the app."
19
+ var okButton = document.getElementById('install-ok');
20
+ okButton.parentElement.removeChild(okButton);
21
+ }
22
+ });
23
+ </script>
@@ -1,3 +1,3 @@
1
1
  module DiscoApp
2
- VERSION = '0.9.7'
2
+ VERSION = '0.9.8'
3
3
  end
@@ -39,7 +39,7 @@ class DiscoAppGenerator < Rails::Generators::Base
39
39
  gem 'classnames-rails', '~> 2.1.5'
40
40
  gem 'active_link_to', '~> 1.0.2'
41
41
  gem 'premailer-rails', '~> 1.8.2'
42
- gem 'nokogiri', '~> 1.6.7.2'
42
+ gem 'nokogiri', '~> 1.6.8'
43
43
  gem 'render_anywhere', '~> 0.0.12', require: false
44
44
 
45
45
  # Add gems for development and testing only.
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.9.7
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Ballard