app_manager 1.1.7 → 1.1.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: 0c3feb475e1932e9ddce85101ac275262e5bd4f2ab9f8abd6f1201cc1d67a929
4
- data.tar.gz: b17c9dc2f616130e5a0f9e3a9c962fd55a6006342fe04caf78fb4c2a850f955d
3
+ metadata.gz: 49b23403c65f2eb57f2d3a3a54d1c966e3810773aea9822c8625f3026fec93b9
4
+ data.tar.gz: 3625d02deadd46fbc14f27227cc49d0ffb774fa285d971df90a4d91dcef06255
5
5
  SHA512:
6
- metadata.gz: e1f07eb0df1fc3d082abbe4a58ed404cac3a2e5d5fd3a19ca21a32183d5d67076409487612be1989016f00a637d305a643ab0739ce957d7f2cb5d94ecd9027b1
7
- data.tar.gz: 18aa4fa121cb88dac088661fb1fb06467ea890af098ac6315401e2d481b42d0b282ad2670334064e3ee95ab3e69b8e730dd4c7be2b02c7741ec7f1f53c627d05
6
+ metadata.gz: 2e755621b1a8dea6d0f24a8135bd562cad9451ca1917a5c011be9e30654529f3dd55f8b9dc60908d7460b2ab8f6ca90823ec779726b277f1e35e45eec711621c
7
+ data.tar.gz: 45f80655e7125a4b00740be0b286867edc755101bdb2d3c6fe5a52ed70ae7f798f56a87b371783be6b3b4cda678917165cf49ffe16fe2aa0ed6cc437b22ff7fb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_manager (1.1.7)
4
+ app_manager (1.1.8)
5
5
  httparty
6
6
  kaminari (>= 0.16.3)
7
7
  rails (>= 5.2.0)
data/README.md CHANGED
@@ -109,8 +109,9 @@ AppManager.configure do |config|
109
109
  "description" => "Feature Description",
110
110
  "value_type" => "array",
111
111
  "values" => [
112
- "val 1",
113
- "val 2"
112
+ "val-1" => "val 1",
113
+ "val-2" => "val 2",
114
+ "val-3" => "val 3",
114
115
  ],
115
116
  "format" => "string",
116
117
  "display_order" => 4,
@@ -118,7 +119,7 @@ AppManager.configure do |config|
118
119
  "group_order" => "1",
119
120
  "group" => "Group Name",
120
121
  }
121
- ]
122
+ ]
122
123
  end
123
124
  #Required, Values type : integer, boolean, string, array #
124
125
  #Format: percentage, count, string
@@ -18,19 +18,19 @@ module AppManager
18
18
  plan_obj = AppManager::Client.new
19
19
  plans = []
20
20
  if params[:shop_domain].present? && !AppManager.configuration.plan_features.nil?
21
- plans = plan_obj.get_plans(params[:shop_domain])
22
21
  @shop = shop_data
23
22
  if !@shop.nil?
24
- active_plan_id_or_name = @shop[@plan_field]
23
+ active_plan_id_or_name = @shop[@plan_field] rescue nil
24
+ plans = plan_obj.get_plans(params[:shop_domain],active_plan_id_or_name)
25
25
  if !@field_names.nil? && @field_names.has_key?('shopify_plan') && !@field_names.nil?
26
26
  shopify_plan_field = AppManager.configuration.field_names['shopify_plan']
27
27
  shopify_plan = @shop[shopify_plan_field] rescue nil
28
- plan = plans.any? && !active_plan_id_or_name.nil? ? (plans.find{|x| x["id"] == active_plan_id_or_name}.present? ? plans.find{|x| x["id"] == active_plan_id_or_name} : nil ) : nil
28
+ plan = plans && plans.any? && !active_plan_id_or_name.nil? ? (plans.find{|x| x["id"] == active_plan_id_or_name}.present? ? plans.find{|x| x["id"] == active_plan_id_or_name} : nil ) : nil
29
29
 
30
30
  @trial_activated_field = AppManager.configuration.field_names['trial_activated_at']
31
31
  trial_activated_at = @shop[@trial_activated_field] rescue nil
32
32
  active_charge = plan_obj.get_charge(params[:shop_domain])
33
- if active_charge.any? && active_charge['active_charge'].nil? && active_charge['cancelled_charge'].nil? && trial_activated_at
33
+ if active_charge && active_charge.any? && active_charge['active_charge'].nil? && active_charge['cancelled_charge'].nil? && trial_activated_at
34
34
  choose_later = true
35
35
  end
36
36
 
@@ -43,6 +43,7 @@ module AppManager
43
43
  end
44
44
 
45
45
 
46
+ plans = plan_obj.get_plans(params[:shop_domain]) if plans && plans.blank?
46
47
  default_plan_data = plans.select{|x| x['choose_later_plan'] == true }
47
48
  if default_plan_data.any?
48
49
  if default_plan_data.select{|x| x['store_base_plan'] == true }.size > 0
@@ -2,8 +2,8 @@ module AppManager
2
2
  class Client
3
3
  module Plans
4
4
 
5
- def get_plans(shop_domain)
6
- get("/plans?shop_domain=#{shop_domain}")
5
+ def get_plans(shop_domain,active_plan_id=nil)
6
+ get("/plans?shop_domain=#{shop_domain}&active_plan_id=#{active_plan_id}")
7
7
  end
8
8
 
9
9
  def get_plan(plan_id,shop_domain=nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppManager
4
- VERSION = "1.1.7"
4
+ VERSION = "1.1.8"
5
5
  end
@@ -61,8 +61,9 @@ AppManager.configure do |config|
61
61
  "description" => "Feature Description",
62
62
  "value_type" => "array",
63
63
  "values" => [
64
- "val 1",
65
- "val 2"
64
+ "val-1" => "val 1",
65
+ "val-2" => "val 2",
66
+ "val-3" => "val 3",
66
67
  ],
67
68
  "format" => "string",
68
69
  "display_order" => 4,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hulkapps