Skip to content

Merge solidus_starter_frontend into the monorepo#6468

Draft
jarednorman wants to merge 1307 commits into
solidusio:mainfrom
SuperGoodSoft:all-together-now
Draft

Merge solidus_starter_frontend into the monorepo#6468
jarednorman wants to merge 1307 commits into
solidusio:mainfrom
SuperGoodSoft:all-together-now

Conversation

@jarednorman

Copy link
Copy Markdown
Member

Summary

As the Starter Frontend has replace solidus_frontend as the primary frontend of Solidus, we want to bring it into monorepo. This helps centralize the maintenance of the project and surface compatibility issues as early as possible.

I have chosen to preserve the whole history of the project, so the PR looks a little scary. In reality, only the merge commit that merges the other history in and subsequent commits need to be reviewed.

elia and others added 30 commits February 16, 2023 16:48
In the order details page shown for the confirmation step and the
order complete page the billing address should be more visually
related to the payment.
Also show the payment state, near the payment.
Code readability and (basic) UX improvements
Probably a legacy of an older layout.
For parity with the new card / payment method partials in which the
radio buttons are external to the partials provided by the payment
methods.
In a real world scenario this would probably hold instructions on
where to send the check. This work both as a placeholder and to
visually balance the check with other payment methods.
Only useful to remember how the numbers are distributed while testing.
The triple level of radio buttons that was previously used was very
confusing and broken. Instead of trying to fix it seems better to
present the customer a single list of options for making the payment.

The list gives precedence to wallet payments as they require less
clicks.

If no wallet payments are available the first payment method is
selected.

Whenever a radio is selected elements from the other list are
deselected, giving the illusion of having a single list.

Each existing and new payment method have clear and distinct areas
for the input label and for the details. This gives more symmetry
between existing and new payments partial implementations and a
cleaner visual layout.
enable localizing shopping cart review page
feat: localizing cart review page
Otherwise, payment iframes will still be clickable

Co-authored-by: Elia Schito <elia@schito.me>
Co-authored-by: Francesco Aiello <francesco.aiello@hey.com>
…ointer-events-none-to-disabled-fields

Block clicks on disabled form elements
- Only render the currency microdata when the price is present
- Keep the cache block in the products grid
- Add specs for rendering with/without a taxon

Co-Authored-By: Safa <aballaghsafa@gmail.com>
Useful for newly created stores and for testing extensions.
Only track coverage on Ruby 3.2 which supports ERB files.
They were commented out for quickly trying out an alternative
configuration but never removed before the merge of solidusio#329.
This makes it more consistent and recognizable.
…d-component

Turn the product-card partial into a component
Rename spec_helper and allow using the debugger with bin/dev
The specs on `solidus_starter_frontend` were failing due
to recent improvements with taxon/taxonomy factories made
in the solidus repository, specifically related to:
solidusio#4851
This commit updates the specs to be compatible with the
latest changes and ensures that the test suite passes
successfully.
sofiabesenski4 and others added 6 commits June 11, 2026 10:44
We want to support additional keyword arguments to this class and a
positional argument interferes with this.

Co-authored-by: Jared Norman <jared@super.gd>
Co-authored-by: Adam Mueller <adam@super.gd>
Co-authored-by: Noah Silvera <noah@super.gd>
This association is autosaved, and Rails knows not to retouch things
when autosaving associated records. I did a test to confirm that
removing this doesn't change whether the field is persisted.
This condition adds a promotion condition that allows store owners to
trigger a benefit if the revenue from a defined set of taxons exceeds
some value. For example, with this condition we can do things like: If
you spend 150 USD on pants, you get a free belt.
This fixes an edge case, a taxon condition without any taxons defined.
Prior to this commit, that would error on MySQL and Postgres.
SimpleCov must start before the app is loaded (Ruby's Coverage only
tracks files required after Coverage.start), so we load it from the top
of the generated spec_helper.rb rather than from spec/support, which is
required after rails_helper has already (eager-)loaded the app.
None of the paypal controllers in this extension had tests, which is
causing the code coverage to be under the solidus required limit.
This should get us to the minimum 89% code coverage to get the build
green.

