kaui 2.0.2 → 2.0.3

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
- SHA256:
3
- metadata.gz: f2de0a1cf9deebfbdae2781d8bfe36637ecd1bf6e01877c6d88ddbc95a77cb05
4
- data.tar.gz: c8089c093f566b916137637e53b56a409d7e5bee8e74d0ed16f2bdaabf76d262
2
+ SHA1:
3
+ metadata.gz: c998eb4ff14442f28a18da7cab14072cc7d19dfc
4
+ data.tar.gz: 660dbac2ba54d6d0c853b63c697587e486a5c2ed
5
5
  SHA512:
6
- metadata.gz: d26ede3ecdbfdc270234d94c374271bbb47bb94bd90e3d4f98e93706f77b623a7a6236c00ce28d354508cd378402bc60a55a2734695f5f88b8a4d7cdf44d1692
7
- data.tar.gz: 870b1a5e19fed59434aec7c4a7a1f4374c834a2e8208689301c7554f91d95ab2f8dd43efc1c989bf679b1426a5eba2365fa8d2a675376f904d3db3dd9baad3fc
6
+ metadata.gz: 714a6e0da369b82570551cd082b7fd9b8d62ab18e906756a4194e31dfa5f90d47dd5b8624f5ca070915e45308d31839f451cca5a343895642d50ba47c89d1716
7
+ data.tar.gz: bc72e0c1b8febf3d413d1191e48431a2d330aff546e84493953e0697b043258365973d3fd5d0ea6dddab244b4c9a5d4cc6a92d9ce9e60155cf9663f7acc92b60
@@ -717,4 +717,47 @@ form[id^="new_tag_definition"] {
717
717
 
718
718
  .switch-tenant-active {
719
719
  color: #00919d;
720
- }
720
+ }
721
+
722
+ /* Required for https://github.com/killbill/killbill-admin-ui/issues/262 */
723
+ .ui-autocomplete {
724
+ position: absolute;
725
+ z-index: 1000;
726
+ float: left;
727
+ display: none;
728
+ min-width: 160px;
729
+ padding: 4px 0;
730
+ margin: 2px 0 0 0;
731
+ list-style: none;
732
+ background-color: #ffffff;
733
+ border-color: rgba(0, 0, 0, 0.2);
734
+ border-style: solid;
735
+ border-width: 1px;
736
+ border-radius: 5px;
737
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
738
+ background-clip: padding-box;
739
+
740
+ .ui-menu-item {
741
+ display: block;
742
+ padding: 3px 15px;
743
+ clear: both;
744
+ font-weight: normal;
745
+ line-height: 18px;
746
+ color: #555555;
747
+ white-space: nowrap;
748
+
749
+ .ui-state-active, .ui-state-hover {
750
+ color: #ffffff;
751
+ text-decoration: none;
752
+ background-color: #0088cc;
753
+ border-radius: 0px;
754
+ -webkit-border-radius: 0px;
755
+ -moz-border-radius: 0px;
756
+ background-image: none;
757
+ }
758
+ }
759
+ }
760
+
761
+ .ui-helper-hidden-accessible {
762
+ display: none;
763
+ }
@@ -48,6 +48,8 @@ class Kaui::InvoicesController < Kaui::EngineController
48
48
  cached_options_for_klient = options_for_klient
49
49
 
50
50
  @invoice = Kaui::Invoice.find_by_id(params.require(:id), 'FULL', cached_options_for_klient)
51
+ # This will put the TAX items at the bottom
52
+ @invoice.items.sort_by! { |ii| [ii.item_type, ii.description] }
51
53
 
52
54
  fetch_payments = promise { @invoice.payments(true, true, 'FULL', cached_options_for_klient).map { |payment| Kaui::InvoicePayment.build_from_raw_payment(payment) } }
53
55
  fetch_pms = fetch_payments.then { |payments| Kaui::PaymentMethod.payment_methods_for_payments(payments, cached_options_for_klient) }
@@ -18,5 +18,11 @@ module Kaui
18
18
  def after_sign_out_path_for(resource)
19
19
  kaui_path
20
20
  end
21
+
22
+ def require_no_authentication
23
+ super
24
+ # Remove the somewhat confusing message "You are already signed in."
25
+ flash.discard(:alert) if flash[:alert] == I18n.t("devise.failure.already_authenticated")
26
+ end
21
27
  end
22
28
  end
@@ -11,9 +11,9 @@ class Kaui::SubscriptionsController < Kaui::EngineController
11
11
 
12
12
  if @plans.empty?
13
13
  if @subscription.product_category == 'BASE'
14
- flash[:error] = 'No available plan'
14
+ flash[:error] = 'No plan available in the catalog'
15
15
  else
16
- flash[:error] = "No available add-on for product #{@base_product_name}"
16
+ flash[:error] = "No add-on available in the catalog for product #{@base_product_name}"
17
17
  end
18
18
  redirect_to kaui_engine.account_bundles_path(@subscription.account_id), :error => 'No available plan'
19
19
  end
