Skip to content
Merged
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 @@ -24,7 +24,7 @@ def call
def user_hidden_content
return unless @bike.user_hidden?

content_tag(:small, "user hidden", class: UI::Alert::Component::TEXT_CLASSES[:notice])
content_tag(:small, "user hidden", class: UI::Alerts::Base::Component::TEXT_CLASSES[:notice])
end

# BikeVersion can't be example
Expand All @@ -47,11 +47,11 @@ def deleted_content
content_tag(:small,
content_tag(:span, "deleted: ") +
content_tag(:span, l(@bike.deleted_at, format: :convert_time), class: "localizeTime"),
class: UI::Alert::Component::TEXT_CLASSES[:warning])
class: UI::Alerts::Base::Component::TEXT_CLASSES[:warning])
end

def error_class
UI::Alert::Component::TEXT_CLASSES[:error]
UI::Alerts::Base::Component::TEXT_CLASSES[:error]
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions app/components/admin/badges/marketplace_listing/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def humanize(str)

def status_class
case @status
when "for_sale" then UI::Alert::Component::TEXT_CLASSES[:notice]
when "sold" then UI::Alert::Component::TEXT_CLASSES[:success]
when "removed" then UI::Alert::Component::TEXT_CLASSES[:warning]
when "for_sale" then UI::Alerts::Base::Component::TEXT_CLASSES[:notice]
when "sold" then UI::Alerts::Base::Component::TEXT_CLASSES[:success]
when "removed" then UI::Alerts::Base::Component::TEXT_CLASSES[:warning]
else
""
end
Expand Down
2 changes: 1 addition & 1 deletion app/components/admin/bike_cell/component.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if @bike.blank? %>
<small class="<%= UI::Alert::Component::TEXT_CLASSES[:error] %>">
<small class="<%= UI::Alerts::Base::Component::TEXT_CLASSES[:error] %>">
Missing bike
<% if @bike_id.present? %>
<code><%= @bike_id %></code>
Expand Down
8 changes: 4 additions & 4 deletions app/components/admin/bikes_table/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

<% if bike.claimed? %>
<span
class="tw:absolute tw:top-0 tw:right-0 <%= UI::Alert::Component::TEXT_CLASSES[:notice] %>"
class="tw:absolute tw:top-0 tw:right-0 <%= UI::Alerts::Base::Component::TEXT_CLASSES[:notice] %>"
title="<%= bike.type %> is claimed"
style="cursor: default"
>
Expand All @@ -65,7 +65,7 @@

<% table.column(sortable: "manufacturer_id") do |bike| %>
<% if bike.manufacturer_other.present? %>
<span class="<%= UI::Alert::Component::TEXT_CLASSES[:warning] %>">
<span class="<%= UI::Alerts::Base::Component::TEXT_CLASSES[:warning] %>">
<%= bike.manufacturer_other %>
</span>
<% else %>
Expand All @@ -85,7 +85,7 @@

<% if bike.stolen_recovery? %>
<small>
<%= link_to "recovery!", edit_admin_recovery_url(bike.recovered_records.first.id), class: "#{UI::Alert::Component::TEXT_CLASSES[:success]} tw:underline" %>
<%= link_to "recovery!", edit_admin_recovery_url(bike.recovered_records.first.id), class: "#{UI::Alerts::Base::Component::TEXT_CLASSES[:success]} tw:underline" %>
</small>
<% end %>

Expand All @@ -104,7 +104,7 @@
<% end %>

<% if bike.status_stolen? %>
<span class="tw:absolute tw:right-0 tw:bottom-0 tw:text-xs <%= UI::Alert::Component::TEXT_CLASSES[:error] %>">
<span class="tw:absolute tw:right-0 tw:bottom-0 tw:text-xs <%= UI::Alerts::Base::Component::TEXT_CLASSES[:error] %>">
stolen
</span>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/components/admin/bikes_table/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module BikesTable
# checkboxes, and skip_user to drop the owner column.
class Component < ApplicationComponent
# Digest of the markup inside the row cache — the cached_markup_digest spec keeps it current
MARKUP_DIGEST = "55bd93d8018c"
MARKUP_DIGEST = "864a82f880b3"

def initialize(bikes:, no_show_header: false, show_serial: false, render_sortable: false,
skip_user: false, render_multi_check: false)
Expand Down
2 changes: 1 addition & 1 deletion app/components/admin/current_header/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def primary_activity_subject
end

def error_text_class
UI::Alert::Component::TEXT_CLASSES[:error]
UI::Alerts::Base::Component::TEXT_CLASSES[:error]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/components/admin/organization_cell/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def organization_subject
end

def error_text_class
UI::Alert::Component::TEXT_CLASSES[:error]
UI::Alerts::Base::Component::TEXT_CLASSES[:error]
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
</div>

