Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def search_url
end

def search_key
:name_or_code_cont
:name_or_code_i_cont
end

def page_actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class extends Controller {

async search({ detail: { query, controller } }) {
controller.resultsValue = await (
await fetch(`${this.productsUrlValue}?q[name_or_variants_including_master_sku_cont]=${query}`)
await fetch(`${this.productsUrlValue}?q[name_or_variants_including_master_sku_i_cont]=${query}`)
).text()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def model_class
end

def search_key
:number_or_shipments_number_or_bill_address_name_or_email_cont
:number_or_shipments_number_or_bill_address_name_or_email_i_cont
end

def search_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def batch_actions
end

def search_key
:label_cont
:label_i_cont
end

def search_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class extends Controller {

async search({ detail: { query, controller } }) {
controller.resultsValue = await (
await fetch(`${this.customersUrlValue}?q[name_or_variants_including_master_sku_cont]=${query}`)
await fetch(`${this.customersUrlValue}?q[name_or_variants_including_master_sku_i_cont]=${query}`)
).text()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def model_class
end

def search_key
:name_or_description_cont
:name_or_description_i_cont
end

def search_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def model_class
end

def search_key
:name_or_variants_including_master_sku_cont
:name_or_variants_including_master_sku_i_cont
end

def search_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def title
end

def search_key
:name_cont
:name_i_cont
end

def search_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def search_url
end

def search_key
:name_or_code_cont
:name_or_code_i_cont
end

def edit_path(refund_reason)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def search_url
end

def search_key
:name_cont
:name_i_cont
end

def columns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def search_url
end

def search_key
:name_cont
:name_i_cont
end

def edit_path(return_reason)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def model_class
end

def search_key
:name_cont
:name_i_cont
end

def search_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def edit_url(shipping_category)
end

def search_key
:name_cont
:name_i_cont
end

def search_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def search_url
end

def search_key
:name_or_description_cont
:name_or_description_i_cont
end

def page_actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def model_class
end

def search_key
:variant_product_name_or_variant_sku_or_variant_option_values_name_or_variant_option_values_presentation_cont
:variant_product_name_or_variant_sku_or_variant_option_values_name_or_variant_option_values_presentation_i_cont
end

def search_url
Expand Down Expand Up @@ -145,7 +145,7 @@ def stock_movements_column
"#{count} #{Spree::StockMovement.model_name.human(count:).downcase}",
solidus_admin.stock_location_stock_movements_path(
_1.stock_location.id,
q: {variant_sku_or_variant_product_name_cont: _1.variant.sku}
q: {variant_sku_or_variant_product_name_i_cont: _1.variant.sku}
),
class: "body-link"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def search_url
end

def search_key
:name_or_description_cont
:name_or_description_i_cont
end

def edit_path(stock_location)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def search_url
end

def search_key
:variant_sku_or_variant_product_name_cont
:variant_sku_or_variant_product_name_i_cont
end

def columns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def search_url
end

def search_key
:name_cont
:name_i_cont
end

def batch_actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def model_class
end

def search_key
:name_or_url_or_code_cont
:name_or_url_or_code_i_cont
end

def search_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def turbo_frames
end

def search_key
:name_or_description_cont
:name_or_description_i_cont
end

def batch_actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def page_actions
end

def search_key
:name_or_description_cont
:name_or_description_i_cont
end

def batch_actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class SolidusAdmin::UI::Forms::Select::Component < SolidusAdmin::BaseComponent
# a query parameter to be used with search, e.g.:
# ```
# src: solidus_admin.countries_url,
# "data-query-param": "q[name_cont]",
# "data-query-param": "q[name_i_cont]",
# ```
# @option attributes [String] :"data-no-preload" when +:src+ param is passed, options are preloaded when the component
# is initialized. Use this option to disable preload.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def model_class
end

def search_key
:email_cont
:email_i_cont
end

def search_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
multiple: true,
class: "required",
src: solidus_admin.states_url(view: :state_with_country),
"data-query-param": "q[name_or_country_name_cont]",
"data-query-param": "q[name_or_country_name_i_cont]",
**stimulus_target("statesSelect")
) %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def title
end

def search_key
:name_or_description_cont
:name_or_description_i_cont
end

def search_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def model_class
end

def search_key
:number_cont
:number_i_cont
end

def search_url
Expand Down
4 changes: 2 additions & 2 deletions admin/spec/features/adjustment_reasons_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
end

context "when creating a new adjustment reason" do
let(:query) { "?page=1&q%5Bname_or_code_cont%5D=new" }
let(:query) { "?page=1&q%5Bname_or_code_i_cont%5D=new" }

before do
visit "/admin/adjustment_reasons#{query}"
Expand Down Expand Up @@ -66,7 +66,7 @@
end

context "when editing an existing adjustment reason" do
let(:query) { "?page=1&q%5Bname_or_code_cont%5D=reason" }
let(:query) { "?page=1&q%5Bname_or_code_i_cont%5D=reason" }

before do
Spree::AdjustmentReason.create(name: "Good Reason", code: 5999)
Expand Down
4 changes: 2 additions & 2 deletions admin/spec/features/refund_reasons_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
end

context "when creating a new refund reason" do
let(:query) { "?page=1&q%5Bname_or_code_cont%5D=Ret" }
let(:query) { "?page=1&q%5Bname_or_code_i_cont%5D=Ret" }

before do
visit "/admin/refund_reasons/#{query}"
Expand Down Expand Up @@ -66,7 +66,7 @@
end

context "when editing an existing refund reason" do
let(:query) { "?page=1&q%5Bname_or_code_cont%5D=Ret" }
let(:query) { "?page=1&q%5Bname_or_code_i_cont%5D=Ret" }

before do
Spree::RefundReason.create(name: "Return process", active: false)
Expand Down
4 changes: 2 additions & 2 deletions admin/spec/features/return_reasons_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
end

context "when creating a new return reason" do
let(:query) { "?page=1&q%5Bname_cont%5D=new" }
let(:query) { "?page=1&q%5Bname_i_cont%5D=new" }

before do
visit "/admin/return_reasons#{query}"
Expand Down Expand Up @@ -65,7 +65,7 @@
end

context "when editing an existing return reason" do
let(:query) { "?page=1&q%5Bname_cont%5D=reason" }
let(:query) { "?page=1&q%5Bname_i_cont%5D=reason" }

before do
Spree::ReturnReason.create(name: "Good Reason")
Expand Down
4 changes: 2 additions & 2 deletions admin/spec/features/roles_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
end

context "when creating a role" do
let(:query) { "?page=1&q%5Bname_cont%5D=new" }
let(:query) { "?page=1&q%5Bname_i_cont%5D=new" }

before do
visit "/admin/roles#{query}"
Expand Down Expand Up @@ -118,7 +118,7 @@
end

context "when editing an existing role" do
let(:query) { "?page=1&q%5Bname_cont%5D=er" }
let(:query) { "?page=1&q%5Bname_i_cont%5D=er" }

before do
Spree::Role.create(name: "Reviewer", permission_sets: [settings_edit_permission])
Expand Down
4 changes: 2 additions & 2 deletions admin/spec/features/shipping_categories_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
end

context "when creating a new shipping category" do
let(:query) { "?page=1&q%5Bname_or_description_cont%5D=What" }
let(:query) { "?page=1&q%5Bname_or_description_i_cont%5D=What" }

before do
visit "/admin/shipping_categories#{query}"
Expand Down Expand Up @@ -63,7 +63,7 @@
end

context "when editing an existing shipping category" do
let(:query) { "?page=1&q%5Bname_or_description_cont%5D=mail" }
let(:query) { "?page=1&q%5Bname_or_description_i_cont%5D=mail" }

before do
Spree::ShippingCategory.create(name: "Letter Mail")
Expand Down
4 changes: 2 additions & 2 deletions admin/spec/features/store_credit_reasons_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
end

context "when creating a new store credit reason" do
let(:query) { "?page=1&q%5Bname_cont%5D=new" }
let(:query) { "?page=1&q%5Bname_i_cont%5D=new" }

before do
visit "/admin/store_credit_reasons#{query}"
Expand Down Expand Up @@ -63,7 +63,7 @@
end

context "when editing an existing store credit reason" do
let(:query) { "?page=1&q%5Bname_cont%5D=customer" }
let(:query) { "?page=1&q%5Bname_i_cont%5D=customer" }

before do
Spree::StoreCreditReason.create(name: "New Customer Reward")
Expand Down
4 changes: 2 additions & 2 deletions admin/spec/features/tax_categories_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
end

context "when creating a new tax category" do
let(:query) { "?page=1&q%5Bname_or_description_cont%5D=Cloth" }
let(:query) { "?page=1&q%5Bname_or_description_i_cont%5D=Cloth" }

before do
visit "/admin/tax_categories#{query}"
Expand Down Expand Up @@ -68,7 +68,7 @@
end

context "when editing an existing tax category" do
let(:query) { "?page=1&q%5Bname_or_description_cont%5D=Cloth" }
let(:query) { "?page=1&q%5Bname_or_description_i_cont%5D=Cloth" }

before do
Spree::TaxCategory.create(name: "Clothing", is_default: true)
Expand Down
2 changes: 1 addition & 1 deletion admin/spec/requests/solidus_admin/users_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
end

it "filters users based on search parameters" do
get solidus_admin.users_path, params: {q: {email_cont: "test"}}
get solidus_admin.users_path, params: {q: {email_i_cont: "test"}}
expect(response.body).to include("test@example.com")
expect(response.body).not_to include("another@example.com")
end
Expand Down
4 changes: 2 additions & 2 deletions api/openapi/pagination-and-filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Most endpoints that return a collection also have the ability to filter data usi
For example, if we want to retrieve only products that contain the word "Watch" in their title we can make the following request:

```
GET /products?q[name_cont]=Watch
GET /products?q[name_i_cont]=Watch
```

The `name_cont` matcher will generate a query using `LIKE` to retrieve all the products that contain the value specified. For an extensive list of search matchers supported, please refer to the Ransack documentation.
The `name_i_cont` matcher will generate a case-insensitive `LIKE` query (`ILIKE` on PostgreSQL) to retrieve all the products that contain the value specified. Use `name_cont` for a case-sensitive match. For an extensive list of search matchers supported, please refer to the Ransack documentation.

The result will be paginated as described in the paragraph above.
Loading
Loading