From b626f4aeb68b6c2d451cf6924db0bae6f7ef83e9 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Tue, 7 Jan 2025 12:09:42 -0500 Subject: [PATCH] fix some minified javascript errors When minified, these files conflict with jQuery, so import them as a module. Secondly, make this object const to avoid assinments to undeclared objects. --- apps/dashboard/app/javascript/path_selector/path_selector.js | 2 +- apps/dashboard/app/views/projects/_form.html.erb | 2 +- apps/dashboard/app/views/projects/new.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/dashboard/app/javascript/path_selector/path_selector.js b/apps/dashboard/app/javascript/path_selector/path_selector.js index 451dc7b1a7..867b9a232c 100644 --- a/apps/dashboard/app/javascript/path_selector/path_selector.js +++ b/apps/dashboard/app/javascript/path_selector/path_selector.js @@ -21,7 +21,7 @@ function makeTable(element) { } function getPathSelectorOptions(element) { - options = {}; + const options = {}; options.filesPath = element.dataset['filesPath']; options.initialDirectory = element.dataset['initialDirectory']; diff --git a/apps/dashboard/app/views/projects/_form.html.erb b/apps/dashboard/app/views/projects/_form.html.erb index b3061d709e..04433c0c76 100644 --- a/apps/dashboard/app/views/projects/_form.html.erb +++ b/apps/dashboard/app/views/projects/_form.html.erb @@ -56,7 +56,7 @@
- <%= javascript_include_tag 'icon_picker', nonce: true %> + <%= javascript_include_tag('icon_picker', nonce: true, type: 'module') %> <%= form.text_field :icon, placeholder: "cog", id: "product_icon_select", value: @project.icon_class %> <% if @project.icon =~ /(fa[bsrl]?):\/\/(.*)/ %> <% icon = $2; style = $1 %> diff --git a/apps/dashboard/app/views/projects/new.html.erb b/apps/dashboard/app/views/projects/new.html.erb index 87c3f41725..41b318d9e9 100644 --- a/apps/dashboard/app/views/projects/new.html.erb +++ b/apps/dashboard/app/views/projects/new.html.erb @@ -1,4 +1,4 @@ -<%= javascript_include_tag 'projects_new', nonce: true %> +<%= javascript_include_tag('projects_new', nonce: true, type: 'module') %>