<% if StravaJobs::RequestRunner.new.skip_job? %>
<%= render(UI::Alert::Component.new(text: "StravaJobs::RequestRunner is skipped", kind: :error)) %>
<%= render(UI::Alerts::Base::Component.new(text: "StravaJobs::RequestRunner is skipped", kind: :error)) %>
<% end %>
</div>
2 changes: 1 addition & 1 deletion app/components/admin/user_cell/component.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<span class="tw:inline-flex tw:items-baseline tw:gap-x-2">
<% if show_missing_user? %>
<small
class="<%= UI::Alert::Component::TEXT_CLASSES[:error] %>"
class="<%= UI::Alerts::Base::Component::TEXT_CLASSES[:error] %>"
title="<%= @user_id %>"
>
Missing user
Expand Down
2 changes: 1 addition & 1 deletion app/components/admin/users_table/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<% end %>

<% table.column(sortable: "deleted_at", classes: "deleted-cell tw:text-xs") do |user| %>
<span class="<%= UI::Alert::Component::TEXT_CLASSES[:error] %>">
<span class="<%= UI::Alerts::Base::Component::TEXT_CLASSES[:error] %>">
<%= render UI::Time::Component.new(time: user.deleted_at) %>
</span>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/components/admin/users_table/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module UsersTable
# render_deleted to show the deleted_at column.
class Component < ApplicationComponent
# Digest of the markup inside the row cache — the cached_markup_digest spec keeps it current
MARKUP_DIGEST = "ec033295a1d5"
MARKUP_DIGEST = "bc1f91c7d43d"

def initialize(users:, render_sortable: false, render_deleted: false)
@users = users
Expand Down
4 changes: 2 additions & 2 deletions app/components/messages/thread_show/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
<% end %>

<% if user_banned? || user_deleted? %>
<%= render(UI::Alert::Component.new(kind: :warning, text: translation(user_banned? ? :banned_message : :removed_message), margin_classes: "tw:my-8")) %>
<%= render(UI::Alerts::Base::Component.new(kind: :warning, text: translation(user_banned? ? :banned_message : :removed_message), margin_classes: "tw:my-8")) %>
<% elsif @can_send_message %>
<%# matches Messages::ThreadShowMessage::Component#margin_class for sender %>
<div class="tw:mb-8 tw:ml-4 tw:lg:ml-8">
<%= render partial: "my_accounts/messages/form", locals: {marketplace_message: @new_marketplace_message} %>
</div>
<% else %>
<%= render(UI::Alert::Component.new(text: translation(".can_not_send_new_message"), kind: :error, margin_classes: "tw:my-10")) %>
<%= render(UI::Alerts::Base::Component.new(text: translation(".can_not_send_new_message"), kind: :error, margin_classes: "tw:my-10")) %>
<% end %>

<% if show_mark_sold? %>
Expand Down
2 changes: 1 addition & 1 deletion app/components/messages/thread_show/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def sold_alert_rendered?

def render_sold_alert
@sold_alert_rendered = true
render(UI::Alert::Component.new(kind: :notice, margin_classes: "tw:my-8")) { sold_alert_content }
render(UI::Alerts::Base::Component.new(kind: :notice, margin_classes: "tw:my-8")) { sold_alert_content }
end

def item_type_display
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def status_display(graduated_notification)
def status_class(status)
case status
when "Bike Graduated" then "text-info"
when "Delivery Failure" then UI::Alert::Component::TEXT_CLASSES[:error]
when "Delivery Failure" then UI::Alerts::Base::Component::TEXT_CLASSES[:error]
else "less-strong"
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div id="impoundRecordUpdateForm" data-controller="org--impound-update">
<% if @multi %>
<div class="tw:hidden" data-org--impound-update-multi-target="error">
<%= render(UI::Alert::Component.new(text: "Select at least one record to update", kind: :error)) %>
<%= render(UI::Alerts::Base::Component.new(text: "Select at least one record to update", kind: :error)) %>
</div>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion app/components/org/search/form/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

