kaui 2.1.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (269) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +8 -7
  3. data/Rakefile +4 -2
  4. data/app/assets/config/kaui_manifest.js +45 -0
  5. data/app/assets/javascripts/jquery.spin.js +76 -0
  6. data/app/assets/javascripts/kaui/kaui.js +76 -0
  7. data/app/assets/javascripts/kaui_application.js +25 -0
  8. data/app/assets/javascripts/spin.js +76 -0
  9. data/app/assets/stylesheets/bootstrap_and_overrides.scss +240 -0
  10. data/app/assets/stylesheets/kaui/{account.less → account.scss} +4 -0
  11. data/app/assets/stylesheets/kaui/{audit.less → audit.scss} +5 -1
  12. data/app/assets/stylesheets/kaui/{common.less → common.scss} +17 -15
  13. data/app/assets/stylesheets/kaui/{datatable.less → datatable.scss} +6 -3
  14. data/app/assets/stylesheets/kaui/{header.less → header.scss} +16 -12
  15. data/app/assets/stylesheets/kaui/{home.less → home.scss} +7 -4
  16. data/app/assets/stylesheets/kaui/{invoice.less → invoice.scss} +7 -3
  17. data/app/assets/stylesheets/kaui/kaui.scss +265 -0
  18. data/app/assets/stylesheets/kaui/kaui_bootstrap.scss +3 -0
  19. data/app/assets/stylesheets/kaui/{overdue.less → overdue.scss} +3 -1
  20. data/app/assets/stylesheets/kaui/{payment.less → payment.scss} +3 -0
  21. data/app/assets/stylesheets/kaui/{subscription.less → subscription.scss} +4 -1
  22. data/app/assets/stylesheets/kaui/{tags.less → tags.scss} +9 -5
  23. data/app/assets/stylesheets/kaui/timeline.scss +7 -0
  24. data/app/assets/stylesheets/kaui/tooltip.scss +15 -0
  25. data/app/controllers/kaui/account_children_controller.rb +25 -28
  26. data/app/controllers/kaui/account_custom_fields_controller.rb +16 -15
  27. data/app/controllers/kaui/account_emails_controller.rb +28 -25
  28. data/app/controllers/kaui/account_tags_controller.rb +37 -34
  29. data/app/controllers/kaui/account_timelines_controller.rb +38 -33
  30. data/app/controllers/kaui/accounts_controller.rb +268 -250
  31. data/app/controllers/kaui/admin_allowed_users_controller.rb +105 -99
  32. data/app/controllers/kaui/admin_controller.rb +32 -31
  33. data/app/controllers/kaui/admin_tenants_controller.rb +434 -388
  34. data/app/controllers/kaui/audit_logs_controller.rb +86 -83
  35. data/app/controllers/kaui/bundle_tags_controller.rb +24 -20
  36. data/app/controllers/kaui/bundles_controller.rb +96 -82
  37. data/app/controllers/kaui/chargebacks_controller.rb +36 -33
  38. data/app/controllers/kaui/charges_controller.rb +23 -20
  39. data/app/controllers/kaui/credits_controller.rb +28 -25
  40. data/app/controllers/kaui/custom_fields_controller.rb +172 -38
  41. data/app/controllers/kaui/engine_controller.rb +2 -1
  42. data/app/controllers/kaui/engine_controller_util.rb +128 -117
  43. data/app/controllers/kaui/home_controller.rb +230 -217
  44. data/app/controllers/kaui/invoice_items_controller.rb +43 -39
  45. data/app/controllers/kaui/invoice_tags_controller.rb +24 -20
  46. data/app/controllers/kaui/invoices_controller.rb +132 -117
  47. data/app/controllers/kaui/login_proxy_controller.rb +2 -1
  48. data/app/controllers/kaui/payment_methods_controller.rb +102 -94
  49. data/app/controllers/kaui/payments_controller.rb +95 -92
  50. data/app/controllers/kaui/queues_controller.rb +47 -14
  51. data/app/controllers/kaui/refunds_controller.rb +36 -33
  52. data/app/controllers/kaui/registrations_controller.rb +7 -7
  53. data/app/controllers/kaui/role_definitions_controller.rb +17 -14
  54. data/app/controllers/kaui/sessions_controller.rb +7 -4
  55. data/app/controllers/kaui/subscriptions_controller.rb +197 -187
  56. data/app/controllers/kaui/tag_definitions_controller.rb +28 -27
  57. data/app/controllers/kaui/tags_controller.rb +25 -22
  58. data/app/controllers/kaui/tenants_controller.rb +30 -28
  59. data/app/controllers/kaui/transactions_controller.rb +43 -38
  60. data/app/helpers/kaui/account_helper.rb +16 -14
  61. data/app/helpers/kaui/application_helper.rb +8 -3
  62. data/app/helpers/kaui/date_helper.rb +4 -3
  63. data/app/helpers/kaui/home_helper.rb +2 -0
  64. data/app/helpers/kaui/locale_helper.rb +7 -6
  65. data/app/helpers/kaui/money_helper.rb +2 -1
  66. data/app/helpers/kaui/object_helper.rb +11 -10
  67. data/app/helpers/kaui/payment_helper.rb +7 -6
  68. data/app/helpers/kaui/payment_method_helper.rb +3 -2
  69. data/app/helpers/kaui/permissions_helper.rb +9 -9
  70. data/app/helpers/kaui/plugin_helper.rb +25 -23
  71. data/app/helpers/kaui/subscription_helper.rb +27 -29
  72. data/app/helpers/kaui/us_states_helper.rb +7 -6
  73. data/app/helpers/kaui/uuid_helper.rb +8 -6
  74. data/app/models/kaui/ability.rb +19 -12
  75. data/app/models/kaui/account.rb +45 -28
  76. data/app/models/kaui/account_email.rb +23 -20
  77. data/app/models/kaui/account_timeline.rb +5 -1
  78. data/app/models/kaui/admin.rb +65 -64
  79. data/app/models/kaui/admin_tenant.rb +81 -82
  80. data/app/models/kaui/allowed_user.rb +13 -9
  81. data/app/models/kaui/allowed_user_tenant.rb +4 -2
  82. data/app/models/kaui/application_record.rb +2 -0
  83. data/app/models/kaui/audit_log.rb +6 -3
  84. data/app/models/kaui/base.rb +13 -7
  85. data/app/models/kaui/bundle.rb +41 -24
  86. data/app/models/kaui/catalog.rb +118 -113
  87. data/app/models/kaui/chargeback.rb +5 -1
  88. data/app/models/kaui/credit.rb +4 -1
  89. data/app/models/kaui/custom_field.rb +9 -6
  90. data/app/models/kaui/invoice.rb +25 -22
  91. data/app/models/kaui/invoice_item.rb +9 -6
  92. data/app/models/kaui/invoice_payment.rb +49 -54
  93. data/app/models/kaui/killbill_authenticatable.rb +14 -8
  94. data/app/models/kaui/killbill_registerable.rb +7 -0
  95. data/app/models/kaui/overdue.rb +64 -65
  96. data/app/models/kaui/payment.rb +22 -19
  97. data/app/models/kaui/payment_method.rb +48 -39
  98. data/app/models/kaui/payment_state.rb +41 -38
  99. data/app/models/kaui/rails_methods.rb +9 -9
  100. data/app/models/kaui/refund.rb +7 -1
  101. data/app/models/kaui/role_definition.rb +5 -1
  102. data/app/models/kaui/simple_plan.rb +5 -3
  103. data/app/models/kaui/subscription.rb +10 -7
  104. data/app/models/kaui/tag.rb +25 -22
  105. data/app/models/kaui/tag_definition.rb +50 -45
  106. data/app/models/kaui/tenant.rb +6 -5
  107. data/app/models/kaui/transaction.rb +43 -31
  108. data/app/models/kaui/user.rb +10 -16
  109. data/app/models/kaui/user_role.rb +8 -5
  110. data/app/views/kaui/accounts/_billing_info.html.erb +1 -1
  111. data/app/views/kaui/accounts/_form.html.erb +2 -2
  112. data/app/views/kaui/accounts/index.html.erb +2 -0
  113. data/app/views/kaui/admin_allowed_users/_form.html.erb +3 -3
  114. data/app/views/kaui/admin_tenants/_form_catalog_translation.erb +1 -1
  115. data/app/views/kaui/admin_tenants/_form_invoice_template.erb +1 -1
  116. data/app/views/kaui/admin_tenants/_form_invoice_translation.erb +1 -1
  117. data/app/views/kaui/admin_tenants/_show_catalog_simple.erb +11 -5
  118. data/app/views/kaui/admin_tenants/new_catalog.html.erb +2 -2
  119. data/app/views/kaui/admin_tenants/new_overdue_config.html.erb +2 -2
  120. data/app/views/kaui/admin_tenants/new_plan_currency.html.erb +1 -1
  121. data/app/views/kaui/bundles/index.html.erb +1 -1
  122. data/app/views/kaui/bundles/transfer.html.erb +13 -5
  123. data/app/views/kaui/invoices/_invoice_table.html.erb +1 -1
  124. data/app/views/kaui/layouts/kaui_flash.html.erb +24 -0
  125. data/app/views/kaui/layouts/kaui_header.html.erb +19 -2
  126. data/app/views/kaui/payment_methods/_payment_methods_details_table.html.erb +13 -4
  127. data/app/views/kaui/payments/_payment_table.html.erb +21 -11
  128. data/app/views/kaui/payments/index.html.erb +9 -9
  129. data/app/views/kaui/queues/index.html.erb +1 -1
  130. data/app/views/kaui/subscriptions/_cancel_by_date_modal.html.erb +1 -4
  131. data/app/views/kaui/subscriptions/_edit_form.html.erb +1 -1
  132. data/app/views/kaui/subscriptions/_form.html.erb +1 -1
  133. data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +3 -3
  134. data/app/views/kaui/subscriptions/edit_bcd.erb +1 -1
  135. data/app/views/kaui/tag_definitions/index.html.erb +2 -2
  136. data/app/views/kaui/tags/index.html.erb +1 -0
  137. data/config/initializers/bootstrap_datepicker_rails.rb +3 -0
  138. data/config/initializers/devise.rb +8 -6
  139. data/config/initializers/js_routes.rb +9 -0
  140. data/config/initializers/kilbill_client_init.rb +13 -0
  141. data/config/initializers/killbill_authenticatable.rb +71 -21
  142. data/config/initializers/killbill_registerable.rb +5 -3
  143. data/config/initializers/time_formats.rb +6 -4
  144. data/config/locales/en.yml +78 -1
  145. data/config/routes.rb +34 -32
  146. data/db/migrate/20130812155313_devise_create_kaui_users.rb +10 -8
  147. data/db/migrate/20150109214021_create_kaui_tenants.rb +10 -8
  148. data/db/migrate/20150112232813_create_kaui_allowed_users.rb +10 -8
  149. data/lib/generators/kaui/install/install_generator.rb +23 -20
  150. data/lib/generators/kaui/install/templates/config/initializers/kaui.rb +3 -1
  151. data/lib/kaui/engine.rb +17 -5
  152. data/lib/kaui/installer/installer.rb +27 -26
  153. data/lib/kaui/version.rb +3 -1
  154. data/lib/kaui.rb +28 -30
  155. data/lib/tasks/kaui_tasks.rake +1 -0
  156. metadata +136 -438
  157. data/app/assets/javascripts/application.js +0 -17
  158. data/app/assets/javascripts/kaui/bootstrap-tweaks.js +0 -172
  159. data/app/assets/stylesheets/bootstrap_and_overrides.css.less +0 -44
  160. data/app/assets/stylesheets/kaui/kaui.less +0 -21
  161. data/app/assets/stylesheets/kaui/timeline.less +0 -4
  162. data/config/initializers/asset.rb +0 -1
  163. data/config/initializers/kilbill-client-init.rb +0 -9
  164. data/db/schema.rb +0 -15
  165. data/test/dummy/README.rdoc +0 -261
  166. data/test/dummy/Rakefile +0 -7
  167. data/test/dummy/app/controllers/application_controller.rb +0 -9
  168. data/test/dummy/app/helpers/application_helper.rb +0 -2
  169. data/test/dummy/bin/bundle +0 -3
  170. data/test/dummy/bin/rails +0 -4
  171. data/test/dummy/bin/rake +0 -4
  172. data/test/dummy/bin/setup +0 -38
  173. data/test/dummy/bin/update +0 -29
  174. data/test/dummy/bin/yarn +0 -11
  175. data/test/dummy/config/application.rb +0 -18
  176. data/test/dummy/config/boot.rb +0 -3
  177. data/test/dummy/config/database.yml +0 -27
  178. data/test/dummy/config/environment.rb +0 -5
  179. data/test/dummy/config/environments/development.rb +0 -58
  180. data/test/dummy/config/environments/production.rb +0 -91
  181. data/test/dummy/config/environments/test.rb +0 -49
  182. data/test/dummy/config/initializers/application_controller_renderer.rb +0 -6
  183. data/test/dummy/config/initializers/assets.rb +0 -14
  184. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  185. data/test/dummy/config/initializers/cookies_serializer.rb +0 -5
  186. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  187. data/test/dummy/config/initializers/inflections.rb +0 -16
  188. data/test/dummy/config/initializers/killbill_client.rb +0 -1
  189. data/test/dummy/config/initializers/mime_types.rb +0 -4
  190. data/test/dummy/config/initializers/money.rb +0 -2
  191. data/test/dummy/config/initializers/new_framework_defaults_5_1.rb +0 -14
  192. data/test/dummy/config/initializers/secret_token.rb +0 -7
  193. data/test/dummy/config/initializers/session_store.rb +0 -8
  194. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  195. data/test/dummy/config/locales/en.yml +0 -33
  196. data/test/dummy/config/routes.rb +0 -3
  197. data/test/dummy/config/secrets.yml +0 -32
  198. data/test/dummy/config/symmetric-encryption.yml +0 -135
  199. data/test/dummy/config.ru +0 -4
  200. data/test/dummy/db/schema.rb +0 -52
  201. data/test/dummy/public/404.html +0 -26
  202. data/test/dummy/public/422.html +0 -26
  203. data/test/dummy/public/500.html +0 -25
  204. data/test/dummy/public/favicon.ico +0 -0
  205. data/test/dummy/script/rails +0 -6
  206. data/test/fixtures/SpyCarAdvanced.xml +0 -824
  207. data/test/fixtures/catalog-v1.xml +0 -73
  208. data/test/fixtures/catalog_translation_fr-v1.properties +0 -1
  209. data/test/fixtures/invoice_template-v1.html +0 -100
  210. data/test/fixtures/invoice_translation_fr-v1.properties +0 -23
  211. data/test/fixtures/overdue-v1.xml +0 -49
  212. data/test/fixtures/stripe.yml +0 -2
  213. data/test/functional/kaui/account_children_controller_test.rb +0 -32
  214. data/test/functional/kaui/account_custom_fields_controller_test.rb +0 -29
  215. data/test/functional/kaui/account_emails_controller_test.rb +0 -55
  216. data/test/functional/kaui/account_tags_controller_test.rb +0 -48
  217. data/test/functional/kaui/account_timelines_controller_test.rb +0 -20
  218. data/test/functional/kaui/accounts_controller_test.rb +0 -297
  219. data/test/functional/kaui/admin_allowed_users_controller_test.rb +0 -234
  220. data/test/functional/kaui/admin_controller_test.rb +0 -45
  221. data/test/functional/kaui/admin_tenants_controller_test.rb +0 -352
  222. data/test/functional/kaui/audit_logs_controller_test.rb +0 -71
  223. data/test/functional/kaui/bundle_tags_controller_test.rb +0 -23
  224. data/test/functional/kaui/bundles_controller_test.rb +0 -130
  225. data/test/functional/kaui/chargebacks_controller_test.rb +0 -42
  226. data/test/functional/kaui/charges_controller_test.rb +0 -60
  227. data/test/functional/kaui/credits_controller_test.rb +0 -54
  228. data/test/functional/kaui/custom_fields_controller_test.rb +0 -52
  229. data/test/functional/kaui/functional_test_helper.rb +0 -13
  230. data/test/functional/kaui/functional_test_helper_nosetup.rb +0 -120
  231. data/test/functional/kaui/home_controller_test.rb +0 -407
  232. data/test/functional/kaui/invoice_items_controller_test.rb +0 -82
  233. data/test/functional/kaui/invoices_controller_test.rb +0 -88
  234. data/test/functional/kaui/login_proxy_controller_test.rb +0 -12
  235. data/test/functional/kaui/payment_methods_controller_test.rb +0 -52
  236. data/test/functional/kaui/payments_controller_test.rb +0 -59
  237. data/test/functional/kaui/queues_controller_test.rb +0 -17
  238. data/test/functional/kaui/refunds_controller_test.rb +0 -63
  239. data/test/functional/kaui/registrations_controller_test.rb +0 -49
  240. data/test/functional/kaui/role_definitions_controller_test.rb +0 -47
  241. data/test/functional/kaui/subscriptions_controller_test.rb +0 -194
  242. data/test/functional/kaui/tag_definitions_controller_test.rb +0 -29
  243. data/test/functional/kaui/tags_controller_test.rb +0 -21
  244. data/test/functional/kaui/tenants_controller_test.rb +0 -60
  245. data/test/functional/kaui/transactions_controller_test.rb +0 -90
  246. data/test/integration/kaui/date_helper_integration_test.rb +0 -16
  247. data/test/integration/kaui/integration_test_helper.rb +0 -32
  248. data/test/integration/kaui/navigation_test.rb +0 -43
  249. data/test/killbill_test_helper.rb +0 -219
  250. data/test/test_helper.rb +0 -22
  251. data/test/unit/helpers/kaui/admin_allowed_users_helper_test.rb +0 -6
  252. data/test/unit/helpers/kaui/admin_tenants_helper_test.rb +0 -6
  253. data/test/unit/helpers/kaui/payment_method_helper_test.rb +0 -17
  254. data/test/unit/helpers/kaui/tenants_helper_test.rb +0 -6
  255. data/test/unit/helpers/kaui/uuid_helper_test.rb +0 -16
  256. data/test/unit/kaui/account_email_test.rb +0 -19
  257. data/test/unit/kaui/account_test.rb +0 -14
  258. data/test/unit/kaui/admin_tenant_test.rb +0 -132
  259. data/test/unit/kaui/allowed_user_test.rb +0 -34
  260. data/test/unit/kaui/base_test.rb +0 -23
  261. data/test/unit/kaui/date_helper_test.rb +0 -26
  262. data/test/unit/kaui/invoice_item_test.rb +0 -11
  263. data/test/unit/kaui/invoice_payment_test.rb +0 -42
  264. data/test/unit/kaui/invoice_test.rb +0 -20
  265. data/test/unit/kaui/money_helper_test.rb +0 -16
  266. data/test/unit/kaui/payment_test.rb +0 -42
  267. data/test/unit/kaui/tag_definition_test.rb +0 -11
  268. data/test/unit/kaui/tenant_test.rb +0 -19
  269. /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>Date</th>
