kaui 2.1.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +8 -7
- data/Rakefile +4 -2
- data/app/assets/config/kaui_manifest.js +45 -0
- data/app/assets/javascripts/jquery.spin.js +76 -0
- data/app/assets/javascripts/kaui/kaui.js +76 -0
- data/app/assets/javascripts/kaui_application.js +25 -0
- data/app/assets/javascripts/spin.js +76 -0
- data/app/assets/stylesheets/bootstrap_and_overrides.scss +240 -0
- data/app/assets/stylesheets/kaui/{account.less → account.scss} +4 -0
- data/app/assets/stylesheets/kaui/{audit.less → audit.scss} +5 -1
- data/app/assets/stylesheets/kaui/{common.less → common.scss} +17 -15
- data/app/assets/stylesheets/kaui/{datatable.less → datatable.scss} +6 -3
- data/app/assets/stylesheets/kaui/{header.less → header.scss} +16 -12
- data/app/assets/stylesheets/kaui/{home.less → home.scss} +7 -4
- data/app/assets/stylesheets/kaui/{invoice.less → invoice.scss} +7 -3
- data/app/assets/stylesheets/kaui/kaui.scss +265 -0
- data/app/assets/stylesheets/kaui/kaui_bootstrap.scss +3 -0
- data/app/assets/stylesheets/kaui/{overdue.less → overdue.scss} +3 -1
- data/app/assets/stylesheets/kaui/{payment.less → payment.scss} +3 -0
- data/app/assets/stylesheets/kaui/{subscription.less → subscription.scss} +4 -1
- data/app/assets/stylesheets/kaui/{tags.less → tags.scss} +9 -5
- data/app/assets/stylesheets/kaui/timeline.scss +7 -0
- data/app/assets/stylesheets/kaui/tooltip.scss +15 -0
- data/app/controllers/kaui/account_children_controller.rb +25 -28
- data/app/controllers/kaui/account_custom_fields_controller.rb +16 -15
- data/app/controllers/kaui/account_emails_controller.rb +28 -25
- data/app/controllers/kaui/account_tags_controller.rb +37 -34
- data/app/controllers/kaui/account_timelines_controller.rb +38 -33
- data/app/controllers/kaui/accounts_controller.rb +268 -250
- data/app/controllers/kaui/admin_allowed_users_controller.rb +105 -99
- data/app/controllers/kaui/admin_controller.rb +32 -31
- data/app/controllers/kaui/admin_tenants_controller.rb +434 -388
- data/app/controllers/kaui/audit_logs_controller.rb +86 -83
- data/app/controllers/kaui/bundle_tags_controller.rb +24 -20
- data/app/controllers/kaui/bundles_controller.rb +96 -82
- data/app/controllers/kaui/chargebacks_controller.rb +36 -33
- data/app/controllers/kaui/charges_controller.rb +23 -20
- data/app/controllers/kaui/credits_controller.rb +28 -25
- data/app/controllers/kaui/custom_fields_controller.rb +172 -38
- data/app/controllers/kaui/engine_controller.rb +2 -1
- data/app/controllers/kaui/engine_controller_util.rb +128 -117
- data/app/controllers/kaui/home_controller.rb +230 -217
- data/app/controllers/kaui/invoice_items_controller.rb +43 -39
- data/app/controllers/kaui/invoice_tags_controller.rb +24 -20
- data/app/controllers/kaui/invoices_controller.rb +132 -117
- data/app/controllers/kaui/login_proxy_controller.rb +2 -1
- data/app/controllers/kaui/payment_methods_controller.rb +102 -94
- data/app/controllers/kaui/payments_controller.rb +95 -92
- data/app/controllers/kaui/queues_controller.rb +47 -14
- data/app/controllers/kaui/refunds_controller.rb +36 -33
- data/app/controllers/kaui/registrations_controller.rb +7 -7
- data/app/controllers/kaui/role_definitions_controller.rb +17 -14
- data/app/controllers/kaui/sessions_controller.rb +7 -4
- data/app/controllers/kaui/subscriptions_controller.rb +197 -187
- data/app/controllers/kaui/tag_definitions_controller.rb +28 -27
- data/app/controllers/kaui/tags_controller.rb +25 -22
- data/app/controllers/kaui/tenants_controller.rb +30 -28
- data/app/controllers/kaui/transactions_controller.rb +43 -38
- data/app/helpers/kaui/account_helper.rb +16 -14
- data/app/helpers/kaui/application_helper.rb +8 -3
- data/app/helpers/kaui/date_helper.rb +4 -3
- data/app/helpers/kaui/home_helper.rb +2 -0
- data/app/helpers/kaui/locale_helper.rb +7 -6
- data/app/helpers/kaui/money_helper.rb +2 -1
- data/app/helpers/kaui/object_helper.rb +11 -10
- data/app/helpers/kaui/payment_helper.rb +7 -6
- data/app/helpers/kaui/payment_method_helper.rb +3 -2
- data/app/helpers/kaui/permissions_helper.rb +9 -9
- data/app/helpers/kaui/plugin_helper.rb +25 -23
- data/app/helpers/kaui/subscription_helper.rb +27 -29
- data/app/helpers/kaui/us_states_helper.rb +7 -6
- data/app/helpers/kaui/uuid_helper.rb +8 -6
- data/app/models/kaui/ability.rb +19 -12
- data/app/models/kaui/account.rb +45 -28
- data/app/models/kaui/account_email.rb +23 -20
- data/app/models/kaui/account_timeline.rb +5 -1
- data/app/models/kaui/admin.rb +65 -64
- data/app/models/kaui/admin_tenant.rb +81 -82
- data/app/models/kaui/allowed_user.rb +13 -9
- data/app/models/kaui/allowed_user_tenant.rb +4 -2
- data/app/models/kaui/application_record.rb +2 -0
- data/app/models/kaui/audit_log.rb +6 -3
- data/app/models/kaui/base.rb +13 -7
- data/app/models/kaui/bundle.rb +41 -24
- data/app/models/kaui/catalog.rb +118 -113
- data/app/models/kaui/chargeback.rb +5 -1
- data/app/models/kaui/credit.rb +4 -1
- data/app/models/kaui/custom_field.rb +9 -6
- data/app/models/kaui/invoice.rb +25 -22
- data/app/models/kaui/invoice_item.rb +9 -6
- data/app/models/kaui/invoice_payment.rb +49 -54
- data/app/models/kaui/killbill_authenticatable.rb +14 -8
- data/app/models/kaui/killbill_registerable.rb +7 -0
- data/app/models/kaui/overdue.rb +64 -65
- data/app/models/kaui/payment.rb +22 -19
- data/app/models/kaui/payment_method.rb +48 -39
- data/app/models/kaui/payment_state.rb +41 -38
- data/app/models/kaui/rails_methods.rb +9 -9
- data/app/models/kaui/refund.rb +7 -1
- data/app/models/kaui/role_definition.rb +5 -1
- data/app/models/kaui/simple_plan.rb +5 -3
- data/app/models/kaui/subscription.rb +10 -7
- data/app/models/kaui/tag.rb +25 -22
- data/app/models/kaui/tag_definition.rb +50 -45
- data/app/models/kaui/tenant.rb +6 -5
- data/app/models/kaui/transaction.rb +43 -31
- data/app/models/kaui/user.rb +10 -16
- data/app/models/kaui/user_role.rb +8 -5
- data/app/views/kaui/accounts/_billing_info.html.erb +1 -1
- data/app/views/kaui/accounts/_form.html.erb +2 -2
- data/app/views/kaui/accounts/index.html.erb +2 -0
- data/app/views/kaui/admin_allowed_users/_form.html.erb +3 -3
- data/app/views/kaui/admin_tenants/_form_catalog_translation.erb +1 -1
- data/app/views/kaui/admin_tenants/_form_invoice_template.erb +1 -1
- data/app/views/kaui/admin_tenants/_form_invoice_translation.erb +1 -1
- data/app/views/kaui/admin_tenants/_show_catalog_simple.erb +11 -5
- data/app/views/kaui/admin_tenants/new_catalog.html.erb +2 -2
- data/app/views/kaui/admin_tenants/new_overdue_config.html.erb +2 -2
- data/app/views/kaui/admin_tenants/new_plan_currency.html.erb +1 -1
- data/app/views/kaui/bundles/index.html.erb +1 -1
- data/app/views/kaui/bundles/transfer.html.erb +13 -5
- data/app/views/kaui/invoices/_invoice_table.html.erb +1 -1
- data/app/views/kaui/layouts/kaui_flash.html.erb +24 -0
- data/app/views/kaui/layouts/kaui_header.html.erb +19 -2
- data/app/views/kaui/payment_methods/_payment_methods_details_table.html.erb +13 -4
- data/app/views/kaui/payments/_payment_table.html.erb +21 -11
- data/app/views/kaui/payments/index.html.erb +9 -9
- data/app/views/kaui/queues/index.html.erb +1 -1
- data/app/views/kaui/subscriptions/_cancel_by_date_modal.html.erb +1 -4
- data/app/views/kaui/subscriptions/_edit_form.html.erb +1 -1
- data/app/views/kaui/subscriptions/_form.html.erb +1 -1
- data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +3 -3
- data/app/views/kaui/subscriptions/edit_bcd.erb +1 -1
- data/app/views/kaui/tag_definitions/index.html.erb +2 -2
- data/app/views/kaui/tags/index.html.erb +1 -0
- data/config/initializers/bootstrap_datepicker_rails.rb +3 -0
- data/config/initializers/devise.rb +8 -6
- data/config/initializers/js_routes.rb +9 -0
- data/config/initializers/kilbill_client_init.rb +13 -0
- data/config/initializers/killbill_authenticatable.rb +71 -21
- data/config/initializers/killbill_registerable.rb +5 -3
- data/config/initializers/time_formats.rb +6 -4
- data/config/locales/en.yml +78 -1
- data/config/routes.rb +34 -32
- data/db/migrate/20130812155313_devise_create_kaui_users.rb +10 -8
- data/db/migrate/20150109214021_create_kaui_tenants.rb +10 -8
- data/db/migrate/20150112232813_create_kaui_allowed_users.rb +10 -8
- data/lib/generators/kaui/install/install_generator.rb +23 -20
- data/lib/generators/kaui/install/templates/config/initializers/kaui.rb +3 -1
- data/lib/kaui/engine.rb +17 -5
- data/lib/kaui/installer/installer.rb +27 -26
- data/lib/kaui/version.rb +3 -1
- data/lib/kaui.rb +28 -30
- data/lib/tasks/kaui_tasks.rake +1 -0
- metadata +136 -438
- data/app/assets/javascripts/application.js +0 -17
- data/app/assets/javascripts/kaui/bootstrap-tweaks.js +0 -172
- data/app/assets/stylesheets/bootstrap_and_overrides.css.less +0 -44
- data/app/assets/stylesheets/kaui/kaui.less +0 -21
- data/app/assets/stylesheets/kaui/timeline.less +0 -4
- data/config/initializers/asset.rb +0 -1
- data/config/initializers/kilbill-client-init.rb +0 -9
- data/db/schema.rb +0 -15
- data/test/dummy/README.rdoc +0 -261
- data/test/dummy/Rakefile +0 -7
- data/test/dummy/app/controllers/application_controller.rb +0 -9
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/bin/bundle +0 -3
- data/test/dummy/bin/rails +0 -4
- data/test/dummy/bin/rake +0 -4
- data/test/dummy/bin/setup +0 -38
- data/test/dummy/bin/update +0 -29
- data/test/dummy/bin/yarn +0 -11
- data/test/dummy/config/application.rb +0 -18
- data/test/dummy/config/boot.rb +0 -3
- data/test/dummy/config/database.yml +0 -27
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -58
- data/test/dummy/config/environments/production.rb +0 -91
- data/test/dummy/config/environments/test.rb +0 -49
- data/test/dummy/config/initializers/application_controller_renderer.rb +0 -6
- data/test/dummy/config/initializers/assets.rb +0 -14
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/cookies_serializer.rb +0 -5
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/killbill_client.rb +0 -1
- data/test/dummy/config/initializers/mime_types.rb +0 -4
- data/test/dummy/config/initializers/money.rb +0 -2
- data/test/dummy/config/initializers/new_framework_defaults_5_1.rb +0 -14
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -33
- data/test/dummy/config/routes.rb +0 -3
- data/test/dummy/config/secrets.yml +0 -32
- data/test/dummy/config/symmetric-encryption.yml +0 -135
- data/test/dummy/config.ru +0 -4
- data/test/dummy/db/schema.rb +0 -52
- data/test/dummy/public/404.html +0 -26
- data/test/dummy/public/422.html +0 -26
- data/test/dummy/public/500.html +0 -25
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +0 -6
- data/test/fixtures/SpyCarAdvanced.xml +0 -824
- data/test/fixtures/catalog-v1.xml +0 -73
- data/test/fixtures/catalog_translation_fr-v1.properties +0 -1
- data/test/fixtures/invoice_template-v1.html +0 -100
- data/test/fixtures/invoice_translation_fr-v1.properties +0 -23
- data/test/fixtures/overdue-v1.xml +0 -49
- data/test/fixtures/stripe.yml +0 -2
- data/test/functional/kaui/account_children_controller_test.rb +0 -32
- data/test/functional/kaui/account_custom_fields_controller_test.rb +0 -29
- data/test/functional/kaui/account_emails_controller_test.rb +0 -55
- data/test/functional/kaui/account_tags_controller_test.rb +0 -48
- data/test/functional/kaui/account_timelines_controller_test.rb +0 -20
- data/test/functional/kaui/accounts_controller_test.rb +0 -297
- data/test/functional/kaui/admin_allowed_users_controller_test.rb +0 -234
- data/test/functional/kaui/admin_controller_test.rb +0 -45
- data/test/functional/kaui/admin_tenants_controller_test.rb +0 -352
- data/test/functional/kaui/audit_logs_controller_test.rb +0 -71
- data/test/functional/kaui/bundle_tags_controller_test.rb +0 -23
- data/test/functional/kaui/bundles_controller_test.rb +0 -130
- data/test/functional/kaui/chargebacks_controller_test.rb +0 -42
- data/test/functional/kaui/charges_controller_test.rb +0 -60
- data/test/functional/kaui/credits_controller_test.rb +0 -54
- data/test/functional/kaui/custom_fields_controller_test.rb +0 -52
- data/test/functional/kaui/functional_test_helper.rb +0 -13
- data/test/functional/kaui/functional_test_helper_nosetup.rb +0 -120
- data/test/functional/kaui/home_controller_test.rb +0 -407
- data/test/functional/kaui/invoice_items_controller_test.rb +0 -82
- data/test/functional/kaui/invoices_controller_test.rb +0 -88
- data/test/functional/kaui/login_proxy_controller_test.rb +0 -12
- data/test/functional/kaui/payment_methods_controller_test.rb +0 -52
- data/test/functional/kaui/payments_controller_test.rb +0 -59
- data/test/functional/kaui/queues_controller_test.rb +0 -17
- data/test/functional/kaui/refunds_controller_test.rb +0 -63
- data/test/functional/kaui/registrations_controller_test.rb +0 -49
- data/test/functional/kaui/role_definitions_controller_test.rb +0 -47
- data/test/functional/kaui/subscriptions_controller_test.rb +0 -194
- data/test/functional/kaui/tag_definitions_controller_test.rb +0 -29
- data/test/functional/kaui/tags_controller_test.rb +0 -21
- data/test/functional/kaui/tenants_controller_test.rb +0 -60
- data/test/functional/kaui/transactions_controller_test.rb +0 -90
- data/test/integration/kaui/date_helper_integration_test.rb +0 -16
- data/test/integration/kaui/integration_test_helper.rb +0 -32
- data/test/integration/kaui/navigation_test.rb +0 -43
- data/test/killbill_test_helper.rb +0 -219
- data/test/test_helper.rb +0 -22
- data/test/unit/helpers/kaui/admin_allowed_users_helper_test.rb +0 -6
- data/test/unit/helpers/kaui/admin_tenants_helper_test.rb +0 -6
- data/test/unit/helpers/kaui/payment_method_helper_test.rb +0 -17
- data/test/unit/helpers/kaui/tenants_helper_test.rb +0 -6
- data/test/unit/helpers/kaui/uuid_helper_test.rb +0 -16
- data/test/unit/kaui/account_email_test.rb +0 -19
- data/test/unit/kaui/account_test.rb +0 -14
- data/test/unit/kaui/admin_tenant_test.rb +0 -132
- data/test/unit/kaui/allowed_user_test.rb +0 -34
- data/test/unit/kaui/base_test.rb +0 -23
- data/test/unit/kaui/date_helper_test.rb +0 -26
- data/test/unit/kaui/invoice_item_test.rb +0 -11
- data/test/unit/kaui/invoice_payment_test.rb +0 -42
- data/test/unit/kaui/invoice_test.rb +0 -20
- data/test/unit/kaui/money_helper_test.rb +0 -16
- data/test/unit/kaui/payment_test.rb +0 -42
- data/test/unit/kaui/tag_definition_test.rb +0 -11
- data/test/unit/kaui/tenant_test.rb +0 -19
- /data/app/assets/stylesheets/{application.css → kaui_application.css} +0 -0
@@ -78,15 +78,15 @@
|
|
78
78
|
<table id="payment_<%= payment.payment_id %>" class="table table-condensed mobile-data">
|
79
79
|
<thead>
|
80
80
|
<tr>
|
81
|
-
<th
|
82
|
-
<th
|
83
|
-
<th
|
84
|
-
<th
|
85
|
-
<th
|
86
|
-
<th
|
87
|
-
<th
|
88
|
-
<th
|
89
|
-
<th
|
81
|
+
<th><%= I18n.translate('date') %></th>
|
82
|
+
<th><%= I18n.translate('type') %></th>
|
83
|
+
<th><%= I18n.translate('amount') %></th>
|
84
|
+
<th><%= I18n.translate('transaction_external_key') %></th>
|
85
|
+
<th><%= I18n.translate('first_id') %></th>
|
86
|
+
<th><%= I18n.translate('second_id') %></th>
|
87
|
+
<th><%= I18n.translate('gateway_code') %></th>
|
88
|
+
<th><%= I18n.translate('gateway_message') %></th>
|
89
|
+
<th><%= I18n.translate('status') %></th>
|
90
90
|
</tr>
|
91
91
|
</thead>
|
92
92
|
<tbody>
|
@@ -96,8 +96,14 @@
|
|
96
96
|
<td><%= transaction.transaction_type %></td>
|
97
97
|
<td>
|
98
98
|
<% if transaction.amount.present? %>
|
99
|
+
<% if transaction.amount != transaction.processed_amount %>
|
100
|
+
<%= humanized_money_with_symbol Kaui::Transaction.processed_amount_to_money(transaction) %>
|
101
|
+
(<%= transaction.currency %>)
|
102
|
+
<a href="#" data-toggle="tooltip" class="kb-tooltip" title="<%= I18n.translate('requested_amount_colon') %> <%= humanized_money_with_symbol Kaui::Transaction.amount_to_money(transaction) %>(<%= transaction.currency %>)">(?)</a>
|
103
|
+
<% else%>
|
99
104
|
<%= humanized_money_with_symbol Kaui::Transaction.amount_to_money(transaction) %>
|
100
105
|
(<%= transaction.currency %>)
|
106
|
+
<% end %>
|
101
107
|
<% end %>
|
102
108
|
</td>
|
103
109
|
<td><%= transaction.transaction_external_key %></td>
|
@@ -127,7 +133,7 @@
|
|
127
133
|
<% (transaction.properties || []).sort_by { |p| p.key }.each do |property| %>
|
128
134
|
<% next if property.value.blank? %>
|
129
135
|
<li><strong><%= property.key %>:</strong>
|
130
|
-
<%=
|
136
|
+
<%= json?(property.value) ? "<pre>#{JSON.pretty_generate(JSON.parse(property.value))}</pre>".html_safe : property.value %></li>
|
131
137
|
<% end %>
|
132
138
|
</ul>
|
133
139
|
</td>
|
@@ -145,6 +151,10 @@
|
|
145
151
|
"dom": "t",
|
146
152
|
"paging": false
|
147
153
|
});
|
154
|
+
|
155
|
+
$(function () {
|
156
|
+
$('[data-toggle="tooltip"]').tooltip();
|
157
|
+
});
|
158
|
+
|
148
159
|
});
|
149
160
|
<% end %>
|
150
|
-
|
@@ -2,23 +2,23 @@
|
|
2
2
|
|
3
3
|
<div class="column-block">
|
4
4
|
|
5
|
-
<h1
|
5
|
+
<h1><%= I18n.translate('payments') %></h1>
|
6
6
|
|
7
7
|
<table id="payments-table" class="table table-condensed mobile-data">
|
8
8
|
<thead>
|
9
9
|
<tr>
|
10
|
-
<th
|
11
|
-
<th
|
12
|
-
<th
|
13
|
-
<th
|
14
|
-
<th
|
15
|
-
<th
|
16
|
-
<th
|
10
|
+
<th><%= I18n.translate('number') %></th>
|
11
|
+
<th><%= I18n.translate('date') %></th>
|
12
|
+
<th><%= I18n.translate('auth_amount') %></th>
|
13
|
+
<th><%= I18n.translate('capture_amount') %></th>
|
14
|
+
<th><%= I18n.translate('refund_amount') %></th>
|
15
|
+
<th><%= I18n.translate('last_transaction_status') %></th>
|
16
|
+
<th><%= I18n.translate('external_key') %></th>
|
17
17
|
</tr>
|
18
18
|
</thead>
|
19
19
|
<tbody>
|
20
20
|
<tr>
|
21
|
-
<td colspan="1" class="dataTables_empty"
|
21
|
+
<td colspan="1" class="dataTables_empty"><%= I18n.translate('loading_data_from_server') %></td>
|
22
22
|
</tr>
|
23
23
|
</tbody>
|
24
24
|
</table>
|
@@ -36,7 +36,7 @@
|
|
36
36
|
<tr>
|
37
37
|
<% end %>
|
38
38
|
<td><%= truncate_millis(bus_event['createdDate']) %></td>
|
39
|
-
<td><%= truncate_class_name(bus_event['className']) %></td>
|
39
|
+
<td><%= truncate_class_name(bus_event['className'], false) %></td>
|
40
40
|
<td><%= "<pre>#{JSON.pretty_generate(bus_event['event'])}</pre>".html_safe %></td>
|
41
41
|
<td><%= object_id_popover(bus_event['userToken'], 'left') %></td>
|
42
42
|
<% if @account_id.blank? %>
|
@@ -35,10 +35,7 @@
|
|
35
35
|
<div class="modal-footer">
|
36
36
|
<div class="alert alert-warning">
|
37
37
|
<strong>Notice</strong>
|
38
|
-
|
39
|
-
<li>When <span class="label label-default">Use requested date for billing?</span> is checked, then entitlement date and billing date are going to be equal to the requested date.</li>
|
40
|
-
<li>When <strong>not</strong> checked, then the entitlement date will be set with requested date, and billing date will default to now.</li>
|
41
|
-
</ul>
|
38
|
+
<%= raw t('views.subscriptions.requested_date_for_billing_notice') %>
|
42
39
|
</div>
|
43
40
|
</div>
|
44
41
|
</div><!-- /.modal-content -->
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<div class="form-group">
|
10
10
|
<%= label_tag :price_override, 'Price Override', :class => 'col-sm-3 control-label' %>
|
11
11
|
<div class="col-sm-9">
|
12
|
-
<%= number_field_tag :price_override, nil, :step => :any, :class => 'form-control' %>
|
12
|
+
<%= number_field_tag :price_override, nil, min: 0, :step => :any, :class => 'form-control' %>
|
13
13
|
</div>
|
14
14
|
</div>
|
15
15
|
<div class="form-group">
|
@@ -37,7 +37,7 @@
|
|
37
37
|
<div class="form-group">
|
38
38
|
<%= label_tag :price_override, 'Price Override', :class => 'col-sm-2 control-label' %>
|
39
39
|
<div class="col-sm-10">
|
40
|
-
<%= number_field_tag :price_override, nil, :step => :any, :class => 'form-control' %>
|
40
|
+
<%= number_field_tag :price_override, nil, :step => :any, :min => 0, :class => 'form-control' %>
|
41
41
|
</div>
|
42
42
|
</div>
|
43
43
|
<div class="form-group">
|
@@ -15,7 +15,7 @@
|
|
15
15
|
</thead>
|
16
16
|
<tbody>
|
17
17
|
<% (bundle.subscriptions || []).each do |sub| %>
|
18
|
-
<tr class="<%=
|
18
|
+
<tr class="<%= subscription_cancelled?(sub) ? 'expired' : 'non-expired' %>">
|
19
19
|
<% unless @available_subscription_tags.blank? && @custom_fields_per_subscription.blank? %>
|
20
20
|
<td class="inline-row-tag-bar">
|
21
21
|
<div class="tag-bar tag-bar-no-border">
|
@@ -53,9 +53,9 @@
|
|
53
53
|
<td><%= humanized_subscription_charged_through_date(sub, account) %></td>
|
54
54
|
<td><%= humanized_subscription_cancelled_information(sub, account) %></td>
|
55
55
|
<td class="text-center">
|
56
|
-
<% if
|
56
|
+
<% if subscription_future_cancelled?(sub, account) %>
|
57
57
|
<%= link_to 'Reinstate', kaui_engine.reinstate_path(:id => sub.subscription_id), :method => :put, :class => 'btn btn-xs' %>
|
58
|
-
<% elsif !
|
58
|
+
<% elsif !subscription_cancelled?(sub) %>
|
59
59
|
<% if can? :change_plan, Kaui::Subscription %>
|
60
60
|
<%= link_to 'Change', kaui_engine.edit_subscription_path(sub.subscription_id), :class => 'btn btn-xs' %>
|
61
61
|
<% end %>
|
@@ -25,10 +25,10 @@
|
|
25
25
|
<td><%= object_id_popover(tag_definition.id) %></td>
|
26
26
|
<td><%= tag_definition.name %></td>
|
27
27
|
<td><%= tag_definition.description %></td>
|
28
|
-
<td><%= tag_definition.
|
28
|
+
<td><%= tag_definition.system_tag? %></td>
|
29
29
|
<td><%= tag_definition.pretty_applicable_object_types %></td>
|
30
30
|
<td>
|
31
|
-
<% unless tag_definition.
|
31
|
+
<% unless tag_definition.system_tag? %>
|
32
32
|
<%= link_to 'Destroy', kaui_engine.tag_definition_path(tag_definition.id), :confirm => 'Are you sure?', :method => :delete %>
|
33
33
|
<% end %>
|
34
34
|
</td>
|
@@ -1,14 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Use this hook to configure devise mailer, warden hooks and so forth.
|
2
4
|
# Many of these configuration options can be set straight in your model.
|
3
5
|
Devise.setup do |config|
|
4
6
|
require 'devise/orm/active_record'
|
5
|
-
config.authentication_keys = [
|
7
|
+
config.authentication_keys = [:kb_username]
|
6
8
|
config.skip_session_storage = [:http_auth]
|
7
9
|
config.timeout_in = 20.minutes
|
8
10
|
config.sign_out_via = :delete
|
9
11
|
|
10
12
|
config.warden do |manager|
|
11
|
-
manager.default_strategies(:
|
13
|
+
manager.default_strategies(scope: :user).unshift :killbill_jwt, :killbill_authenticatable
|
12
14
|
end
|
13
15
|
|
14
16
|
config.router_name = :kaui_engine
|
@@ -20,7 +22,7 @@ end
|
|
20
22
|
module Devise
|
21
23
|
class FailureApp < ActionController::Metal
|
22
24
|
def scope_url
|
23
|
-
opts
|
25
|
+
opts = {}
|
24
26
|
|
25
27
|
# Initialize script_name with nil to prevent infinite loops in
|
26
28
|
# authenticated mounted engines in rails 4.2 and 5.0
|
@@ -32,8 +34,8 @@ module Devise
|
|
32
34
|
|
33
35
|
# Fix for Rails 5.1
|
34
36
|
# See https://github.com/rails/rails/pull/29898/files (merge_script_names)
|
35
|
-
#opts[:script_name] = relative_url_root if relative_url_root?
|
36
|
-
opts[:script_name] = relative_url_root
|
37
|
+
# opts[:script_name] = relative_url_root if relative_url_root?
|
38
|
+
opts[:script_name] = "#{relative_url_root}/" if relative_url_root?
|
37
39
|
|
38
40
|
router_name = Devise.mappings[scope].router_name || Devise.available_router_name
|
39
41
|
context = send(router_name)
|
@@ -43,7 +45,7 @@ module Devise
|
|
43
45
|
elsif respond_to?(:root_url)
|
44
46
|
root_url(opts)
|
45
47
|
else
|
46
|
-
|
48
|
+
'/'
|
47
49
|
end
|
48
50
|
end
|
49
51
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# HACK: to make the killbill client models work as rails models
|
4
|
+
|
5
|
+
require File.expand_path('../../app/models/kaui/rails_methods.rb', __dir__)
|
6
|
+
|
7
|
+
module KillBillClient
|
8
|
+
module Model
|
9
|
+
Resource.class_eval do
|
10
|
+
include Kaui::RailsMethods
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -1,44 +1,94 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'devise/strategies/authenticatable'
|
4
|
+
require 'jwt'
|
2
5
|
|
3
6
|
module Devise
|
4
7
|
module Strategies
|
8
|
+
module KillbillHelpers
|
9
|
+
def kb_authenticate!(kb_username, creds)
|
10
|
+
# Find the associated user object (see find_for_killbill_authentication in app/models/kaui/killbill_authenticatable.rb)
|
11
|
+
resource = mapping.to.find_for_killbill_authentication(kb_username)
|
12
|
+
|
13
|
+
# Validate the credentials (see valid_killbill_password? in app/models/kaui/killbill_authenticatable.rb)
|
14
|
+
return unless validate(resource) { resource.valid_killbill_password?(creds) }
|
15
|
+
|
16
|
+
# Create the user if needed
|
17
|
+
resource.after_killbill_authentication
|
18
|
+
# Tell warden to halt the strategy and set the user in the appropriate scope
|
19
|
+
success!(resource)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
5
23
|
class KillbillAuthenticatable < Authenticatable
|
6
|
-
|
24
|
+
include KillbillHelpers
|
25
|
+
|
26
|
+
# Invoked by Warden::Strategies::Base#_run! to execute the strategy
|
27
|
+
def authenticate!
|
28
|
+
return false unless valid_password?
|
29
|
+
|
30
|
+
user = params[:user] || {}
|
31
|
+
kb_authenticate!(user[:kb_username], { username: user[:kb_username], password: })
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Warden strategy to authenticate an user through a JWT token in the `Authorization` request header
|
36
|
+
class KillbillJWTAuthenticatable < Authenticatable
|
37
|
+
# Must match the Kill Bill configuration (e.g. org.killbill.security.auth0.usernameClaim)
|
38
|
+
mattr_accessor :username_claim
|
39
|
+
self.username_claim = 'sub'
|
40
|
+
|
41
|
+
include KillbillHelpers
|
42
|
+
|
43
|
+
# Invoked by Warden::Strategies::Base#_run! to execute the strategy
|
7
44
|
def authenticate!
|
45
|
+
payload, = ::JWT.decode(token, nil, false)
|
46
|
+
kb_username = payload[username_claim].presence
|
47
|
+
return false unless kb_username
|
48
|
+
|
49
|
+
kb_authenticate!(kb_username, { bearer: token })
|
50
|
+
end
|
51
|
+
|
52
|
+
def valid?
|
53
|
+
!token.nil?
|
54
|
+
end
|
8
55
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
# Tell warden to halt the strategy and set the user in the appropriate scope
|
21
|
-
success!(resource)
|
56
|
+
private
|
57
|
+
|
58
|
+
def token
|
59
|
+
@token ||= begin
|
60
|
+
auth = env['HTTP_AUTHORIZATION']
|
61
|
+
if auth
|
62
|
+
method, token = auth.split
|
63
|
+
method == 'Bearer' ? token : nil
|
64
|
+
else
|
65
|
+
nil
|
66
|
+
end
|
22
67
|
end
|
23
|
-
rescue Errno::ECONNREFUSED => _
|
24
|
-
return fail(:killbill_not_available)
|
25
68
|
end
|
26
69
|
end
|
27
70
|
end
|
28
71
|
end
|
29
72
|
|
30
73
|
Warden::Strategies.add(:killbill_authenticatable, Devise::Strategies::KillbillAuthenticatable)
|
74
|
+
Warden::Strategies.add(:killbill_jwt, Devise::Strategies::KillbillJWTAuthenticatable)
|
31
75
|
|
32
76
|
Warden::Manager.after_set_user do |user, auth, opts|
|
33
77
|
unless user.authenticated_with_killbill?
|
34
78
|
scope = opts[:scope]
|
35
79
|
auth.logout(scope)
|
36
|
-
throw(:warden,
|
80
|
+
throw(:warden, scope:, reason: 'Kill Bill session expired')
|
37
81
|
end
|
38
82
|
end
|
39
83
|
|
40
84
|
Devise.add_module(:killbill_authenticatable,
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
44
|
-
:
|
85
|
+
strategy: true,
|
86
|
+
route: :session,
|
87
|
+
controller: :sessions,
|
88
|
+
model: 'kaui/killbill_authenticatable')
|
89
|
+
|
90
|
+
Devise::Strategies::KillbillJWTAuthenticatable.username_claim = if defined?(JRUBY_VERSION)
|
91
|
+
java.lang.System.getProperty('kaui.jwt.username_claim', ENV['KAUI_USERNAME_CLAIM'] || 'sub')
|
92
|
+
else
|
93
|
+
ENV['KAUI_USERNAME_CLAIM'] || 'sub'
|
94
|
+
end
|
@@ -1,4 +1,6 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Devise.add_module(:killbill_registerable,
|
2
|
-
:
|
3
|
-
:
|
4
|
-
:
|
4
|
+
route: :registration,
|
5
|
+
controller: :registrations,
|
6
|
+
model: 'kaui/killbill_registerable')
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Time::DATE_FORMATS[:
|
4
|
-
Date::DATE_FORMATS[:
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Time::DATE_FORMATS[:pretty] = '%b %d %Y at %H:%M'
|
4
|
+
Date::DATE_FORMATS[:pretty] = '%b %d %Y at %H:%M'
|
5
|
+
Time::DATE_FORMATS[:date_only] = '%Y-%m-%d'
|
6
|
+
Date::DATE_FORMATS[:date_only] = '%Y-%m-%d'
|
data/config/locales/en.yml
CHANGED
@@ -1,3 +1,80 @@
|
|
1
1
|
en:
|
2
2
|
account: "Account"
|
3
|
-
|
3
|
+
new_account: "New Account"
|
4
|
+
transfer: "Transfer"
|
5
|
+
comment: "Comment"
|
6
|
+
change: "Change"
|
7
|
+
unknown_bcd: "Unknown bill cycle day"
|
8
|
+
payment_method_id: "Payment Method ID:"
|
9
|
+
external_key_with_colon: "External Key:"
|
10
|
+
external_id_with_colon: "External ID:"
|
11
|
+
name_with_colon: "Name:"
|
12
|
+
custom_field_created_success: "Custom field was successfully created"
|
13
|
+
custom_field_uuid_exist_in_account_db: "UUID do exist in ACCOUNT object database."
|
14
|
+
custom_field_uuid_exist_in_bundle_db: "UUID do exist in BUNDLE object database."
|
15
|
+
custom_field_uuid_exist_in_subscription_db: "UUID do exist in SUBSCRIPTION object database."
|
16
|
+
custom_field_uuid_exist_in_invoice_db: "UUID do exist in INVOICE object database."
|
17
|
+
custom_field_uuid_exist_in_payment_db: "UUID do exist in PAYMENT object database."
|
18
|
+
custom_field_uuid_exist_in_invoice_payment_db: "UUID do exist in INVOICE PAYMENT object database."
|
19
|
+
custom_field_uuid_do_not_exist_in_db: "UUID do not exist in object database."
|
20
|
+
custom_field_uuid_exist_in_invoice_item_db: "UUID do exist in INVOICE ITEMS object database."
|
21
|
+
immediate: "Immediate"
|
22
|
+
start_of_term: "Start of term"
|
23
|
+
end_of_term: "End of term"
|
24
|
+
billing_policy: "Billing Policy"
|
25
|
+
new_account_id_or_external_key: "New account id or external key"
|
26
|
+
object_invalid_dont_exist: "Object type INVALID or object id do not exist."
|
27
|
+
date: "Date"
|
28
|
+
type: "Type"
|
29
|
+
amount: "Amount"
|
30
|
+
processed_amount: "Processed Amount"
|
31
|
+
transaction_external_key: "Transaction external key"
|
32
|
+
first_id: "First id"
|
33
|
+
second_id: "Second id"
|
34
|
+
gateway_code: "Gateway code"
|
35
|
+
gateway_message: "Gateway message"
|
36
|
+
status: "Status"
|
37
|
+
payments: "Payments"
|
38
|
+
number: "Number"
|
39
|
+
auth_amount: "Auth amount"
|
40
|
+
capture_amount: "Capture amount"
|
41
|
+
refund_amount: "Refund amount"
|
42
|
+
last_transaction_status: "Last transaction status"
|
43
|
+
external_key: "External key"
|
44
|
+
loading_data_from_server: "Loading data from server"
|
45
|
+
requested_amount_colon: "Requested amount: "
|
46
|
+
|
47
|
+
flashes:
|
48
|
+
notices:
|
49
|
+
clock_updated_successfully: "Clock was successfully updated to %{new_date}"
|
50
|
+
clock_reset_successfully: 'Clock was successfully reset'
|
51
|
+
overdue_uploaded_successfully: 'Overdue config was successfully uploaded'
|
52
|
+
overdue_added_successfully: 'Overdue config was successfully added'
|
53
|
+
invoice_template_uploaded_successfully: 'Invoice template was successfully uploaded'
|
54
|
+
invoice_translation_uploaded_successfully: 'Invoice translation was successfully uploaded'
|
55
|
+
catalog_translation_uploaded_successfully: 'Catalog translation was successfully uploaded'
|
56
|
+
catalog_uploaded_successfully: 'Catalog was successfully uploaded'
|
57
|
+
|
58
|
+
errors:
|
59
|
+
messages:
|
60
|
+
invalid_object_type: "Invalid Object Type: %{error}"
|
61
|
+
invalid_phone: "Invalid phone number!"
|
62
|
+
invalid_bill_cycle_day_local: "Incorrect day of the billing cycle. It should be in the range from 1 to 31."
|
63
|
+
invalid_xml: "Invalid XML: %{error}"
|
64
|
+
invalid_min_date: "Invalid min date format"
|
65
|
+
invalid_max_date: "Invalid max date format"
|
66
|
+
views:
|
67
|
+
subscriptions:
|
68
|
+
requested_date_for_billing_notice: <ul>
|
69
|
+
<li>When <span class="label label-default">Use requested date for billing?</span> is checked, then entitlement date and billing date are going to be equal to the requested date.</li>
|
70
|
+
<li>When <strong>not</strong> checked, then the entitlement date will be set with requested date, and billing date will be derived from the catalog policy.</li>
|
71
|
+
</ul>
|
72
|
+
catalogs:
|
73
|
+
show:
|
74
|
+
plan_table:
|
75
|
+
plan_id: "Plan Id"
|
76
|
+
product: "Product"
|
77
|
+
category: "Category"
|
78
|
+
billing_period: "Billing Period"
|
79
|
+
trial: "Trial"
|
80
|
+
final_phase_duration: "Final Phase Duration"
|
data/config/routes.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ActionDispatch
|
2
4
|
module Routing
|
3
5
|
class Mapper
|
@@ -14,13 +16,12 @@ module ActionDispatch
|
|
14
16
|
end
|
15
17
|
|
16
18
|
Kaui::Engine.routes.draw do
|
17
|
-
|
18
19
|
devise_for :users,
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
20
|
+
class_name: 'Kaui::User',
|
21
|
+
module: :devise,
|
22
|
+
controllers: { sessions: 'kaui/sessions', registrations: 'kaui/registrations' }
|
22
23
|
|
23
|
-
root :
|
24
|
+
root to: 'home#index', as: 'kaui'
|
24
25
|
|
25
26
|
scope '/accounts' do
|
26
27
|
match '/pagination' => 'accounts#pagination', :via => :get, :as => 'accounts_pagination'
|
@@ -65,7 +66,7 @@ Kaui::Engine.routes.draw do
|
|
65
66
|
end
|
66
67
|
end
|
67
68
|
end
|
68
|
-
resources :accounts, :
|
69
|
+
resources :accounts, only: %i[index new create edit update show destroy], param: :account_id do
|
69
70
|
member do
|
70
71
|
put :set_default_payment_method
|
71
72
|
delete :delete_payment_method
|
@@ -74,25 +75,25 @@ Kaui::Engine.routes.draw do
|
|
74
75
|
end
|
75
76
|
|
76
77
|
# The id is the email itself
|
77
|
-
resources :account_emails, :
|
78
|
-
resources :bundles, :
|
79
|
-
resources :charges, :
|
80
|
-
resources :chargebacks, :
|
81
|
-
resources :credits, :
|
82
|
-
resources :invoices, :
|
83
|
-
resources :invoice_items, :
|
84
|
-
resources :payments, :
|
85
|
-
resources :refunds, :
|
86
|
-
resources :transactions, :
|
87
|
-
resources :queues, :
|
88
|
-
resources :audit_logs, :
|
78
|
+
resources :account_emails, only: %i[new create destroy], constraints: { id: /[\w+\-;@.]+/ }, path: 'emails'
|
79
|
+
resources :bundles, only: [:index]
|
80
|
+
resources :charges, only: %i[new create]
|
81
|
+
resources :chargebacks, only: %i[new create]
|
82
|
+
resources :credits, only: %i[new create]
|
83
|
+
resources :invoices, only: %i[index show]
|
84
|
+
resources :invoice_items, only: [:edit]
|
85
|
+
resources :payments, only: %i[index show new create]
|
86
|
+
resources :refunds, only: %i[new create]
|
87
|
+
resources :transactions, only: %i[new create]
|
88
|
+
resources :queues, only: [:index]
|
89
|
+
resources :audit_logs, only: [:index]
|
89
90
|
end
|
90
91
|
|
91
92
|
scope '/payment_methods' do
|
92
93
|
match '/validate_external_key' => 'payment_methods#validate_external_key', :via => :get, :as => 'payment_methods_validate_external_key'
|
93
94
|
match '/refresh' => 'payment_methods#refresh', :via => :post, :as => 'refresh_payment_methods'
|
94
95
|
end
|
95
|
-
resources :payment_methods, :
|
96
|
+
resources :payment_methods, only: %i[new create show destroy]
|
96
97
|
|
97
98
|
scope '/invoices' do
|
98
99
|
match '/pagination' => 'invoices#pagination', :via => :get, :as => 'invoices_pagination'
|
@@ -101,19 +102,19 @@ Kaui::Engine.routes.draw do
|
|
101
102
|
match '/commit' => 'invoices#commit_invoice', :via => :post, :as => 'commit_invoice'
|
102
103
|
match '/void' => 'invoices#void_invoice', :via => :delete, :as => 'void_invoice'
|
103
104
|
end
|
104
|
-
resources :invoices, :
|
105
|
+
resources :invoices, only: [:index]
|
105
106
|
|
106
107
|
scope '/invoice_items' do
|
107
108
|
match '/:id/tags' => 'invoice_items#update_tags', :via => :post, :as => 'update_invoice_items_tags'
|
108
109
|
end
|
109
|
-
resources :invoice_items, :
|
110
|
+
resources :invoice_items, only: %i[update destroy]
|
110
111
|
|
111
112
|
scope '/payments' do
|
112
113
|
match '/pagination' => 'payments#pagination', :via => :get, :as => 'payments_pagination'
|
113
114
|
match '/:id' => 'payments#restful_show', :via => :get, :as => 'payment'
|
114
115
|
match '/:id/cancel_scheduled_payment' => 'payments#cancel_scheduled_payment', :via => :delete, :as => 'payment_cancel_scheduled_payment'
|
115
116
|
end
|
116
|
-
resources :payments, :
|
117
|
+
resources :payments, only: [:index]
|
117
118
|
|
118
119
|
scope '/transactions' do
|
119
120
|
match '/:id' => 'transactions#restful_show', :via => :get, :as => 'transaction'
|
@@ -121,10 +122,10 @@ Kaui::Engine.routes.draw do
|
|
121
122
|
end
|
122
123
|
|
123
124
|
scope '/bundles' do
|
124
|
-
put '/:id/do_pause_resume', :
|
125
|
-
get '/:id/pause_resume', :
|
126
|
-
put '/:id/do_transfer', :
|
127
|
-
get '/:id/transfer', :
|
125
|
+
put '/:id/do_pause_resume', to: 'bundles#do_pause_resume', as: 'do_pause_resume_bundle'
|
126
|
+
get '/:id/pause_resume', to: 'bundles#pause_resume', as: 'pause_resume_bundle'
|
127
|
+
put '/:id/do_transfer', to: 'bundles#do_transfer', as: 'do_transfer_bundle'
|
128
|
+
get '/:id/transfer', to: 'bundles#transfer', as: 'transfer_bundle'
|
128
129
|
match '/:id' => 'bundles#restful_show', :via => :get, :as => 'bundle'
|
129
130
|
end
|
130
131
|
|
@@ -136,19 +137,20 @@ Kaui::Engine.routes.draw do
|
|
136
137
|
match '/validate_external_key' => 'subscriptions#validate_external_key', :via => :get, :as => 'subscriptions_validate_external_key'
|
137
138
|
match '/validate_bundle_external_key' => 'subscriptions#validate_bundle_external_key', :via => :get, :as => 'subscriptions_validate_bundle_external_key'
|
138
139
|
end
|
139
|
-
resources :subscriptions, :
|
140
|
+
resources :subscriptions, only: %i[new create show edit update destroy]
|
140
141
|
|
141
142
|
scope '/tags' do
|
142
143
|
match '/pagination' => 'tags#pagination', :via => :get, :as => 'tags_pagination'
|
143
144
|
end
|
144
|
-
resources :tags, :
|
145
|
+
resources :tags, only: [:index]
|
145
146
|
|
146
|
-
resources :tag_definitions, :
|
147
|
+
resources :tag_definitions, only: %i[index new create destroy]
|
147
148
|
|
148
149
|
scope '/custom_fields' do
|
149
150
|
match '/pagination' => 'custom_fields#pagination', :via => :get, :as => 'custom_fields_pagination'
|
151
|
+
match '/check_object_exist' => 'custom_fields#check_object_exist', :via => :get, :as => 'custom_fields_check_object_exist'
|
150
152
|
end
|
151
|
-
resources :custom_fields, :
|
153
|
+
resources :custom_fields, only: %i[index new create check_object_exist]
|
152
154
|
|
153
155
|
scope '/tenants' do
|
154
156
|
match '/' => 'tenants#index', :via => :get, :as => 'tenants'
|
@@ -195,12 +197,12 @@ Kaui::Engine.routes.draw do
|
|
195
197
|
match '/switch' => 'admin_tenants#switch_tenant', :via => :get, :as => 'switch_tenant'
|
196
198
|
match '/:id/download_catalog' => 'admin_tenants#download_catalog_xml', :via => :get, :as => 'download_catalog_xml'
|
197
199
|
end
|
198
|
-
resources :admin_tenants, :
|
200
|
+
resources :admin_tenants, only: %i[index new create show]
|
199
201
|
|
200
202
|
resources :admin_allowed_users
|
201
203
|
scope '/admin_allowed_users' do
|
202
204
|
match '/add_tenant' => 'admin_allowed_users#add_tenant', :via => :post, :as => 'add_tenant'
|
203
205
|
end
|
204
206
|
|
205
|
-
resources :role_definitions, :
|
207
|
+
resources :role_definitions, only: %i[new create]
|
206
208
|
end
|