Open MrFehr opened 4 years ago
I'm running into the same issue, except that I'm also getting it on the overview tab.
This is a problem with the installed JS and CSS assets from this extension being included in the overall application manifest after running the install generator.
Because these files are only used on a single view, I was able to solve this problem by removing the lines from the backend all.js and all.css manifest files and instead adding this extension's assets to the precompile list and including them in the head content block inside overview/index.html
file.
<% content_for :head do %>
<% if @display_ability %>
<%= stylesheet_link_tag 'spree/backend/solidus_simple_dash', media: 'all', data: {turbolinks_track: 'reload'} %>
<%= javascript_include_tag 'spree/backend/solidus_simple_dash', data: {turbolinks_track: 'reload'} %>
<%= javascript_tag do -%>
var orders_by_day_points = [[ <%== @orders_by_day.map { |day| "[\"#{day[0]}\",#{day[1]}]" }.join(",") %> ]];
var abandoned_carts_by_day_points = [[ <%== @abandoned_carts_by_day.map { |day| "[\"#{day[0]}\",#{day[1]}]" }.join(",") %> ]];
var new_users_by_day_points = [[ <%== @new_users_by_day.map { |day| "[\"#{day[0]}\",#{day[1]}]" }.join(",") %> ]];
var best_selling_variants_points = [ <%== @best_selling_variants.map { |v| "[\"#{h(v[0])}\",#{v[1]}]" }.join(",") %> ];
var top_grossing_variants_points = [ <%== @top_grossing_variants.map { |v| "[\"#{h(v[0])}\",#{v[1]}]" }.join(",") %> ];
var best_selling_taxons_points = [ <%== @best_selling_taxons.map { |t| "[\"#{h(t[0])}\",#{t[1]}]" }.join(",") %> ];
var abandoned_carts_points = [ <%== @abandoned_carts.map { |v| "[\"#{h(v[0])}\",#{v[1]}]" }.join(",") %> ];
var checkout_steps_points = [ <%== @checkout_steps.map { |v| "[\"#{h(v[0])}\",#{v[1]}]" }.join(",") %> ];
var abandoned_carts_products_points = [ <%== @abandoned_carts_products.map { |v| "[\"#{h(v[0])}\",#{v[1]}]" }.join(",") %> ];
var orders = "<%= t('spree.simple_dash.orders') %>";
var abandoned_orders = "<%= t('spree.simple_dash.abandoned_orders') %>";
var new_users = "<%= t('spree.simple_dash.new_users') %>";
var by_day = "<%= t('spree.simple_dash.by_day') %>";
var pie_colors = [<%== @pie_colors.map{|c| "'#{c}'"}.join(",") %>];
<% end -%>
<% end %>
<% end %>
Rails.application.configure do
config.assets.precompile += %w(
spree/backend/solidus_simple_dash.js
spree/backend/solidus_simple_dash.css
)
end