82
- <th>Type</th>
83
- <th>Amount</th>
84
- <th>Transaction external key</th>
85
- <th>First id</th>
86
- <th>Second id</th>
87
- <th>Gateway code</th>
88
- <th>Gateway message</th>
89
- <th>Status</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
- <%= is_json?(property.value) ? "<pre>#{JSON.pretty_generate(JSON.parse(property.value))}</pre>".html_safe : property.value %></li>
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>Payments</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>Number</th>
11
- <th>Date</th>
12
- <th>Auth amount</th>
13
- <th>Capture amount</th>
14
- <th>Refund amount</th>
15
- <th>Last transaction status</th>
16
- <th>External key</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">Loading data from server</td>
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
- <ul>
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="<%= is_subscription_cancelled?(sub) ? 'expired' : 'non-expired' %>">
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 is_subscription_future_cancelled?(sub, account) %>
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 !is_subscription_cancelled?(sub) %>
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 %>
@@ -20,7 +20,7 @@
20
20
  </div>
21
21
  <div class="form-group">
22
22
  <div class="col-sm-offset-2 col-sm-10">
23
- <%= f.submit_tag 'Save', :class => 'btn btn-default' %>
23
+ <%= f.submit 'Save', :class => 'btn btn-default' %>
24
24
  </div>