<% if render_serial_field? && serial_looks_like_not_a_serial? %>
<%= render(
UI::Alert::Component.new(
UI::Alerts::Base::Component.new(
text: translation(".doesnt_look_like_serial"),
kind: :warning,
margin_classes: "tw:my-2",
Expand Down
2 changes: 1 addition & 1 deletion app/components/register/step1/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<%= render UI::Header::Component.new(text: heading_text, subtitle: translation(".just_the_essentials")) %>

<% if @b_param.errors.any? %>
<%= render UI::Alert::Component.new(kind: :error, text: @b_param.errors.full_messages.to_sentence) %>
<%= render UI::Alerts::Base::Component.new(kind: :error, text: @b_param.errors.full_messages.to_sentence) %>
<% end %>

<%= form_with(model: @b_param, url: register_path, method: :post, scope: :b_param,
Expand Down
4 changes: 2 additions & 2 deletions app/components/register/step2/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<%= render Register::Progress::Component.new(step: 2, total: BikeServices::Register.total_steps(@sequence)) %>

<% if awaiting_confirmation? %>
<%= render UI::Alert::Component.new(kind: :purple, text: translation(".confirmation_link_sent"),
<%= render UI::Alerts::Base::Component.new(kind: :purple, text: translation(".confirmation_link_sent"),
icon: helpers.inline_svg_tag("icons/envelope.svg", class: "tw:-mb-0.5 tw:h-4 tw:w-4 tw:shrink-0", aria_hidden: true)) %>
<% end %>

<%= render UI::Header::Component.new(text: translation(".add_your_bikes_details", cycle_type:), subtitle: translation(".more_useful_registration")) %>

<% if @b_param.errors.any? %>
<%= render UI::Alert::Component.new(kind: :error, text: @b_param.errors.full_messages.to_sentence) %>
<%= render UI::Alerts::Base::Component.new(kind: :error, text: @b_param.errors.full_messages.to_sentence) %>
<% end %>

<%= form_with(url: register_path, method: :patch, scope: :bike,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if alert? %>
<%= render(UI::Alert::Component.new(kind: :purple, header: @title, margin_classes: "")) do %>
<%= render(UI::Alerts::Base::Component.new(kind: :purple, header: @title, margin_classes: "")) do %>
<%= content %>
<% end %>
<% else %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= render(UI::Alert::Component.new(kind: :success, margin_classes: "", icon: qr_icon)) do %>
<%= render(UI::Alerts::Base::Component.new(kind: :success, margin_classes: "", icon: qr_icon)) do %>
<p>
<%= translation(".you_scanned_this_sticker_html", sticker: render(Atom::Sticker::Component.new(bike_sticker: @bike_sticker)), bike_type: @bike.type) %>
</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= render(UI::Alert::Component.new(kind: :notice, margin_classes: "")) do %>
<%= render(UI::Alerts::Base::Component.new(kind: :notice, margin_classes: "")) do %>
<p>
<%= translation(".you_sent_this_bike_html", bike_type: @bike.type, owner_email: tag.em(@bike.owner_email)) %>
</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="tw:mt-2 tw:text-center">
<%= render(UI::Alert::Component.new(kind: :purple)) do %>
<%= render(UI::Alerts::Base::Component.new(kind: :purple)) do %>
<div class="tw:flex tw:flex-wrap tw:items-center tw:justify-between tw:gap-3">
<span class="tw:font-semibold">
<%= translation(".using_new_view", bike_type: @bike.type) %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= render(UI::Alert::Component.new(kind: :purple)) do %>
<%= render(UI::Alerts::Base::Component.new(kind: :purple)) do %>
<div class="tw:flex tw:flex-wrap tw:items-center tw:justify-between tw:gap-3">
<% if redesign_enabled? %>
<div class="tw:font-semibold">
Expand Down
2 changes: 1 addition & 1 deletion app/components/registrations/show/wrapper/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Wrapper
class Component < ApplicationComponent
# Digest of the markup inside the cache block — the cached_markup_digest spec
# keeps it current, following what this tree renders out into UI:: and elsewhere
MARKUP_DIGEST = "e340959dc45c"
MARKUP_DIGEST = "42c2902c0a00"

def initialize(bike:, current_user:, view:, available_views:, bike_sticker: nil, current_alerts: {})
@bike = bike
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ def bike_with_ownership(claimed:)
end

def production_notice
render(UI::Alert::Component.new(kind: :error,
render(UI::Alerts::Base::Component.new(kind: :error,
text: "This preview renders a real registration, so it's disabled in production."))
end

def missing_notice(needed)
render(UI::Alert::Component.new(kind: :warning,
render(UI::Alerts::Base::Component.new(kind: :warning,
text: "Nothing to preview — this environment has no #{needed}."))
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/components/search/form/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

<% if render_serial_field? && serial_looks_like_not_a_serial? %>
<%= render(
UI::Alert::Component.new(
UI::Alerts::Base::Component.new(
text: translation(".doesnt_look_like_serial"),
kind: :warning,
margin_classes: "tw:my-2",
Expand Down
2 changes: 1 addition & 1 deletion app/components/search_results/frame/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
%>

<div hidden data-search-rate-limited>
<%= render UI::Alert::Component.new(text: translation(".rate_limited"), kind: :warning) %>
<%= render UI::Alerts::Base::Component.new(text: translation(".rate_limited"), kind: :warning) %>
</div>

<%= helpers.turbo_frame_tag @frame_id, src: @src do %>
Expand Down
77 changes: 0 additions & 77 deletions app/components/ui/alert/component.rb

This file was deleted.

Loading