avo 1.3.4 → 1.4.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.lock +4 -4
- data/README.md +1 -0
- 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/fields/common/key_value_component.html.erb +53 -0
- data/app/components/avo/fields/common/key_value_component.rb +11 -0
- 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/{common → fields/common}/status_viewer_component.html.erb +0 -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/fields/key_value_field/edit_component.html.erb +3 -0
- data/app/components/avo/fields/key_value_field/edit_component.rb +4 -0
- data/app/components/avo/fields/key_value_field/show_component.html.erb +3 -0
- 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/fields/trix_field/edit_component.html.erb +19 -0
- 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 +3 -3
- 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 +5 -1
- data/app/controllers/avo/attachments_controller.rb +14 -3
- data/app/controllers/avo/base_controller.rb +26 -2
- data/app/controllers/avo/home_controller.rb +1 -1
- data/app/controllers/avo/search_controller.rb +1 -1
- data/app/helpers/avo/application_helper.rb +1 -1
- data/app/helpers/avo/resources_helper.rb +0 -44
- data/app/packs/entrypoints/application.css +1 -0
- data/app/packs/entrypoints/application.js +14 -11
- data/app/packs/js/controllers/fields/code_field_controller.js +1 -0
- data/app/packs/js/controllers/fields/date_field_controller.js +1 -1
- data/app/packs/js/controllers/fields/key_value_controller.js +136 -0
- data/app/packs/js/controllers/fields/trix_field_controller.js +121 -0
- data/app/packs/stylesheets/components/progress.css +13 -0
- data/app/views/avo/actions/show.html.erb +1 -1
- data/app/views/avo/partials/_javascript.html.erb +3 -1
- data/app/views/avo/partials/_profile_dropdown.html.erb +19 -0
- data/app/views/layouts/avo/application.html.erb +6 -3
- data/config/routes.rb +4 -0
- data/config/webpacker.yml +2 -2
- 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.rb +1 -1
- data/lib/avo/app.rb +9 -20
- data/lib/avo/base_resource.rb +9 -1
- data/lib/avo/configuration.rb +1 -1
- data/lib/avo/engine.rb +1 -0
- data/lib/avo/fields/badge_field.rb +4 -6
- data/lib/avo/fields/base_field.rb +62 -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 +2 -7
- data/lib/avo/fields/file_field.rb +4 -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 +27 -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 +7 -7
- data/lib/avo/fields_collector.rb +47 -11
- data/lib/avo/licensing/pro_license.rb +2 -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/tool/view.tt +1 -1
- data/public/avo-packs/css/{application-af3e670d.css → application-cb627e0b.css} +179 -43
- data/public/avo-packs/css/application-cb627e0b.css.br +0 -0
- data/public/avo-packs/css/application-cb627e0b.css.gz +0 -0
- data/public/avo-packs/css/application-cb627e0b.css.map +1 -0
- data/public/avo-packs/css/application-cb627e0b.css.map.br +0 -0
- data/public/avo-packs/css/application-cb627e0b.css.map.gz +0 -0
- data/public/avo-packs/js/application-6a0b9e58526ae6bef242.js +26 -0
- data/public/avo-packs/js/{application-801f1297670a4c6df1b6.js.LICENSE.txt → application-6a0b9e58526ae6bef242.js.LICENSE.txt} +0 -0
- data/public/avo-packs/js/application-6a0b9e58526ae6bef242.js.br +0 -0
- data/public/avo-packs/js/application-6a0b9e58526ae6bef242.js.gz +0 -0
- data/public/avo-packs/js/application-6a0b9e58526ae6bef242.js.map +1 -0
- data/public/avo-packs/js/application-6a0b9e58526ae6bef242.js.map.br +0 -0
- data/public/avo-packs/js/application-6a0b9e58526ae6bef242.js.map.gz +0 -0
- data/public/avo-packs/manifest.json +15 -15
- metadata +185 -159
- data/app/components/avo/common/files_list_viewer_component.html.erb +0 -5
- 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/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.html.erb +0 -11
- 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/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-af3e670d.css.br +0 -0
- data/public/avo-packs/css/application-af3e670d.css.gz +0 -0
- data/public/avo-packs/css/application-af3e670d.css.map +0 -1
- data/public/avo-packs/css/application-af3e670d.css.map.br +0 -0
- data/public/avo-packs/css/application-af3e670d.css.map.gz +0 -0
- data/public/avo-packs/js/application-801f1297670a4c6df1b6.js +0 -26
- data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.br +0 -0
- data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.gz +0 -0
- data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.map +0 -1
- data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.map.br +0 -0
- data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.map.gz +0 -0
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
@import './../stylesheets/components/status.css';
|
20
20
|
@import './../stylesheets/components/code.css';
|
21
|
+
@import './../stylesheets/components/progress.css';
|
21
22
|
@import './../stylesheets/tailwindcss/components.css';
|
22
23
|
|
23
24
|
@import './../stylesheets/tailwindcss/utilities.css';
|
@@ -2,7 +2,6 @@
|
|
2
2
|
import 'core-js/stable'
|
3
3
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
4
4
|
import 'regenerator-runtime/runtime'
|
5
|
-
import 'trix'
|
6
5
|
import * as Mousetrap from 'mousetrap'
|
7
6
|
import { Application } from 'stimulus'
|
8
7
|
import { Turbo } from '@hotwired/turbo-rails'
|
@@ -19,6 +18,19 @@ window.Turbolinks = Turbo
|
|
19
18
|
|
20
19
|
Mousetrap.bind('r r r', () => Turbo.visit(window.location.href, { action: 'replace' }))
|
21
20
|
|
21
|
+
function initTippy() {
|
22
|
+
tippy('[data-tippy="tooltip"]', {
|
23
|
+
theme: 'light',
|
24
|
+
content(reference) {
|
25
|
+
const title = reference.getAttribute('title')
|
26
|
+
reference.removeAttribute('title')
|
27
|
+
|
28
|
+
return title
|
29
|
+
},
|
30
|
+
})
|
31
|
+
}
|
32
|
+
window.initTippy = initTippy
|
33
|
+
|
22
34
|
const application = Application.start()
|
23
35
|
|
24
36
|
const context = require.context('./../js/controllers', true, /\.js$/)
|
@@ -29,16 +41,7 @@ application.load(definitionsFromContext(fieldsContext))
|
|
29
41
|
|
30
42
|
document.addEventListener('turbo:load', () => {
|
31
43
|
document.body.classList.remove('turbo-loading')
|
32
|
-
|
33
|
-
tippy('[data-tippy="tooltip"]', {
|
34
|
-
theme: 'light',
|
35
|
-
content(reference) {
|
36
|
-
const title = reference.getAttribute('title')
|
37
|
-
reference.removeAttribute('title')
|
38
|
-
|
39
|
-
return title
|
40
|
-
},
|
41
|
-
})
|
44
|
+
initTippy()
|
42
45
|
})
|
43
46
|
document.addEventListener('turbo:visit', () => document.body.classList.add('turbo-loading'))
|
44
47
|
document.addEventListener('turbo:submit-start', () => document.body.classList.add('turbo-loading'))
|
@@ -12,6 +12,7 @@ import 'codemirror/mode/shell/shell'
|
|
12
12
|
import 'codemirror/mode/sql/sql'
|
13
13
|
import 'codemirror/mode/vue/vue'
|
14
14
|
import 'codemirror/mode/xml/xml'
|
15
|
+
import 'codemirror/mode/yaml/yaml'
|
15
16
|
|
16
17
|
import { Controller } from 'stimulus'
|
17
18
|
import { castBoolean } from '@/js/helpers/cast_boolean'
|
@@ -33,7 +33,7 @@ export default class extends Controller {
|
|
33
33
|
|
34
34
|
// enable timezone display
|
35
35
|
if (enableTime) {
|
36
|
-
currentValue = DateTime.fromISO(this.inputTarget.value, { zone: window.timezone })
|
36
|
+
currentValue = DateTime.fromISO(this.inputTarget.value, { zone: window.Avo.configuration.timezone })
|
37
37
|
currentValue = currentValue.setZone(this.inputTarget.dataset.timezone)
|
38
38
|
currentValue = currentValue.toISO()
|
39
39
|
|
@@ -0,0 +1,136 @@
|
|
1
|
+
/* eslint-disable max-len */
|
2
|
+
import { Controller } from 'stimulus'
|
3
|
+
import { castBoolean } from '@/js/helpers/cast_boolean'
|
4
|
+
|
5
|
+
export default class extends Controller {
|
6
|
+
static targets = ['input', 'controller', 'rows']
|
7
|
+
|
8
|
+
fieldValue = []
|
9
|
+
|
10
|
+
options = {}
|
11
|
+
|
12
|
+
get keyInputDisabled() {
|
13
|
+
return !this.options.editable || this.options.disable_editing_keys
|
14
|
+
}
|
15
|
+
|
16
|
+
get valueInputDisabled() {
|
17
|
+
return !this.options.editable
|
18
|
+
}
|
19
|
+
|
20
|
+
connect() {
|
21
|
+
this.setOptions()
|
22
|
+
|
23
|
+
try {
|
24
|
+
const objectValue = JSON.parse(this.inputTarget.value)
|
25
|
+
Object.keys(objectValue).forEach((key) => this.fieldValue.push([key, objectValue[key]]))
|
26
|
+
} catch (error) {
|
27
|
+
this.fieldValue = []
|
28
|
+
}
|
29
|
+
|
30
|
+
this.updateKeyValueComponent()
|
31
|
+
}
|
32
|
+
|
33
|
+
addRow() {
|
34
|
+
if (this.options.disable_adding_rows || !this.options.editable) return
|
35
|
+
this.fieldValue.push(['', ''])
|
36
|
+
this.updateKeyValueComponent()
|
37
|
+
this.focusLastRow()
|
38
|
+
}
|
39
|
+
|
40
|
+
deleteRow(event) {
|
41
|
+
if (this.options.disable_deleting_rows || !this.options.editable) return
|
42
|
+
const { index } = event.target.dataset
|
43
|
+
this.fieldValue.splice(index, 1)
|
44
|
+
this.updateTextareaInput()
|
45
|
+
this.updateKeyValueComponent()
|
46
|
+
}
|
47
|
+
|
48
|
+
focusLastRow() {
|
49
|
+
return this.rowsTarget.querySelector('.flex.key-value-row:last-child .key-value-input-key').focus()
|
50
|
+
}
|
51
|
+
|
52
|
+
valueFieldUpdated(event) {
|
53
|
+
const { value } = event.target
|
54
|
+
const { index } = event.target.dataset
|
55
|
+
this.fieldValue[index][1] = value
|
56
|
+
|
57
|
+
this.updateTextareaInput()
|
58
|
+
}
|
59
|
+
|
60
|
+
keyFieldUpdated(event) {
|
61
|
+
const { value } = event.target
|
62
|
+
const { index } = event.target.dataset
|
63
|
+
this.fieldValue[index][0] = value
|
64
|
+
|
65
|
+
this.updateTextareaInput()
|
66
|
+
}
|
67
|
+
|
68
|
+
updateTextareaInput() {
|
69
|
+
if (!this.hasInputTarget) return
|
70
|
+
let result = {}
|
71
|
+
if (this.fieldValue && this.fieldValue.length > 0) {
|
72
|
+
result = Object.assign(...this.fieldValue.map(([key, val]) => ({ [key]: val })))
|
73
|
+
}
|
74
|
+
this.inputTarget.innerText = JSON.stringify(result)
|
75
|
+
}
|
76
|
+
|
77
|
+
updateKeyValueComponent() {
|
78
|
+
let result = ''
|
79
|
+
let index = 0
|
80
|
+
this.fieldValue.forEach((row) => {
|
81
|
+
const [key, value] = row
|
82
|
+
result += this.interpolatedRow(key, value, index)
|
83
|
+
index++
|
84
|
+
})
|
85
|
+
this.rowsTarget.innerHTML = result
|
86
|
+
window.initTippy()
|
87
|
+
}
|
88
|
+
|
89
|
+
interpolatedRow(key, value, index) {
|
90
|
+
let result = `<div class="flex key-value-row">
|
91
|
+
${this.inputField('key', index, key, value)}
|
92
|
+
${this.inputField('value', index, key, value)}`
|
93
|
+
if (this.options.editable) {
|
94
|
+
result += `<a
|
95
|
+
href="javascript:void(0);"
|
96
|
+
data-index="${index}"
|
97
|
+
data-action="click->key-value#deleteRow"
|
98
|
+
title="${this.options.delete_text}"
|
99
|
+
data-tippy="tooltip"
|
100
|
+
data-button="delete-row"
|
101
|
+
tabindex="-1"
|
102
|
+
${this.options.disable_deleting_rows ? "disabled='disabled'" : ''}
|
103
|
+
class="flex items-center justify-center p-2 px-3 border-none ${this.options.disable_deleting_rows ? 'cursor-not-allowed' : ''}"
|
104
|
+
><svg class="pointer-events-none text-gray-500 h-5 hover:text-gray-500" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" stroke="currentColor"><path d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"></path></svg></a>`
|
105
|
+
}
|
106
|
+
result += '</div>'
|
107
|
+
|
108
|
+
return result
|
109
|
+
}
|
110
|
+
|
111
|
+
inputField(id = 'key', index, key, value) {
|
112
|
+
return `<input
|
113
|
+
class="${this.options.inputClasses} !rounded-none border-gray-600 border-r border-l-0 border-b-0 border-t-0 focus:border-gray-300 w-1/2 focus:outline-none outline-none key-value-input-${id}"
|
114
|
+
data-action="input->key-value#${id}FieldUpdated"
|
115
|
+
placeholder="${this.options[`${id}_label`]}"
|
116
|
+
data-index="${index}"
|
117
|
+
${this[`${id}InputDisabled`] ? "disabled='disabled'" : ''}
|
118
|
+
value="${id === 'key' ? key : value}"
|
119
|
+
/>`
|
120
|
+
}
|
121
|
+
|
122
|
+
setOptions() {
|
123
|
+
let fieldOptions
|
124
|
+
|
125
|
+
try {
|
126
|
+
fieldOptions = JSON.parse(this.controllerTarget.dataset.options)
|
127
|
+
} catch (error) {
|
128
|
+
fieldOptions = {}
|
129
|
+
}
|
130
|
+
this.options = {
|
131
|
+
...fieldOptions,
|
132
|
+
inputClasses: this.controllerTarget.dataset.inputClasses,
|
133
|
+
editable: castBoolean(this.controllerTarget.dataset.editable),
|
134
|
+
}
|
135
|
+
}
|
136
|
+
}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
import 'trix'
|
2
|
+
import { Controller } from 'stimulus'
|
3
|
+
import { castBoolean } from '@/js/helpers/cast_boolean'
|
4
|
+
|
5
|
+
export default class extends Controller {
|
6
|
+
static targets = ['editor', 'controller']
|
7
|
+
|
8
|
+
get resourceId() {
|
9
|
+
return this.controllerTarget.dataset.resourceId
|
10
|
+
}
|
11
|
+
|
12
|
+
get resourceName() {
|
13
|
+
return this.controllerTarget.dataset.resourceName
|
14
|
+
}
|
15
|
+
|
16
|
+
get attachmentKey() {
|
17
|
+
return this.controllerTarget.dataset.attachmentKey
|
18
|
+
}
|
19
|
+
|
20
|
+
get attachmentsDisabled() {
|
21
|
+
return castBoolean(this.controllerTarget.dataset.attachmentsDisabled)
|
22
|
+
}
|
23
|
+
|
24
|
+
get uploadUrl() {
|
25
|
+
return `${window.location.origin}${window.Avo.configuration.root_path}/avo_api/resources/${this.resourceName}/${this.resourceId}/attachments`
|
26
|
+
}
|
27
|
+
|
28
|
+
connect() {
|
29
|
+
if (this.attachmentsDisabled) {
|
30
|
+
// Remove the attachments button
|
31
|
+
this.controllerTarget.querySelector('.trix-button-group--file-tools').remove()
|
32
|
+
}
|
33
|
+
|
34
|
+
window.addEventListener('trix-file-accept', (event) => {
|
35
|
+
if (event.target === this.editorTarget) {
|
36
|
+
// Prevent file uploads for fields that have attachments disabled.
|
37
|
+
if (this.attachmentsDisabled) {
|
38
|
+
event.preventDefault()
|
39
|
+
window.toastr.warning('This field has attachments disabled.')
|
40
|
+
|
41
|
+
return
|
42
|
+
}
|
43
|
+
|
44
|
+
// Prevent file uploads for resources that haven't been saved yet.
|
45
|
+
if (this.resourceId === '') {
|
46
|
+
event.preventDefault()
|
47
|
+
window.toastr.warning("You can't upload files into the Trix editor until you save the resource.")
|
48
|
+
|
49
|
+
return
|
50
|
+
}
|
51
|
+
|
52
|
+
// Prevent file uploads for fields without an attachment key.
|
53
|
+
if (this.attachmentKey === '') {
|
54
|
+
event.preventDefault()
|
55
|
+
window.toastr.warning("You haven't set an <a href='https://google.com' class='!text-blue-700 underline'>attachment_key</a> to this Trix field.")
|
56
|
+
}
|
57
|
+
}
|
58
|
+
})
|
59
|
+
|
60
|
+
window.addEventListener('trix-attachment-add', (event) => {
|
61
|
+
if (event.target === this.editorTarget) {
|
62
|
+
if (event.attachment.file) {
|
63
|
+
this.uploadFileAttachment(event.attachment)
|
64
|
+
}
|
65
|
+
}
|
66
|
+
})
|
67
|
+
}
|
68
|
+
|
69
|
+
uploadFileAttachment(attachment) {
|
70
|
+
this.uploadFile(
|
71
|
+
attachment.file,
|
72
|
+
(progress) => attachment.setUploadProgress(progress),
|
73
|
+
(attributes) => attachment.setAttributes(attributes),
|
74
|
+
)
|
75
|
+
}
|
76
|
+
|
77
|
+
uploadFile(file, progressCallback, successCallback) {
|
78
|
+
const formData = this.createFormData(file)
|
79
|
+
const xhr = new XMLHttpRequest()
|
80
|
+
|
81
|
+
xhr.open('POST', this.uploadUrl, true)
|
82
|
+
|
83
|
+
xhr.setRequestHeader('X-CSRF-Token', document.querySelector('meta[name="csrf-token"]').content)
|
84
|
+
|
85
|
+
xhr.upload.addEventListener('progress', (event) => {
|
86
|
+
// eslint-disable-next-line no-mixed-operators
|
87
|
+
const progress = event.loaded / event.total * 100
|
88
|
+
progressCallback(progress)
|
89
|
+
})
|
90
|
+
|
91
|
+
xhr.addEventListener('load', () => {
|
92
|
+
if (xhr.status === 200) {
|
93
|
+
let response
|
94
|
+
try {
|
95
|
+
response = JSON.parse(xhr.response)
|
96
|
+
} catch (error) {
|
97
|
+
response = {}
|
98
|
+
}
|
99
|
+
|
100
|
+
const attributes = {
|
101
|
+
url: response.url,
|
102
|
+
href: response.href,
|
103
|
+
}
|
104
|
+
|
105
|
+
successCallback(attributes)
|
106
|
+
}
|
107
|
+
})
|
108
|
+
|
109
|
+
xhr.send(formData)
|
110
|
+
}
|
111
|
+
|
112
|
+
createFormData(file) {
|
113
|
+
const data = new FormData()
|
114
|
+
data.append('Content-Type', file.type)
|
115
|
+
data.append('file', file)
|
116
|
+
data.append('filename', file.name)
|
117
|
+
data.append('attachment_key', this.attachmentKey)
|
118
|
+
|
119
|
+
return data
|
120
|
+
}
|
121
|
+
}
|
@@ -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
|
+
}
|
@@ -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
|
|
@@ -1,3 +1,5 @@
|
|
1
1
|
<%= javascript_tag nonce: true do %>
|
2
|
-
|
2
|
+
window.Avo = window.Avo || { configuration: {} }
|
3
|
+
Avo.configuration.timezone = '<%= Avo.configuration.timezone %>'
|
4
|
+
Avo.configuration.root_path = '<%= Avo.configuration.root_path %>'
|
3
5
|
<% end %>
|
@@ -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>
|
@@ -19,15 +19,18 @@
|
|
19
19
|
<%= render partial: 'avo/sidebar/sidebar' %>
|
20
20
|
|
21
21
|
<div class="flex-1 flex flex-col h-full overflow-auto">
|
22
|
-
<div class="relative bg-white p-2 shadow-md h-16 w-full flex flex-shrink-0 items-center z-50" v-if="layout !== 'blank'">
|
23
|
-
<div
|
22
|
+
<div class="relative bg-white p-2 shadow-md h-16 w-full flex flex-shrink-0 items-center z-50 px-6" v-if="layout !== 'blank'">
|
23
|
+
<div>
|
24
24
|
<%= render partial: "avo/partials/header" %>
|
25
25
|
</div>
|
26
26
|
<div class="flex-1 flex justify-center">
|
27
|
-
<div class="w-64">
|
27
|
+
<div class="w-64 flex">
|
28
28
|
<%# <resources-search :global="true"> %>
|
29
29
|
</div>
|
30
30
|
</div>
|
31
|
+
<div class="align-end">
|
32
|
+
<%= render partial: "avo/partials/profile_dropdown" %>
|
33
|
+
</div>
|
31
34
|
</div>
|
32
35
|
|
33
36
|
<div class="content p-8 flex-1 flex flex-col justify-between items-stretch <%= @container_classes %>">
|
data/config/routes.rb
CHANGED
@@ -3,6 +3,10 @@ Avo::Engine.routes.draw do
|
|
3
3
|
|
4
4
|
get "resources", to: redirect("/avo")
|
5
5
|
|
6
|
+
scope "avo_api", as: "avo_api" do
|
7
|
+
post "/resources/:resource_name/:id/attachments/", to: "attachments#create"
|
8
|
+
end
|
9
|
+
|
6
10
|
scope "resources", as: "resources" do
|
7
11
|
# Attachments
|
8
12
|
get "/:resource_name/:id/active_storage_attachments/:attachment_name/:signed_attachment_id", to: "attachments#show"
|
data/config/webpacker.yml
CHANGED
@@ -35,8 +35,8 @@ development:
|
|
35
35
|
dev_server:
|
36
36
|
https: false
|
37
37
|
host: localhost
|
38
|
-
port:
|
39
|
-
public: localhost:
|
38
|
+
port: 7299
|
39
|
+
public: localhost:7299
|
40
40
|
# Inject browserside javascript that required by both HMR and Live(full) reload
|
41
41
|
inject_client: true
|
42
42
|
# Hot Module Replacement updates modules while the application is running without a full reload
|
data/db/factories.rb
CHANGED
@@ -13,6 +13,7 @@ FactoryBot.define do
|
|
13
13
|
name { Faker::Company.name }
|
14
14
|
description { Faker::Lorem.paragraph(sentence_count: 4) }
|
15
15
|
url { Faker::Internet.url }
|
16
|
+
color { Faker::Color.hex_color }
|
16
17
|
end
|
17
18
|
|
18
19
|
factory :post do
|
@@ -24,6 +25,7 @@ FactoryBot.define do
|
|
24
25
|
Time.now - rand(10...365).days
|
25
26
|
end
|
26
27
|
end
|
28
|
+
status { 0 }
|
27
29
|
end
|
28
30
|
|
29
31
|
factory :project do
|
@@ -36,5 +38,6 @@ FactoryBot.define do
|
|
36
38
|
users_required { Faker::Number.between(from: 10, to: 100) }
|
37
39
|
started_at { Time.now - rand(10...365).days }
|
38
40
|
meta { [{foo: "bar", hey: "hi"}, {bar: "baz"}, {hoho: "hohoho"}].sample }
|
41
|
+
progress { Faker::Number.between(from: 0, to: 100) }
|
39
42
|
end
|
40
43
|
end
|