Co-authored-by: Adam Mueller <adam@super.gd>
Co-authored-by: Alistair Norman <alistair@super.gd>
Co-authored-by: Noah Silvera <noah@super.gd>
@forkata forkata force-pushed the all-together-now branch from 6044fa3 to 61a70e8 Compare June 11, 2026 18:02
@github-actions github-actions Bot added changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_promotions Changes to the solidus_promotions gem labels Jun 11, 2026

if (termsCheckbox) {
const form = termsCheckbox.closest('form');
const submitButton = form.querySelector('[type="submit"]');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

const termsCheckbox = document.getElementById('accept_terms_and_conditions');

if (termsCheckbox) {
const form = termsCheckbox.closest('form');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

};

window.addEventListener('DOMContentLoaded', () => {
const termsCheckbox = document.getElementById('accept_terms_and_conditions');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

});
};

window.addEventListener('DOMContentLoaded', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

const form = document.querySelector('form.edit_order');
form.addEventListener('submit', () => {
const elements = form.querySelectorAll('[type="submit"], [type="image"]');
elements.forEach(element => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

def load_log_entries
@all_log_entries = Spree::LogEntry
.where(source: @payment)
.or(Spree::LogEntry.where(source: @payment.refunds))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/MultilineMethodCallIndentation: Align .or with Spree::LogEntry on line 107.


def load_log_entries
@all_log_entries = Spree::LogEntry
.where(source: @payment)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/MultilineMethodCallIndentation: Align .where with Spree::LogEntry on line 107.

if gem_version && !gem_version.prerelease?
"v#{gem_version.segments[0, 2].join(".")}"
else
"main"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.


ref =
if gem_version && !gem_version.prerelease?
"v#{gem_version.segments[0, 2].join(".")}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiteralsInInterpolation: Prefer single-quoted strings inside interpolations.

template =
ENV["SOLIDUS_STOREFRONT_TEMPLATE"] ||
begin
version = Spree.solidus_version if defined?(Spree) && Spree.respond_to?(:solidus_version)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [93/80]

# frozen_string_literal: true

template =
ENV["SOLIDUS_STOREFRONT_TEMPLATE"] ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

shipments = Spree::Config.stock.coordinator_class.new(@order, @reimbursement_objects.map(&:build_exchange_inventory_unit)).shipments
shipments = Spree::Config.stock.coordinator_class.new(
@order,
inventory_units: @reimbursement_objects.map(&:build_exchange_inventory_unit)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [86/80]

inventory_units = Spree::Config.stock.inventory_unit_builder_class.new(self).missing_units_for_line_item(line_item)

Spree::Config.stock.coordinator_class.new(self, units).shipments.each do |shipment|
Spree::Config.stock.coordinator_class.new(self, inventory_units:).shipments.each do |shipment|

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint/Syntax: unexpected token tRPAREN

(line_item.variant.product.classifications.map(&:taxon_id) & taxon_and_descendant_ids).any?
end
end
matching.sum(&:discounted_amount).public_send(OPERATORS.fetch(preferred_operator), preferred_amount)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [108/80]

def order_eligible?(order, _options = {})
matching = order.line_items.select do |line_item|
taxon_ids_with_children.any? do |taxon_and_descendant_ids|
(line_item.variant.product.classifications.map(&:taxon_id) & taxon_and_descendant_ids).any?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [103/80]

module SolidusPromotions
module InMemoryOrderUpdaterPatch
# This is only needed for stores upgrading from the legacy promotion system.
# Once we've removed support for the legacy promotion system, we can remove this.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [85/80]

# frozen_string_literal: true

module SolidusPromotions
module InMemoryOrderUpdaterPatch

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/Documentation: Missing top-level module documentation comment.

"SolidusPromotions::Conditions::PriceTaxon",
"SolidusPromotions::Conditions::PriceOptionValue"
"SolidusPromotions::Conditions::PriceOptionValue",
"SolidusPromotions::Conditions::TaxonRevenue"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

"SolidusPromotions::Conditions::PriceProduct",
"SolidusPromotions::Conditions::PriceTaxon",
"SolidusPromotions::Conditions::PriceOptionValue"
"SolidusPromotions::Conditions::PriceOptionValue",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

require "rails_helper"

RSpec.describe SolidusPromotions::Conditions::TaxonRevenue do
subject(:condition) { described_class.new(preferred_amount:, taxons: [matching_taxon]) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint/Syntax: unexpected token tCOMMA
Lint/Syntax: unexpected token tRPAREN

Comment thread storefront/Gemfile
gem "guard-shell"

gem "codecov"
gem "simplecov", "~> 0.22"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile
gem "guard"
gem "guard-shell"

gem "codecov"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile
group :development do
gem "benchmark", "~> 0.5", require: false
gem "guard"
gem "guard-shell"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile

group :development do
gem "benchmark", "~> 0.5", require: false
gem "guard"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile
gem "state_machines", "<= 0.6"

group :development do
gem "benchmark", "~> 0.5", require: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

next unless path.end_with?(".erb")

# Remove the extra trailing lines added by ERB
coverage[:lines] = coverage[:lines][...File.read(path).lines.size]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint/Syntax: unexpected token tDOT3
Lint/Syntax: unexpected token tRBRACK

Comment thread storefront/template.rb
out https://solidus.io/security.
TEXT

say_status :RECOMMENDED, set_color(message.tr("\n", " "), :yellow), :yellow

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
generate "rspec:install"
end

with_log["security advisory"] do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
end

with_log["setting up rspec"] do
generate "rspec:install"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gsub_file "app/assets/stylesheets/application.css", "*= require_tree", "* OFF require_tree"
end

with_log["setting up rspec"] do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile
gem "guard-shell"

gem "codecov"
gem "simplecov", "~> 0.22"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile
gem "guard"
gem "guard-shell"

gem "codecov"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile
group :development do
gem "benchmark", "~> 0.5", require: false
gem "guard"
gem "guard-shell"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile

group :development do
gem "benchmark", "~> 0.5", require: false
gem "guard"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile
gem "state_machines", "<= 0.6"

group :development do
gem "benchmark", "~> 0.5", require: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

next unless path.end_with?(".erb")

# Remove the extra trailing lines added by ERB
coverage[:lines] = coverage[:lines][...File.read(path).lines.size]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint/Syntax: unexpected token tDOT3
Lint/Syntax: unexpected token tRBRACK

Comment thread storefront/template.rb
out https://solidus.io/security.
TEXT

say_status :RECOMMENDED, set_color(message.tr("\n", " "), :yellow), :yellow

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
generate "rspec:install"
end

with_log["security advisory"] do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
end

with_log["setting up rspec"] do
generate "rspec:install"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gsub_file "app/assets/stylesheets/application.css", "*= require_tree", "* OFF require_tree"
end

with_log["setting up rspec"] do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile
gem "guard-shell"

gem "codecov"
gem "simplecov", "~> 0.22"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile
gem "guard"
gem "guard-shell"

gem "codecov"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile
group :development do
gem "benchmark", "~> 0.5", require: false
gem "guard"
gem "guard-shell"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile

group :development do
gem "benchmark", "~> 0.5", require: false
gem "guard"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/Gemfile
gem "state_machines", "<= 0.6"

group :development do
gem "benchmark", "~> 0.5", require: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

next unless path.end_with?(".erb")

# Remove the extra trailing lines added by ERB
coverage[:lines] = coverage[:lines][...File.read(path).lines.size]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint/Syntax: unexpected token tDOT3
Lint/Syntax: unexpected token tRBRACK

Comment thread storefront/template.rb
out https://solidus.io/security.
TEXT

say_status :RECOMMENDED, set_color(message.tr("\n", " "), :yellow), :yellow

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
generate "rspec:install"
end

with_log["security advisory"] do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
end

with_log["setting up rspec"] do
generate "rspec:install"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gsub_file "app/assets/stylesheets/application.css", "*= require_tree", "* OFF require_tree"
end

with_log["setting up rspec"] do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
with_log["patching asset files"] do
append_file "config/initializers/assets.rb", "Rails.application.config.assets.precompile += ['solidus_storefront_manifest.js']"
append_file "config/initializers/assets.rb", "\nRails.application.config.assets.paths << Rails.root.join('app', 'assets', 'stylesheets', 'fonts')"
gsub_file "app/assets/stylesheets/application.css", "*= require_tree", "* OFF require_tree"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Metrics/LineLength: Line is too long. [93/80]

Comment thread storefront/template.rb

with_log["patching asset files"] do
append_file "config/initializers/assets.rb", "Rails.application.config.assets.precompile += ['solidus_storefront_manifest.js']"
append_file "config/initializers/assets.rb", "\nRails.application.config.assets.paths << Rails.root.join('app', 'assets', 'stylesheets', 'fonts')"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Metrics/LineLength: Line is too long. [148/80]

Comment thread storefront/template.rb
end

with_log["patching asset files"] do
append_file "config/initializers/assets.rb", "Rails.application.config.assets.precompile += ['solidus_storefront_manifest.js']"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Metrics/LineLength: Line is too long. [129/80]

Comment thread storefront/template.rb
ROBOTS
end

with_log["patching asset files"] do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
RUBY
end

append_file "public/robots.txt", <<-ROBOTS.strip_heredoc

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb

# Allows to skip frontend specs generation from extensions CI pipelines
if ENV.fetch("FRONTEND_SPECS", "all") == "all"
directory "spec", verbose: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
RUBY

# Allows to skip frontend specs generation from extensions CI pipelines
if ENV.fetch("FRONTEND_SPECS", "all") == "all"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
insert_into_file "config/environments/test.rb", "\n config.assets.css_compressor = nil\n", after: "config.active_support.deprecation = :stderr"
insert_into_file "config/environments/development.rb", "\n config.assets.css_compressor = nil\n", after: "config.active_support.deprecation = :log"

append_file "config/initializers/devise.rb", <<~RUBY

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
rake "tailwindcss:install"

insert_into_file "config/environments/test.rb", "\n config.assets.css_compressor = nil\n", after: "config.active_support.deprecation = :stderr"
insert_into_file "config/environments/development.rb", "\n config.assets.css_compressor = nil\n", after: "config.active_support.deprecation = :log"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Metrics/LineLength: Line is too long. [150/80]

Comment thread storefront/template.rb
create_file "app/assets/builds/tailwind.css"
rake "tailwindcss:install"

insert_into_file "config/environments/test.rb", "\n config.assets.css_compressor = nil\n", after: "config.active_support.deprecation = :stderr"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Metrics/LineLength: Line is too long. [146/80]

@github-actions github-actions Bot removed changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_promotions Changes to the solidus_promotions gem labels Jun 11, 2026
This will allow us to run feature specs headless by just overriding the
CAPYBARA_DRIVER ENV variable by passing `selenium_chrome` as the driver.

Co-authored-by: Adam Mueller <adam@super.gd>
Co-authored-by: Alistair Norman <alistair@super.gd>
Co-authored-by: Noah Silvera <noah@super.gd>
Comment thread storefront/template.rb
copy_file "config/routes/storefront.rb"
copy_file "config/tailwind.config.js"
create_file "app/assets/builds/tailwind.css"
rake "tailwindcss:install"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
copy_file "config/initializers/solidus_auth_devise_unauthorized_redirect.rb"
copy_file "config/routes/storefront.rb"
copy_file "config/tailwind.config.js"
create_file "app/assets/builds/tailwind.css"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
copy_file "config/importmap.rb"
copy_file "config/initializers/solidus_auth_devise_unauthorized_redirect.rb"
copy_file "config/routes/storefront.rb"
copy_file "config/tailwind.config.js"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb

copy_file "config/importmap.rb"
copy_file "config/initializers/solidus_auth_devise_unauthorized_redirect.rb"
copy_file "config/routes/storefront.rb"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
directory "public", "public"

copy_file "config/importmap.rb"
copy_file "config/initializers/solidus_auth_devise_unauthorized_redirect.rb"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gem "ffaker", "~> 2.13"
gem "rubocop", "~> 1.0"
gem "rubocop-performance", "~> 1.5"
gem "rubocop-rails", "~> 2.3"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gem "factory_bot_rails"
gem "ffaker", "~> 2.13"
gem "rubocop", "~> 1.0"
gem "rubocop-performance", "~> 1.5"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gem "factory_bot", ">= 4.8"
gem "factory_bot_rails"
gem "ffaker", "~> 2.13"
gem "rubocop", "~> 1.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb

gem "factory_bot", ">= 4.8"
gem "factory_bot_rails"
gem "ffaker", "~> 2.13"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gem "rspec-activemodel-mocks", "~> 1.1.0"

gem "factory_bot", ">= 4.8"
gem "factory_bot_rails"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gem "rails-controller-testing", "~> 1.0.5"
gem "rspec-activemodel-mocks", "~> 1.1.0"

gem "factory_bot", ">= 4.8"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gem_group :development, :test do
gem "rspec-rails"
gem "rails-controller-testing", "~> 1.0.5"
gem "rspec-activemodel-mocks", "~> 1.1.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb

gem_group :development, :test do
gem "rspec-rails"
gem "rails-controller-testing", "~> 1.0.5"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
end

gem_group :development, :test do
gem "rspec-rails"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gem "capybara-screenshot", "~> 1.0"

gem "simplecov", require: false
gem "simplecov-cobertura", require: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gem "tailwindcss-rails", "~> 3.0"

gem_group :test do
# We need to add capybara along with a javascript driver to support the provided system specs.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [98/80]

Comment thread storefront/template.rb
gem "responders"
gem "solidus_support", ">= 0.12.0"
gem "view_component", "~> 3.0"
gem "tailwindcss-rails", "~> 3.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb

gem "responders"
gem "solidus_support", ">= 0.12.0"
gem "view_component", "~> 3.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
end

gem "responders"
gem "solidus_support", ">= 0.12.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
generate "solidus:auth:install"
end

gem "responders"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gem "rails-controller-testing", "~> 1.0.5"
gem "rspec-activemodel-mocks", "~> 1.1.0"

gem "factory_bot", ">= 4.8"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gem_group :development, :test do
gem "rspec-rails"
gem "rails-controller-testing", "~> 1.0.5"
gem "rspec-activemodel-mocks", "~> 1.1.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb

gem_group :development, :test do
gem "rspec-rails"
gem "rails-controller-testing", "~> 1.0.5"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
end

gem_group :development, :test do
gem "rspec-rails"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gem "capybara-screenshot", "~> 1.0"

gem "simplecov", require: false
gem "simplecov-cobertura", require: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
gem "tailwindcss-rails", "~> 3.0"

gem_group :test do
# We need to add capybara along with a javascript driver to support the provided system specs.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [98/80]

Comment thread storefront/template.rb
gem "responders"
gem "solidus_support", ">= 0.12.0"
gem "view_component", "~> 3.0"
gem "tailwindcss-rails", "~> 3.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb

gem "responders"
gem "solidus_support", ">= 0.12.0"
gem "view_component", "~> 3.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
end

gem "responders"
gem "solidus_support", ">= 0.12.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
generate "solidus:auth:install"
end

gem "responders"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
with_log["installing gems"] do
unless Bundler.locked_gems.dependencies["solidus_auth_devise"]
bundle_command "add solidus_auth_devise"
generate "solidus:auth:install"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb

with_log["installing gems"] do
unless Bundler.locked_gems.dependencies["solidus_auth_devise"]
bundle_command "add solidus_auth_devise"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
end

with_log["installing gems"] do
unless Bundler.locked_gems.dependencies["solidus_auth_devise"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
source_paths.unshift(templates_dir)
end

with_log["installing gems"] do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/BlockLength: Block has too many lines. [29/25]
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb

templates_dir = Pathname.new(repo_dir).join("storefront", "templates")
else
templates_dir = Pathname.new(File.dirname(__FILE__)).join("templates")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
unless match
say_status :error, shell.set_color(
"Could not parse storefront template URL: #{__FILE__}\n" \
"Expected shape: https://github.com/<owner>/<repo>/raw/<ref>/storefront/template.rb",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Metrics/LineLength: Line is too long. [93/80]

Comment thread storefront/template.rb
if __FILE__.match?(%r{\Ahttps?://})
require "uri"
url_path = URI.parse(__FILE__).path
match = url_path.match(%r{\A/([^/]+)/([^/]+)/raw/(.+?)/starter_frontend/template\.rb\z})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [92/80]

Comment thread storefront/template.rb
require "securerandom"

if __FILE__.match?(%r{\Ahttps?://})
require "uri"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
# In that case, use `git clone` to download them to a local temporary dir.
with_log["fetching remote templates"] do
require "shellwords"
require "securerandom"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
# invoked remotely via HTTP, that means the files are not present locally.
# In that case, use `git clone` to download them to a local temporary dir.
with_log["fetching remote templates"] do
require "shellwords"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

The specs we copied didn't really add any coverage to the PayPal
controllers in the extension, so this change starts work on actually
testing the PayPal checkout flow.
Comment thread storefront/template.rb
# copy_file and template resolve against our source files. If this file was
# invoked remotely via HTTP, that means the files are not present locally.
# In that case, use `git clone` to download them to a local temporary dir.
with_log["fetching remote templates"] do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/BlockLength: Block has too many lines. [29/25]
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
"You are installing solidus_storefront on an outdated Ruby version.\n" \
"Please keep in mind that some features might not work with it.", :bold
), :red
exit 1 if auto_accept || no?("Do you wish to proceed?")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.7")
say_status :unsupported, shell.set_color(
"You are installing solidus_storefront on an outdated Ruby version.\n" \
"Please keep in mind that some features might not work with it.", :bold

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
exit 1
end

if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.7")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

Comment thread storefront/template.rb
if Rails.gem_version < Gem::Version.new("7.0")
say_status :error, shell.set_color(
"You are trying to install solidus_storefront on an outdated Rails version.\n" \
"This installation attempt has been aborted, please retry using at least Rails 7.", :bold

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Metrics/LineLength: Line is too long. [95/80]

selects.forEach(sel => sel.setAttribute('disabled', true));
} else {
addressInputs.forEach(addressInput => addressInput.style.display = 'block');
inputs.forEach(input => input.removeAttribute('disabled'));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

inputs.forEach(input => input.setAttribute('disabled', true));
selects.forEach(sel => sel.setAttribute('disabled', true));
} else {
addressInputs.forEach(addressInput => addressInput.style.display = 'block');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

if (order_use_billing.checked) {
addressInputs.forEach(addressInput => addressInput.style.display = 'none');
inputs.forEach(input => input.setAttribute('disabled', true));
selects.forEach(sel => sel.setAttribute('disabled', true));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

const selects = document.querySelectorAll('#shipping .address-inputs select');
if (order_use_billing.checked) {
addressInputs.forEach(addressInput => addressInput.style.display = 'none');
inputs.forEach(input => input.setAttribute('disabled', true));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

const inputs = document.querySelectorAll('#shipping .address-inputs input');
const selects = document.querySelectorAll('#shipping .address-inputs select');
if (order_use_billing.checked) {
addressInputs.forEach(addressInput => addressInput.style.display = 'none');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

function update_shipping_form_state(order_use_billing) {
const addressInputs = document.querySelectorAll('#shipping .address-inputs');
const inputs = document.querySelectorAll('#shipping .address-inputs input');
const selects = document.querySelectorAll('#shipping .address-inputs select');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).


function update_shipping_form_state(order_use_billing) {
const addressInputs = document.querySelectorAll('#shipping .address-inputs');
const inputs = document.querySelectorAll('#shipping .address-inputs input');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

});

function update_shipping_form_state(order_use_billing) {
const addressInputs = document.querySelectorAll('#shipping .address-inputs');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

update_shipping_form_state(orderUseBilling);
});

function update_shipping_form_state(order_use_billing) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.

element.dispatchEvent(new Event('change'));
});

const orderUseBilling = document.getElementById('order_use_billing');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

stateSelect.innerHTML = '';
const statesWithBlank = [{ name: '', id: ''}].concat(states);
statesWithBlank.forEach(state => {
const selectOption = document.createElement('option');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

const selected = parseInt(stateSelect.value);
stateSelect.innerHTML = '';
const statesWithBlank = [{ name: '', id: ''}].concat(states);
statesWithBlank.forEach(state => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

if (states.length > 0) {
const selected = parseInt(stateSelect.value);
stateSelect.innerHTML = '';
const statesWithBlank = [{ name: '', id: ''}].concat(states);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

const stateInput = stateContainer.querySelector('input');

if (states.length > 0) {
const selected = parseInt(stateSelect.value);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

const states = stateData.states;

const stateSelect = stateContainer.querySelector('select');
const stateInput = stateContainer.querySelector('input');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

function update_shipping_form_state(order_use_billing) {
const addressInputs = document.querySelectorAll('#shipping .address-inputs');
const inputs = document.querySelectorAll('#shipping .address-inputs input');
const selects = document.querySelectorAll('#shipping .address-inputs select');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).


function update_shipping_form_state(order_use_billing) {
const addressInputs = document.querySelectorAll('#shipping .address-inputs');
const inputs = document.querySelectorAll('#shipping .address-inputs input');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

});

function update_shipping_form_state(order_use_billing) {
const addressInputs = document.querySelectorAll('#shipping .address-inputs');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

update_shipping_form_state(orderUseBilling);
});

function update_shipping_form_state(order_use_billing) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.

element.dispatchEvent(new Event('change'));
});

const orderUseBilling = document.getElementById('order_use_billing');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

stateSelect.innerHTML = '';
const statesWithBlank = [{ name: '', id: ''}].concat(states);
statesWithBlank.forEach(state => {
const selectOption = document.createElement('option');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

const selected = parseInt(stateSelect.value);
stateSelect.innerHTML = '';
const statesWithBlank = [{ name: '', id: ''}].concat(states);
statesWithBlank.forEach(state => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

if (states.length > 0) {
const selected = parseInt(stateSelect.value);
stateSelect.innerHTML = '';
const statesWithBlank = [{ name: '', id: ''}].concat(states);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

const stateInput = stateContainer.querySelector('input');

if (states.length > 0) {
const selected = parseInt(stateSelect.value);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

const states = stateData.states;

const stateSelect = stateContainer.querySelector('select');
const stateInput = stateContainer.querySelector('input');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

const statesRequired = stateData.states_required;
const states = stateData.states;

const stateSelect = stateContainer.querySelector('select');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

}

const statesRequired = stateData.states_required;
const states = stateData.states;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

return;
}

const statesRequired = stateData.states_required;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

}

function fillStates(stateContainer, countryId) {
const stateData = statesCache[countryId];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

});
}

function fillStates(stateContainer, countryId) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.

@@ -0,0 +1,124 @@
window.addEventListener('DOMContentLoaded', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

});

if(variantsThumbnailsToDisplay.length) {
const variantFirstImage = variantsThumbnailsToDisplay[0].querySelector('a').href

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
Missing semicolon.

thumbnail.style.display = 'none';
});

variantsThumbnailsToDisplay.forEach(thumbnail => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

const selector = "[data-js='variant-thumbnail'][data-js-id='" + variantId + "']";
const variantsThumbnailsToDisplay = document.querySelectorAll(selector);

variantsThumbnails.forEach(thumbnail => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').


function updateVariantImages(variantId) {
const selector = "[data-js='variant-thumbnail'][data-js-id='" + variantId + "']";
const variantsThumbnailsToDisplay = document.querySelectorAll(selector);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:solidus_core Changes to the solidus_core gem

Projects

None yet

Development

Successfully merging this pull request may close these issues.