kanaui 5.0.0 → 5.0.2

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.
@@ -11,24 +11,20 @@
11
11
  <div class="container">
12
12
  <div class="container-fluid">
13
13
  <%- # :alert used by devise -%>
14
- <% [:error, :alert].each do |key| %>
15
- <% if flash[key] %>
16
- <div class="row">
17
- <div class="col-md-10 col-md-offset-2">
18
- <div class="alert alert-error"><%= flash[key] %></div>
19
- </div>
20
- </div>
14
+ <% if flash[:error] || flash[:alert] || flash[:notice] %>
15
+ <div class="kanaui-flash-container">
16
+ <% [:error, :alert].each do |key| %>
17
+ <% if flash[key] %>
18
+ <div class="alert alert-danger alert-error" role="alert"><%= flash[key] %></div>
19
+ <% end %>
21
20
  <% end %>
22
- <% end %>
23
- <% if flash[:notice] %>
24
- <div class="row">
25
- <div class="col-md-10 col-md-offset-2">
26
- <div class="alert alert-info"><%= flash[:notice] %></div>
27
- </div>
28
- </div>
21
+ <% if flash[:notice] %>
22
+ <div class="alert alert-info" role="status"><%= flash[:notice] %></div>
23
+ <% end %>
24
+ </div>
29
25
  <% end %>
30
26
  <%= yield %>
31
- <div>
27
+ </div>
32
28
  </div>
33
29
  </body>
34
30
  </html>
@@ -1,64 +1,94 @@
1
- <%= form_tag @report[:reportName].blank? ? url_for(:controller => :reports, :action => :create) : report_path(@report[:reportName]), :method => (@report[:reportName].blank? ? :post : :put), :class => 'form-horizontal' do %>
1
+ <%= form_tag @report[:reportName].blank? ? url_for(:controller => :reports, :action => :create) : report_path(@report[:reportName]), :method => (@report[:reportName].blank? ? :post : :put), :class => 'form-horizontal', :id => 'kanaui-report-form' do %>
2
2
  <div class="form-group d-flex pb-3">
3
- <%= label_tag :report_name, 'Report name', :class => 'col-sm-3 control-label' %>
3
+ <%= label_tag :report_name, t('kanaui.reports.form.report_name'), :class => 'col-sm-3 control-label' %>
4
4
  <div class="col-sm-9">
5
- <%= text_field_tag :report_name, @report[:reportName], :class => 'form-control', :disabled => !@report[:reportName].blank?, :read_only => !@report[:reportName].blank? %>
5
+ <div class="kanaui-field-control">
6
+ <%= text_field_tag :report_name, @report[:reportName], :class => 'form-control', :disabled => !@report[:reportName].blank?, :read_only => !@report[:reportName].blank?, :required => @report[:reportName].blank? %>
7
+ <button type="button" class="kanaui-field-help" data-kanaui-tooltip="<%= t('kanaui.reports.form.tooltips.report_name') %>" aria-label="<%= t('kanaui.reports.form.tooltips.report_name') %>" aria-expanded="false"><i class="fa fa-question-circle" aria-hidden="true"></i></button>
8
+ </div>
6
9
  </div>
7
10
  </div>
8
11
  <div class="form-group d-flex pb-3">
9
- <%= label_tag :report_pretty_name, 'Pretty name', :class => 'col-sm-3 control-label' %>
12
+ <%= label_tag :report_pretty_name, t('kanaui.reports.form.pretty_name'), :class => 'col-sm-3 control-label' %>
10
13
  <div class="col-sm-9">
11
- <%= text_field_tag :report_pretty_name, @report[:reportPrettyName], :class => 'form-control' %>
14
+ <div class="kanaui-field-control">
15
+ <%= text_field_tag :report_pretty_name, @report[:reportPrettyName], :class => 'form-control' %>
16
+ <button type="button" class="kanaui-field-help" data-kanaui-tooltip="<%= t('kanaui.reports.form.tooltips.report_pretty_name') %>" aria-label="<%= t('kanaui.reports.form.tooltips.report_pretty_name') %>" aria-expanded="false"><i class="fa fa-question-circle" aria-hidden="true"></i></button>
17
+ </div>
12
18
  </div>
13
19
  </div>
14
20
  <div class="form-group d-flex pb-3">
