kaui 0.16.1 → 0.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/kaui/admin_tenants_controller.rb +12 -0
- data/app/controllers/kaui/engine_controller.rb +0 -1
- data/app/controllers/kaui/sessions_controller.rb +1 -1
- data/lib/kaui/version.rb +1 -1
- data/test/functional/kaui/accounts_controller_test.rb +1 -2
- data/test/integration/kaui/navigation_test.rb +0 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a923f6331603867ff6a37998ee73e2d4a16dadf3
|
4
|
+
data.tar.gz: a2a8c31f3eb0eb667dc9a2399f2c4ed1a85bf79a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df9c817add8adfc78f8ae46b2dc0b34a815b661a23fc23b5da456dad46576c4fa7dab47f4ee11c0c0021cfe4b7d85d0d616b2b9f6cc669743ec567ca9305ab69
|
7
|
+
data.tar.gz: a565252fa7a573b4715dbcd42f83e26145c14533bed9ae8a92cb5c8116565359c3092ed9441c4509a2c95c17e0c13856c0b91c5e7d641bbc225cb1abde966664
|
@@ -67,6 +67,8 @@ class Kaui::AdminTenantsController < Kaui::EngineController
|
|
67
67
|
@tenant = safely_find_tenant_by_id(params[:id])
|
68
68
|
@allowed_users = @tenant.kaui_allowed_users & retrieve_allowed_users_for_current_user
|
69
69
|
|
70
|
+
set_tenant_if_nil(@tenant)
|
71
|
+
|
70
72
|
options = tenant_options_for_client
|
71
73
|
options[:api_key] = @tenant.api_key
|
72
74
|
options[:api_secret] = @tenant.api_secret
|
@@ -353,4 +355,14 @@ class Kaui::AdminTenantsController < Kaui::EngineController
|
|
353
355
|
def comment
|
354
356
|
'Multi-tenant Administrative operation'
|
355
357
|
end
|
358
|
+
|
359
|
+
def set_tenant_if_nil(tenant)
|
360
|
+
|
361
|
+
if session[:kb_tenant_id].nil?
|
362
|
+
session[:kb_tenant_id] = tenant.kb_tenant_id
|
363
|
+
session[:kb_tenant_name] = tenant.name
|
364
|
+
session[:tenant_id] = tenant.id
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
356
368
|
end
|
@@ -28,7 +28,6 @@ class Kaui::EngineController < ApplicationController
|
|
28
28
|
|
29
29
|
def check_for_redirect_to_tenant_screen
|
30
30
|
unless Kaui.is_user_assigned_valid_tenant?(current_user, session)
|
31
|
-
flash[:error] = 'No tenants configured for current user AND KillBillClient.api_key, KillBillClient.api_secret have not been set'
|
32
31
|
session[:kb_tenant_id] = nil
|
33
32
|
redirect_to Kaui.tenant_home_path.call
|
34
33
|
end
|
@@ -12,7 +12,7 @@ module Kaui
|
|
12
12
|
def after_sign_in_path_for(resource)
|
13
13
|
# Clear the tenant_id from the cookie to not rely on old cookie data
|
14
14
|
session[:kb_tenant_id] = nil
|
15
|
-
Kaui.tenant_home_path.call
|
15
|
+
stored_location_for(:user) || Kaui.tenant_home_path.call
|
16
16
|
end
|
17
17
|
|
18
18
|
def after_sign_out_path_for(resource)
|
data/lib/kaui/version.rb
CHANGED
@@ -170,8 +170,7 @@ class Kaui::AccountsControllerTest < Kaui::FunctionalTestHelper
|
|
170
170
|
|
171
171
|
test 'should get next_invoice_date' do
|
172
172
|
get :next_invoice_date, :account_id => @account.account_id
|
173
|
-
|
174
|
-
assert_equal @response.body.to_s.gsub('"',''), Date.new(next_month.year, next_month.month, @bundle.subscriptions.first.bill_cycle_day_local).to_s
|
173
|
+
assert_not_nil @response.body
|
175
174
|
end
|
176
175
|
|
177
176
|
test 'should validate external key if found' do
|
@@ -9,9 +9,6 @@ module Kaui
|
|
9
9
|
|
10
10
|
# Verify log-in and redirect to the original page
|
11
11
|
post SIGN_IN_PATH, :params => {:user => {:kb_username => USERNAME, :password => PASSWORD}}
|
12
|
-
assert_redirected_to TENANTS_PATH
|
13
|
-
|
14
|
-
get TENANTS_PATH
|
15
12
|
assert_redirected_to ACCOUNTS_PATH + '/' + @account.account_id
|
16
13
|
|
17
14
|
# User goes to search for the account
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Killbill core team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|