kaui 0.8.1 → 0.8.2

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
  SHA1:
3
- metadata.gz: f76c44debafe012a786bfaad08689567c41e67c1
4
- data.tar.gz: 685ef282ca6ec11ce123b672803827ed3ab6bdca
3
+ metadata.gz: 8c4c83530dabc57b1b0441fdac6761621d8c06ac
4
+ data.tar.gz: b50be017d6fa75203ef48637b7a5a67cc6d77207
5
5
  SHA512:
6
- metadata.gz: d5e837d361a21b06f0fbb19202170733fcd3fb7e5b5413e7e17aed117b8c7c81af34e55df61f317a2f1acd640143e791b7d574b4e609233bd0c1eb6b5c78dfe6
7
- data.tar.gz: 2a86fe5e70491f0e8b5fc472f44282371d7ce68e1b044ce82ff028d07443ce3883569aa63e9777e5dd6ca9df79a8fdf65d7f107caa3fbdb92ec86a0960df53de
6
+ metadata.gz: 3ac3e544f3499cb230eb9c5db0ef745567694ab2958556e498f25efc2f83c750022b05ba03c8289cea1c676c69d9256f9dbd262a8fe264a168e00498f7ac33a3
7
+ data.tar.gz: 5efc247745b46113471e1acc3522979199f07dda37caac949108de7ed5ed606dc14d1d4347426a728eb68840ef89d42b2bc922086ab01b0ee55fea2a7f45c285
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kaui (0.8.1)
4
+ kaui (0.8.2)
5
5
  cancan (~> 1.6.10)
6
6
  carmen-rails (~> 1.0.0)
7
7
  d3_rails (~> 3.2.8)
@@ -23,11 +23,12 @@ module Kaui
23
23
  tenant = KillBillClient::Model::Tenant.find_by_api_key(KillBillClient.api_key, {
24
24
  :session_id => user.kb_session_id
25
25
  })
26
- kb_tenant_id = tenant.tenant_id if tenant.present?
27
- select_tenant_for_tenant_id(kb_tenant_id)
26
+ if tenant.present?
27
+ select_tenant_for_tenant_id(tenant.tenant_id, tenant.external_key)
28
+ end
28
29
  when 1
29
30
  # If there is only one tenant defined we skip the screen and set the tenant for the user
30
- select_tenant_for_tenant_id(@tenants[0].kb_tenant_id)
31
+ select_tenant_for_tenant_id(@tenants[0].kb_tenant_id, @tenants[0].name)
31
32
  else
32
33
  # Jump to default view allowing to chose which tenant to pick
33
34
  respond_to do |format|
@@ -45,14 +46,16 @@ module Kaui
45
46
 
46
47
  def select_tenant
47
48
  kb_tenant_id = params[:kb_tenant_id]
48
- select_tenant_for_tenant_id(kb_tenant_id)
49
+ tenant = Kaui::Tenant.find_by_kb_tenant_id(kb_tenant_id)
50
+ select_tenant_for_tenant_id(tenant.kb_tenant_id, tenant.name)
49
51
  end
50
52
 
51
53
  private
52
54
 
53
- def select_tenant_for_tenant_id(kb_tenant_id)
55
+ def select_tenant_for_tenant_id(kb_tenant_id, kb_tenant_name_or_key)
54
56
  # Set kb_tenant_id in the session
55
57
  session[:kb_tenant_id] = kb_tenant_id
58
+ session[:kb_tenant_name] = kb_tenant_name_or_key
56
59
  redirect_to Kaui.home_path.call
57
60
  end
58
61
 
@@ -22,7 +22,11 @@
22
22
  </ul>
23
23
  <ul class="nav pull-right">
24
24
  <% if user_signed_in? -%>
25
- <li><%= link_to 'Sign out', destroy_user_session_path, method: :delete %></li>
25
+ <% if session[:kb_tenant_name].present? %>
26
+ <li><%= link_to "Sign out [tenant: #{session[:kb_tenant_name]}]", destroy_user_session_path, method: :delete %></li>
27
+ <% else %>
28
+ <li><%= link_to 'Sign out', destroy_user_session_path, method: :delete %></li>
29
+ <% end %>
26
30
  <% end -%>
27
31
  </ul>
28
32
  </div>
@@ -1,3 +1,3 @@
1
1
  module Kaui
2
- VERSION = '0.8.1'
2
+ VERSION = '0.8.2'
3
3
  end
@@ -1,2 +1,4 @@
1
- KillBillClient.url = 'http://127.0.0.1:8080'
1
+ KillBillClient.url = 'http://127.0.0.1:8080'
2
+ #KillBillClient.api_key = 'bob'
3
+ #KillBillClient.api_secret = 'lazar'
2
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Killbill core team