15
- <%= label_tag :report_type, 'Type', :class => 'col-sm-3 control-label' %>
21
+ <%= label_tag :report_type, t('kanaui.reports.form.type'), :class => 'col-sm-3 control-label' %>
16
22
  <div class="col-sm-9">
17
- <%= select_tag :report_type, options_for_select(%w(TIMELINE COUNTERS TABLE), @report[:reportType] || 'TABLE'), :class => 'form-control' %>
23
+ <div class="kanaui-field-control">
24
+ <%= select_tag :report_type, options_for_select(%w(TIMELINE COUNTERS TABLE), @report[:reportType] || 'TABLE'), :class => 'form-control', :required => true %>
25
+ <button type="button" class="kanaui-field-help" data-kanaui-tooltip="<%= t('kanaui.reports.form.tooltips.report_type') %>" aria-label="<%= t('kanaui.reports.form.tooltips.report_type') %>" aria-expanded="false"><i class="fa fa-question-circle" aria-hidden="true"></i></button>
26
+ </div>
18
27
  </div>
19
28
  </div>
20
29
  <div class="form-group d-flex pb-3">
21
- <%= label_tag :source_table_name, 'Source', :class => 'col-sm-3 control-label' %>
30
+ <%= label_tag :source_table_name, t('kanaui.reports.form.source_table_name'), :class => 'col-sm-3 control-label' %>
22
31
  <div class="col-sm-9">
23
- <%= text_field_tag :source_table_name, @report[:sourceTableName], :class => 'form-control' %>
32
+ <div class="kanaui-field-control">
33
+ <%= text_field_tag :source_table_name, @report[:sourceTableName], :class => 'form-control' %>
34
+ <button type="button" class="kanaui-field-help" data-kanaui-tooltip="<%= t('kanaui.reports.form.tooltips.source_table_name') %>" aria-label="<%= t('kanaui.reports.form.tooltips.source_table_name') %>" aria-expanded="false"><i class="fa fa-question-circle" aria-hidden="true"></i></button>
35
+ </div>
24
36
  </div>
25
37
  </div>
26
38
  <div class="form-group d-flex pb-3">
27
- <%= label_tag :source_name, 'Source name', :class => 'col-sm-3 control-label' %>
39
+ <%= label_tag :source_query, t('kanaui.reports.form.source_query'), :class => 'col-sm-3 control-label' %>
28
40
  <div class="col-sm-9">
29
- <%= text_field_tag :source_name, @report[:sourceName], :class => 'form-control' %>
30
- <span>Must match a database configuration entry in the Analytics plugin</span>
41
+ <div class="kanaui-field-control kanaui-field-control-top">
42
+ <%= text_area_tag :source_query, @report[:sourceQuery], rows: 10, cols: 25, :class => 'form-control' %>
43
+ <button type="button" class="kanaui-field-help" data-kanaui-tooltip="<%= t('kanaui.reports.form.tooltips.source_query') %>" aria-label="<%= t('kanaui.reports.form.tooltips.source_query') %>" aria-expanded="false"><i class="fa fa-question-circle" aria-hidden="true"></i></button>
44
+ </div>
45
+ <span><%= t('kanaui.reports.form.source_query_help') %></span>
46
+ <div id="source-configuration-error" class="text-danger mt-2" style="display: none;">
47
+ <%= t('kanaui.reports.form.source_configuration_error') %>
48
+ </div>
31
49
  </div>
32
50
  </div>
33
51
  <div class="form-group d-flex pb-3">
34
- <%= label_tag :source_query, 'SQL query', :class => 'col-sm-3 control-label' %>
52
+ <%= label_tag :source_name, t('kanaui.reports.form.source_name'), :class => 'col-sm-3 control-label' %>
35
53
  <div class="col-sm-9">
36
- <%= text_area_tag :source_query, @report[:sourceQuery], rows: 10, cols: 25, :class => 'form-control' %>
37
- <span>Don't add a trailing ;</span>
54
+ <div class="kanaui-field-control">
55
+ <%= text_field_tag :source_name, @report[:sourceName], :class => 'form-control' %>
56
+ <button type="button" class="kanaui-field-help" data-kanaui-tooltip="<%= t('kanaui.reports.form.tooltips.source_name') %>" aria-label="<%= t('kanaui.reports.form.tooltips.source_name') %>" aria-expanded="false"><i class="fa fa-question-circle" aria-hidden="true"></i></button>
57
+ </div>
58
+ <span><%= t('kanaui.reports.form.source_name_help') %></span>
38
59
  </div>
