Class: Avo::AlertComponent
Constant Summary
Concerns::FindAssociationField::ASSOCIATIONS
Instance Method Summary
collapse
#a_button, #a_link, #body_classes, #button_classes, #chart_color, #container_classes, #d, #decode_filter_params, #e, #editor_file_path, #editor_url, #empty_state, #encode_filter_params, #frame_id, #get_model_class, #input_classes, #mount_path, #number_to_social, #possibly_rails_authentication?, #render_license_warning, #root_path_without_url, #rtl?, #text_direction, #ui, #wrap_in_modal
#field_wrapper, #filter_wrapper, #index_field_wrapper, #item_selector_data_attributes, #record_path, #record_title, #resource_for_record, #resource_grid, #resource_show_path, #resource_table
#component_name, #hotkey_badge
#find_association_field
Instance Method Details
#icon ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'app/components/avo/alert_component.rb', line 11
def icon
case variant
when :danger
"tabler/outline/circle-x"
when :warning
"tabler/outline/exclamation-circle"
when :info
"tabler/outline/info-circle"
when :success
"tabler/outline/circle-check"
else
"tabler/outline/circle"
end
end
|
#is_empty? ⇒ Boolean
53
54
55
|
# File 'app/components/avo/alert_component.rb', line 53
def is_empty?
@message.nil?
end
|
#is_error? ⇒ Boolean
37
38
39
|
# File 'app/components/avo/alert_component.rb', line 37
def is_error?
normalized_type == :error || normalized_type == :alert
end
|
#is_info? ⇒ Boolean
45
46
47
|
# File 'app/components/avo/alert_component.rb', line 45
def is_info?
normalized_type == :notice || normalized_type == :info
end
|
#is_success? ⇒ Boolean
41
42
43
|
# File 'app/components/avo/alert_component.rb', line 41
def is_success?
normalized_type == :success
end
|
#is_warning? ⇒ Boolean
49
50
51
|
# File 'app/components/avo/alert_component.rb', line 49
def is_warning?
normalized_type == :warning
end
|
#variant ⇒ Object
26
27
28
29
30
31
32
33
34
35
|
# File 'app/components/avo/alert_component.rb', line 26
def variant
@variant ||= begin
return :danger if is_error?
return :success if is_success?
return :warning if is_warning?
return :info if is_info?
:default
end
end
|