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 %> - + <% 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] %>