39
60
  </div>
40
61
  <div class="form-group d-flex pb-3">
41
- <%= label_tag :refresh_procedure_name, 'Refresh procedure', :class => 'col-sm-3 control-label' %>
62
+ <%= label_tag :refresh_procedure_name, t('kanaui.reports.form.refresh_procedure'), :class => 'col-sm-3 control-label' %>
42
63
  <div class="col-sm-9">
43
- <%= text_field_tag :refresh_procedure_name, @report[:refreshProcedureName], :class => 'form-control' %>
64
+ <div class="kanaui-field-control">
65
+ <%= text_field_tag :refresh_procedure_name, @report[:refreshProcedureName], :class => 'form-control' %>
66
+ <button type="button" class="kanaui-field-help" data-kanaui-tooltip="<%= t('kanaui.reports.form.tooltips.refresh_procedure_name') %>" aria-label="<%= t('kanaui.reports.form.tooltips.refresh_procedure_name') %>" aria-expanded="false"><i class="fa fa-question-circle" aria-hidden="true"></i></button>
67
+ </div>
44
68
  </div>
45
69
  </div>
46
70
  <div class="form-group d-flex pb-3">
47
- <%= label_tag :refresh_frequency, 'Refresh frequency', :class => 'col-sm-3 control-label' %>
71
+ <%= label_tag :refresh_frequency, t('kanaui.reports.form.refresh_frequency'), :class => 'col-sm-3 control-label' %>
48
72
  <div class="col-sm-9">
49
- <%= select_tag :refresh_frequency, options_for_select(%w(HOURLY DAILY), @report[:refreshFrequency]), :class => 'form-control', :include_blank => true %>
73
+ <div class="kanaui-field-control">
74
+ <%= select_tag :refresh_frequency, options_for_select(%w(HOURLY DAILY), @report[:refreshFrequency]), :class => 'form-control', :include_blank => true %>
75
+ <button type="button" class="kanaui-field-help" data-kanaui-tooltip="<%= t('kanaui.reports.form.tooltips.refresh_frequency') %>" aria-label="<%= t('kanaui.reports.form.tooltips.refresh_frequency') %>" aria-expanded="false"><i class="fa fa-question-circle" aria-hidden="true"></i></button>
76
+ </div>
50
77
  </div>
51
78
  </div>
52
79
  <div class="form-group d-flex pb-3">
53
- <%= label_tag :refresh_hour_of_day_gmt, 'Refresh hour (GMT)', :class => 'col-sm-3 control-label' %>
80
+ <%= label_tag :refresh_hour_of_day_gmt, t('kanaui.reports.form.refresh_hour_gmt'), :class => 'col-sm-3 control-label' %>
54
81
  <div class="col-sm-9">
55
- <%= number_field_tag :refresh_hour_of_day_gmt, @report[:refreshHourOfDayGmt], {:min => 1, :max => 23, :class => 'form-control'} %>
82
+ <div class="kanaui-field-control">
83
+ <%= number_field_tag :refresh_hour_of_day_gmt, @report[:refreshHourOfDayGmt], {:min => 1, :max => 23, :class => 'form-control'} %>
84
+ <button type="button" class="kanaui-field-help" data-kanaui-tooltip="<%= t('kanaui.reports.form.tooltips.refresh_hour_of_day_gmt') %>" aria-label="<%= t('kanaui.reports.form.tooltips.refresh_hour_of_day_gmt') %>" aria-expanded="false"><i class="fa fa-question-circle" aria-hidden="true"></i></button>
85
+ </div>
56
86
  </div>
57
87
  </div>
58
88
 
59
89
  <div class="form-group d-flex justify-content-end border-top pt-3 pb-3">
60
90
  <%= render "kaui/components/button/button", {
61
- label: 'Close',
91
+ label: t('kanaui.actions.close'),
62
92
  variant: "outline-secondary d-inline-flex align-items-center gap-1",
63
93
  type: "button",
64
94
  html_class: "kaui-button custom-hover mx-2",
@@ -67,10 +97,81 @@
67
97
  }
68
98
  } %>
69
99
  <%= render "kaui/components/button/button", {
70
- label: 'Save',
100
+ label: t('kanaui.actions.save'),
71
101
  variant: "outline-secondary d-inline-flex align-items-center gap-1",
72
102
  type: "submit",
73
103
  html_class: "kaui-dropdown custom-hover"
74
104
  } %>
