Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Commit

Permalink
Add missing metafield filters
Browse files Browse the repository at this point in the history
Filter list updated by running the following in a SFR console

```
filters = Liquid::StrainerFactory.send(:global_filters).each_with_object({}) { |group, acc| acc[group.to_s] = group.instance_methods.map(&:to_s) }`
Pathname('filters.yml').write(YAML.dump(filters))
```

Fixes #543
  • Loading branch information
charlespwd committed Feb 8, 2022
1 parent f8f051e commit 9451a2e
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 52 deletions.
119 changes: 68 additions & 51 deletions data/shopify_liquid/filters.yml
Original file line number Diff line number Diff line change
@@ -1,91 +1,104 @@
---
Liquid::StandardFilters:
- url_encode
- where
- times
- h
- uniq
- compact
- url_encode
- escape
- escape_once
- url_decode
- base64_encode
- base64_decode
- base64_url_safe_encode
- base64_url_safe_decode
- truncatewords
- strip_html
- strip_newlines
- replace
- remove
- h
- sort_natural
- replace_first
- remove_first
- newline_to_br
- upcase
- downcase
- capitalize
- date
- divided_by
- minus
- at_most
- at_least
- size
- last
- split
- size
- append
- reverse
- join
- concat
- prepend
- escape_once
- url_decode
- truncatewords
- strip_html
- join
- strip
- lstrip
- rstrip
- strip_newlines
- plus
- sort_natural
- compact
- replace_first
- remove_first
- newline_to_br
- minus
- divided_by
- at_least
- at_most
- sort
- where
- map
- default
- modulo
- first
- slice
- modulo
- abs
- map
- floor
- date
- ceil
- round
- truncate
- first
- times
- plus
- floor
FormFilter:
- payment_button
- payment_terms
- installments_pricing
- default_errors
- payment_button
DateFilter:
- date
I18nFilter:
- translate
- time_tag
- sentence
- t
- date
- sentence
- time_tag
- app_block_path_for
- dev_shop?
- app_extension_path_for
- global_block_type?
- app_block_path?
- app_extension_path?
- app_snippet_path?
- registration_uuid_from
- handle_from
UrlFilter:
- stylesheet_tag
- script_tag
- img_tag
- image_tag
- image_url
- link_to
- shopify_asset_url
- payment_type_img_url
- payment_type_svg_tag
- placeholder_svg_tag
- link_to
- asset_url
- img_url
- asset_url
- asset_img_url
- global_asset_url
- file_url
- file_img_url
- product_img_url
- collection_img_url
- article_img_url
- image_url
- preload_tag
JsonFilter:
- json
ColorFilter:
- color_mix
- color_contrast
- color_difference
- brightness_difference
Expand All @@ -100,40 +113,39 @@ ColorFilter:
- color_darken
- color_saturate
- color_desaturate
- color_mix
MoneyFilter:
- money_without_currency
- money_without_trailing_zeros
- money
- money_with_currency
- money_without_currency
- money_without_trailing_zeros
StringFilter:
- md5
- camelcase
- format_code
- handle
- camelize
- handleize
- url_param_escape
- url_escape
- camelcase
- camelize
- encode_url_component
- format_code
- md5
- handle
CollectionFilter:
- sort_by
- within
- link_to_vendor
- url_for_vendor
- link_to_type
- url_for_type
- sort_by
- url_for_vendor
TagFilter:
- link_to_add_tag
- link_to_remove_tag
- link_to_tag
- highlight_active_tag
- link_to_add_tag
- link_to_remove_tag
CryptoFilter:
- hmac_sha1
- sha256
- hmac_sha256
- md5
- sha1
- sha256
CustomerAccountFilter:
- customer_login_link
- customer_logout_link
Expand All @@ -147,30 +159,35 @@ CurrencyFormFilter:
PaginationFilter:
- default_pagination
WeightFilter:
- unit
- weight
- weight_with_unit
- unit
TextFilter:
- pad_spaces
- paragraphize
- pluralize
- highlight
- format_address
- paragraphize
- excerpt
- pluralize
- pad_spaces
FontFilter:
- font_face
- font_url
- font_modify
DistanceFilter:
- distance_from
MediaFilter:
- external_video_url
- external_video_tag
- video_tag
- model_viewer_tag
- media_tag
- image_tag
- external_video_url
ThemeFilter:
- theme_url
- link_to_theme
- _online_store_editor_live_setting
MetafieldFilter:
- metafield_tag
- metafield_text
DebugFilter:
- debug
2 changes: 1 addition & 1 deletion test/shopify_liquid_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_deprecated_filter_alternatives
end

def test_filter_labels
assert_equal(153, ThemeCheck::ShopifyLiquid::Filter.labels.size)
assert_equal(169, ThemeCheck::ShopifyLiquid::Filter.labels.size)
end

def test_object_labels
Expand Down

0 comments on commit 9451a2e

Please sign in to comment.