avo 1.4.0.pre.1 → 1.4.4.pre.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +10 -4
- data/README.md +5 -4
- data/app/components/avo/fields/badge_field/index_component.html.erb +3 -0
- data/app/components/avo/fields/badge_field/index_component.rb +4 -0
- data/app/components/avo/fields/badge_field/show_component.html.erb +3 -0
- data/app/components/avo/fields/badge_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/belongs_to_field_component.html.erb → fields/belongs_to_field/edit_component.html.erb} +0 -0
- data/app/components/avo/{edit/fields/belongs_to_field_component.rb → fields/belongs_to_field/edit_component.rb} +1 -1
- data/app/components/avo/{index/fields/belongs_to_field_component.html.erb → fields/belongs_to_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/belongs_to_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/belongs_to_field_component.html.erb → fields/belongs_to_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/belongs_to_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/boolean_field_component.html.erb → fields/boolean_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/boolean_field/edit_component.rb +4 -0
- data/app/components/avo/fields/boolean_field/index_component.html.erb +3 -0
- data/app/components/avo/fields/boolean_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/boolean_field_component.html.erb → fields/boolean_field/show_component.html.erb} +1 -1
- data/app/components/avo/fields/boolean_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/boolean_group_field_component.html.erb → fields/boolean_group_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/boolean_group_field/edit_component.rb +4 -0
- data/app/components/avo/fields/boolean_group_field/index_component.html.erb +3 -0
- data/app/components/avo/fields/boolean_group_field/index_component.rb +4 -0
- data/app/components/avo/fields/boolean_group_field/show_component.html.erb +3 -0
- data/app/components/avo/fields/boolean_group_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/code_field_component.html.erb → fields/code_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/code_field/edit_component.rb +4 -0
- data/app/components/avo/{show/fields/code_field_component.html.erb → fields/code_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/code_field/show_component.rb +4 -0
- data/app/components/avo/{common → fields/common}/badge_viewer_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/badge_viewer_component.rb +1 -1
- data/app/components/avo/{common → fields/common}/boolean_check_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/boolean_check_component.rb +1 -1
- data/app/components/avo/{common → fields/common}/boolean_group_component.html.erb +1 -1
- data/app/components/avo/{common → fields/common}/boolean_group_component.rb +1 -1
- data/app/components/avo/fields/common/files_list_viewer_component.html.erb +5 -0
- data/app/components/avo/{common → fields/common}/files_list_viewer_component.rb +1 -1
- data/app/components/avo/{common → fields/common}/gravatar_viewer_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/gravatar_viewer_component.rb +1 -1
- data/app/components/avo/{common → fields/common}/heading_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/heading_component.rb +1 -1
- data/app/components/avo/{common → fields/common}/key_value_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/key_value_component.rb +1 -1
- data/app/components/avo/{common → fields/common}/multiple_file_viewer_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/multiple_file_viewer_component.rb +1 -1
- data/app/components/avo/{common → fields/common}/single_file_viewer_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/single_file_viewer_component.rb +1 -1
- data/app/components/avo/fields/common/status_viewer_component.html.erb +18 -0
- data/app/components/avo/{common → fields/common}/status_viewer_component.rb +1 -1
- data/app/components/avo/{edit/fields/country_field_component.html.erb → fields/country_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/country_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/country_field_component.html.erb → fields/country_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/country_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/country_field_component.html.erb → fields/country_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/country_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/date_field_component.html.erb → fields/date_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/date_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/date_field_component.html.erb → fields/date_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/date_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/date_field_component.html.erb → fields/date_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/date_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/date_time_field_component.html.erb → fields/date_time_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/date_time_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/date_time_field_component.html.erb → fields/date_time_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/date_time_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/date_time_field_component.html.erb → fields/date_time_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/date_time_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/field_component.rb → fields/edit_component.rb} +1 -1
- data/app/components/avo/{edit/fields/external_image_field_component.html.erb → fields/external_image_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/external_image_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/external_image_field_component.html.erb → fields/external_image_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/external_image_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/external_image_field_component.html.erb → fields/external_image_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/external_image_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/file_field_component.html.erb → fields/file_field/edit_component.html.erb} +1 -1
- data/app/components/avo/fields/file_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/file_field_component.html.erb → fields/file_field/index_component.html.erb} +1 -1
- data/app/components/avo/fields/file_field/index_component.rb +4 -0
- data/app/components/avo/fields/file_field/show_component.html.erb +3 -0
- data/app/components/avo/fields/file_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/files_field_component.html.erb → fields/files_field/edit_component.html.erb} +1 -1
- data/app/components/avo/fields/files_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/files_field_component.html.erb → fields/files_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/files_field/index_component.rb +4 -0
- data/app/components/avo/fields/files_field/show_component.html.erb +3 -0
- data/app/components/avo/fields/files_field/show_component.rb +4 -0
- data/app/components/avo/{index/fields/gravatar_field_component.html.erb → fields/gravatar_field/index_component.html.erb} +2 -2
- data/app/components/avo/fields/gravatar_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/gravatar_field_component.html.erb → fields/gravatar_field/show_component.html.erb} +1 -1
- data/app/components/avo/fields/gravatar_field/show_component.rb +4 -0
- data/app/components/avo/{show/fields/has_many_field_component.html.erb → fields/has_many_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/has_many_field/show_component.rb +4 -0
- data/app/components/avo/{index/fields/has_one_field_component.html.erb → fields/has_one_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/has_one_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/has_one_field_component.html.erb → fields/has_one_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/has_one_field/show_component.rb +5 -0
- data/app/components/avo/{show/fields/heading_field_component.html.erb → fields/heading_field/edit_component.html.erb} +1 -1
- data/app/components/avo/fields/heading_field/edit_component.rb +4 -0
- data/app/components/avo/{edit/fields/heading_field_component.html.erb → fields/heading_field/show_component.html.erb} +1 -1
- data/app/components/avo/fields/heading_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/hidden_field_component.html.erb → fields/hidden_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/hidden_field/edit_component.rb +4 -0
- data/app/components/avo/{edit/fields/id_field_component.html.erb → fields/id_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/id_field/edit_component.rb +4 -0
- data/app/components/avo/fields/id_field/index_component.html.erb +3 -0
- data/app/components/avo/fields/id_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/id_field_component.html.erb → fields/id_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/id_field/show_component.rb +4 -0
- data/app/components/avo/fields/index_component.rb +20 -0
- data/app/components/avo/{edit/fields/key_value_field_component.html.erb → fields/key_value_field/edit_component.html.erb} +1 -1
- data/app/components/avo/fields/key_value_field/edit_component.rb +4 -0
- data/app/components/avo/{show/fields/key_value_field_component.html.erb → fields/key_value_field/show_component.html.erb} +1 -1
- data/app/components/avo/fields/key_value_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/markdown_field_component.html.erb → fields/markdown_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/markdown_field/edit_component.rb +4 -0
- data/app/components/avo/{show/fields/markdown_field_component.html.erb → fields/markdown_field/show_component.html.erb} +1 -1
- data/app/components/avo/fields/markdown_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/number_field_component.html.erb → fields/number_field/edit_component.html.erb} +3 -3
- data/app/components/avo/fields/number_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/number_field_component.html.erb → fields/number_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/number_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/number_field_component.html.erb → fields/number_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/number_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/password_field_component.html.erb → fields/password_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/password_field/edit_component.rb +4 -0
- data/app/components/avo/fields/progress_bar_field/edit_component.html.erb +26 -0
- data/app/components/avo/fields/progress_bar_field/edit_component.rb +4 -0
- data/app/components/avo/fields/progress_bar_field/index_component.html.erb +8 -0
- data/app/components/avo/fields/progress_bar_field/index_component.rb +4 -0
- data/app/components/avo/fields/progress_bar_field/show_component.html.erb +8 -0
- data/app/components/avo/fields/progress_bar_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/select_field_component.html.erb → fields/select_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/select_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/select_field_component.html.erb → fields/select_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/select_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/select_field_component.html.erb → fields/select_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/select_field/show_component.rb +4 -0
- data/app/components/avo/{show/fields/field_component.rb → fields/show_component.rb} +1 -1
- data/app/components/avo/{edit/fields/status_field_component.html.erb → fields/status_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/status_field/edit_component.rb +4 -0
- data/app/components/avo/fields/status_field/index_component.html.erb +3 -0
- data/app/components/avo/fields/status_field/index_component.rb +4 -0
- data/app/components/avo/fields/status_field/show_component.html.erb +3 -0
- data/app/components/avo/fields/status_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/text_field_component.html.erb → fields/text_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/text_field/edit_component.rb +4 -0
- data/app/components/avo/fields/text_field/index_component.html.erb +3 -0
- data/app/components/avo/fields/text_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/text_field_component.html.erb → fields/text_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/text_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/textarea_field_component.html.erb → fields/textarea_field/edit_component.html.erb} +1 -1
- data/app/components/avo/fields/textarea_field/edit_component.rb +4 -0
- data/app/components/avo/{show/fields/textarea_field_component.html.erb → fields/textarea_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/textarea_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/trix_field_component.html.erb → fields/trix_field/edit_component.html.erb} +1 -2
- data/app/components/avo/fields/trix_field/edit_component.rb +4 -0
- data/app/components/avo/{show/fields/trix_field_component.html.erb → fields/trix_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/trix_field/show_component.rb +4 -0
- data/app/components/avo/index/resource_controls_component.html.erb +2 -3
- data/app/components/avo/index/table_row_component.html.erb +1 -1
- data/app/components/avo/panel_component.html.erb +1 -1
- data/app/components/avo/panel_component.rb +4 -4
- data/app/components/avo/views/resource_edit_component.html.erb +2 -2
- data/app/components/avo/views/resource_index_component.html.erb +6 -6
- data/app/components/avo/views/resource_new_component.html.erb +2 -2
- data/app/components/avo/views/resource_show_component.html.erb +5 -5
- data/app/controllers/avo/application_controller.rb +14 -7
- data/app/controllers/avo/base_controller.rb +26 -2
- data/app/controllers/avo/home_controller.rb +1 -1
- data/app/controllers/avo/relations_controller.rb +1 -1
- data/app/controllers/avo/search_controller.rb +50 -35
- data/app/helpers/avo/resources_helper.rb +0 -44
- data/app/packs/entrypoints/application.css +3 -1
- data/app/packs/entrypoints/application.js +3 -0
- data/app/packs/js/controllers/fields/key_value_controller.js +0 -1
- data/app/packs/js/controllers/search_controller.js +120 -0
- data/app/packs/js/helpers/debounce_promise.js +13 -0
- data/app/packs/stylesheets/components/progress.css +13 -0
- data/app/packs/stylesheets/components/status.css +31 -20
- data/app/packs/stylesheets/search.css +79 -0
- data/app/packs/svgs/check-circle-sm.svg +3 -0
- data/app/packs/svgs/x-circle-sm.svg +3 -0
- data/app/views/avo/actions/show.html.erb +1 -1
- data/app/views/avo/partials/_global_search.html.erb +17 -0
- data/app/views/avo/partials/_profile_dropdown.html.erb +19 -0
- data/app/views/avo/partials/_resource_search.html.erb +10 -0
- data/app/views/layouts/avo/application.html.erb +7 -6
- data/avo.gemspec +2 -1
- data/config/routes.rb +2 -6
- data/db/factories.rb +3 -0
- data/db/migrate/20210421064037_add_color_to_teams.rb +5 -0
- data/db/migrate/20210423075924_add_progress_to_projects.rb +5 -0
- data/lib/avo/app.rb +12 -21
- data/lib/avo/base_resource.rb +91 -7
- data/lib/avo/configuration.rb +3 -1
- data/lib/avo/engine.rb +1 -0
- data/lib/avo/fields/badge_field.rb +4 -6
- data/lib/avo/fields/base_field.rb +68 -83
- data/lib/avo/fields/belongs_to_field.rb +11 -11
- data/lib/avo/fields/boolean_field.rb +2 -7
- data/lib/avo/fields/boolean_group_field.rb +2 -7
- data/lib/avo/fields/code_field.rb +3 -7
- data/lib/avo/fields/country_field.rb +3 -6
- data/lib/avo/fields/currency_field.rb +4 -13
- data/lib/avo/fields/date_field.rb +2 -8
- data/lib/avo/fields/date_time_field.rb +2 -3
- data/lib/avo/fields/external_image_field.rb +3 -7
- data/lib/avo/fields/file_field.rb +8 -8
- data/lib/avo/fields/files_field.rb +6 -8
- data/lib/avo/fields/gravatar_field.rb +6 -9
- data/lib/avo/fields/has_and_belongs_to_many_field.rb +6 -7
- data/lib/avo/fields/has_many_field.rb +3 -9
- data/lib/avo/fields/has_one_field.rb +3 -8
- data/lib/avo/fields/heading_field.rb +10 -8
- data/lib/avo/fields/hidden_field.rb +2 -6
- data/lib/avo/fields/id_field.rb +5 -17
- data/lib/avo/fields/key_value_field.rb +4 -6
- data/lib/avo/fields/markdown_field.rb +3 -5
- data/lib/avo/fields/number_field.rb +8 -11
- data/lib/avo/fields/password_field.rb +2 -6
- data/lib/avo/fields/progress_bar_field.rb +19 -0
- data/lib/avo/fields/select_field.rb +13 -12
- data/lib/avo/fields/status_field.rb +2 -6
- data/lib/avo/fields/text_field.rb +3 -6
- data/lib/avo/fields/textarea_field.rb +4 -7
- data/lib/avo/fields/trix_field.rb +5 -9
- data/lib/avo/fields_collector.rb +47 -11
- data/lib/avo/licensing/license.rb +10 -0
- data/lib/avo/licensing/pro_license.rb +4 -1
- data/lib/avo/services/authorization_service.rb +1 -1
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/eject_generator.rb +1 -0
- data/lib/generators/avo/field_generator.rb +17 -0
- data/lib/generators/avo/filter_generator.rb +1 -1
- data/lib/generators/avo/templates/field/%singular_name%_field.rb.tt +5 -0
- data/lib/generators/avo/templates/field/components/edit_component.html.erb.tt +6 -0
- data/lib/generators/avo/templates/field/components/edit_component.rb.tt +4 -0
- data/lib/generators/avo/templates/field/components/index_component.html.erb.tt +3 -0
- data/lib/generators/avo/templates/field/components/index_component.rb.tt +4 -0
- data/lib/generators/avo/templates/field/components/show_component.html.erb.tt +3 -0
- data/lib/generators/avo/templates/field/components/show_component.rb.tt +4 -0
- data/lib/generators/avo/templates/initializer/avo.tt +1 -0
- data/lib/generators/avo/templates/resource/resource.tt +3 -0
- data/lib/generators/avo/templates/tool/view.tt +1 -1
- data/public/avo-packs/css/{application-5bdca030.css → application-d69fe930.css} +303 -50
- data/public/avo-packs/css/application-d69fe930.css.br +0 -0
- data/public/avo-packs/css/application-d69fe930.css.gz +0 -0
- data/public/avo-packs/css/application-d69fe930.css.map +1 -0
- data/public/avo-packs/css/application-d69fe930.css.map.br +0 -0
- data/public/avo-packs/css/application-d69fe930.css.map.gz +0 -0
- data/public/avo-packs/js/application-7b3d507875f4bc1f6677.js +26 -0
- data/public/avo-packs/js/{application-16a456a2b7cb56b01153.js.LICENSE.txt → application-7b3d507875f4bc1f6677.js.LICENSE.txt} +0 -0
- data/public/avo-packs/js/application-7b3d507875f4bc1f6677.js.br +0 -0
- data/public/avo-packs/js/application-7b3d507875f4bc1f6677.js.gz +0 -0
- data/public/avo-packs/js/{application-16a456a2b7cb56b01153.js.map → application-7b3d507875f4bc1f6677.js.map} +1 -1
- data/public/avo-packs/js/application-7b3d507875f4bc1f6677.js.map.br +0 -0
- data/public/avo-packs/js/application-7b3d507875f4bc1f6677.js.map.gz +0 -0
- data/public/avo-packs/manifest.json +15 -15
- metadata +206 -173
- data/app/components/avo/common/files_list_viewer_component.html.erb +0 -5
- data/app/components/avo/common/status_viewer_component.html.erb +0 -10
- data/app/components/avo/edit/fields/boolean_field_component.rb +0 -4
- data/app/components/avo/edit/fields/boolean_group_field_component.rb +0 -4
- data/app/components/avo/edit/fields/code_field_component.rb +0 -4
- data/app/components/avo/edit/fields/country_field_component.rb +0 -4
- data/app/components/avo/edit/fields/date_field_component.rb +0 -4
- data/app/components/avo/edit/fields/date_time_field_component.rb +0 -4
- data/app/components/avo/edit/fields/external_image_field_component.rb +0 -4
- data/app/components/avo/edit/fields/file_field_component.rb +0 -4
- data/app/components/avo/edit/fields/files_field_component.rb +0 -4
- data/app/components/avo/edit/fields/heading_field_component.rb +0 -4
- data/app/components/avo/edit/fields/hidden_field_component.rb +0 -4
- data/app/components/avo/edit/fields/id_field_component.rb +0 -4
- data/app/components/avo/edit/fields/key_value_field_component.rb +0 -4
- data/app/components/avo/edit/fields/markdown_field_component.rb +0 -4
- data/app/components/avo/edit/fields/number_field_component.rb +0 -4
- data/app/components/avo/edit/fields/password_field_component.rb +0 -4
- data/app/components/avo/edit/fields/select_field_component.rb +0 -4
- data/app/components/avo/edit/fields/status_field_component.rb +0 -4
- data/app/components/avo/edit/fields/text_field_component.rb +0 -4
- data/app/components/avo/edit/fields/textarea_field_component.rb +0 -4
- data/app/components/avo/edit/fields/trix_field_component.rb +0 -4
- data/app/components/avo/index/fields/badge_field_component.html.erb +0 -3
- data/app/components/avo/index/fields/badge_field_component.rb +0 -4
- data/app/components/avo/index/fields/belongs_to_field_component.rb +0 -4
- data/app/components/avo/index/fields/boolean_field_component.html.erb +0 -3
- data/app/components/avo/index/fields/boolean_field_component.rb +0 -4
- data/app/components/avo/index/fields/boolean_group_field_component.html.erb +0 -3
- data/app/components/avo/index/fields/boolean_group_field_component.rb +0 -4
- data/app/components/avo/index/fields/country_field_component.rb +0 -4
- data/app/components/avo/index/fields/date_field_component.rb +0 -4
- data/app/components/avo/index/fields/date_time_field_component.rb +0 -4
- data/app/components/avo/index/fields/external_image_field_component.rb +0 -4
- data/app/components/avo/index/fields/field_component.html.erb +0 -1
- data/app/components/avo/index/fields/field_component.rb +0 -11
- data/app/components/avo/index/fields/file_field_component.rb +0 -4
- data/app/components/avo/index/fields/files_field_component.rb +0 -4
- data/app/components/avo/index/fields/gravatar_field_component.rb +0 -4
- data/app/components/avo/index/fields/has_one_field_component.rb +0 -4
- data/app/components/avo/index/fields/id_field_component.html.erb +0 -10
- data/app/components/avo/index/fields/id_field_component.rb +0 -4
- data/app/components/avo/index/fields/number_field_component.rb +0 -4
- data/app/components/avo/index/fields/select_field_component.rb +0 -4
- data/app/components/avo/index/fields/status_field_component.html.erb +0 -3
- data/app/components/avo/index/fields/status_field_component.rb +0 -4
- data/app/components/avo/index/fields/text_field_component.html.erb +0 -3
- data/app/components/avo/index/fields/text_field_component.rb +0 -4
- data/app/components/avo/show/fields/badge_field_component.html.erb +0 -3
- data/app/components/avo/show/fields/badge_field_component.rb +0 -4
- data/app/components/avo/show/fields/belongs_to_field_component.rb +0 -4
- data/app/components/avo/show/fields/boolean_field_component.rb +0 -4
- data/app/components/avo/show/fields/boolean_group_field_component.html.erb +0 -3
- data/app/components/avo/show/fields/boolean_group_field_component.rb +0 -4
- data/app/components/avo/show/fields/code_field_component.rb +0 -4
- data/app/components/avo/show/fields/country_field_component.rb +0 -4
- data/app/components/avo/show/fields/date_field_component.rb +0 -4
- data/app/components/avo/show/fields/date_time_field_component.rb +0 -4
- data/app/components/avo/show/fields/external_image_field_component.rb +0 -4
- data/app/components/avo/show/fields/file_field_component.html.erb +0 -3
- data/app/components/avo/show/fields/file_field_component.rb +0 -4
- data/app/components/avo/show/fields/files_field_component.html.erb +0 -3
- data/app/components/avo/show/fields/files_field_component.rb +0 -4
- data/app/components/avo/show/fields/gravatar_field_component.rb +0 -4
- data/app/components/avo/show/fields/has_many_field_component.rb +0 -4
- data/app/components/avo/show/fields/has_one_field_component.rb +0 -5
- data/app/components/avo/show/fields/heading_field_component.rb +0 -4
- data/app/components/avo/show/fields/id_field_component.rb +0 -4
- data/app/components/avo/show/fields/key_value_field_component.rb +0 -4
- data/app/components/avo/show/fields/markdown_field_component.rb +0 -4
- data/app/components/avo/show/fields/number_field_component.rb +0 -4
- data/app/components/avo/show/fields/select_field_component.rb +0 -4
- data/app/components/avo/show/fields/status_field_component.html.erb +0 -3
- data/app/components/avo/show/fields/status_field_component.rb +0 -4
- data/app/components/avo/show/fields/text_field_component.rb +0 -4
- data/app/components/avo/show/fields/textarea_field_component.rb +0 -4
- data/app/components/avo/show/fields/trix_field_component.rb +0 -4
- data/public/avo-packs/css/application-5bdca030.css.br +0 -0
- data/public/avo-packs/css/application-5bdca030.css.gz +0 -0
- data/public/avo-packs/css/application-5bdca030.css.map +0 -1
- data/public/avo-packs/css/application-5bdca030.css.map.br +0 -0
- data/public/avo-packs/css/application-5bdca030.css.map.gz +0 -0
- data/public/avo-packs/js/application-16a456a2b7cb56b01153.js +0 -26
- data/public/avo-packs/js/application-16a456a2b7cb56b01153.js.br +0 -0
- data/public/avo-packs/js/application-16a456a2b7cb56b01153.js.gz +0 -0
- data/public/avo-packs/js/application-16a456a2b7cb56b01153.js.map.br +0 -0
- data/public/avo-packs/js/application-16a456a2b7cb56b01153.js.map.gz +0 -0
@@ -14,50 +14,6 @@ module Avo
|
|
14
14
|
}
|
15
15
|
end
|
16
16
|
|
17
|
-
def index_field(field, index, resource)
|
18
|
-
component = field.component_name(:index)
|
19
|
-
|
20
|
-
if Object.const_defined? component
|
21
|
-
render component.safe_constantize.new(field: field, resource: resource, index: index)
|
22
|
-
else
|
23
|
-
render partial: field.partial_path_for(:index), locals: {
|
24
|
-
field: field,
|
25
|
-
index: index,
|
26
|
-
resource: resource
|
27
|
-
}
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def show_field(field, index, resource)
|
32
|
-
component = field.component_name(:show)
|
33
|
-
|
34
|
-
if Object.const_defined? component
|
35
|
-
render component.safe_constantize.new(field: field, resource: resource, index: index)
|
36
|
-
else
|
37
|
-
render partial: field.partial_path_for(:show), locals: {
|
38
|
-
field: field,
|
39
|
-
index: index,
|
40
|
-
resource: resource
|
41
|
-
}
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def edit_field(field, index, resource, form, displayed_in_modal: false)
|
46
|
-
component = field.component_name(:edit)
|
47
|
-
|
48
|
-
if Object.const_defined? component
|
49
|
-
render component.safe_constantize.new(field: field, resource: resource, index: index, form: form, displayed_in_modal: displayed_in_modal)
|
50
|
-
else
|
51
|
-
render partial: field.partial_path_for(:edit), locals: {
|
52
|
-
field: field,
|
53
|
-
index: index,
|
54
|
-
resource: resource,
|
55
|
-
form: form,
|
56
|
-
displayed_in_modal: displayed_in_modal
|
57
|
-
}
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
17
|
def index_field_wrapper(**args, &block)
|
62
18
|
render Index::FieldWrapperComponent.new(**args) do
|
63
19
|
capture(&block)
|
@@ -4,7 +4,7 @@
|
|
4
4
|
@import './../../../node_modules/tippy.js/themes/light.css';
|
5
5
|
@import './../../../node_modules/trix/dist/trix.css';
|
6
6
|
@import './../../../node_modules/flatpickr/dist/flatpickr.css';
|
7
|
-
|
7
|
+
@import './../../../node_modules/@algolia/autocomplete-theme-classic/dist/theme.css';
|
8
8
|
|
9
9
|
@import './../stylesheets/tailwindcss/base.css';
|
10
10
|
|
@@ -15,9 +15,11 @@
|
|
15
15
|
@import './../stylesheets/loader.css';
|
16
16
|
@import './../stylesheets/pagination.css';
|
17
17
|
@import './../stylesheets/breadcrumbs.css';
|
18
|
+
@import './../stylesheets/search.css';
|
18
19
|
|
19
20
|
@import './../stylesheets/components/status.css';
|
20
21
|
@import './../stylesheets/components/code.css';
|
22
|
+
@import './../stylesheets/components/progress.css';
|
21
23
|
@import './../stylesheets/tailwindcss/components.css';
|
22
24
|
|
23
25
|
@import './../stylesheets/tailwindcss/utilities.css';
|
@@ -45,6 +45,9 @@ document.addEventListener('turbo:load', () => {
|
|
45
45
|
})
|
46
46
|
document.addEventListener('turbo:visit', () => document.body.classList.add('turbo-loading'))
|
47
47
|
document.addEventListener('turbo:submit-start', () => document.body.classList.add('turbo-loading'))
|
48
|
+
document.addEventListener('turbo:before-cache', () => {
|
49
|
+
document.querySelectorAll('[data-turbo-remove-before-cache]').forEach((element) => element.remove())
|
50
|
+
})
|
48
51
|
|
49
52
|
// Uncomment to copy all static images under ../images to the output folder and reference
|
50
53
|
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
|
@@ -0,0 +1,120 @@
|
|
1
|
+
/* eslint-disable no-underscore-dangle */
|
2
|
+
import * as Mousetrap from 'mousetrap'
|
3
|
+
import { Controller } from 'stimulus'
|
4
|
+
import { Turbo } from '@hotwired/turbo-rails'
|
5
|
+
import { autocomplete } from '@algolia/autocomplete-js'
|
6
|
+
import debouncePromise from '@/js/helpers/debounce_promise'
|
7
|
+
|
8
|
+
export default class extends Controller {
|
9
|
+
static targets = ['autocomplete', 'button']
|
10
|
+
|
11
|
+
debouncedFetch = debouncePromise(fetch, this.debounceTimeout)
|
12
|
+
|
13
|
+
get translationKeys() {
|
14
|
+
let keys
|
15
|
+
try {
|
16
|
+
keys = JSON.parse(this.autocompleteTarget.dataset.translationKeys)
|
17
|
+
} catch (error) {
|
18
|
+
keys = {}
|
19
|
+
}
|
20
|
+
|
21
|
+
return keys
|
22
|
+
}
|
23
|
+
|
24
|
+
get debounceTimeout() {
|
25
|
+
return this.autocompleteTarget.dataset.debounceTimeout
|
26
|
+
}
|
27
|
+
|
28
|
+
get searchResource() {
|
29
|
+
return this.autocompleteTarget.dataset.searchResource
|
30
|
+
}
|
31
|
+
|
32
|
+
get isGlobalSearch() {
|
33
|
+
return this.searchResource === 'global'
|
34
|
+
}
|
35
|
+
|
36
|
+
get searchUrl() {
|
37
|
+
return this.isGlobalSearch ? '/avo/avo_api/search' : `/avo/avo_api/${this.searchResource}/search`
|
38
|
+
}
|
39
|
+
|
40
|
+
addSource(resourceName, data) {
|
41
|
+
const that = this
|
42
|
+
|
43
|
+
return {
|
44
|
+
sourceId: resourceName,
|
45
|
+
getItems: () => data.results,
|
46
|
+
onSelect({ item }) {
|
47
|
+
Turbo.visit(item._url, { action: 'replace' })
|
48
|
+
},
|
49
|
+
templates: {
|
50
|
+
header() {
|
51
|
+
return data.header
|
52
|
+
},
|
53
|
+
item({ item, createElement }) {
|
54
|
+
let element = ''
|
55
|
+
|
56
|
+
if (item._avatar) {
|
57
|
+
let classes
|
58
|
+
|
59
|
+
switch (item._avatar_type) {
|
60
|
+
default:
|
61
|
+
case 'circle':
|
62
|
+
classes = 'rounded-full'
|
63
|
+
break
|
64
|
+
case 'rounded':
|
65
|
+
classes = 'rounded'
|
66
|
+
break
|
67
|
+
}
|
68
|
+
|
69
|
+
element += `<img src="${item._avatar}" alt="${item._label}" class="flex-shrink-0 w-8 h-8 my-[2px] inline mr-2 ${classes}" />`
|
70
|
+
}
|
71
|
+
element += `<div>${item._label}`
|
72
|
+
|
73
|
+
if (item._description) {
|
74
|
+
element += `<div class="aa-ItemDescription">${item._description}</div>`
|
75
|
+
}
|
76
|
+
|
77
|
+
element += '</div>'
|
78
|
+
|
79
|
+
return createElement('div', {
|
80
|
+
class: 'flex',
|
81
|
+
dangerouslySetInnerHTML: {
|
82
|
+
__html: element,
|
83
|
+
},
|
84
|
+
})
|
85
|
+
},
|
86
|
+
noResults() {
|
87
|
+
return that.translationKeys.no_item_found.replace('%{item}', resourceName)
|
88
|
+
},
|
89
|
+
},
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
showSearchPanel() {
|
94
|
+
this.autocompleteTarget.querySelector('button').click()
|
95
|
+
}
|
96
|
+
|
97
|
+
connect() {
|
98
|
+
const that = this
|
99
|
+
|
100
|
+
this.buttonTarget.onclick = () => this.showSearchPanel()
|
101
|
+
|
102
|
+
if (this.isGlobalSearch) {
|
103
|
+
Mousetrap.bind(['command+k', 'ctrl+k'], () => this.showSearchPanel())
|
104
|
+
}
|
105
|
+
|
106
|
+
autocomplete({
|
107
|
+
container: this.autocompleteTarget,
|
108
|
+
placeholder: 'Search',
|
109
|
+
openOnFocus: true,
|
110
|
+
detachedMediaQuery: '',
|
111
|
+
getSources: ({ query }) => {
|
112
|
+
const endpoint = `${that.searchUrl}?q=${query}`
|
113
|
+
|
114
|
+
return that.debouncedFetch(endpoint)
|
115
|
+
.then((response) => response.json())
|
116
|
+
.then((data) => Object.keys(data).map((resourceName) => that.addSource(resourceName, data[resourceName])))
|
117
|
+
},
|
118
|
+
})
|
119
|
+
}
|
120
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
progress {
|
2
|
+
@apply h-2 bg-white border border-gray-400 rounded shadow-inner;
|
3
|
+
}
|
4
|
+
progress[value]::-webkit-progress-bar {
|
5
|
+
@apply bg-white border border-gray-500 rounded shadow-inner;
|
6
|
+
}
|
7
|
+
progress[value]::-webkit-progress-value{
|
8
|
+
@apply bg-green-600 rounded;
|
9
|
+
|
10
|
+
}
|
11
|
+
progress[value]::-moz-progress-bar {
|
12
|
+
@apply bg-green-600 rounded appearance-none;
|
13
|
+
}
|
@@ -1,30 +1,41 @@
|
|
1
1
|
.spinner {
|
2
|
+
width: 16px;
|
3
|
+
height: 16px;
|
4
|
+
|
2
5
|
position: relative;
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
6
|
+
}
|
7
|
+
|
8
|
+
|
9
|
+
.double-bounce1, .double-bounce2 {
|
10
|
+
width: 100%;
|
11
|
+
height: 100%;
|
12
|
+
border-radius: 50%;
|
7
13
|
background-color: #333;
|
8
|
-
|
9
|
-
|
10
|
-
|
14
|
+
opacity: 0.6;
|
15
|
+
position: absolute;
|
16
|
+
top: 0;
|
17
|
+
left: 0;
|
18
|
+
|
19
|
+
-webkit-animation: sk-bounce 2.0s infinite ease-in-out;
|
20
|
+
animation: sk-bounce 2.0s infinite ease-in-out;
|
11
21
|
}
|
12
22
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
-webkit-transform: scale(1.0);
|
17
|
-
opacity: 0;
|
18
|
-
}
|
23
|
+
.double-bounce2 {
|
24
|
+
-webkit-animation-delay: -1.0s;
|
25
|
+
animation-delay: -1.0s;
|
19
26
|
}
|
20
27
|
|
21
|
-
|
22
|
-
0% {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
28
|
+
@-webkit-keyframes sk-bounce {
|
29
|
+
0%, 100% { -webkit-transform: scale(0.0) }
|
30
|
+
50% { -webkit-transform: scale(1.0) }
|
31
|
+
}
|
32
|
+
|
33
|
+
@keyframes sk-bounce {
|
34
|
+
0%, 100% {
|
35
|
+
transform: scale(0.0);
|
36
|
+
-webkit-transform: scale(0.0);
|
37
|
+
} 50% {
|
27
38
|
transform: scale(1.0);
|
28
|
-
|
39
|
+
-webkit-transform: scale(1.0);
|
29
40
|
}
|
30
41
|
}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
:root {
|
2
|
+
--aa-primary-color: --tw-ring-color;
|
3
|
+
--aa-selected-color: --tw-ring-color;
|
4
|
+
--aa-primary-color-rgb: 5, 150, 105;
|
5
|
+
}
|
6
|
+
|
7
|
+
.global-search {
|
8
|
+
.aa-DetachedSearchButton:focus,
|
9
|
+
.aa-DetachedSearchButton {
|
10
|
+
border: none !important;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
.resource-search {
|
15
|
+
.aa-Autocomplete {
|
16
|
+
@apply w-full;
|
17
|
+
}
|
18
|
+
|
19
|
+
.aa-DetachedSearchButton {
|
20
|
+
@apply rounded-full border-gray-300;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
.aa-SourceHeader {
|
25
|
+
@apply uppercase text-xs font-semibold;
|
26
|
+
}
|
27
|
+
|
28
|
+
.aa-DetachedFormContainer,
|
29
|
+
.aa-DetachedContainer .aa-Panel {
|
30
|
+
@apply bg-blue-gray-100 border-b-0;
|
31
|
+
}
|
32
|
+
|
33
|
+
.aa-Form {
|
34
|
+
&:focus-within {
|
35
|
+
@apply ring-0 !important;
|
36
|
+
}
|
37
|
+
|
38
|
+
input {
|
39
|
+
@apply focus:ring-0 !important;
|
40
|
+
}
|
41
|
+
&:focus-within {
|
42
|
+
.aa-InputWrapperPrefix{
|
43
|
+
.aa-SubmitButton {
|
44
|
+
@apply ring-0;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
.aa-Input {
|
50
|
+
@apply focus:ring-green-600;
|
51
|
+
}
|
52
|
+
|
53
|
+
.aa-DetachedContainer {
|
54
|
+
.aa-PanelLayout {
|
55
|
+
@apply pt-0 space-y-3;
|
56
|
+
}
|
57
|
+
|
58
|
+
.aa-Source {
|
59
|
+
.aa-List {
|
60
|
+
@apply space-y-1;
|
61
|
+
|
62
|
+
.aa-Item {
|
63
|
+
@apply bg-white rounded-md px-3 py-4 shadow;
|
64
|
+
|
65
|
+
.aa-ItemDescription {
|
66
|
+
@apply text-gray-500 text-sm;
|
67
|
+
}
|
68
|
+
|
69
|
+
&[aria-selected=true]{
|
70
|
+
@apply bg-blue-700 text-white;
|
71
|
+
|
72
|
+
.aa-ItemDescription {
|
73
|
+
@apply text-white;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
2
|
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
|
3
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
2
|
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" />
|
3
|
+
</svg>
|
@@ -21,7 +21,7 @@
|
|
21
21
|
|
22
22
|
<% if @action.get_fields.present? %>
|
23
23
|
<% @action.get_fields.each_with_index do |field, index| %>
|
24
|
-
<%=
|
24
|
+
<%= render field.component_for_view(:edit).new field: field, resource: @resource, index: index, form: form, displayed_in_modal: true %>
|
25
25
|
<% end %>
|
26
26
|
<% end %>
|
27
27
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div data-controller="search" class="global-search" data-turbo-remove-before-cache>
|
2
|
+
<div class="inline-block"
|
3
|
+
data-search-target="autocomplete"
|
4
|
+
data-search-resource="global"
|
5
|
+
data-translation-keys='{"no_item_found": "<%= I18n.translate 'avo.no_item_found' %>"}'
|
6
|
+
data-debounce-timeout='<%= Avo.configuration.search_debounce %>'
|
7
|
+
>
|
8
|
+
</div>
|
9
|
+
<div class="relative top-[-5px] inline-flex text-gray-400 text-sm leading-5 py-0.5 px-1.5 border border-gray-300 rounded-md cursor-pointer"
|
10
|
+
data-search-target="button"
|
11
|
+
>
|
12
|
+
<span class="sr-only">Press </span>
|
13
|
+
<kbd class="font-sans"><abbr title="Command" class="no-underline">⌘</abbr></kbd>
|
14
|
+
<span class="sr-only"> and </span>
|
15
|
+
<kbd class="font-sans">K</kbd><span class="sr-only"> to search</span>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div data-controller="toggle-panel">
|
2
|
+
<a href="javascript:void(0);" class="flex items-center cursor-pointer font-semibold text-gray-700" data-action="click->toggle-panel#togglePanel">
|
3
|
+
<% if _current_user.respond_to? 'avatar' %>
|
4
|
+
<%= image_tag _current_user.avatar, class: "h-12 rounded-full border-4 border-white mr-1" if _current_user.avatar.present? %>
|
5
|
+
<% end %>
|
6
|
+
<% if _current_user.name.present? %>
|
7
|
+
<%= _current_user.name %>
|
8
|
+
<% elsif _current_user.email.present? %>
|
9
|
+
<%= _current_user.email %>
|
10
|
+
<% else %>
|
11
|
+
Avo user
|
12
|
+
<% end %>
|
13
|
+
<%= svg 'chevron-down', class: "ml-1 h-4" %>
|
14
|
+
</a>
|
15
|
+
|
16
|
+
<div class="hidden absolute inset-auto inset-auto right-0 mr-6 mt-0 py-4 bg-white rounded-xl min-w-[200px] shadow-context" data-toggle-panel-target="panel">
|
17
|
+
<%= button_to "Sign out", main_app.destroy_user_session_path, method: :delete, form: { "data-turbo" => "false" }, class: "appearance-none bg-white text-left cursor-pointer text-green-600 font-semibold hover:text-white hover:bg-green-500 block px-4 py-1 w-full" %>
|
18
|
+
</div>
|
19
|
+
</div>
|