kaui 2.2.1 → 3.0.1
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/accounts_controller.rb +1 -1
- data/app/controllers/kaui/admin_tenants_controller.rb +2 -2
- data/app/controllers/kaui/audit_logs_controller.rb +1 -1
- data/app/controllers/kaui/charges_controller.rb +1 -1
- data/app/controllers/kaui/credits_controller.rb +1 -1
- data/app/controllers/kaui/engine_controller_util.rb +3 -5
- data/app/controllers/kaui/home_controller.rb +8 -8
- data/app/controllers/kaui/invoice_tags_controller.rb +1 -1
- data/app/helpers/kaui/date_helper.rb +1 -1
- data/app/helpers/kaui/plugin_helper.rb +1 -1
- data/app/helpers/kaui/uuid_helper.rb +2 -2
- data/app/models/kaui/account_email.rb +3 -3
- data/app/models/kaui/admin.rb +3 -3
- data/app/models/kaui/killbill_authenticatable.rb +2 -2
- data/config/initializers/killbill_authenticatable.rb +2 -2
- data/lib/kaui/version.rb +1 -1
- data/lib/kaui.rb +9 -0
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c270a67aa73b6b9195aae2e4578519dde9bdefab0bdb4fdd1f7a59a8137fb7a
|
4
|
+
data.tar.gz: 48791ecdfe32bbb730a447e8e994ab127acabd36fc356bedb023f8e67dc174ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13e7dc0a95b7a6bd39f3996a50fd32c7216b4eb7e2507b386a5bbe6cd959358e631a6520bafb6bf83f4573b730904bb9058a3475c851c7e3540ecd31e0280987
|
7
|
+
data.tar.gz: 402e25c2418833089ab69307de78deaa64597d76e0d40c07daa37dd15d050ba9b3b35e6e9a1485447faf07ee458e364de0d2c7dac02172bbb3c7bdf853e584b4
|
@@ -202,7 +202,7 @@ module Kaui
|
|
202
202
|
render template: 'kaui/invoices/show'
|
203
203
|
else
|
204
204
|
# Redirect to fetch payments, etc.
|
205
|
-
redirect_to invoice_path(invoice.invoice_id, account_id:
|
205
|
+
redirect_to invoice_path(invoice.invoice_id, account_id:), notice: "Generated invoice #{invoice.invoice_number} for target date #{invoice.target_date}"
|
206
206
|
end
|
207
207
|
end
|
208
208
|
|
@@ -15,7 +15,7 @@ module Kaui
|
|
15
15
|
currency = params[:currency] || 'USD'
|
16
16
|
end
|
17
17
|
|
18
|
-
@charge = Kaui::InvoiceItem.new(account_id: params.require(:account_id), invoice_id
|
18
|
+
@charge = Kaui::InvoiceItem.new(account_id: params.require(:account_id), invoice_id:, amount:, currency:)
|
19
19
|
end
|
20
20
|
|
21
21
|
def create
|
@@ -15,7 +15,7 @@ module Kaui
|
|
15
15
|
currency = params[:currency] || 'USD'
|
16
16
|
end
|
17
17
|
|
18
|
-
@credit = Kaui::Credit.new(account_id: params.require(:account_id), invoice_id
|
18
|
+
@credit = Kaui::Credit.new(account_id: params.require(:account_id), invoice_id:, amount:, currency:)
|
19
19
|
end
|
20
20
|
|
21
21
|
def create
|
@@ -53,17 +53,15 @@ module Kaui
|
|
53
53
|
pages.each { |page| json[:data] << formatter.call(page) }
|
54
54
|
|
55
55
|
respond_to do |format|
|
56
|
-
format.json { render json:
|
56
|
+
format.json { render json: }
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
def promise
|
60
|
+
def promise(&)
|
61
61
|
# Evaluation starts immediately
|
62
62
|
::Concurrent::Promises.future do
|
63
63
|
# https://github.com/rails/rails/issues/26847
|
64
|
-
Rails.application.executor.wrap
|
65
|
-
yield
|
66
|
-
end
|
64
|
+
Rails.application.executor.wrap(&)
|
67
65
|
end
|
68
66
|
end
|
69
67
|
|
@@ -46,7 +46,7 @@ module Kaui
|
|
46
46
|
elsif true?(fast)
|
47
47
|
redirect_to account_path(account.account_id) and return
|
48
48
|
else
|
49
|
-
redirect_to accounts_path(q: search_query, fast:
|
49
|
+
redirect_to accounts_path(q: search_query, fast:) and return
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -73,7 +73,7 @@ module Kaui
|
|
73
73
|
elsif true?(fast)
|
74
74
|
redirect_to account_invoice_path(invoice.account_id, invoice.invoice_id) and return
|
75
75
|
else
|
76
|
-
redirect_to account_invoices_path(account_id: invoice.account_id, q: search_query, fast:
|
76
|
+
redirect_to account_invoices_path(account_id: invoice.account_id, q: search_query, fast:) and return
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
@@ -100,7 +100,7 @@ module Kaui
|
|
100
100
|
elsif true?(fast)
|
101
101
|
redirect_to account_payment_path(payment.account_id, payment.payment_id) and return
|
102
102
|
else
|
103
|
-
redirect_to account_payments_path(account_id: payment.account_id, q: search_query, fast:
|
103
|
+
redirect_to account_payments_path(account_id: payment.account_id, q: search_query, fast:) and return
|
104
104
|
end
|
105
105
|
end
|
106
106
|
end
|
@@ -167,7 +167,7 @@ module Kaui
|
|
167
167
|
if custom_field.blank?
|
168
168
|
search_error("No custom field matches \"#{search_query}\"")
|
169
169
|
else
|
170
|
-
redirect_to custom_fields_path(q: search_query, fast:
|
170
|
+
redirect_to custom_fields_path(q: search_query, fast:)
|
171
171
|
end
|
172
172
|
else
|
173
173
|
unsupported_external_key_search('CUSTOM FIELD')
|
@@ -206,7 +206,7 @@ module Kaui
|
|
206
206
|
if tag.blank?
|
207
207
|
search_error("No tag matches \"#{search_query}\"")
|
208
208
|
else
|
209
|
-
redirect_to tags_path(q: search_query, fast:
|
209
|
+
redirect_to tags_path(q: search_query, fast:)
|
210
210
|
end
|
211
211
|
else
|
212
212
|
unsupported_external_key_search('TAG')
|
@@ -217,7 +217,7 @@ module Kaui
|
|
217
217
|
if search_by == 'ID'
|
218
218
|
begin
|
219
219
|
Kaui::TagDefinition.find_by_id(search_query, 'NONE', options)
|
220
|
-
redirect_to tag_definitions_path(q: search_query, fast:
|
220
|
+
redirect_to tag_definitions_path(q: search_query, fast:)
|
221
221
|
rescue KillBillClient::API::NotFound => _e
|
222
222
|
search_error("No tag definition matches \"#{search_query}\"")
|
223
223
|
end
|
@@ -228,12 +228,12 @@ module Kaui
|
|
228
228
|
if tag_definition.blank?
|
229
229
|
begin
|
230
230
|
Kaui::TagDefinition.find_by_id(search_query, 'NONE', options)
|
231
|
-
redirect_to tag_definitions_path(q: search_query, fast:
|
231
|
+
redirect_to tag_definitions_path(q: search_query, fast:) and return
|
232
232
|
rescue KillBillClient::API::NotFound => _e
|
233
233
|
search_error("No tag definition matches \"#{search_query}\"")
|
234
234
|
end
|
235
235
|
else
|
236
|
-
redirect_to tag_definitions_path(q: search_query, fast:
|
236
|
+
redirect_to tag_definitions_path(q: search_query, fast:)
|
237
237
|
end
|
238
238
|
end
|
239
239
|
end
|
@@ -26,7 +26,7 @@ module Kaui
|
|
26
26
|
end
|
27
27
|
|
28
28
|
Kaui::Tag.set_for_invoice(invoice_id, tags, current_user.kb_username, params[:reason], params[:comment], options_for_klient)
|
29
|
-
redirect_to kaui_engine.invoice_path(invoice_id, account_id:
|
29
|
+
redirect_to kaui_engine.invoice_path(invoice_id, account_id:), notice: 'Invoice tags successfully set'
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -21,7 +21,7 @@ module Kaui
|
|
21
21
|
plugin_key = plugin.plugin_key
|
22
22
|
installed_plugins << {
|
23
23
|
# Unique identifier chosen by the user and used for kpm operations
|
24
|
-
plugin_key
|
24
|
+
plugin_key:,
|
25
25
|
# Notes:
|
26
26
|
# * plugin.plugin_name comes from kpm and is arbitrary (see Utils.get_plugin_name_from_file_path in the kpm codebase for instance)
|
27
27
|
# * plugin_name here is the plugin name as seen by Kill Bill and is typically defined in the Activator.java (this value is the one that matters for plugin configuration)
|
@@ -12,10 +12,10 @@ module Kaui
|
|
12
12
|
|
13
13
|
def object_id_popover(object_id, placement = 'right', title = nil)
|
14
14
|
content_tag(:span, truncate_uuid(object_id),
|
15
|
-
id: "#{object_id}-popover", class: 'object-id-popover', title
|
15
|
+
id: "#{object_id}-popover", class: 'object-id-popover', title:,
|
16
16
|
data: {
|
17
17
|
id: object_id,
|
18
|
-
placement:
|
18
|
+
placement:
|
19
19
|
})
|
20
20
|
end
|
21
21
|
end
|
@@ -3,17 +3,17 @@
|
|
3
3
|
module Kaui
|
4
4
|
class AccountEmail < KillBillClient::Model::AccountEmailAttributes
|
5
5
|
def self.find_all_sorted_by_account_id(account_id, audit = 'NONE', options = {})
|
6
|
-
emails = Kaui::Account.new(account_id:
|
6
|
+
emails = Kaui::Account.new(account_id:).emails(audit, options)
|
7
7
|
emails.map { |email| Kaui::AccountEmail.new(email.to_hash) }.sort
|
8
8
|
end
|
9
9
|
|
10
10
|
def create(user = nil, reason = nil, comment = nil, options = {})
|
11
|
-
account = Kaui::Account.new(account_id:
|
11
|
+
account = Kaui::Account.new(account_id:)
|
12
12
|
account.add_email(email, user, reason, comment, options)
|
13
13
|
end
|
14
14
|
|
15
15
|
def destroy(user = nil, reason = nil, comment = nil, options = {})
|
16
|
-
account = Kaui::Account.new(account_id:
|
16
|
+
account = Kaui::Account.new(account_id:)
|
17
17
|
account.remove_email(email, user, reason, comment, options)
|
18
18
|
end
|
19
19
|
|
data/app/models/kaui/admin.rb
CHANGED
@@ -31,8 +31,8 @@ module Devise
|
|
31
31
|
# Invoked by the KillbillAuthenticatable strategy to lookup the user
|
32
32
|
# before attempting authentication
|
33
33
|
def find_for_killbill_authentication(kb_username)
|
34
|
-
find_for_authentication(kb_username:
|
35
|
-
new(kb_username:
|
34
|
+
find_for_authentication(kb_username:) ||
|
35
|
+
new(kb_username:)
|
36
36
|
rescue KillBillClient::API::Unauthorized => _e
|
37
37
|
# Multi-Tenancy was enabled, but the tenant_id couldn't be retrieved because of bad credentials
|
38
38
|
nil
|
@@ -28,7 +28,7 @@ module Devise
|
|
28
28
|
return false unless valid_password?
|
29
29
|
|
30
30
|
user = params[:user] || {}
|
31
|
-
kb_authenticate!(user[:kb_username], { username: user[:kb_username], password:
|
31
|
+
kb_authenticate!(user[:kb_username], { username: user[:kb_username], password: })
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -77,7 +77,7 @@ Warden::Manager.after_set_user do |user, auth, opts|
|
|
77
77
|
unless user.authenticated_with_killbill?
|
78
78
|
scope = opts[:scope]
|
79
79
|
auth.logout(scope)
|
80
|
-
throw(:warden, scope
|
80
|
+
throw(:warden, scope:, reason: 'Kill Bill session expired')
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
data/lib/kaui/version.rb
CHANGED
data/lib/kaui.rb
CHANGED
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:
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kill Bill core team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -238,16 +238,16 @@ dependencies:
|
|
238
238
|
name: kenui
|
239
239
|
requirement: !ruby/object:Gem::Requirement
|
240
240
|
requirements:
|
241
|
-
- - "
|
241
|
+
- - ">="
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version:
|
243
|
+
version: '0'
|
244
244
|
type: :runtime
|
245
245
|
prerelease: false
|
246
246
|
version_requirements: !ruby/object:Gem::Requirement
|
247
247
|
requirements:
|
248
|
-
- - "
|
248
|
+
- - ">="
|
249
249
|
- !ruby/object:Gem::Version
|
250
|
-
version:
|
250
|
+
version: '0'
|
251
251
|
- !ruby/object:Gem::Dependency
|
252
252
|
name: killbill-client
|
253
253
|
requirement: !ruby/object:Gem::Requirement
|
@@ -310,14 +310,14 @@ dependencies:
|
|
310
310
|
requirements:
|
311
311
|
- - "~>"
|
312
312
|
- !ruby/object:Gem::Version
|
313
|
-
version: '
|
313
|
+
version: '7.0'
|
314
314
|
type: :runtime
|
315
315
|
prerelease: false
|
316
316
|
version_requirements: !ruby/object:Gem::Requirement
|
317
317
|
requirements:
|
318
318
|
- - "~>"
|
319
319
|
- !ruby/object:Gem::Version
|
320
|
-
version: '
|
320
|
+
version: '7.0'
|
321
321
|
- !ruby/object:Gem::Dependency
|
322
322
|
name: sass
|
323
323
|
requirement: !ruby/object:Gem::Requirement
|
@@ -695,7 +695,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
695
695
|
requirements:
|
696
696
|
- - ">="
|
697
697
|
- !ruby/object:Gem::Version
|
698
|
-
version: 2.
|
698
|
+
version: 2.7.0
|
699
699
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
700
700
|
requirements:
|
701
701
|
- - ">="
|