mat_views 0.2.0 → 0.3.0

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.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -4
  3. data/app/assets/images/mat_views/android-chrome-192x192.png +0 -0
  4. data/app/assets/images/mat_views/android-chrome-512x512.png +0 -0
  5. data/app/assets/images/mat_views/apple-touch-icon.png +0 -0
  6. data/app/assets/images/mat_views/favicon-16x16.png +0 -0
  7. data/app/assets/images/mat_views/favicon-32x32.png +0 -0
  8. data/app/assets/images/mat_views/favicon-48x48.png +0 -0
  9. data/app/assets/images/mat_views/favicon.ico +0 -0
  10. data/app/assets/images/mat_views/favicon.svg +18 -0
  11. data/app/assets/images/mat_views/logo.svg +18 -0
  12. data/app/assets/images/mat_views/mask-icon.svg +5 -0
  13. data/app/assets/stylesheets/mat_views/application.css +323 -12
  14. data/app/controllers/mat_views/admin/application_controller.rb +135 -0
  15. data/app/controllers/mat_views/admin/dashboard_controller.rb +32 -0
  16. data/app/controllers/mat_views/admin/mat_view_definitions_controller.rb +248 -0
  17. data/app/controllers/mat_views/admin/preferences_controller.rb +91 -0
  18. data/app/controllers/mat_views/admin/runs_controller.rb +74 -0
  19. data/app/helpers/mat_views/admin/ui_helper.rb +385 -0
  20. data/app/javascript/mat_views/application.js +8 -0
  21. data/app/javascript/mat_views/controllers/application.js +10 -0
  22. data/app/javascript/mat_views/controllers/details_controller.js +122 -0
  23. data/app/javascript/mat_views/controllers/drawer_controller.js +252 -0
  24. data/app/javascript/mat_views/controllers/filter_controller.js +90 -0
  25. data/app/javascript/mat_views/controllers/flash_controller.js +13 -0
  26. data/app/javascript/mat_views/controllers/index.js +10 -0
  27. data/app/javascript/mat_views/controllers/mv_confirm_controller.js +281 -0
  28. data/app/javascript/mat_views/controllers/submitter_controller.js +15 -0
  29. data/app/javascript/mat_views/controllers/tabs_controller.js +67 -0
  30. data/app/javascript/mat_views/controllers/timezone_controller.js +16 -0
  31. data/app/javascript/mat_views/controllers/tooltip_controller.js +328 -0
  32. data/app/javascript/mat_views/controllers/turbo_frame_lifecycle_controller.js +49 -0
  33. data/app/jobs/mat_views/application_job.rb +2 -2
  34. data/app/jobs/mat_views/create_view_job.rb +9 -8
  35. data/app/jobs/mat_views/delete_view_job.rb +8 -8
  36. data/app/jobs/mat_views/refresh_view_job.rb +8 -9
  37. data/app/models/concerns/mat_views_i18n.rb +139 -0
  38. data/app/models/mat_views/application_record.rb +1 -0
  39. data/app/models/mat_views/mat_view_definition.rb +12 -7
  40. data/app/models/mat_views/mat_view_run.rb +11 -13
  41. data/app/views/layouts/mat_views/_footer.html.erb +41 -0
  42. data/app/views/layouts/mat_views/_header.html.erb +25 -0
  43. data/app/views/layouts/mat_views/admin.html.erb +47 -0
  44. data/app/views/layouts/mat_views/turbo_frame.html.erb +3 -0
  45. data/app/views/mat_views/admin/dashboard/index.html.erb +33 -0
  46. data/app/views/mat_views/admin/mat_view_definitions/_definition_actions.html.erb +94 -0
  47. data/app/views/mat_views/admin/mat_view_definitions/_table.html.erb +48 -0
  48. data/app/views/mat_views/admin/mat_view_definitions/empty.html.erb +1 -0
  49. data/app/views/mat_views/admin/mat_view_definitions/form.html.erb +79 -0
  50. data/app/views/mat_views/admin/mat_view_definitions/index.html.erb +10 -0
  51. data/app/views/mat_views/admin/mat_view_definitions/show.html.erb +40 -0
  52. data/app/views/mat_views/admin/preferences/show.html.erb +50 -0
  53. data/app/views/mat_views/admin/runs/_table.html.erb +61 -0
  54. data/app/views/mat_views/admin/runs/index.html.erb +38 -0
  55. data/app/views/mat_views/admin/runs/show.html.erb +64 -0
  56. data/app/views/mat_views/admin/ui/_card.html.erb +15 -0
  57. data/app/views/mat_views/admin/ui/_details.html.erb +10 -0
  58. data/app/views/mat_views/admin/ui/_flash.html.erb +6 -0
  59. data/app/views/mat_views/admin/ui/_table.html.erb +8 -0
  60. data/config/importmap.rb +9 -0
  61. data/config/locales/en-AU-ocker.yml +187 -0
  62. data/config/locales/en-AU.yml +187 -0
  63. data/config/locales/en-BB.yml +187 -0
  64. data/config/locales/en-BD.yml +187 -0
  65. data/config/locales/en-BE.yml +187 -0
  66. data/config/locales/en-BORK.yml +187 -0
  67. data/config/locales/en-BS.yml +187 -0
  68. data/config/locales/en-BZ.yml +187 -0
  69. data/config/locales/en-CA.yml +187 -0
  70. data/config/locales/en-CM.yml +187 -0
  71. data/config/locales/en-CY.yml +187 -0
  72. data/config/locales/en-EG.yml +187 -0
  73. data/config/locales/en-FJ.yml +187 -0
  74. data/config/locales/en-GB.yml +187 -0
  75. data/config/locales/en-GH.yml +187 -0
  76. data/config/locales/en-GI.yml +187 -0
  77. data/config/locales/en-GM.yml +187 -0
  78. data/config/locales/en-GY.yml +187 -0
  79. data/config/locales/en-HK.yml +187 -0
  80. data/config/locales/en-IE.yml +187 -0
  81. data/config/locales/en-IN.yml +187 -0
  82. data/config/locales/en-JM.yml +187 -0
  83. data/config/locales/en-KE.yml +187 -0
  84. data/config/locales/en-LK.yml +187 -0
  85. data/config/locales/en-LOL.yml +187 -0
  86. data/config/locales/en-LR.yml +187 -0
  87. data/config/locales/en-MS.yml +187 -0
  88. data/config/locales/en-MT.yml +187 -0
  89. data/config/locales/en-MW.yml +187 -0
  90. data/config/locales/en-MY.yml +187 -0
  91. data/config/locales/en-NG.yml +187 -0
  92. data/config/locales/en-NP.yml +187 -0
  93. data/config/locales/en-NZ.yml +187 -0
  94. data/config/locales/en-PG.yml +187 -0
  95. data/config/locales/en-PH.yml +187 -0
  96. data/config/locales/en-PK.yml +187 -0
  97. data/config/locales/en-RW.yml +187 -0
  98. data/config/locales/en-SCOT.yml +187 -0
  99. data/config/locales/en-SG.yml +187 -0
  100. data/config/locales/en-SHAKESPEARE.yml +187 -0
  101. data/config/locales/en-SL.yml +187 -0
  102. data/config/locales/en-SS.yml +187 -0
  103. data/config/locales/en-TH.yml +187 -0
  104. data/config/locales/en-TT.yml +187 -0
  105. data/config/locales/en-TZ.yml +187 -0
  106. data/config/locales/en-UG.yml +187 -0
  107. data/config/locales/en-US-pirate.yml +187 -0
  108. data/config/locales/en-US.yml +187 -0
  109. data/config/locales/en-YODA.yml +187 -0
  110. data/config/locales/en-ZA.yml +187 -0
  111. data/config/locales/en-ZW.yml +187 -0
  112. data/config/locales/en.yml +187 -0
  113. data/config/routes.rb +27 -3
  114. data/lib/generators/mat_views/install/templates/create_mat_view_definitions.rb +7 -7
  115. data/lib/generators/mat_views/install/templates/create_mat_view_runs.rb +5 -5
  116. data/lib/mat_views/admin/auth_bridge.rb +93 -0
  117. data/lib/mat_views/admin/default_auth.rb +61 -0
  118. data/lib/mat_views/configuration.rb +9 -0
  119. data/lib/mat_views/engine.rb +50 -2
  120. data/lib/mat_views/helpers/ui_test_ids.rb +43 -0
  121. data/lib/mat_views/services/base_service.rb +46 -38
  122. data/lib/mat_views/services/check_matview_exists.rb +76 -0
  123. data/lib/mat_views/services/concurrent_refresh.rb +9 -6
  124. data/lib/mat_views/services/create_view.rb +15 -15
  125. data/lib/mat_views/services/delete_view.rb +8 -11
  126. data/lib/mat_views/services/regular_refresh.rb +6 -5
  127. data/lib/mat_views/services/swap_refresh.rb +11 -9
  128. data/lib/mat_views/version.rb +1 -1
  129. data/lib/mat_views.rb +10 -4
  130. data/lib/tasks/helpers.rb +13 -13
  131. data/lib/tasks/mat_views_tasks.rake +15 -15
  132. metadata +130 -5
