app_manager 1.3.9 → 1.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dfdd07111c73c3c82b14f21099777f2b8f173e5ee38a8a8bd2eb1413993690f
4
- data.tar.gz: 23e680f4470a0ac86745fc51379f60770e75d9391f02758a9152930afe42c463
3
+ metadata.gz: 323da6aca37d494397aea55d292e70a76b0a7280116fbda06eef42a23359147b
4
+ data.tar.gz: 9e73448ce7fd0d997780dde01638c8d9c342a9408faf58e28fe231d65b577a7b
5
5
  SHA512:
6
- metadata.gz: 64f68a22812c58a5cb3c2156b8dc1a5d8c0d95a216b61d5bc145494ca53157e3faa424be03cee86bf93a4b5d5466b1e2e2076960e5ef8fd770be91980e38d909
7
- data.tar.gz: a014b7af9a38fecdd17cebb6d978984cfa95fae711931fca5968a7c1d4160d758acb264e677e9be36a584ca4ee1ca7194739a6dff16784e8b7998c54081f102c
6
+ metadata.gz: 12b8049dcef01005dce9b9debba9a0eb1d9921e73d4af6d629fb68fbb028711a26d9942031ed654bb93da656a2674e35d891f6bc6acf5b335db646e2a8698978
7
+ data.tar.gz: 62f134c579d43e5187bc0a8cb3c6dd172e36f8b040f2e2421657b7072ac4c7f0ccff910c333f79097380149db8dc4c15c98bcd309e947e347059314f92905a4b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_manager (1.3.9)
4
+ app_manager (1.4.0)
5
5
  activerecord-import (~> 1.4)
6
6
  httparty
7
7
  kaminari (>= 0.16.3)
@@ -136,7 +136,11 @@ module AppManager
136
136
  end
137
137
  embed_host = Base64.encode64(params[:shop] + "/admin")
138
138
  # redirect_to "/login?host=#{embed_host}&shop=#{shop}" and return
139
- redirect_to "#{app_url}?host=#{embed_host}&shop=#{params[:shop]}", :status => 301 and return
139
+ if app_slug.present?
140
+ redirect_to "https://#{params[:shop]}/admin/apps/#{app_slug}"
141
+ else
142
+ redirect_to "#{app_url}?host=#{embed_host}&shop=#{params[:shop]}", :status => 301 and return
143
+ end
140
144
  else
141
145
  raise Error, "Invalid shopify charge #{charges.insect}"
142
146
  end
@@ -146,7 +150,11 @@ module AppManager
146
150
  else
147
151
  if params[:shop].present?
148
152
  embed_host = Base64.encode64(params[:shop] + "/admin")
149
- redirect_to "#{app_url}?host=#{embed_host}&shop=#{params[:shop]}", :status => 301 and return
153
+ if app_slug.present?
154
+ redirect_to "https://#{params[:shop]}/admin/apps/#{app_slug}"
155
+ else
156
+ redirect_to "#{app_url}?host=#{embed_host}&shop=#{params[:shop]}", :status => 301 and return
157
+ end
150
158
  else
151
159
  raise Error, "Invalid params, must have charge_id,shop && plan in charge controller"
152
160
  end
@@ -185,6 +193,10 @@ module AppManager
185
193
  AppManager.configuration.app_url
186
194
  end
187
195
 
196
+ def app_slug
197
+ AppManager.configuration.shopify_app_slug
198
+ end
199
+
188
200
  def config_trial_days
189
201
  @field_names = AppManager.configuration.field_names
190
202
  if !@field_names.nil? && @field_names.has_key?('total_trial_days') && !@field_names['total_trial_days'].nil? && !@field_names['total_trial_days'].blank?
@@ -13,6 +13,7 @@ module AppManager
13
13
  attr_accessor :plan_id_or_name_field
14
14
  attr_accessor :field_names
15
15
  attr_accessor :refresh_by_request_params
16
+ attr_accessor :shopify_app_slug
16
17
 
17
18
  def initialize
18
19
  @refresh_by_request_params = true
@@ -24,6 +25,7 @@ module AppManager
24
25
  @shopify_table_name = 'shops'
25
26
  @shopify_domain_field = 'shopify_domain'
26
27
  @plan_id_or_name_field = nil
28
+ @shopify_app_slug = nil
27
29
  @field_names = {
28
30
  'name' => 'shopify_domain', # sample example: demo-chirag-parmar.myshopify.com
29
31
  'shopify_email' => 'email', # chirag.p@hulkapps.com
@@ -82,5 +84,9 @@ module AppManager
82
84
  @refresh_by_request_params
83
85
  end
84
86
 
87
+ def shopify_app_slug
88
+ @shopify_app_slug
89
+ end
90
+
85
91
  end
86
92
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppManager
4
- VERSION = "1.3.9"
4
+ VERSION = "1.4.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.9
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hulkapps
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-02 00:00:00.000000000 Z
11
+ date: 2022-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty