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 +4 -4
- data/app/controllers/disco_app/concerns/authenticated_controller.rb +1 -1
- data/app/models/disco_app/concerns/shop.rb +5 -0
- data/app/views/disco_app/charges/new.html.erb +15 -4
- data/lib/disco_app/version.rb +1 -1
- data/lib/generators/disco_app/disco_app_generator.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5066f1c6e2468ac501dbbba2a8d316bcf8004d6bd8ab91f9f7228e886018cd7
|
4
|
+
data.tar.gz: 63c6c47b149ecfc2070c0a61582e94ff95509c9caa0280e84174b6b5521211f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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>
|
data/lib/disco_app/version.rb
CHANGED
@@ -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.
|
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.
|