kaui 4.0.24 → 4.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/assets/images/kaui/blocking-states/shield-white.svg +3 -0
- data/app/assets/images/kaui/timeline/block.svg +4 -0
- data/app/assets/stylesheets/kaui/auth_pages.css +9 -0
- data/app/assets/stylesheets/kaui/kaui.css +0 -206
- data/app/assets/stylesheets/kaui/subscription.css +38 -0
- data/app/assets/stylesheets/kaui/tags.css +7 -7
- data/app/controllers/kaui/account_timelines_controller.rb +24 -6
- data/app/controllers/kaui/accounts_controller.rb +24 -1
- data/app/controllers/kaui/bundles_controller.rb +14 -0
- data/app/controllers/kaui/subscriptions_controller.rb +14 -0
- data/app/helpers/kaui/date_helper.rb +12 -0
- data/app/helpers/kaui/exception_helper.rb +1 -1
- data/app/services/dependencies/aviate.rb +7 -4
- data/app/views/kaui/account_timelines/show.html.erb +247 -88
- data/app/views/kaui/accounts/_billing_details.html.erb +13 -1
- data/app/views/kaui/accounts/_billing_info.html.erb +5 -1
- data/app/views/kaui/accounts/block.html.erb +16 -0
- data/app/views/kaui/admin_allowed_users/_form.html.erb +5 -1
- data/app/views/kaui/bundles/block.html.erb +16 -0
- data/app/views/kaui/components/blocking_state_form/_about_panel.html.erb +9 -0
- data/app/views/kaui/components/blocking_state_form/_fields.html.erb +79 -0
- data/app/views/kaui/layouts/kaui_account_navbar.html.erb +1 -0
- data/app/views/kaui/layouts/kaui_account_sidebar.html.erb +1 -0
- data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +24 -0
- data/app/views/kaui/subscriptions/block.html.erb +16 -0
- data/config/locales/en.yml +4 -0
- data/config/routes.rb +6 -0
- data/lib/kaui/version.rb +1 -1
- metadata +26 -5
|
@@ -29,19 +29,25 @@
|
|
|
29
29
|
<div class="form-group p-0 w-100 max-width-148">
|
|
30
30
|
<label for="payment_filter" class="control-label">Payment</label>
|
|
31
31
|
<div class="d-flex">
|
|
32
|
-
<%= select_tag 'payment_filter', options_for_select('<option value="all">ALL</option><option value="authorize">AUTHORIZE</option><option value="purchase">PURCHASE</option><option value="capture">CAPTURE</option><option value="credit">CREDIT</option><option value="refund">REFUND</option><option value="void">VOID</option><option value="chargeback">CHARGEBACK</option>'.html_safe), :class => 'form-control' %>
|
|
32
|
+
<%= select_tag 'payment_filter', options_for_select('<option value="all">ALL</option><option value="none">NONE</option><option value="authorize">AUTHORIZE</option><option value="purchase">PURCHASE</option><option value="capture">CAPTURE</option><option value="credit">CREDIT</option><option value="refund">REFUND</option><option value="void">VOID</option><option value="chargeback">CHARGEBACK</option>'.html_safe), :class => 'form-control' %>
|
|
33
33
|
</div>
|
|
34
34
|
</div>
|
|
35
35
|
<div class="form-group p-0 w-100 max-width-148">
|
|
36
36
|
<label for="subscription_filter" class="control-label">Subscription</label>
|
|
37
37
|
<div class="d-flex">
|
|
38
|
-
<%= select_tag 'subscription_filter', options_for_select('<option value="all">ALL</option><option value="start_entitlement">START_ENTITLEMENT</option><option value="pause_entitlement">PAUSE_ENTITLEMENT</option><option value="resume_entitlement">RESUME_ENTITLEMENT</option><option value="stop_entitlement">STOP_ENTITLEMENT</option><option value="phase">PHASE</option><option value="change">CHANGE</option>'.html_safe), :class => 'form-control' %>
|
|
38
|
+
<%= select_tag 'subscription_filter', options_for_select('<option value="all">ALL</option><option value="none">NONE</option><option value="start_entitlement">START_ENTITLEMENT</option><option value="pause_entitlement">PAUSE_ENTITLEMENT</option><option value="resume_entitlement">RESUME_ENTITLEMENT</option><option value="stop_entitlement">STOP_ENTITLEMENT</option><option value="phase">PHASE</option><option value="change">CHANGE</option>'.html_safe), :class => 'form-control' %>
|
|
39
39
|
</div>
|
|
40
40
|
</div>
|
|
41
41
|
<div class="form-group p-0 w-100 max-width-148">
|
|
42
42
|
<label for="billing_filter" class="control-label">Billing</label>
|
|
43
43
|
<div class="d-flex">
|
|
44
|
-
<%= select_tag 'billing_filter', options_for_select('<option value="all">ALL</option><option value="invoice">INVOICE</option><option value="start_billing">START_BILLING</option><option value="pause_billing">PAUSE_BILLING</option><option value="resume_billing">RESUME_BILLING</option><option value="stop_billing">STOP_BILLING</option>'.html_safe), :class => 'form-control' %>
|
|
44
|
+
<%= select_tag 'billing_filter', options_for_select('<option value="all">ALL</option><option value="none">NONE</option><option value="invoice">INVOICE</option><option value="start_billing">START_BILLING</option><option value="pause_billing">PAUSE_BILLING</option><option value="resume_billing">RESUME_BILLING</option><option value="stop_billing">STOP_BILLING</option>'.html_safe), :class => 'form-control' %>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="form-group p-0 w-100 max-width-148">
|
|
48
|
+
<label for="blocking_state_filter" class="control-label">Blocking State</label>
|
|
49
|
+
<div class="d-flex">
|
|
50
|
+
<%= select_tag 'blocking_state_filter', options_for_select('<option value="all">ALL</option><option value="start_entitlement">START_ENTITLEMENT</option><option value="start_billing">START_BILLING</option><option value="service_state_change">SERVICE_STATE_CHANGE</option><option value="none">NONE</option>'.html_safe), :class => 'form-control' %>
|
|
45
51
|
</div>
|
|
46
52
|
</div>
|
|
47
53
|
<div class="form-group p-0 d-flex align-self-end justify-content-end w-100">
|
|
@@ -49,7 +55,7 @@
|
|
|
49
55
|
</div>
|
|
50
56
|
</form>
|
|
51
57
|
|
|
52
|
-
<div>
|
|
58
|
+
<div id="timeline-entries">
|
|
53
59
|
<% if @account.present? %>
|
|
54
60
|
<% @invoices.each do |invoice_stub| %>
|
|
55
61
|
<% if invoice_stub.bundle_keys.present? %>
|
|
@@ -60,7 +66,7 @@
|
|
|
60
66
|
<% else %>
|
|
61
67
|
<% invoice = invoice_stub %>
|
|
62
68
|
<% end %>
|
|
63
|
-
<div title="<%= bundles %>" data-event-type="INVOICE">
|
|
69
|
+
<div title="<%= bundles %>" data-event-type="INVOICE" data-event-category="invoice" data-timestamp="<%= timeline_sort_timestamp(invoice.target_date) %>">
|
|
64
70
|
<div class="datetime-container">
|
|
65
71
|
<% if invoice.target_date.present? %>
|
|
66
72
|
<%= invoice.target_date %>
|
|
@@ -148,7 +154,7 @@
|
|
|
148
154
|
<% invoice = nil %>
|
|
149
155
|
<% end %>
|
|
150
156
|
<% payment.transactions.each do |transaction| %>
|
|
151
|
-
<div title="<%= bundles %>" data-event-type="<%= transaction.transaction_type %>">
|
|
157
|
+
<div title="<%= bundles %>" data-event-type="<%= transaction.transaction_type %>" data-event-category="payment" data-timestamp="<%= timeline_sort_timestamp(transaction.effective_date) %>">
|
|
152
158
|
<div class="datetime-container">
|
|
153
159
|
<% if transaction.effective_date.present? %>
|
|
154
160
|
<%= format_date(transaction.effective_date, @account.time_zone).html_safe %>
|
|
@@ -228,61 +234,179 @@
|
|
|
228
234
|
<% @bundles.each do |bundle| %>
|
|
229
235
|
<% bundle.subscriptions.each do |sub| %>
|
|
230
236
|
<% sub.events.each do |event| %>
|
|
231
|
-
<%
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
237
|
+
<% if event.event_type == 'SERVICE_STATE_CHANGE' %>
|
|
238
|
+
<div title="<%= @bundle_names[bundle.external_key] %>" data-event-type="SERVICE_STATE_CHANGE" data-event-category="blocking_state" data-timestamp="<%= timeline_sort_timestamp(event.effective_date) %>">
|
|
239
|
+
<div class="datetime-container">
|
|
240
|
+
<% if event.effective_date.present? %>
|
|
241
|
+
<%= format_date(event.effective_date, @account.time_zone).html_safe %>
|
|
242
|
+
<% else %>
|
|
243
|
+
[unknown]
|
|
244
|
+
<% end %>
|
|
245
|
+
</div>
|
|
246
|
+
<div class="account-timeline-card d-flex gap-3">
|
|
247
|
+
<span class="icon-container">
|
|
248
|
+
<%= image_tag("kaui/timeline/block.svg", width: 20, height: 20) %>
|
|
249
|
+
</span>
|
|
250
|
+
|
|
251
|
+
<div class="d-flex justify-content-start flex-column gap-3 w-100 row">
|
|
252
|
+
<h3>BLOCKING STATE</h3>
|
|
253
|
+
<div class="w-100">
|
|
254
|
+
<div class="row account-timeline-card-detail">
|
|
255
|
+
<div class="col-sm-4">
|
|
256
|
+
<div>
|
|
257
|
+
<b>Service / State</b>
|
|
258
|
+
<p>
|
|
259
|
+
<%= event.service_name %> / <%= event.service_state_name %>
|
|
260
|
+
</p>
|
|
261
|
+
</div>
|
|
255
262
|
</div>
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
</
|
|
263
|
+
<div class="col-sm-4">
|
|
264
|
+
<div>
|
|
265
|
+
<b>Blocked</b>
|
|
266
|
+
<p>
|
|
267
|
+
<%= 'Billing' if event.is_blocked_billing %>
|
|
268
|
+
<%= 'Entitlement' if event.is_blocked_entitlement %>
|
|
269
|
+
</p>
|
|
270
|
+
</div>
|
|
271
|
+
<div>
|
|
272
|
+
<b>Bundle</b>
|
|
273
|
+
<p>
|
|
274
|
+
<%= truncate_uuid(@bundle_names[bundle.external_key]) %>
|
|
275
|
+
</p>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
<div class="col-sm-4">
|
|
279
|
+
<div>
|
|
280
|
+
<b>Reason Code / Comments</b>
|
|
281
|
+
<p>
|
|
282
|
+
<% if event.audit_logs.present? %>
|
|
283
|
+
<% event.audit_logs.each do |entry| %>
|
|
284
|
+
<%= Kaui::AuditLog.description(entry) %>
|
|
285
|
+
<% end %>
|
|
286
|
+
<% end %>
|
|
287
|
+
</p>
|
|
288
|
+
</div>
|
|
264
289
|
</div>
|
|
265
290
|
</div>
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
291
|
+
</div>
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
<% else %>
|
|
296
|
+
<% event_category = %w[START_BILLING PAUSE_BILLING RESUME_BILLING STOP_BILLING].include?(event.event_type) ? 'billing' : 'subscription' %>
|
|
297
|
+
<div title="<%= @bundle_names[bundle.external_key] %>" data-event-type="<%= event.event_type %>" data-event-category="<%= event_category %>" data-timestamp="<%= timeline_sort_timestamp(event.effective_date) %>">
|
|
298
|
+
<div class="datetime-container">
|
|
299
|
+
<% if event.effective_date.present? %>
|
|
300
|
+
<%= format_date(event.effective_date, @account.time_zone).html_safe %>
|
|
301
|
+
<% else %>
|
|
302
|
+
[unknown]
|
|
303
|
+
<% end %>
|
|
304
|
+
</div>
|
|
305
|
+
<div class="account-timeline-card d-flex gap-3">
|
|
306
|
+
<span class="icon-container">
|
|
307
|
+
<%= image_tag("kaui/timeline/invoice.svg", width: 20, height: 20) %>
|
|
308
|
+
</span>
|
|
309
|
+
|
|
310
|
+
<div class="d-flex justify-content-start flex-column gap-3 w-100 row">
|
|
311
|
+
<h3><%= event.event_type %></h3>
|
|
312
|
+
<div class="w-100">
|
|
313
|
+
<div class="row account-timeline-card-detail">
|
|
314
|
+
<div class="col-sm-4">
|
|
315
|
+
<div>
|
|
316
|
+
<b>Details</b>
|
|
317
|
+
<p>
|
|
318
|
+
<% if event.is_blocked_billing || event.is_blocked_entitlement %>
|
|
319
|
+
<%= event.service_name %> / <%= event.service_state_name %><br/>
|
|
273
320
|
<% end %>
|
|
274
|
-
|
|
275
|
-
|
|
321
|
+
<%= event.phase %><span class="hide" title="<%= sub.product_category %>"></span>
|
|
322
|
+
</p>
|
|
323
|
+
</div>
|
|
324
|
+
|
|
325
|
+
</div>
|
|
326
|
+
<div class="col-sm-4">
|
|
327
|
+
<div>
|
|
328
|
+
<b>Bundle</b>
|
|
329
|
+
<p>
|
|
330
|
+
<%= truncate_uuid(@bundle_names[bundle.external_key]) %>
|
|
331
|
+
</p>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
<div class="col-sm-4">
|
|
335
|
+
<div>
|
|
336
|
+
<b>Reason Code / Comments</b>
|
|
337
|
+
<p>
|
|
338
|
+
<% if event.audit_logs.present? %>
|
|
339
|
+
<% event.audit_logs.each do |entry| %>
|
|
340
|
+
<%= Kaui::AuditLog.description(entry) %>
|
|
341
|
+
<% end %>
|
|
342
|
+
<% end %>
|
|
343
|
+
</p>
|
|
344
|
+
</div>
|
|
276
345
|
</div>
|
|
277
346
|
</div>
|
|
278
347
|
</div>
|
|
279
348
|
</div>
|
|
280
349
|
</div>
|
|
281
350
|
</div>
|
|
282
|
-
|
|
351
|
+
<% end %>
|
|
283
352
|
<% end %>
|
|
284
353
|
<% end %>
|
|
285
354
|
<% end %>
|
|
355
|
+
|
|
356
|
+
<% (@account_blocking_states || []).each do |blocking_state| %>
|
|
357
|
+
<div data-event-type="SERVICE_STATE_CHANGE" data-event-category="blocking_state" data-timestamp="<%= timeline_sort_timestamp(blocking_state.effective_date) %>">
|
|
358
|
+
<div class="datetime-container">
|
|
359
|
+
<% if blocking_state.effective_date.present? %>
|
|
360
|
+
<%= format_date(blocking_state.effective_date, @account.time_zone).html_safe %>
|
|
361
|
+
<% else %>
|
|
362
|
+
[unknown]
|
|
363
|
+
<% end %>
|
|
364
|
+
</div>
|
|
365
|
+
<div class="account-timeline-card d-flex gap-3">
|
|
366
|
+
<span class="icon-container">
|
|
367
|
+
<%= image_tag("kaui/timeline/block.svg", width: 20, height: 20) %>
|
|
368
|
+
</span>
|
|
369
|
+
|
|
370
|
+
<div class="d-flex justify-content-start flex-column gap-3 w-100 row">
|
|
371
|
+
<h3>BLOCKING STATE</h3>
|
|
372
|
+
<div class="w-100">
|
|
373
|
+
<div class="row account-timeline-card-detail">
|
|
374
|
+
<div class="col-sm-4">
|
|
375
|
+
<div>
|
|
376
|
+
<b>Service / State</b>
|
|
377
|
+
<p>
|
|
378
|
+
<%= blocking_state.service %> / <%= blocking_state.state_name %>
|
|
379
|
+
</p>
|
|
380
|
+
</div>
|
|
381
|
+
</div>
|
|
382
|
+
<div class="col-sm-4">
|
|
383
|
+
<div>
|
|
384
|
+
<b>Blocked</b>
|
|
385
|
+
<p>
|
|
386
|
+
<%= 'Change' if blocking_state.is_block_change %>
|
|
387
|
+
<%= 'Billing' if blocking_state.is_block_billing %>
|
|
388
|
+
<%= 'Entitlement' if blocking_state.is_block_entitlement %>
|
|
389
|
+
</p>
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
<div class="col-sm-4">
|
|
393
|
+
<div>
|
|
394
|
+
<b>Reason Code / Comments</b>
|
|
395
|
+
<p>
|
|
396
|
+
<% if blocking_state.audit_logs.present? %>
|
|
397
|
+
<% blocking_state.audit_logs.each do |entry| %>
|
|
398
|
+
<%= Kaui::AuditLog.description(entry) %>
|
|
399
|
+
<% end %>
|
|
400
|
+
<% end %>
|
|
401
|
+
</p>
|
|
402
|
+
</div>
|
|
403
|
+
</div>
|
|
404
|
+
</div>
|
|
405
|
+
</div>
|
|
406
|
+
</div>
|
|
407
|
+
</div>
|
|
408
|
+
</div>
|
|
409
|
+
<% end %>
|
|
286
410
|
<% end %>
|
|
287
411
|
</div>
|
|
288
412
|
</div>
|
|
@@ -298,7 +422,7 @@
|
|
|
298
422
|
}
|
|
299
423
|
|
|
300
424
|
var eventsOrder = ["START_ENTITLEMENT", "START_BILLING", "PAUSE_ENTITLEMENT", "PAUSE_BILLING", "RESUME_ENTITLEMENT",
|
|
301
|
-
"RESUME_BILLING", "PHASE", "CHANGE", "STOP_ENTITLEMENT", "STOP_BILLING", "INVOICE", "AUTHORIZE", "PURCHASE", "CAPTURE",
|
|
425
|
+
"RESUME_BILLING", "PHASE", "CHANGE", "STOP_ENTITLEMENT", "STOP_BILLING", "SERVICE_STATE_CHANGE", "INVOICE", "AUTHORIZE", "PURCHASE", "CAPTURE",
|
|
302
426
|
"CREDIT", "REFUND", "VOID", "CHARGEBACK"];
|
|
303
427
|
|
|
304
428
|
jQuery.fn.dataTableExt.oSort['timeline-event-asc'] = function(e1,e2) {
|
|
@@ -352,59 +476,95 @@
|
|
|
352
476
|
});
|
|
353
477
|
}
|
|
354
478
|
|
|
479
|
+
function sortTimelineEntries() {
|
|
480
|
+
var $container = $('#timeline-entries');
|
|
481
|
+
var $entries = $container.children('[data-event-type]');
|
|
482
|
+
|
|
483
|
+
var orderedEntries = $entries.get().sort(function (a, b) {
|
|
484
|
+
var x = parseInt($(a).attr('data-timestamp'), 10);
|
|
485
|
+
var y = parseInt($(b).attr('data-timestamp'), 10);
|
|
486
|
+
x = isNaN(x) ? -Infinity : x;
|
|
487
|
+
y = isNaN(y) ? -Infinity : y;
|
|
488
|
+
if (y !== x) {
|
|
489
|
+
return y - x;
|
|
490
|
+
}
|
|
491
|
+
var typeX = eventsOrder.indexOf($(a).attr('data-event-type'));
|
|
492
|
+
var typeY = eventsOrder.indexOf($(b).attr('data-event-type'));
|
|
493
|
+
typeX = typeX === -1 ? Infinity : typeX;
|
|
494
|
+
typeY = typeY === -1 ? Infinity : typeY;
|
|
495
|
+
return typeX - typeY;
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
$.each(orderedEntries, function (_, entry) {
|
|
499
|
+
$container.append(entry);
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
filterTimeline();
|
|
503
|
+
}
|
|
504
|
+
|
|
355
505
|
function filterTimeline() {
|
|
356
506
|
var selectedBundle = $("#bundles").val();
|
|
357
|
-
var selectedPayment = $('#payment_filter').val().toUpperCase();
|
|
358
|
-
var selectedSubscription = $('#subscription_filter').val().toUpperCase();
|
|
359
|
-
var selectedBilling = $('#billing_filter').val().toUpperCase();
|
|
360
507
|
var searchQuery = $('#search').val().toLowerCase();
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
508
|
+
var blockingStateFilter = $('#blocking_state_filter').val().toUpperCase();
|
|
509
|
+
|
|
510
|
+
var categoryFilters = {
|
|
511
|
+
payment: { value: $('#payment_filter').val().toUpperCase(), categories: ['payment'] },
|
|
512
|
+
subscription: { value: $('#subscription_filter').val().toUpperCase(), categories: ['subscription'] },
|
|
513
|
+
billing: { value: $('#billing_filter').val().toUpperCase(), categories: ['billing', 'invoice'] }
|
|
514
|
+
};
|
|
515
|
+
|
|
366
516
|
$('.account-timeline-card').parent().each(function() {
|
|
367
517
|
var $card = $(this);
|
|
368
|
-
var eventType = $card.
|
|
518
|
+
var eventType = ($card.attr('data-event-type') || '').toUpperCase();
|
|
519
|
+
var eventCategory = $card.attr('data-event-category') || '';
|
|
369
520
|
var bundleTitle = $card.attr('title');
|
|
370
521
|
var cardText = $card.text().toLowerCase();
|
|
371
|
-
|
|
522
|
+
|
|
372
523
|
var shouldShow = true;
|
|
373
|
-
|
|
524
|
+
|
|
374
525
|
if (selectedBundle && selectedBundle !== '' && selectedBundle !== 'All') {
|
|
375
526
|
if (!bundleTitle || bundleTitle.indexOf(selectedBundle) === -1) {
|
|
376
527
|
shouldShow = false;
|
|
377
528
|
}
|
|
378
529
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
530
|
+
|
|
531
|
+
if (shouldShow) {
|
|
532
|
+
if (blockingStateFilter === 'NONE') {
|
|
533
|
+
if (eventCategory === 'blocking_state') {
|
|
534
|
+
shouldShow = false;
|
|
535
|
+
}
|
|
536
|
+
} else if (blockingStateFilter !== 'ALL') {
|
|
537
|
+
// Specific type selected: show only events matching that exact type
|
|
538
|
+
if (eventType !== blockingStateFilter) {
|
|
539
|
+
shouldShow = false;
|
|
540
|
+
}
|
|
541
|
+
} else {
|
|
542
|
+
// Blocking state filter is ALL — apply per-category filters
|
|
543
|
+
var governingFilter = null;
|
|
544
|
+
$.each(categoryFilters, function(_, f) {
|
|
545
|
+
if (f.categories.indexOf(eventCategory) !== -1) {
|
|
546
|
+
governingFilter = f;
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
if (governingFilter) {
|
|
550
|
+
if (governingFilter.value === 'NONE') {
|
|
551
|
+
shouldShow = false;
|
|
552
|
+
} else if (governingFilter.value !== 'ALL') {
|
|
553
|
+
if (eventType !== governingFilter.value) {
|
|
554
|
+
shouldShow = false;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
398
558
|
}
|
|
399
559
|
}
|
|
400
|
-
|
|
560
|
+
|
|
401
561
|
// Apply search filter if query exists
|
|
402
562
|
if (searchQuery && shouldShow) {
|
|
403
563
|
if (cardText.indexOf(searchQuery) === -1) {
|
|
404
564
|
shouldShow = false;
|
|
405
565
|
}
|
|
406
566
|
}
|
|
407
|
-
|
|
567
|
+
|
|
408
568
|
// Show or hide the card based on all filters
|
|
409
569
|
if (shouldShow) {
|
|
410
570
|
$card.show();
|
|
@@ -416,17 +576,15 @@
|
|
|
416
576
|
|
|
417
577
|
$(document).ready(function() {
|
|
418
578
|
disableLinks();
|
|
419
|
-
|
|
579
|
+
|
|
420
580
|
// Initialize filters with debounce for search
|
|
421
581
|
var searchTimeout;
|
|
422
|
-
$("#bundles, #payment_filter, #subscription_filter, #billing_filter").on('change', filterTimeline);
|
|
582
|
+
$("#bundles, #payment_filter, #subscription_filter, #billing_filter, #blocking_state_filter").on('change', filterTimeline);
|
|
423
583
|
$('#search').on('keyup', function() {
|
|
424
584
|
clearTimeout(searchTimeout);
|
|
425
585
|
searchTimeout = setTimeout(filterTimeline, 300);
|
|
426
586
|
});
|
|
427
|
-
|
|
428
587
|
|
|
429
|
-
|
|
430
588
|
// Clear all filters button
|
|
431
589
|
$('#clear-all-filters').click(function() {
|
|
432
590
|
$('#search').val('');
|
|
@@ -434,10 +592,11 @@
|
|
|
434
592
|
$('#payment_filter').val('all');
|
|
435
593
|
$('#subscription_filter').val('all');
|
|
436
594
|
$('#billing_filter').val('all');
|
|
595
|
+
$('#blocking_state_filter').val('all');
|
|
437
596
|
filterTimeline();
|
|
438
597
|
});
|
|
439
|
-
|
|
440
|
-
//
|
|
441
|
-
|
|
598
|
+
|
|
599
|
+
// Sort by date first, event type second, then apply filters
|
|
600
|
+
sortTimelineEntries();
|
|
442
601
|
});
|
|
443
602
|
<% end %>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="billing-details-header">
|
|
4
4
|
<h2>Billing Information</h2>
|
|
5
5
|
<span>
|
|
6
|
-
<% if can?(:trigger, Kaui::Payment) || can?(:credit, Kaui::Account) || can?(:charge, Kaui::Account) %>
|
|
6
|
+
<% if can?(:trigger, Kaui::Payment) || can?(:credit, Kaui::Account) || can?(:charge, Kaui::Account) || can?(:update, Kaui::Account) %>
|
|
7
7
|
<div class="tag-bar tag-bar-breathe">
|
|
8
8
|
<div class="toggler">
|
|
9
9
|
<div class="toggle">
|
|
@@ -59,6 +59,18 @@
|
|
|
59
59
|
<% end %>
|
|
60
60
|
<% end %>
|
|
61
61
|
|
|
62
|
+
<% if can? :update, Kaui::Account %>
|
|
63
|
+
<%= link_to kaui_engine.block_account_path(@account.account_id) do %>
|
|
64
|
+
<%= render "kaui/components/button/button", {
|
|
65
|
+
label: "Create Blocking State",
|
|
66
|
+
icon: "kaui/plus.svg",
|
|
67
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
68
|
+
type: "button",
|
|
69
|
+
html_class: "kaui-dropdown custom-hover",
|
|
70
|
+
} %>
|
|
71
|
+
<% end %>
|
|
72
|
+
<% end %>
|
|
73
|
+
|
|
62
74
|
</div>
|
|
63
75
|
</div>
|
|
64
76
|
</div>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<div class="info-wrapper">
|
|
8
8
|
|
|
9
|
-
<% if can?(:trigger, Kaui::Payment) || can?(:credit, Kaui::Account) || can?(:charge, Kaui::Account) %>
|
|
9
|
+
<% if can?(:trigger, Kaui::Payment) || can?(:credit, Kaui::Account) || can?(:charge, Kaui::Account) || can?(:update, Kaui::Account) %>
|
|
10
10
|
<div class="tag-bar tag-bar-breathe">
|
|
11
11
|
<div class="toggler">
|
|
12
12
|
<div class="toggle">
|
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
<%= link_to '<i class="fa fa-plus-square"></i> Create deposit'.html_safe,
|
|
30
30
|
deposit_engine.collection_index_path(:account_id => @account.account_id, :currency => @account.currency) %>
|
|
31
31
|
<% end %>
|
|
32
|
+
<% if can? :update, Kaui::Account %>
|
|
33
|
+
<%= link_to '<i class="fa fa-plus-square"></i> Create blocking state'.html_safe,
|
|
34
|
+
kaui_engine.block_account_path(@account.account_id) %>
|
|
35
|
+
<% end %>
|
|
32
36
|
</div>
|
|
33
37
|
</div>
|
|
34
38
|
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<div class="register kaui-subscription-new">
|
|
2
|
+
<div class="d-flex justify-content-center flex-wrap" style="gap: 2rem; max-width: 60.5rem; margin: 0 auto;">
|
|
3
|
+
<h5 class="add-account-title border-bottom pb-3 mb-3" style="flex: 0 0 100%;">
|
|
4
|
+
<span class="icon-container">
|
|
5
|
+
<%= image_tag "kaui/timeline/block.svg", width: 20, height: 20 %>
|
|
6
|
+
</span>
|
|
7
|
+
Create blocking state
|
|
8
|
+
</h5>
|
|
9
|
+
<div style="max-width: 37.5rem; width: 100%;">
|
|
10
|
+
<%= form_tag do_block_account_path(:account_id => @account.account_id), :class => 'form-horizontal', :method => :put do %>
|
|
11
|
+
<%= render "kaui/components/blocking_state_form/fields", :applies_to_type => 'Account', :applies_to_id => @account.account_id %>
|
|
12
|
+
<% end %>
|
|
13
|
+
</div>
|
|
14
|
+
<%= render "kaui/components/blocking_state_form/about_panel" %>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
<%= form_for @allowed_user, :url => @allowed_user.persisted? ? admin_allowed_user_path(@allowed_user.id) : admin_allowed_users_path, :method => @allowed_user.persisted? ? :put : :post, :html => {:class => 'form-horizontal'} do |f| %>
|
|
2
2
|
<input type="hidden" id="killbillManaged" value="<%= @is_killbill_managed %>" />
|
|
3
3
|
<div class='form-group d-flex pb-3'>
|
|
4
|
-
|
|
4
|
+
<%# Not associated with a real attribute - use label_tag instead of f.label, which under
|
|
5
|
+
Rails 7.2 raises NoMethodError (undefined method `humanize' for nil) for a blank name,
|
|
6
|
+
since ActiveModel::Translation#human_attribute_name only handles a blank *namespaced*
|
|
7
|
+
attribute (e.g. "foo."), not a plain blank string. %>
|
|
8
|
+
<%= label_tag nil, ' ', :class => 'col-sm-3 control-label' %>
|
|
5
9
|
<div class="col-sm-9">
|
|
6
10
|
<div class="checkbox">
|
|
7
11
|
<label for="external" class="d-flex align-items-center gap-2 control-label">
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<div class="register kaui-subscription-new">
|
|
2
|
+
<div class="d-flex justify-content-center flex-wrap" style="gap: 2rem; max-width: 60.5rem; margin: 0 auto;">
|
|
3
|
+
<h5 class="add-account-title border-bottom pb-3 mb-3" style="flex: 0 0 100%;">
|
|
4
|
+
<span class="icon-container">
|
|
5
|
+
<%= image_tag "kaui/timeline/block.svg", width: 20, height: 20 %>
|
|
6
|
+
</span>
|
|
7
|
+
Create blocking state
|
|
8
|
+
</h5>
|
|
9
|
+
<div style="max-width: 37.5rem; width: 100%;">
|
|
10
|
+
<%= form_tag do_block_bundle_path(:id => @bundle.bundle_id, :account_id => @bundle.account_id), :class => 'form-horizontal', :method => :put do %>
|
|
11
|
+
<%= render "kaui/components/blocking_state_form/fields", :applies_to_type => 'Bundle', :applies_to_id => @bundle.bundle_id %>
|
|
12
|
+
<% end %>
|
|
13
|
+
</div>
|
|
14
|
+
<%= render "kaui/components/blocking_state_form/about_panel" %>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<div class="blocking-state-about-panel">
|
|
2
|
+
<div class="d-flex align-items-center gap-2 mb-2">
|
|
3
|
+
<div class="icon-container">
|
|
4
|
+
<%= image_tag "kaui/blocking-states/shield-white.svg", width: 20, height: 20 %>
|
|
5
|
+
</div>
|
|
6
|
+
<h6 class="mb-0"><%= t('blocking_state_about_panel.title') %></h6>
|
|
7
|
+
</div>
|
|
8
|
+
<p><%= t('blocking_state_about_panel.description') %></p>
|
|
9
|
+
</div>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<div class="form-group d-flex pb-3">
|
|
2
|
+
<label class="col-sm-3 control-label">Applies to</label>
|
|
3
|
+
<div class="col-sm-9">
|
|
4
|
+
<p class="form-control-plaintext mb-0"><%= applies_to_type %> — <%= applies_to_id %></p>
|
|
5
|
+
</div>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="form-group d-flex pb-3">
|
|
8
|
+
<%= label_tag :state_name, 'State', :class => 'col-sm-3 control-label' %>
|
|
9
|
+
<div class="col-sm-9">
|
|
10
|
+
<%= text_field_tag :state_name, nil, :class => 'form-control', :placeholder => 'e.g., OVERDUE_ENFORCEMENT' %>
|
|
11
|
+
<small class="form-text text-muted">The name of the state being applied, e.g. a step in an overdue enforcement process.</small>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="form-group d-flex pb-3">
|
|
15
|
+
<%= label_tag :service, 'Service', :class => 'col-sm-3 control-label' %>
|
|
16
|
+
<div class="col-sm-9">
|
|
17
|
+
<%= text_field_tag :service, nil, :class => 'form-control' %>
|
|
18
|
+
<small class="form-text text-muted">The service responsible for setting and enforcing this blocking state.</small>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="form-group d-flex pb-3">
|
|
22
|
+
<label class="col-sm-3 control-label">Block</label>
|
|
23
|
+
<div class="col-sm-9">
|
|
24
|
+
<div class="d-flex gap-3">
|
|
25
|
+
<div class="form-check">
|
|
26
|
+
<%= check_box_tag :is_block_change, '1', false, :class => 'form-check-input' %>
|
|
27
|
+
<%= label_tag :is_block_change, 'Change', :class => 'form-check-label' %>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="form-check">
|
|
30
|
+
<%= check_box_tag :is_block_entitlement, '1', false, :class => 'form-check-input' %>
|
|
31
|
+
<%= label_tag :is_block_entitlement, 'Entitlement', :class => 'form-check-label' %>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="form-check">
|
|
34
|
+
<%= check_box_tag :is_block_billing, '1', false, :class => 'form-check-input' %>
|
|
35
|
+
<%= label_tag :is_block_billing, 'Billing', :class => 'form-check-label' %>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<small class="form-text text-muted">Change blocks plan/subscription changes, Entitlement blocks usage of the service, and Billing blocks invoicing.</small>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="form-group d-flex pb-3" id="form_effective_from_date">
|
|
42
|
+
<%= label_tag :requested_date, 'Effective date', :class => 'col-sm-3 control-label' %>
|
|
43
|
+
<div class="col-sm-9">
|
|
44
|
+
<div class="custom-date-input-wrapper kaui-button custom-hover" onclick="$(this).find('input').focus();">
|
|
45
|
+
<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
46
|
+
<path d="M14.9167 12.5V18.3333M17.8333 15.4167H12" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
47
|
+
<path d="M14.0833 1.66675V5.00008M6.58325 1.66675V5.00008" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
48
|
+
<path d="M17.8333 10.8333V4.99992C17.8333 4.07944 17.0871 3.33325 16.1666 3.33325H4.49992C3.57944 3.33325 2.83325 4.07944 2.83325 4.99992V16.6666C2.83325 17.5871 3.57944 18.3333 4.49992 18.3333H10.3333" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
49
|
+
<path d="M2.83325 8.33325H17.8333" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
50
|
+
</svg>
|
|
51
|
+
<input class="form-control" name="requested_date" type="text" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-today-highlight="true">
|
|
52
|
+
</div>
|
|
53
|
+
<small class="form-text text-muted">Defaults to now if left blank.</small>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="form-group d-flex pb-3 border-bottom mb-3">
|
|
57
|
+
<%= label_tag :comment, 'Comment', :class => 'col-sm-3 control-label' %>
|
|
58
|
+
<div class="col-sm-9">
|
|
59
|
+
<%= text_area_tag :comment, nil, :rows => 3, :class => 'form-control' %>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="form-group d-flex justify-content-end pb-3">
|
|
63
|
+
<%= render "kaui/components/button/button", {
|
|
64
|
+
label: 'Close',
|
|
65
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
66
|
+
type: "button",
|
|
67
|
+
html_class: "kaui-button custom-hover mx-2",
|
|
68
|
+
html_options: {
|
|
69
|
+
id: "closeButton",
|
|
70
|
+
onclick: "window.history.back();"
|
|
71
|
+
}
|
|
72
|
+
} %>
|
|
73
|
+
<%= render "kaui/components/button/button", {
|
|
74
|
+
label: 'Submit',
|
|
75
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
76
|
+
type: "submit",
|
|
77
|
+
html_class: "kaui-dropdown custom-hover"
|
|
78
|
+
} %>
|
|
79
|
+
</div>
|