75
105
  </div>
76
106
  <% end %>
107
+
108
+ <%= javascript_tag do %>
109
+ (function () {
110
+ var form = document.getElementById('kanaui-report-form');
111
+ if (!form) {
112
+ return;
113
+ }
114
+
115
+ $(function () {
116
+ var tooltip = document.createElement('div');
117
+ tooltip.className = 'kanaui-field-tooltip';
118
+ tooltip.setAttribute('role', 'tooltip');
119
+ document.body.appendChild(tooltip);
120
+ var activeTooltipTrigger = null;
121
+
122
+ function hideTooltip() {
123
+ tooltip.classList.remove('is-visible');
124
+ if (activeTooltipTrigger) {
125
+ activeTooltipTrigger.setAttribute('aria-expanded', 'false');
126
+ activeTooltipTrigger = null;
127
+ }
128
+ }
129
+
130
+ document.querySelectorAll('[data-kanaui-tooltip]').forEach(function (el) {
131
+ el.addEventListener('mouseenter', function () {
132
+ var rect = el.getBoundingClientRect();
133
+ var left = window.pageXOffset + rect.right + 12;
134
+ var top = window.pageYOffset + rect.top - 2;
135
+
136
+ hideTooltip();
137
+ tooltip.textContent = el.getAttribute('data-kanaui-tooltip');
138
+ tooltip.style.left = left + 'px';
139
+ tooltip.style.top = top + 'px';
140
+ tooltip.classList.remove('is-flipped');
141
+ tooltip.classList.add('is-visible');
142
+ activeTooltipTrigger = el;
143
+ activeTooltipTrigger.setAttribute('aria-expanded', 'true');
144
+
145
+ if (tooltip.getBoundingClientRect().right > window.innerWidth - 12) {
146
+ tooltip.style.left = window.pageXOffset + rect.left - tooltip.offsetWidth - 12 + 'px';
147
+ tooltip.classList.add('is-flipped');
148
+ }
149
+ });
150
+
151
+ el.addEventListener('mouseleave', function () {
152
+ hideTooltip();
153
+ });
154
+ });
155
+
156
+ document.addEventListener('keydown', function (event) {
157
+ if (event.key === 'Escape') {
158
+ hideTooltip();
159
+ }
160
+ });
161
+ });
162
+
163
+ form.addEventListener('submit', function (event) {
164
+ var sourceTableName = document.getElementById('source_table_name').value.trim();
165
+ var sourceQuery = document.getElementById('source_query').value.trim();
166
+ var error = document.getElementById('source-configuration-error');
167
+
168
+ if (!sourceTableName && !sourceQuery) {
169
+ event.preventDefault();
170
+ error.style.display = 'block';
171
+ document.getElementById('source_table_name').focus();
172
+ } else {
173
+ error.style.display = 'none';
174
+ }
175
+ });
176
+ })();
177
+ <% end %>
@@ -1,21 +1,22 @@
1
1
  <table id="reports-table">
2
2
  <thead>
3
3
  <tr>
4
- <th>Name</th>
5
- <th>Pretty name</th>
6
- <th>Type</th>
7
- <th>Source</th>
8
- <th>Source Name</th>
9
- <th>Source Query</th>
10
- <th>Refresh procedure</th>
11
- <th>Refresh frequency</th>
12
- <th>Refresh hour (GMT)</th>
13
- <th>Fields</th>
4
+ <th><%= t('kanaui.reports.table.name') %></th>
5
+ <th><%= t('kanaui.reports.table.pretty_name') %></th>
6
+ <th><%= t('kanaui.reports.table.type') %></th>
7
+ <th><%= t('kanaui.reports.table.source') %></th>
8
+ <th><%= t('kanaui.reports.table.source_name') %></th>
9
+ <th><%= t('kanaui.reports.table.source_query') %></th>
10
+ <th><%= t('kanaui.reports.table.refresh_procedure') %></th>
11
+ <th><%= t('kanaui.reports.table.refresh_frequency') %></th>
12
+ <th><%= t('kanaui.reports.table.refresh_hour_gmt') %></th>
13
+ <th><%= t('kanaui.reports.table.fields') %></th>
14
14
  <th></th>
15
15
  </tr>
16
16
  </thead>
17
17
  <tbody>
18
18
  <% reports.each do |report| %>