@@ -0,0 +1,40 @@
1
+ <% humanize_attr = ->(attr) { MatViews::MatViewDefinition.human_attribute_name(attr) } %>
2
+ <% humanize_enum_attr = ->(col, val) { MatViews::MatViewDefinition.human_enum_name(col, val) } %>
3
+
4
+ <input type="hidden" id="mv-drawer-title-text" value="<%= mv_t("view_var", name: @definition.name) %>"/>
5
+ <input type="hidden" id="mv-drawer-open-url-identifier" value="definitions_view_<%= @definition.id %>"/>
6
+ <%= render "mat_views/admin/ui/card" do %>
7
+ <div class="mv-field">
8
+ <div class="mv-label"><%= humanize_attr.call(:refresh_strategy) %></div>
9
+ <div><%= humanize_enum_attr.call(:refresh_strategy, @definition.refresh_strategy) %></div>
10
+ </div>
11
+ <div class="mv-field">
12
+ <div class="mv-label"><%= humanize_attr.call(:schedule_cron) %></div>
13
+ <div><%= @definition.schedule_cron.presence || "-" %></div>
14
+ </div>
15
+ <div class="mv-field">
16
+ <div class="mv-label"><%= humanize_attr.call(:unique_index_columns) %></div>
17
+ <div><%= Array(@definition.unique_index_columns).join(", ").presence || "-" %></div>
18
+ </div>
19
+ <div class="mv-field">
20
+ <div class="mv-label"><%= humanize_attr.call(:dependencies) %></div>
21
+ <div><%= Array(@definition.dependencies).join(", ").presence || "-" %></div>
22
+ </div>
23
+ <div class="mv-field">
24
+ <div class="mv-label"><%= humanize_attr.call(:last_run) %></div>
25
+ <div><%= @definition.last_run ? l(@definition.last_run.started_at.in_time_zone, format: :datetime12hour) : "-" %></div>
26
+ </div>
27
+ <div class="mv-field">
28
+ <%= render "mat_views/admin/ui/details",
29
+ tooltip_text: mv_t("mat_view_definition.sql_summary_tooltip"),
30
+ title: content_tag(:div, humanize_attr.call(:sql), class: "mv-label") do %>
31
+ <pre><%= @definition.sql -%></pre>
32
+ <% end %>
33
+ </div>
34
+
35
+ <% content_for :footer do %>
36
+ <div class="mv-header-row even">
37
+ <%= render "definition_actions", defn: @definition, mv_exists: @mv_exists, frame_id: "mv-drawer" %>
38
+ </div>
39
+ <% end %>
40
+ <% end %>
@@ -0,0 +1,50 @@
1
+ <input type="hidden" id="mv-drawer-open-url-identifier" value="preferences_edit" %>
2
+ <div class="mv-card">
3
+ <div class="mv-card-b">
4
+ <%= form_with url: admin_preferences_path(frame_id: 'mv-drawer', frame_action: "window-reload"), method: :put, data: { turbo_frame: :"mv-drawer" } do %>
5
+ <!-- Theme -->
6
+ <div class="mv-field">
7
+ <div class="mv-label"><%= mv_t("settings.theme") %></div>
8
+ <p class="mv-label mv-label--sublabel">
9
+ <%= mv_t("settings.theme_hint") %>
10
+ </p>
11
+ <div class="mv-actions" style="justify-content:flex-start">
12
+ <% [["auto", mv_t("settings.auto")], ["light", mv_t("settings.light")], ["dark", mv_t("settings.dark")]].each do |value, label| %>
13
+ <label for="lang-<%= label %>" class="mv-btn mv-btn--secondary mv-btn--sm" style="gap:.4rem;">
14
+ <input id="lang-<%= label %>" type="radio" name="theme" value="<%= value %>" <%= "checked" if @theme == value %> style="margin:0"/>
15
+ <span><%= label %></span>
16
+ </label>
17
+ <% end %>
18
+ </div>
19
+ </div>
20
+ <br/>
21
+ <!-- Language -->
22
+ <div class="mv-field">
23
+ <label for="locale" class="mv-label"><%= mv_t("settings.language") %></label>
24
+ <p class="mv-label mv-label--sublabel">
25
+ <%= mv_t("settings.language_hint") %>
26
+ </p>
27
+ <select name="locale" id="locale" class="mv-select">
28
+ <% @locales.each do |loc| %>
29
+ <% label = MatViews::Engine.locale_code_mapping[loc.to_sym] %>
30
+ <option value="<%= loc %>" <%= "selected" if @locale == loc %>>
31
+ <%= label %>
32
+ </option>
33
+ <% end %>
34
+ </select>
35
+ </div>
36
+ <div class="mv-actions">
37
+ <%= mv_submit_button class: "mv-btn mv-btn--primary mv-btn--md",
38
+ testid: 'PREFERENCES_SAVE_BUTTON' do %>
39
+ <%= mv_t("save_changes") %>
40
+ <% end %>
41
+
42
+ <%= mv_cancel_button variant: :ghost, data: { action: "click->drawer#close" },
43
+ class: 'mv-btn mv-btn--ghost mv-btn--md',
44
+ testid: 'PREFERENCES_CANCEL_BUTTON' do %>
45
+ <%= mv_t("cancel") %>
46
+ <% end %>
47
+ </div>
48
+ <% end %>
49
+ </div>
50
+ </div>
@@ -0,0 +1,61 @@
1
+ <% humanize_attr = ->(attr) { MatViews::MatViewRun.human_attribute_name(attr) } %>
2
+ <% humanize_enum_attr = ->(col, val) { MatViews::MatViewRun.human_enum_name(col, val) } %>
3
+
4
+ <table class="mv-table">
5
+ <thead>
6
+ <tr class="mv-tr">
7
+ <th class="mv-th"><%= humanize_attr.call(:operation) %></th>
8
+ <th class="mv-th"><%= humanize_attr.call(:mat_view_definition) %></th>
9
+ <th class="mv-th"><%= humanize_attr.call(:started_at) %></th>
10
+ <th class="mv-th"><%= humanize_attr.call(:status) %></th>
11
+ <th class="mv-th"><%= humanize_attr.call(:duration_ms) %></th>
12
+ <th class="mv-th"><%= humanize_attr.call(:rows_before_after) %></th>
13
+ <th class="mv-th"><%= humanize_attr.call(:details) %></th>
14
+ </tr>
15
+ </thead>
16
+ <tbody>
17
+ <% if runs.any? %>
18
+ <% runs.each do |run| %>
19
+ <tr class="mv-tr" data-testid="RUN_ROW_<%= run.id %>">
20
+ <td class="mv-td"><%= humanize_enum_attr.call(:operation, run.operation) %></td>
21
+ <td class="mv-td">
22
+ <%= mv_drawer_link(admin_mat_view_definition_path(run.mat_view_definition, frame_id: "mv-drawer"), mv_t("view_var", name: run.mat_view_definition.name),
23
+ variant: :ghost,
24
+ underline: true,
25
+ testid: 'VIEW_LINK',
26
+ testid_identifier: "defn-#{run.mat_view_definition.id}",
27
+ tooltip: mv_t("mat_view_definition.view_tooltip")) do %>
28
+ <%= run.mat_view_definition.name %>
29
+ <% end %>
30
+ </td>
31
+ <td class="mv-td"><%= l(run.started_at.in_time_zone, format: :datetime12hour) %></td>
32
+ <td class="mv-td"><%= mv_badge(run.status, humanize_enum_attr.call(:status, run.status)) %></td>
33
+ <td class="mv-td"><%= run.duration_ms ? "#{run.duration_ms} ms" : "-" %></td>
34
+ <td class="mv-td"><%= run.row_count_before || "-" %>/<%= run.row_count_after || "-" %></td>
35
+ <td class="mv-td">
36
+ <%= mv_drawer_link(admin_run_path(id: run.id, frame_id: 'mv-drawer'), mv_t('mat_view_run.view_details'),
37
+ variant: :ghost,
38
+ underline: true,
39
+ testid: 'VIEW_LINK',
40
+ testid_identifier: "run-#{run.id}",
41
+ tooltip: mv_t("mat_view_run.view_tooltip")) do %>
42
+ <%= mv_t("mat_view_run.view_details") %>
43
+ <% end %>
44
+ </td>
45
+ </tr>
46
+ <% end %>
47
+ <% else %>
48
+ <tr class="mv-tr">
49
+ <td class="mv-td" colspan="7">
50
+ <% filter_present = params[:mat_view_definition_id].present? || params[:operation].present? || params[:status].present? %>
51
+
52
+ <% if filter_present %>
53
+ <%= mv_t("mat_view_run.no_runs_if_filtered") %>
54
+ <% else %>
55
+ <%= mv_t("mat_view_run.no_runs") %>
56
+ <% end %>
57
+ </td>
58
+ </tr>
59
+ <% end %>
60
+ </tbody>
61
+ </table>
@@ -0,0 +1,38 @@
1
+ <% data = { controller: "filter", query_params: %w[mat_view_definition_id operation status].join(","), turbo_frame: @frame_id } %>
2
+ <% humanize_attr = ->(attr) { MatViews::MatViewRun.human_attribute_name(attr) } %>
3
+ <% operation_options = [[mv_t("all_operations"), ""]].concat(MatViews::MatViewRun.human_enum_options(:operation)) %>
4
+ <% status_options = [[mv_t("all_statuses"), ""]].concat(MatViews::MatViewRun.human_enum_options(:status)) %>
5
+ <% definition_options = [[mv_t("all_definitions"), ""]] + @definitions.map { |d| [d.name, d.id] } %>
6
+ <%= form_with url: admin_runs_path, method: :get, data: data, class: "mv-form mv-form--no-pad" do %>
7
+ <div class="mv-field-inline-row">
8
+ <div class="mv-field-inline">
9
+ <%= mv_t("filter_by") %>
10
+ </div>
11
+ <div class="mv-field-inline">
12
+ <%= label_tag :mat_view_definition_id, humanize_attr.call(:mat_view_definition), class: "mv-label" %>
13
+ <%= select_tag :mat_view_definition_id,
14
+ options_for_select(definition_options, params[:mat_view_definition_id]),
15
+ class: "mv-select",
16
+ data: {
17
+ action: "change->filter#autoSubmit",
18
+ } %>
19
+ </div>
20
+ <div class="mv-field-inline">
21
+ <%= label_tag :operation, humanize_attr.call(:operation), class: "mv-label" %>
22
+ <%= select_tag :operation, options_for_select(operation_options, params[:operation]), class: "mv-select", data: { action: "change->filter#autoSubmit" } %>
23
+ </div>
24
+ <div class="mv-field-inline">
25
+ <%= label_tag :status, humanize_attr.call(:status), class: "mv-label" %>
26
+ <%= select_tag :status, options_for_select(status_options, params[:status]), class: "mv-select", data: { action: "change->filter#autoSubmit" } %>
27
+ </div>
28
+ <div class="mv-field-inline">
29
+ <%= hidden_field_tag :frame_id, @frame_id %>
30
+ <%= hidden_field_tag :frame_action, @frame_action %>
31
+ <%= mv_button_link "#", variant: :ghost, data: { action: "click->filter#reset" }, testid: 'RESET_FILTERS_LINK' do %>
32
+ <%= mv_icon(:x_circle) %>
33
+ <%= mv_t("reset") %>
34
+ <% end %>
35
+ </div>
36
+ </div>
37
+ <% end %>
38
+ <%= render "mat_views/admin/runs/table", runs: @runs %>
@@ -0,0 +1,64 @@
1
+ <% humanize_attr = ->(attr) { MatViews::MatViewRun.human_attribute_name(attr) } %>
2
+ <% humanize_enum_attr = ->(col, val) { MatViews::MatViewRun.human_enum_name(col, val) } %>
3
+ <input type="hidden" id="mv-drawer-open-url-identifier" value="runs_view_<%= @run.id %>"/>
4
+ <div class="mv-card">
5
+ <div class="mv-card-b">
6
+ <div class="mv-field">
7
+ <div class="mv-label"><%= mv_t("definition") %></div>
8
+ <div>
9
+ <%= mv_drawer_link(admin_mat_view_definition_path(@run.mat_view_definition, frame_id: "mv-drawer"), mv_t("view_var", name: @run.mat_view_definition.name),
10
+ variant: :ghost,
11
+ underline: true,
12
+ tooltip: mv_t("mat_view_definition.view_tooltip")) do %>
13
+ <%= @run.mat_view_definition.name %>
14
+ <% end %>
15
+ </div>
16
+ </div>
17
+ <div class="mv-field">
18
+ <div class="mv-label"><%= humanize_attr.call(:operation) %></div>
19
+ <div><%= humanize_enum_attr.call(:operation, @run.operation) %></div>
20
+ </div>
21
+ <div class="mv-field">
22
+ <div class="mv-label"><%= humanize_attr.call(:started_at) %></div>
23
+ <div><%= l(@run.started_at.in_time_zone, format: :datetime12hour) %></div>
24
+ </div>
25
+ <div class="mv-field">
26
+ <div class="mv-label"><%= humanize_attr.call(:finished_at) %></div>
27
+ <div><%= l(@run.finished_at&.in_time_zone, format: :datetime12hour) || "-" %></div>
28
+ </div>
29
+ <div class="mv-field">
30
+ <div class="mv-label"><%= humanize_attr.call(:status) %></div>
31
+ <div><%= mv_badge(@run.status, humanize_enum_attr.call(:status, @run.status)) %></div>
32
+ </div>
33
+ <div class="mv-field">
34
+ <div class="mv-label"><%= humanize_attr.call(:duration_ms) %></div>
35
+ <div><%= @run.duration_ms ? "#{@run.duration_ms} ms" : "-" %></div>
36
+ </div>
37
+ <div class="mv-field">
38
+ <div class="mv-label"><%= humanize_attr.call(:row_count_before) %></div>
39
+ <div><%= @run.row_count_before || "-" %></div>
40
+ </div>
41
+ <div class="mv-field">
42
+ <div class="mv-label"><%= humanize_attr.call(:row_count_after) %></div>
43
+ <div><%= @run.row_count_after || "-" %></div>
44
+ </div>
45
+
46
+ <div class="mv-field">
47
+ <%= render "mat_views/admin/ui/details",
48
+ tooltip_text: mv_t("mat_view_run.meta_tooltip"),
49
+ title: content_tag(:div, humanize_attr.call(:meta), class: "mv-label") do %>
50
+ <pre><%= JSON.pretty_generate(@run.meta || {}).strip -%></pre>
51
+ <% end %>
52
+ </div>
53
+
54
+ <% if @run.try(:error).present? %>
55
+ <div class="mv-field">
56
+ <%= render "mat_views/admin/ui/details",
57
+ tooltip_text: mv_t("mat_view_run.error_tooltip"),
58
+ title: content_tag(:div, humanize_attr.call(:error), class: "mv-label") do %>
59
+ <pre><%= JSON.pretty_generate(@run.error || {}).strip -%></pre>
60
+ <% end %>
61
+ </div>
62
+ <% end %>
63
+ </div>
64
+ </div>
@@ -0,0 +1,15 @@
1
+ <% body = capture { yield } %>
2
+ <div class="mv-card">
3
+ <% if content_for?(:title) %>
4
+ <div class="mv-card-h">
5
+ <%= yield :title %>
6
+ </div>
7
+ <% end %>
8
+
9
+ <div class="mv-card-b"><%= body %></div>
10
+ <% if content_for?(:footer) %>
11
+ <div class="mv-card-f">
12
+ <%= yield :footer %>
13
+ </div>
14
+ <% end %>
15
+ </div>
@@ -0,0 +1,10 @@
1
+ <% body = capture { yield } %>
2
+ <details data-controller="details" data-details-duration-value="200" class="mv-details"
3
+ open>
4
+ <summary data-action="click->details#toggle" data-controller="tooltip" data-tooltip-text-value="<%= tooltip_text %>">
5
+ <%= mv_icon(:arrow_right, class_name: "mv-chevron") %>
6
+ <%= title %>
7
+ </summary>
8
+
9
+ <div data-details-target="content" class="mv-details__content"><%= body -%></div>
10
+ </details>
@@ -0,0 +1,6 @@
1
+ <% if notice %>
2
+ <div class="mv-flash mv-flash--ok" data-controller="flash"><%= notice %></div>
3
+ <% end %>
4
+ <% if alert %>
5
+ <div class="mv-flash mv-flash--err" data-controller="flash"><%= alert %></div>
6
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <table class="mv-table">
2
+ <% if local_assigns[:head].present? %>
3
+ <thead>
4
+ <tr class="mv-tr"><%= head %></tr>
5
+ </thead>
6
+ <% end %>
7
+ <tbody><%= yield %></tbody>
8
+ </table>
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ enable_integrity!
4
+ pin 'mat_views/application'
5
+ pin '@hotwired/turbo-rails', to: 'turbo.min.js'
6
+ pin '@hotwired/stimulus', to: 'stimulus.min.js'
7
+ pin '@hotwired/stimulus-loading', to: 'stimulus-loading.js'
8
+
9
+ pin_all_from MatViews::Engine.root.join('app/javascript/mat_views/controllers'), under: 'mat_views/controllers'
@@ -0,0 +1,187 @@
1
+ en-AU-ocker:
2
+ activerecord:
3
+ attributes:
4
+ mat_views/mat_view_definition:
5
+ created_at: "Cooked up at"
6
+ dependencies: "Mates it leans on"
7
+ name: "Name"
8
+ refresh_strategy: "Refresh trick"
9
+ schedule_cron: "Roster (cron)"
10
+ sql: "SQL (SELECT ...)"
11
+ unique_index_columns: "Unique index columns"
12
+ updated_at: "Spruced up at"
13
+ mat_views/mat_view_run:
14
+ created_at: "Cooked up at"
15
+ details: "The nitty-gritty"
16
+ duration_ms: "How long (ms)"
17
+ error: "Stuff-up"
18
+ finished_at: "Wrapped up at"
19
+ mat_view_definition: "Definition"
20
+ meta: "Extra bits"
21
+ operation: "What we did"
22
+ row_count_after: "Row count after"
23
+ row_count_before: "Row count before"
24
+ rows_before_after: "Rows (before/after)"
25
+ started_at: "Kicked off at"
26
+ status: "Status"
27
+ updated_at: "Spruced up at"
28
+ enums:
29
+ mat_views/mat_view_definition:
30
+ refresh_strategy:
31
+ concurrent: "All at once"
32
+ regular: "The usual"
33
+ swap: "Quick swap"
34
+ mat_views/mat_view_run:
35
+ operation:
36
+ create: "Spin up"
37
+ drop: "Chuck out"
38
+ refresh: "Give it a tickle"
39
+ status:
40
+ failed: "Gone bung"
41
+ running: "Flat out"
42
+ success: "All good"
43
+ errors:
44
+ models:
45
+ mat_views/mat_view_definition:
46
+ attributes:
47
+ name:
48
+ blank: "ya gotta give it a name"
49
+ invalid: "nah mate, that's not a fair dinkum PostgreSQL name"
50
+ taken: "someone's already nabbed that"
51
+ sql:
52
+ blank: "chuck in some SQL, mate"
53
+ invalid: "has to start with SELECT, no muckin' about"
54
+ unique_index_columns:
55
+ at_least_one: "need at least one column when usin' the concurrent trick"
56
+ hints:
57
+ mat_views/mat_view_definition:
58
+ dependencies: "List the tables or views it leans on, comma separated."
59
+ name: "What we call the materialised view in the DB."
60
+ refresh_strategy: "How you wanna give it a tickle."
61
+ schedule_cron: "Use cron format. Leave it blank if ya can't be bothered."
62
+ sql: "Has to be a proper SELECT statement."
63
+ unique_index_columns: "Columns for a unique index. Needed for the all-at-once trick."
64
+ mat_views/mat_view_run:
65
+ error: "Stuff-up if it went bung."
66
+ meta: "Extra bits in JSON."
67
+ operation: "What sort of job we ran."
68
+ status: "Where it's at."
69
+ models:
70
+ mat_views/mat_view_definition: "Mat View Def'n"
71
+ mat_views/mat_view_run: "Mat View Run"
72
+ placeholders:
73
+ mat_views/mat_view_definition:
74
+ dependencies: "Chuck in dependencies (comma separated, optional)"
75
+ name: "Give it a name, mate"
76
+ refresh_strategy: "Pick how to refresh"
77
+ schedule_cron: "0 0 * * * for midnight daily, leave blank otherwise"
78
+ sql: "Type in ya SQL (SELECT ...)"
79
+ unique_index_columns: "Unique index columns (comma separated, optional)"
80
+ mat_views/mat_view_run:
81
+ error: "Error msg"
82
+ mat_view_definition: "Pick a mat view"
83
+ meta: "Extra bits (JSON)"
84
+ operation: "Pick what to do"
85
+ status: "Pick a status"
86
+ i18n:
87
+ name: Aussie (Ocker)
88
+ mat_views:
89
+ actions: "Stuff ya can do"
90
+ all_definitions: "Every def'n"
91
+ all_operations: "Every job"
92
+ all_statuses: "Every status"
93
+ cancel: "Nah, cancel"
94
+ close: "Shut it"
95
+ close_window: "Shut the window"
96
+ create: "Knock one up"
97
+ dashboard:
98
+ metrics:
99
+ title: "Stats & that"
100
+ title: "Dashy board"
101
+ definition: "Def'n"
102
+ definitions: "Def'ns"
103
+ delete: "Chuck it"
104
+ details: "The nitty-gritty"
105
+ edit: "Tweak it"
106
+ edit_var: "Tweak %{name}"
107
+ errors:
108
+ frame_only: "Oi, only works in a frame. Back to the dashy board."
109
+ prevented_saving:
110
+ one: "1 stuff-up stopped savin':"
111
+ other: "%{count} stuff-ups stopped savin':"
112
+ filter_by: "Filter by:"
113
+ footer:
114
+ copyright: "© %{year} %{company} — all rights, mate."
115
+ documentation: "The manual"
116
+ need_help: "Need a hand, cobber?"
117
+ open_issue: "Yell out (open issue)"
118
+ project_homepage: "Project home"
119
+ support: "Fair dinkum support →"
120
+ tagline: "Built with ❤️ by battlers, for battlers."
121
+ tooltip:
122
+ documentation: "Have a squiz at the docs"
123
+ gem_version: "Hop over to RubyGems"
124
+ open_issue: "Report a bug or ask for somethin'"
125
+ project_homepage: "Check the repo"
126
+ support: "Paid help if ya keen"
127
+ version: "v%{version}"
128
+ header:
129
+ signed_in_as: "Signed in as %{email}"
130
+ history: "Back story"
131
+ loading: "Hang on..."
132
+ loading_definitions: "Grabbin' the defs..."
133
+ loading_runs: "Grabbin' the runs..."
134
+ mat_view_definition:
135
+ create_mv: "Spin up MV"
136
+ create_mv_tooltip: "Makes the MV in the DB."
137
+ delete_confirm: "Sure ya wanna chuck %{name}? (Does NOT drop MV)"
138
+ delete_tooltip: "Deletes the def'n but leaves the MV."
139
+ drop_mv: "Drop MV"
140
+ drop_mv_cascade: "Drop MV (Cascade)"
141
+ drop_mv_cascade_confirm: "Drop the MV and all the tag-alongs for %{name}?"
142
+ drop_mv_cascade_tooltip: "Drops MV + mates, but keeps def'n."
143
+ drop_mv_confirm: "Drop the MV for %{name}?"
144
+ drop_mv_tooltip: "Drops the MV but keeps def'n."
145
+ edit_tooltip: "Tweak the mat view def'n."
146
+ materialized_view: "Mat View"
147
+ materialized_view_exists: "Mat view's there"
148
+ materialized_view_not_exists: "Mat view's not made yet!"
149
+ new_definition: "New def'n"
150
+ new_definition_tooltip: "Knock up a new mat view def'n."
151
+ no_definitions: "No defs found. Knock one up to start."
152
+ refresh_tooltip: "Give the mat view a tickle."
153
+ sql_summary_tooltip: "Click to open/close SQL"
154
+ view_tooltip: "See the mat view def'n."
155
+ mat_view_run:
156
+ error_tooltip: "Error if it went bung."
157
+ meta_tooltip: "Extra bits in JSON."
158
+ no_runs: "No runs yet."
159
+ no_runs_if_filtered: "No runs for that filter."
160
+ view_details: "See the deets"
161
+ view_tooltip: "See the run deets."
162
+ project_author: "Codevedas Inc."
163
+ project_description: "Admin UI for bossin' around Postgres mat views in Rails apps."
164
+ project_tags: "rails, ruby, mat views, admin, dashy, ui, managing stuff"
165
+ refresh: "Give it a tickle"
166
+ refresh_contents: "Tickle contents"
167
+ reloading: "Reloadin'..."
168
+ reset: "Start over"
169
+ run: "Run"
170
+ runs: "Runs"
171
+ save_changes: "Save it"
172
+ settings:
173
+ auto: "Auto"
174
+ dark: "Dark"
175
+ language: "Lingo"
176
+ language_hint: "Pick ya lingo for the UI."
177
+ light: "Light"
178
+ theme: "Theme"
179
+ theme_hint: "Auto follows system, light/dark overrides."
180
+ title: "Prefs"
181
+ title: "MatViews Admin"
182
+ view_var: "See %{name}"
183
+ time:
184
+ am: "AM"
185
+ formats:
186
+ datetime12hour: "%Y-%m-%d %I:%M:%S %p"
187
+ pm: "PM"