From e012b7f5ac9f069e7c78db1291c3515a8d68c7d6 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Fri, 18 Sep 2026 17:18:42 +0300 Subject: [PATCH] adjust title --- app/javascript/elements/bar_chart.js | 18 +++++++++++++----- app/javascript/elements/native_bridge.js | 3 ++- app/views/api_settings/index.html.erb | 2 +- app/views/esign_settings/show.html.erb | 2 +- app/views/mcp_settings/index.html.erb | 2 +- app/views/profile/index.html.erb | 8 ++++---- .../_applied_filters.html.erb | 4 ++-- app/views/template_folders/_folder.html.erb | 2 +- .../template_folders/_shared_folder.html.erb | 2 +- app/views/templates/_template.html.erb | 6 +++--- app/views/templates/_title.html.erb | 6 +++--- app/views/templates/show.html.erb | 6 +++--- app/views/webhook_settings/index.html.erb | 2 +- app/views/webhook_settings/show.html.erb | 4 ++-- 14 files changed, 38 insertions(+), 29 deletions(-) diff --git a/app/javascript/elements/bar_chart.js b/app/javascript/elements/bar_chart.js index 32fdfa0fc..1e482c224 100644 --- a/app/javascript/elements/bar_chart.js +++ b/app/javascript/elements/bar_chart.js @@ -1,8 +1,7 @@ export default class extends HTMLElement { - connectedCallback () { - this.chartLabels = JSON.parse(this.dataset.labels || '[]') - this.chartDatasets = JSON.parse(this.dataset.datasets || '[]') + static observedAttributes = ['data-labels', 'data-datasets'] + connectedCallback () { this.initChart() } @@ -13,6 +12,15 @@ export default class extends HTMLElement { } } + attributeChangedCallback (_, oldValue, newValue) { + if (!this.chartInstance || oldValue === newValue) return + + this.chartInstance.data.labels = JSON.parse(this.dataset.labels || '[]') + this.chartInstance.data.datasets = JSON.parse(this.dataset.datasets || '[]') + + this.chartInstance.update() + } + async initChart () { const { default: Chart } = await import(/* webpackChunkName: "chartjs" */ 'chart.js/auto') @@ -23,8 +31,8 @@ export default class extends HTMLElement { this.chartInstance = new Chart(ctx, { type: 'bar', data: { - labels: this.chartLabels, - datasets: this.chartDatasets + labels: JSON.parse(this.dataset.labels || '[]'), + datasets: JSON.parse(this.dataset.datasets || '[]') }, options: { responsive: true, diff --git a/app/javascript/elements/native_bridge.js b/app/javascript/elements/native_bridge.js index 3b290bd84..8f88e0177 100644 --- a/app/javascript/elements/native_bridge.js +++ b/app/javascript/elements/native_bridge.js @@ -39,7 +39,8 @@ if (handlers?.native && window === window.top) { if (!link) return - const title = link.dataset.nativeTitle || link.getAttribute('aria-label') || link.closest('[data-native-title]')?.dataset.nativeTitle || link.innerText.trim() + const action = link.closest('native-action, native-menu-action') + const title = link.dataset.nativeTitle || link.getAttribute('aria-label') || link.closest('[data-native-title]')?.dataset.nativeTitle || action?.dataset.label || action?.textContent.replace(/\s+/g, ' ').trim() if (!title) return diff --git a/app/views/api_settings/index.html.erb b/app/views/api_settings/index.html.erb index e009646b7..fdf58537f 100644 --- a/app/views/api_settings/index.html.erb +++ b/app/views/api_settings/index.html.erb @@ -19,7 +19,7 @@ <%= render 'shared/clipboard_copy', icon: 'copy', text: token, class: 'base-button', icon_class: 'w-6 h-6 text-white', copy_title: t('copy'), copied_title: t('copied') %> <% else %> - +
<%= svg_icon('copy', class: 'w-6 h-6 text-white') %> diff --git a/app/views/esign_settings/show.html.erb b/app/views/esign_settings/show.html.erb index fa0eab259..d8ec568bb 100644 --- a/app/views/esign_settings/show.html.erb +++ b/app/views/esign_settings/show.html.erb @@ -46,7 +46,7 @@ <%= t('signing_certificates') %> <% if can?(:create, @encrypted_config) %> - <%= link_to new_settings_esign_path, class: 'btn btn-primary btn-md', data: { turbo_frame: 'modal' } do %> + <%= link_to new_settings_esign_path, class: 'btn btn-primary btn-md', aria: { label: t('upload_certificate') }, data: { turbo_frame: 'modal' } do %> <%= svg_icon('plus', class: 'w-6 h-6') %> <%= t('upload_cert') %> <% end %> diff --git a/app/views/mcp_settings/index.html.erb b/app/views/mcp_settings/index.html.erb index 9191a6e29..c92936b82 100644 --- a/app/views/mcp_settings/index.html.erb +++ b/app/views/mcp_settings/index.html.erb @@ -7,7 +7,7 @@ <%= t('mcp_server') %>
- <%= link_to new_settings_mcp_path, class: 'btn btn-primary btn-md gap-2 w-full md:w-fit', data: { turbo_frame: 'modal' } do %> + <%= link_to new_settings_mcp_path, class: 'btn btn-primary btn-md gap-2 w-full md:w-fit', aria: { label: t('new_token') }, data: { turbo_frame: 'modal' } do %> <%= svg_icon('plus', class: 'w-6 h-6') %> <%= t('new_token') %> <% end %> diff --git a/app/views/profile/index.html.erb b/app/views/profile/index.html.erb index 8bc1af296..eef076f67 100644 --- a/app/views/profile/index.html.erb +++ b/app/views/profile/index.html.erb @@ -40,7 +40,7 @@
<% end %> -
+ <%= t('update_signature') %>

@@ -53,7 +53,7 @@

<% end %> - + <%= t('update_initials') %> <% if true_user == current_user && !current_account.testing? %> @@ -94,7 +94,7 @@ <%= t('2fa_has_been_configured') %>

- 🔓 <%= t('remove_2fa') %> + 🔓 <%= t('remove_2fa') %> <% else %>

<%= svg_icon('info_circle', class: 'stroke-warning inline flex-none w-5 h-5') %> @@ -102,7 +102,7 @@ <%= t('2fa_is_not_configured') %>

- 🔒 <%= t('set_up_2fa') %> + 🔒 <%= t('set_up_2fa') %> <% end %> <% end %> diff --git a/app/views/submissions_filters/_applied_filters.html.erb b/app/views/submissions_filters/_applied_filters.html.erb index 480a86517..3d9caf689 100644 --- a/app/views/submissions_filters/_applied_filters.html.erb +++ b/app/views/submissions_filters/_applied_filters.html.erb @@ -33,11 +33,11 @@ <% end %> <% end %> - <% if params[:template_id].present? %> + <% if local_assigns[:filter_template] %>
<%= svg_icon('layout_grid', class: 'w-5 h-5 shrink-0') %> - <%= local_assigns[:filter_template]&.name || 'NA' %> + <%= local_assigns[:filter_template].name %> <%= link_to url_for(params: request.query_parameters.except('template_id')), class: 'rounded-lg ml-1 shrink-0 hover:bg-base-content hover:text-white' do %> <%= svg_icon('x', class: 'w-5 h-5') %> diff --git a/app/views/template_folders/_folder.html.erb b/app/views/template_folders/_folder.html.erb index b7571a1f2..eacfd632c 100644 --- a/app/views/template_folders/_folder.html.erb +++ b/app/views/template_folders/_folder.html.erb @@ -1,6 +1,6 @@ <% is_long = folder.name.size > 32 %> <% icon = folder.default? ? 'folder_star' : 'folder' %> - + <% if !is_long %> <%= svg_icon(icon, class: 'w-6 h-6') %> <% end %> diff --git a/app/views/template_folders/_shared_folder.html.erb b/app/views/template_folders/_shared_folder.html.erb index f76ea5986..8964b6d75 100644 --- a/app/views/template_folders/_shared_folder.html.erb +++ b/app/views/template_folders/_shared_folder.html.erb @@ -1,4 +1,4 @@ - + <%= svg_icon('folder_up', class: 'w-6 h-6') %>
<%= t('shared') %> diff --git a/app/views/templates/_template.html.erb b/app/views/templates/_template.html.erb index 00b483628..713cae13c 100644 --- a/app/views/templates/_template.html.erb +++ b/app/views/templates/_template.html.erb @@ -1,5 +1,5 @@
- + <% end %> - <%= link_to template_share_link_path(template), class: 'btn btn-xs md:btn-sm whitespace-nowrap btn-neutral text-white px-2', data: { turbo_frame: :modal, native_modal: :medium } do %> + <%= link_to template_share_link_path(template), class: 'btn btn-xs md:btn-sm whitespace-nowrap btn-neutral text-white px-2', aria: { label: t('share_link') }, data: { turbo_frame: :modal, native_modal: :medium } do %> <%= svg_icon('link', class: 'w-4 h-4 md:w-6 md:h-6') %> <%= t('link') %> @@ -117,7 +117,7 @@ <% end %> <% if !template.archived_at? && can?(:update, template) && @template.account_id == current_account.id %> - + <% end %> <% if can?(:destroy, template) %> diff --git a/app/views/templates/show.html.erb b/app/views/templates/show.html.erb index c7faec664..e3936e0f1 100644 --- a/app/views/templates/show.html.erb +++ b/app/views/templates/show.html.erb @@ -30,7 +30,7 @@ <% end %> <% if !@template.archived_at? && can?(:create, Submission) %> - <%= link_to new_template_submission_path(@template), id: 'add_recipients_button', class: 'white-button !border', data: { turbo_frame: 'modal', native_modal: ('medium' if @template.submitters.size < 3) } do %> + <%= link_to new_template_submission_path(@template), id: 'add_recipients_button', class: 'white-button !border', aria: { label: t('add_new_recipients') }, data: { turbo_frame: 'modal', native_modal: ('medium' if @template.submitters.size < 3) } do %> <%= svg_icon('plus', class: 'w-6 h-6 stroke-2') %> <%= t('add_recipients_html') %> <% end %> @@ -104,7 +104,7 @@
<% if can?(:create, Submission) %> - <%= link_to new_template_submission_path(@template, with_link: true), id: 'send_to_recipients_button', class: 'base-button', data: { turbo_frame: 'modal', native_modal: ('medium' if @template.submitters.size < 3) } do %> + <%= link_to new_template_submission_path(@template, with_link: true), id: 'send_to_recipients_button', class: 'base-button', data: { turbo_frame: 'modal', native_title: t('add_new_recipients'), native_modal: ('medium' if @template.submitters.size < 3) } do %> <%= svg_icon('plus', class: 'w-6 h-6 stroke-2') %> <%= t('send_to_recipients') %> <% end %> @@ -117,7 +117,7 @@ <% end %> <% else %> - <%= link_to new_template_submission_path(@template, selfsign: true), id: 'sign_yourself_button', class: 'white-button', data: { turbo_frame: 'modal', native_modal: ('medium' if @template.submitters.size < 3) } do %> + <%= link_to new_template_submission_path(@template, selfsign: true), id: 'sign_yourself_button', class: 'white-button', data: { turbo_frame: 'modal', native_title: t('add_recipients'), native_modal: ('medium' if @template.submitters.size < 3) } do %> <%= svg_icon('writing', class: 'w-6 h-6') %> <%= t('sign_it_yourself') %> <% end %> diff --git a/app/views/webhook_settings/index.html.erb b/app/views/webhook_settings/index.html.erb index c18914bac..8a0f72605 100644 --- a/app/views/webhook_settings/index.html.erb +++ b/app/views/webhook_settings/index.html.erb @@ -7,7 +7,7 @@
<%= render 'shared/test_mode_toggle' %> <% if @webhook_url.persisted? %> - <%= link_to new_settings_webhook_path, class: 'md:ml-3 btn bg-white btn-outline btn-md gap-2 w-full md:w-fit', data: { turbo_frame: 'modal' } do %> + <%= link_to new_settings_webhook_path, class: 'md:ml-3 btn bg-white btn-outline btn-md gap-2 w-full md:w-fit', aria: { label: t('new_webhook') }, data: { turbo_frame: 'modal' } do %> <%= svg_icon('plus', class: 'w-6 h-6') %> <%= t('new_webhook') %> <% end %> diff --git a/app/views/webhook_settings/show.html.erb b/app/views/webhook_settings/show.html.erb index ed6d5f48d..9222481a0 100644 --- a/app/views/webhook_settings/show.html.erb +++ b/app/views/webhook_settings/show.html.erb @@ -9,7 +9,7 @@ <%= render 'shared/test_mode_toggle' %> <% end %> <% if @webhook_url.persisted? && params[:action] == 'index' %> - <%= link_to new_settings_webhook_path, class: 'md:ml-3 btn bg-white btn-outline btn-md gap-2 w-full md:w-fit', data: { turbo_frame: 'modal' } do %> + <%= link_to new_settings_webhook_path, class: 'md:ml-3 btn bg-white btn-outline btn-md gap-2 w-full md:w-fit', aria: { label: t('new_webhook') }, data: { turbo_frame: 'modal' } do %> <%= svg_icon('plus', class: 'w-6 h-6') %> <%= t('new_webhook') %> <% end %> @@ -22,7 +22,7 @@ <%= label_tag :url, 'Webhook URL', class: 'text-sm font-semibold' %> <% if @webhook_url.persisted? %>
- <%= link_to webhook_secret_path(@webhook_url), class: 'btn btn-outline btn-sm bg-white', data: { turbo_frame: 'modal' } do %> + <%= link_to webhook_secret_path(@webhook_url), class: 'btn btn-outline btn-sm bg-white', aria: { label: t('webhook_security') }, data: { turbo_frame: 'modal' } do %> <%= svg_icon('lock', class: 'w-4 h-4') %> <%= t('security') %> <% end %>