19
+ <% report_name = report[:reportName].to_s %>
19
20
  <tr>
20
21
  <td><%= report[:reportName] %></td>
21
22
  <td><%= report[:reportPrettyName] %></td>
@@ -25,7 +26,7 @@
25
26
  <td>
26
27
  <% unless report[:sourceQuery].blank? %>
27
28
  <a href="" data-bs-toggle="modal" data-bs-target="#<%= report[:reportName] %>-query-modal">
28
- Show SQL
29
+ <%= t('kanaui.reports.table.show_sql') %>
29
30
  </a>
30
31
 
31
32
  <div class="modal fade" id="<%= report[:reportName] %>-query-modal" tabindex="-1" role="dialog">
@@ -36,7 +37,7 @@
36
37
  <span class="icon-container">
37
38
  <%= image_tag("kaui/modal/search.svg", width: 20, height: 20) %>
38
39
  </span>
39
- Source Query
40
+ <%= t('kanaui.reports.table.source_query') %>
40
41
  </h5>
41
42
  <button type="button" class="close close-button custom-hover" data-bs-dismiss="modal" aria-label="Close">
42
43
  <span aria-hidden="true">
@@ -49,7 +50,7 @@
49
50
  </div>
50
51
  <div class="modal-footer">
51
52
  <%= render "kaui/components/button/button", {
52
- label: 'Close',
53
+ label: t('kanaui.actions.close'),
53
54
  variant: "outline-secondary d-inline-flex align-items-center gap-1",
54
55
  type: "button",
55
56
  html_class: "kaui-button custom-hover",
@@ -70,15 +71,19 @@
70
71
  <td><%= report[:refreshHourOfDayGmt] %></td>
71
72
  <td>
72
73
  <ul>
73
- <% report[:schema][:fields].each do |field| %>
74
+ <% Array(report.dig(:schema, :fields)).each do |field| %>
74
75
  <li><%= field[:name] %> (<%= field[:dataType] %>)</li>
75
76
  <% end %>
76
77
  </ul>
77
78
  </td>
78
79
  <td>
79
- <%= link_to 'Delete', report_path(report[:reportName]), :method => :delete, :class => 'delete-button table-button' %>
80
- <%= link_to 'Refresh', refresh_report_path(report[:reportName]), :method => :put, :class => 'refresh-button table-button' %>
81
- <%= link_to 'Edit', edit_report_path(report[:reportName]), :class => 'edit-button table-button' %>
80
+ <% if report_name.blank? %>
81
+ <span class="table-button disabled-table-button" title="<%= report[:recordId].present? ? t('kanaui.reports.table.cleanup_required_with_record_id', :record_id => report[:recordId]) : t('kanaui.reports.table.cleanup_required') %>"><%= t('kanaui.actions.delete') %></span>
82
+ <% else %>
83
+ <%= link_to t('kanaui.actions.delete'), report_path(report_name), :method => :delete, :class => 'delete-button table-button' %>
84
+ <%= link_to t('kanaui.actions.refresh'), refresh_report_path(report_name), :method => :put, :class => 'refresh-button table-button' %>
85
+ <%= link_to t('kanaui.actions.edit'), edit_report_path(report_name), :class => 'edit-button table-button' %>
86
+ <% end %>
82
87
  </td>
83
88
  </tr>
84
89
  <% end %>
@@ -9,7 +9,7 @@
9
9
  <path d="M8.14341 2.23582L7.50001 4.16602L6.20014 4.98815L4.07331 4.4619C3.71675 4.37368 3.34448 4.52931 3.15681 4.84505L2.01998 6.75762C1.81512 7.10229 1.88473 7.54398 2.18568 7.80891L3.67746 9.12218V10.8765L2.18615 12.1898C1.88527 12.4547 1.81569 12.8963 2.02053 13.2409L3.15741 15.1536C3.34508 15.4694 3.71736 15.625 4.07391 15.5368L6.20075 15.0105L7.43216 15.7011L8.01996 17.7311C8.12313 18.0874 8.44943 18.3327 8.82043 18.3327H11.1803C11.5512 18.3327 11.8775 18.0874 11.9807 17.7311L12.5685 15.7011L13.7993 15.0105L15.9261 15.5368C16.2827 15.625 16.6549 15.4694 16.8426 15.1536L18.0009 13.2048C18.196 12.8767 18.1431 12.4578 17.8726 12.1885L16.3674 10.6899L16.368 9.30877L17.8732 7.81017C18.1438 7.5408 18.1967 7.12202 18.0016 6.79384L16.8432 4.84505C16.6555 4.52931 16.2833 4.37368 15.9267 4.4619L13.7998 4.98815L12.5 4.16602L11.8566 2.23582C11.7432 1.89554 11.4248 1.66602 11.066 1.66602H8.93401C8.57526 1.66602 8.25683 1.89554 8.14341 2.23582Z" stroke="#414651" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
10
10
  </svg>
11
11
  </span>
12
- Update report
12
+ <%= t('kanaui.reports.edit.title') %>
13
13
  </h5>
14
14
  <%= render 'form' %>
15
15
  </div>
@@ -2,14 +2,17 @@
2
2
  <div class="d-flex " style="gap: 4rem;">
3
3
  <div class="configured-reports">
4
4
  <div class="d-flex flex-column ">
5
+ <% if @report_notice %>
6
+ <div class="alert alert-info kanaui-report-notice" role="status"><%= @report_notice %></div>
7
+ <% end %>
5
8
  <div class="configured-reports-header mb-4">
6
9
  <div class="d-flex align-items-center">
7
- <h2>Configured reports</h2>
10
+ <h2><%= t('kanaui.reports.index.title') %></h2>
8
11
  </div>
9
12
  <span>
10
13
  <%= link_to dashboard_index_path, class: 'text-decoration-none' do %>
11
14
  <%= render "kaui/components/button/button", {
12
- label: "Dashboard",
15
+ label: t('kanaui.reports.index.dashboard'),
13
16
  variant: "outline-secondary d-inline-flex align-items-center gap-1",
14
17
  type: "button",
15
18
  html_class: "btn btn-xs kaui-button custom-hover py-2 px-3"
@@ -17,7 +20,7 @@
17
20
  <% end %>
18
21
  <%= link_to new_report_path, class: 'text-decoration-none' do %>
19
22
  <%= render "kaui/components/button/button", {
20
- label: "New Report",
23
+ label: t('kanaui.reports.index.new_report'),
21
24
  icon: "kaui/plus.svg",
22
25
  variant: "outline-secondary d-inline-flex align-items-center gap-1",
23
26
  type: "button",
@@ -8,7 +8,7 @@
8
8
  <path d="M8.14341 2.23582L7.50001 4.16602L6.20014 4.98815L4.07331 4.4619C3.71675 4.37368 3.34448 4.52931 3.15681 4.84505L2.01998 6.75762C1.81512 7.10229 1.88473 7.54398 2.18568 7.80891L3.67746 9.12218V10.8765L2.18615 12.1898C1.88527 12.4547 1.81569 12.8963 2.02053 13.2409L3.15741 15.1536C3.34508 15.4694 3.71736 15.625 4.07391 15.5368L6.20075 15.0105L7.43216 15.7011L8.01996 17.7311C8.12313 18.0874 8.44943 18.3327 8.82043 18.3327H11.1803C11.5512 18.3327 11.8775 18.0874 11.9807 17.7311L12.5685 15.7011L13.7993 15.0105L15.9261 15.5368C16.2827 15.625 16.6549 15.4694 16.8426 15.1536L18.0009 13.2048C18.196 12.8767 18.1431 12.4578 17.8726 12.1885L16.3674 10.6899L16.368 9.30877L17.8732 7.81017C18.1438 7.5408 18.1967 7.12202 18.0016 6.79384L16.8432 4.84505C16.6555 4.52931 16.2833 4.37368 15.9267 4.4619L13.7998 4.98815L12.5 4.16602L11.8566 2.23582C11.7432 1.89554 11.4248 1.66602 11.066 1.66602H8.93401C8.57526 1.66602 8.25683 1.89554 8.14341 2.23582Z" stroke="#414651" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
9
9
  </svg>
10
10
  </span>
11
- Add new report
11
+ <%= t('kanaui.reports.new.title') %>
12
12
  </h5>
13
13
  <%= render 'form' %>
14
14
  </div>
@@ -2,6 +2,70 @@
2
2
  # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
3
 
4
4
  en:
5
+ kanaui:
6
+ actions:
7
+ close: "Close"
8
+ delete: "Delete"
9
+ edit: "Edit"
10
+ refresh: "Refresh"
11
+ save: "Save"
12
+ errors:
13
+ killbill_communication: "Error while communicating with the Kill Bill server: %{error}"
14
+ dashboard:
15
+ advanced_controls:
16
+ sql_query: "SQL query"
17
+ no_reports_available: "No reports available"
18
+ reports:
19
+ notices:
20
+ created: "Report successfully created"
21
+ updated: "Report successfully updated"
22
+ refresh_scheduled: "Report refresh successfully scheduled"
23
+ deleted: "Report successfully deleted"
24
+ index:
25
+ title: "Configured reports"
26
+ dashboard: "Dashboard"
27
+ new_report: "New Report"
28
+ new:
29
+ title: "Add new report"
30
+ edit:
31
+ title: "Update report"
32
+ form:
33
+ report_name: "Report Name"
34
+ pretty_name: "Pretty Name"
35
+ type: "Type"
36
+ source_table_name: "Source Table Name"
37
+ source_query: "SQL Query"
38
+ source_query_help: "Don't add a trailing ;"
39
+ source_configuration_error: "Either Source Table Name or SQL Query is required."
40
+ source_name: "Remote Database Name"
41
+ source_name_help: "Must match a database configuration entry in the Analytics plugin"
42
+ tooltips:
43
+ report_name: "Unique identifier for your report."
44
+ report_pretty_name: "Description, that will be used in Kaui."
45
+ report_type: "Type of report. Possible values are COUNTERS, TIMELINE, TABLE."
46
+ source_table_name: "Name of the source table/view."
47
+ source_query: "SQL query to be executed."
48
+ source_name: "Name of the remote database."
49
+ refresh_procedure_name: "Name of the stored procedure."
50
+ refresh_frequency: "Frequency with which the refresh procedure will be executed. Possible values are HOURLY and DAILY."
51
+ refresh_hour_of_day_gmt: "Hour of the day when the procedure will be executed."
52
+ refresh_procedure: "Refresh Procedure"
53
+ refresh_frequency: "Refresh Frequency"
54
+ refresh_hour_gmt: "Refresh Hour (GMT)"
55
+ table:
56
+ cleanup_required: "Cannot delete from the UI because reportName is blank. Clean up this malformed record directly in the analytics plugin database."
57
+ cleanup_required_with_record_id: "Cannot delete from the UI because reportName is blank. Clean up recordId %{record_id} directly in the analytics plugin database."
58
+ name: "Name"
59
+ pretty_name: "Pretty Name"
60
+ type: "Type"
61
+ source: "Source"
62
+ source_name: "Remote Database Name"
63
+ source_query: "Source Query"
64
+ refresh_procedure: "Refresh Procedure"
65
+ refresh_frequency: "Refresh Frequency"
66
+ refresh_hour_gmt: "Refresh Hour (GMT)"
67
+ fields: "Fields"
68
+ show_sql: "Show SQL"
5
69
  helpers:
6
70
  actions: "Actions"
7
71
  links:
data/config/routes.rb CHANGED
@@ -4,13 +4,13 @@ Kanaui::Engine.routes.draw do
4
4
  root to: 'dashboard#index'
5
5
  resources :dashboard, only: [:index]
6
6
  scope '/dashboard' do
7
- match '/available_reports' => 'dashboard#available_reports', :via => :get, :as => 'available_reports'
8
- match '/reports' => 'dashboard#reports', :via => :get, :as => 'reports'
7
+ get '/available_reports' => 'dashboard#available_reports', :as => 'available_reports'
8
+ get '/reports' => 'dashboard#reports', :as => 'reports'
9
9
  end
10
10
 
11
11
  resources :reports, only: %i[index new create edit update destroy]
12
12
  scope '/reports' do
13
- match '/refresh/:id' => 'reports#refresh', :via => :put, :as => 'refresh_report'
13
+ put '/refresh/:id' => 'reports#refresh', :as => 'refresh_report'
14
14
  end
15
15
 
16
16
  resources :settings, only: %i[index create]
data/lib/kanaui/engine.rb CHANGED
@@ -11,7 +11,6 @@ require 'jquery-rails'
11
11
  require 'killbill_assets_ui'
12
12
  require 'font-awesome-rails'
13
13
  require 'bootstrap-datepicker-rails'
14
- require 'd3_rails'
15
14
  require 'spinjs-rails'
16
15
  require 'killbill_client'
17
16
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kanaui
4
- VERSION = '5.0.0'
4
+ VERSION = '5.0.2'
5
5
  end