25
25
  </div>
26
26
  <% 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.is_system_tag? %></td>
28
+ <td><%= tag_definition.system_tag? %></td>
29
29
  <td><%= tag_definition.pretty_applicable_object_types %></td>
30
30
  <td>
31
- <% unless tag_definition.is_system_tag? %>
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>
@@ -25,6 +25,7 @@
25
25
  </div>
26
26
 
27
27
  <%= javascript_tag do %>
28
+
28
29
  $(document).ready(function() {
29
30
  var table = $('#tags-table').DataTable({
30
31
  "dom": "<'row'<'col-md-6'l><'col-md-6'f>r>t<'row'<'col-md-6'i><'col-md-6'p>>",
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bootstrap-datepicker-rails'
@@ -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 = [ :kb_username ]
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(:scope => :user).unshift :killbill_authenticatable
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 + '/' if 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,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ JsRoutes.setup do |config|
4
+ config.module_type = 'NIL'
5
+ config.namespace = 'Routes'
6
+ config.prefix = ActionController::Base.relative_url_root.to_s
7
+ config.url_links = true
8
+ end
9
+ JsRoutes.generate!
@@ -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
- # Invoked by warden to execute the strategy
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
- creds = params[:user] || {}
10
- kb_username = creds[:kb_username]
11
- kb_password = password
12
- # Find the associated user object
13
- resource = valid_password? && mapping.to.find_for_killbill_authentication(kb_username)
14
- return fail(:not_found_in_database) unless resource
15
-
16
- # Validate the credentials
17
- if validate(resource){ resource.valid_killbill_password?(kb_username, kb_password) }
18
- # Create the user if needed
19
- resource.after_killbill_authentication
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, :scope => scope, :reason => "Kill Bill session expired")
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
- :strategy => true,
42
- :route => :session,
43
- :controller => :sessions,
44
- :model => 'kaui/killbill_authenticatable')
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
- :route => :registration,
3
- :controller => :registrations,
4
- :model => 'kaui/killbill_registerable')
4
+ route: :registration,
5
+ controller: :registrations,
6
+ model: 'kaui/killbill_registerable')
@@ -1,4 +1,6 @@
1
- Time::DATE_FORMATS[:pretty] = "%b %d %Y at %H:%M"
2
- Date::DATE_FORMATS[:pretty] = "%b %d %Y at %H:%M"
3
- Time::DATE_FORMATS[:date_only] = "%Y-%m-%d"
4
- Date::DATE_FORMATS[:date_only] = "%Y-%m-%d"
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'
@@ -1,3 +1,80 @@
1
1
  en:
2
2
  account: "Account"
3
- unknown_bcd: "Unknown bill cycle day"
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
- :class_name => 'Kaui::User',
20
- :module => :devise,
21
- :controllers => { :sessions => 'kaui/sessions', :registrations => 'kaui/registrations' }
20
+ class_name: 'Kaui::User',
21
+ module: :devise,
22
+ controllers: { sessions: 'kaui/sessions', registrations: 'kaui/registrations' }
22
23
 
23
- root :to => 'home#index', as: 'kaui'
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, :only => [ :index, :new, :create, :edit, :update, :show, :destroy ], :param => :account_id do
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, :only => [:new, :create, :destroy], :constraints => { :id => /[\w+\-;@\.]+/ }, :path => 'emails'
78
- resources :bundles, :only => [:index]
79
- resources :charges, :only => [:new, :create]
80
- resources :chargebacks, :only => [:new, :create]
81
- resources :credits, :only => [:new, :create]
82
- resources :invoices, :only => [:index, :show]
83
- resources :invoice_items, :only => [:edit]
84
- resources :payments, :only => [:index, :show, :new, :create]
85
- resources :refunds, :only => [:new, :create]
86
- resources :transactions, :only => [:new, :create]
87
- resources :queues, :only => [:index]
88
- resources :audit_logs, :only => [:index]
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, :only => [:new, :create, :show, :destroy]
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, :only => [ :index ]
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, :only => [:update, :destroy]
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, :only => [ :index ]
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', :to => 'bundles#do_pause_resume', :as => 'do_pause_resume_bundle'
125
- get '/:id/pause_resume', :to => 'bundles#pause_resume', :as => 'pause_resume_bundle'
126
- put '/:id/do_transfer', :to => 'bundles#do_transfer', :as => 'do_transfer_bundle'
127
- get '/:id/transfer', :to => 'bundles#transfer', :as => 'transfer_bundle'
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, :only => [:new, :create, :show, :edit, :update, :destroy]
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, :only => [:index]
145
+ resources :tags, only: [:index]
145
146
 
146
- resources :tag_definitions, :only => [:index, :new, :create, :destroy]
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, :only => [:index, :new, :create]
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, :only => [ :index, :new, :create, :show ]
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, :only => [ :new, :create ]
207
+ resources :role_definitions, only: %i[new create]
206
208
  end