Skip to content

Commit

Permalink
Rename URLHelpers to UrlHelpers (#1808)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhawksley authored Feb 2, 2023
1 parent 238328a commit 3154441
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 35 deletions.
5 changes: 5 additions & 0 deletions .changeset/kind-ears-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/view-components": patch
---

Rename URLHelpers to UrlHelpers to fix console error.
12 changes: 6 additions & 6 deletions previews/primer/alpha/auto_complete_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def playground(label_text: "Select a fruit", is_label_visible: true, is_label_in
label_text: label_text,
input_id: "input-id",
list_id: "test-id",
src: URLHelpers.autocomplete_index_path(version: "alpha"),
src: UrlHelpers.autocomplete_index_path(version: "alpha"),
is_label_visible: is_label_visible,
is_label_inline: is_label_inline,
with_icon: with_icon,
Expand All @@ -42,7 +42,7 @@ def default(label_text: "Select a fruit", is_label_visible: true, is_label_inlin
label_text: label_text,
input_id: "input-id",
list_id: "test-id",
src: URLHelpers.autocomplete_index_path(version: "alpha"),
src: UrlHelpers.autocomplete_index_path(version: "alpha"),
is_label_visible: is_label_visible,
is_label_inline: is_label_inline,
with_icon: with_icon,
Expand All @@ -62,7 +62,7 @@ def with_non_visible_label
label_text: "Select a fruit",
input_id: "input-id-1",
list_id: "test-id-1",
src: URLHelpers.autocomplete_index_path(version: "alpha"),
src: UrlHelpers.autocomplete_index_path(version: "alpha"),
is_label_visible: false
)
)
Expand All @@ -77,7 +77,7 @@ def with_inline_label
label_text: "Select a fruit",
input_id: "input-id-2",
list_id: "test-id-2",
src: URLHelpers.autocomplete_index_path(version: "alpha"),
src: UrlHelpers.autocomplete_index_path(version: "alpha"),
is_label_inline: true
)
)
Expand All @@ -92,7 +92,7 @@ def with_icon
label_text: "Select a fruit",
input_id: "input-id-3",
list_id: "test-id-3",
src: URLHelpers.autocomplete_index_path(version: "alpha"),
src: UrlHelpers.autocomplete_index_path(version: "alpha"),
with_icon: true
)
)
Expand All @@ -107,7 +107,7 @@ def with_clear_button
label_text: "Select a fruit",
input_id: "input-id-4",
list_id: "test-id-4",
src: URLHelpers.autocomplete_index_path(version: "alpha"),
src: UrlHelpers.autocomplete_index_path(version: "alpha"),
is_clearable: true
)
)
Expand Down
4 changes: 2 additions & 2 deletions previews/primer/alpha/text_field_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ def with_validation_message
#
# @label Auto check request ok
def with_auto_check_ok
render(Primer::Alpha::TextField.new(auto_check_src: URLHelpers.example_check_ok_path, name: "my-text-field", label: "My text field"))
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_ok_path, name: "my-text-field", label: "My text field"))
end

# @label Auto check request error
def with_auto_check_error
render(Primer::Alpha::TextField.new(auto_check_src: URLHelpers.example_check_error_path, name: "my-text-field", label: "My text field"))
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_error_path, name: "my-text-field", label: "My text field"))
end
#
# @!endgroup
Expand Down
18 changes: 9 additions & 9 deletions previews/primer/alpha/toggle_switch_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ class ToggleSwitchPreview < ViewComponent::Preview
include ActionView::Helpers::FormTagHelper

def playground
render(ToggleSwitch.new(src: URLHelpers.toggle_switch_index_path))
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path))
end

def default
render(ToggleSwitch.new(src: URLHelpers.toggle_switch_index_path))
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path))
end

def checked
render(ToggleSwitch.new(src: URLHelpers.toggle_switch_index_path, checked: true))
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, checked: true))
end

def disabled
render(ToggleSwitch.new(src: URLHelpers.toggle_switch_index_path, enabled: false))
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, enabled: false))
end

def checked_disabled
render(ToggleSwitch.new(src: URLHelpers.toggle_switch_index_path, checked: true, enabled: false))
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, checked: true, enabled: false))
end

def small
render(ToggleSwitch.new(src: URLHelpers.toggle_switch_index_path, size: :small))
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, size: :small))
end

def with_status_label_position_end
render(ToggleSwitch.new(src: URLHelpers.toggle_switch_index_path, status_label_position: :end))
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, status_label_position: :end))
end

def with_a_bad_src
Expand All @@ -45,11 +45,11 @@ def with_no_src
end

def with_csrf_token
render(ToggleSwitch.new(src: URLHelpers.toggle_switch_index_path, csrf_token: "let_me_in"))
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, csrf_token: "let_me_in"))
end

def with_bad_csrf_token
render(ToggleSwitch.new(src: URLHelpers.toggle_switch_index_path, csrf_token: "i_am_a_criminal"))
render(ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, csrf_token: "i_am_a_criminal"))
end
end
end
Expand Down
Loading

0 comments on commit 3154441

Please sign in to comment.