@@ -46,6 +46,16 @@ class Kaui::SubscriptionsController < Kaui::EngineController
46
46
  redirect_to kaui_engine.account_bundles_path(@subscription.account_id), :notice => 'Subscription was successfully created'
47
47
  rescue => e
48
48
  @plans = plans_details.nil? ? [] : plans_details.map { |p| p.plan }
49
+
50
+ if e.is_a?(::KillBillClient::API::BadRequest) && !e.response.nil? && !e.response.body.nil?
51
+ error_message = JSON.parse(e.response.body) rescue nil
52
+ if !error_message.nil? & !error_message['code'].nil? && error_message['code'] == 2010 # CAT_NO_PRICE_FOR_CURRENCY
53
+ # Hack for lack of proper Kill Bill messaging (https://github.com/killbill/killbill-admin-ui/issues/266)
54
+ flash.now[:error] = "Unable to create the subscription: a price for this currency hasn't been specified in the catalog"
55
+ render :new and return
56
+ end
57
+ end
58
+
49
59
  flash.now[:error] = "Error while creating the subscription: #{as_string(e)}"
50
60
  render :new
51
61
  end
@@ -212,8 +222,7 @@ class Kaui::SubscriptionsController < Kaui::EngineController
212
222
  else
213
223
  options = options_for_klient
214
224
 
215
- catalog = Kaui::Catalog.get_tenant_catalog_json( DateTime.now.to_s, options)
216
-
225
+ catalog = Kaui::Catalog.get_tenant_catalog_json(DateTime.now.to_s, options)
217
226
  return [] if catalog.blank?
218
227
 
219
228
  plans = []
@@ -4,9 +4,21 @@ class Kaui::Catalog < KillBillClient::Model::Catalog
4
4
 
5
5
  class << self
6
6
 
7
- def get_catalog_json(latest, requested_date, options)
7
+ def get_tenant_catalog_json(requested_date = nil, options = {})
8
+ super
9
+ rescue ::KillBillClient::API::InternalServerError => e
10
+ if !e.response.nil? && !e.response.body.nil?
11
+ error_message = JSON.parse(e.response.body) rescue nil
12
+ raise e if error_message.nil? || error_message['message'].nil?
13
+
14
+ # Hack for lack of proper Kill Bill messaging (see https://github.com/killbill/killbill-admin-ui/issues/265)
15
+ return [] if error_message['message'].starts_with?('No existing versions')
16
+ end
17
+ raise e
18
+ end
8
19
 
9
- catalogs = KillBillClient::Model::Catalog.get_tenant_catalog_json(requested_date, options)
20
+ def get_catalog_json(latest, requested_date, options)
21
+ catalogs = get_tenant_catalog_json(requested_date, options)
10
22
  return catalogs.length > 0 ? catalogs[catalogs.length - 1] : nil if latest
11
23
 
12
24
  # Order by latest
@@ -2,7 +2,7 @@
2
2
  <div class='form-group'>
3
3
  <%= f.label :email, 'Email', :class => 'col-sm-2 control-label' %>
4
4
  <div class="col-sm-10">
5
- <%= f.text_field :email, :class => 'form-control', :required => true %>
5
+ <%= f.email_field :email, :class => 'form-control', :required => true %>
6
6
  </div>
7
7
  </div>
8
8
  <div class="form-group">
@@ -38,7 +38,7 @@
38
38
  <div class="form-group">
39
39
  <%= f.label :email, 'Email', :class => 'col-sm-3 control-label' %>
40
40
  <div class="col-sm-9">
41
- <%= f.text_field :email, :class => 'form-control' %>
41
+ <%= f.email_field :email, :class => 'form-control' %>
42
42
  </div>
43
43
  </div>
44
44
  <% unless @account.persisted? %>
@@ -105,7 +105,6 @@
105
105
  $('#invoice-table').dataTable({
106
106
  "dom": "t",
107
107
  "paging": false,
108
- "order": [[ 1, "asc" ]],
109
108
  "columns": [
110
109
  null,
111
110
  null,
@@ -1,3 +1,3 @@
1
1
  module Kaui
2
- VERSION = '2.0.2'
2
+ VERSION = '2.0.3'
3
3
  end
@@ -2,4 +2,4 @@
2
2
 
3
3
  # Specify a serializer for the signed and encrypted cookie jars.
4
4
  # Valid options are :json, :marshal, and :hybrid.
5
- Rails.application.config.action_dispatch.cookies_serializer = :marshal
5
+ Rails.application.config.action_dispatch.cookies_serializer = :hybrid
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: 2.0.2
4
+ version: 2.0.3
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: 2020-02-01 00:00:00.000000000 Z
11
+ date: 2020-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -879,7 +879,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
879
879
  - !ruby/object:Gem::Version
880
880
  version: '0'
881
881
  requirements: []
882
- rubygems_version: 3.0.6
882
+ rubyforge_project:
883
+ rubygems_version: 2.6.13
883
884
  signing_key:
884
885
  specification_version: 4
885
886
  summary: Killbill Admin UI mountable engine