Skip to content

Commit

Permalink
Merge branch 'avo-hq:main' into feature/confirmation-message-before-save
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Simpson authored Jul 11, 2024
2 parents 80d3266 + 77c4000 commit 3b5fa08
Show file tree
Hide file tree
Showing 34 changed files with 236 additions and 102 deletions.
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ end

gem "zeitwerk"

gem "httparty"

gem "iso"

gem "active_link_to"
Expand Down
8 changes: 0 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ PATH
activesupport (>= 6.1)
addressable
docile
httparty
inline_svg
literal (~> 0.2)
meta-tags
Expand Down Expand Up @@ -333,10 +332,6 @@ GEM
listen (>= 3.0.0)
railties (>= 6.0.0)
htmlbeautifier (1.4.3)
httparty (0.22.0)
csv
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
i18n-tasks (1.0.14)
Expand Down Expand Up @@ -409,8 +404,6 @@ GEM
money (~> 6.13)
railties (>= 3.0)
msgpack (1.7.2)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
net-imap (0.4.14)
date
net-protocol
Expand Down Expand Up @@ -696,7 +689,6 @@ DEPENDENCIES
hightop
hotwire-livereload (~> 1.3.0)
htmlbeautifier
httparty
i18n-tasks (~> 1.0.12)
image_processing (~> 1.12)
iso
Expand Down
53 changes: 38 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,49 @@
[![Gem Version](https://badge.fury.io/rb/avo.svg)](https://badge.fury.io/rb/avo)
![Tests](https://github.com/avo-hq/avo/workflows/Tests/badge.svg)
![reviewdog](https://github.com/avo-hq/avo/workflows/reviewdog/badge.svg)
[![System Tests](https://github.com/avo-hq/avo/actions/workflows/system-tests.yml/badge.svg)](https://github.com/avo-hq/avo/actions/workflows/system-tests.yml)
[![Feature Tests](https://github.com/avo-hq/avo/actions/workflows/feature-tests.yml/badge.svg)](https://github.com/avo-hq/avo/actions/workflows/feature-tests.yml)
[![Lint](https://github.com/avo-hq/avo/actions/workflows/lint.yml/badge.svg)](https://github.com/avo-hq/avo/actions/workflows/lint.yml)
<a href="https://github.com/avo-hq/avo/discussions" target="_blank">
<img alt="GitHub Discussions" src="https://img.shields.io/github/discussions/avo-hq/avo?color=168AFE&logo=github">
</a>
<a href="https://github.com/avo-hq/avo/issues" target="_blank">
<img alt="GitHub Issues or Pull Requests" src="https://img.shields.io/github/issues-closed/avo-hq/avo?style=flat&link=https%3A%2F%2Fgithub.com%2Favo-hq%2Favo%2Fissues&logo=github">
</a>
<a href="https://rubygems.org/gems/avo">
<img alt="GEM Downloads" src="https://img.shields.io/gem/dt/avo?color=168AFE&logo=ruby&logoColor=FE1616">
</a>
<a href="https://github.com/testdouble/standard">
<img alt="Ruby Style" src="https://img.shields.io/badge/style-standard-168AFE?logo=ruby&logoColor=FE1616" />
</a>
<a href="https://discord.com/invite/vuuwFe4Km3">
<img alt="Avo Rails Admin Discord Community" src="https://img.shields.io/discord/740892036978442260?color=8892F6&label=discord&logo=discord&logoColor=8892F6">
</a>
[![codecov](https://codecov.io/gh/avo-hq/avo/branch/master/graph/badge.svg?token=Q2LMFE4989)](https://codecov.io/gh/avo-hq/avo)
[![Maintainability](https://api.codeclimate.com/v1/badges/676a0afa2cc79f03aa29/maintainability)](https://codeclimate.com/github/avo-hq/avo/maintainability)
[![Open Source Helpers](https://www.codetriage.com/avo-hq/avo/badges/users.svg)](https://www.codetriage.com/avo-hq/avo)

![](./public/avo-assets/logo-on-white.png)

**Ruby on Rails application building framework.**
**<a href="https://avohq.io" title="Ruby on Rails Admin Panel Framework">Avo - Ruby on Rails Admin Panel Framework</a>**

Avo is a beautiful next-generation framework that empowers you, the developer, to create fantastic admin panels for your Ruby on Rails apps with the flexibility to fit your needs as you grow.
Avo is a very custom Admin Panel Framework, Content Management System, and Internal Tool Builder for Ruby on Rails that saves engineers and teams **months of development time**.

## Get started

⚡️ **Install**: [docs.avohq.io/3.0/installation](https://docs.avohq.io/3.0/installation.html)\
**Website**: [avohq.io](https://avohq.io)\
📚 **Documentation**: [docs.avohq.io](https://docs.avohq.io)\
🗺 **Roadmap**: [GitHub Roadmap](https://github.com/orgs/avo-hq/projects/8)\
🎸 **Demo app**: [Avodemo](https://main.avodemo.com/)\
🐤 **Twitter**: [avo_hq](https://twitter.com/avo_hq)\
💬 **Community chat**: [discord](https://discord.gg/pkTF6y8)\
🔧 **Issue tracker**: [GitHub issues](http://github.com/avo-hq/avo/issues)\
⚡️ **Install**: [docs.avohq.io/3.0/installation](https://docs.avohq.io/3.0/installation.html)
<br>
**Website**: [avohq.io](https://avohq.io)
<br>
📚 **Documentation**: [docs.avohq.io](https://docs.avohq.io)
<br>
🗺 **Roadmap**: [GitHub Roadmap](https://github.com/orgs/avo-hq/projects/14)
<br>
🎸 **Demo app**: [Avodemo](https://main.avodemo.com/)
<br>
🐤 **Twitter**: [avo_hq](https://twitter.com/avo_hq)
<br>
💬 **Community chat**: [discord](https://discord.gg/pkTF6y8)
<br>
🔧 **Issue tracker**: [GitHub issues](http://github.com/avo-hq/avo/issues)
<br>
🎙 **Discussions and feature requests**: [GitHub issues](http://github.com/avo-hq/avo/discussions)

## Features
Expand Down Expand Up @@ -50,9 +73,9 @@ Avo is a beautiful next-generation framework that empowers you, the developer, t

## Some of the things we're going to focus on next

Theming ⭐️ &nbsp;notifications ⭐️ &nbsp;Resource segmentation ⭐️ &nbsp;filterable fields ⭐️ &nbsp;inline editing ⭐️ &nbsp;multilingual records ⭐️ &nbsp;keyboard shortcuts ⭐️ &nbsp;track resource changes ⭐️ &nbsp;smart resource generation ⭐️ &nbsp;live resources ⭐️ &nbsp;columns view ⭐️ &nbsp;list view ⭐️ &nbsp;custom action items ⭐️ &nbsp;command bar ⭐️ &nbsp; use fields DSL in your custom views
Theming ⭐️ &nbsp;notifications ⭐️ &nbsp;Resource segmentation ⭐️ &nbsp;inline editing ⭐️ &nbsp;multilingual records ⭐️ &nbsp;keyboard shortcuts ⭐️ &nbsp;track resource changes ⭐️ &nbsp;live resources ⭐️ &nbsp;columns view ⭐️ &nbsp;list view ⭐️ &nbsp;custom action items ⭐️ &nbsp;command bar

For more up-to-date info check out our 🗺 [Roadmap](https://github.com/orgs/avo-hq/projects/8).
For more up-to-date info check out our 🗺 [Roadmap](https://github.com/orgs/avo-hq/projects/14).

# Installation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% if file.present? %>
<div class="flex flex-col h-full">
<% if file.representable? && is_image? %>
<%= image_tag helpers.main_app.url_for(file), class: "rounded-lg max-w-full self-start #{@extra_classes}" %>
<%= image_tag helpers.main_app.url_for(file), class: "rounded-lg max-w-full self-start #{@extra_classes}", loading: :lazy, width: file.metadata["width"], height: file.metadata["height"] %>
<% elsif is_audio? %>
<%= audio_tag(helpers.main_app.url_for(file), controls: true, preload: false, class: 'w-full') %>
<% elsif is_video? %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<%= sanitize @field.value.to_s %>
<% end %>
<%= @form.text_area @field.id,
value: @field.value,
value: @field.value.try(:to_trix_html) || @field.value,
class: classes("w-full hidden"),
data: @field.get_html(:data, view: view, element: :input),
disabled: disabled?,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="absolute bg-gray-50 w-full h-full">
<%= image_tag Avo.configuration.branding.placeholder, class: 'relative transform -translate-x-1/2 -translate-y-1/2 h-20 text-gray-400 inset-auto top-1/2 left-1/2' %>
<%= image_tag Avo.configuration.branding.placeholder, class: "relative transform -translate-x-1/2 -translate-y-1/2 h-20 text-gray-400 inset-auto top-1/2 left-1/2", loading: :lazy %>
</div>
2 changes: 1 addition & 1 deletion app/components/avo/index/grid_item_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def render_cover
def link_to_cover
classes = "absolute h-full w-full object-cover"

link_to image_tag(@card[:cover_url], class: classes), resource_view_path, class: classes, title: @card[:title]
link_to image_tag(@card[:cover_url], class: classes), resource_view_path, class: classes, title: @card[:title], loading: :lazy, width: "640", height: "480"
end

def render_title
Expand Down
8 changes: 6 additions & 2 deletions app/components/avo/index/resource_map_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,18 @@ def resource_location_markers
# If we have no proc and no default location method, don't try to create markers
return [] unless resource_mappable?

resources
records_markers = resources
.map do |resource|
Avo::ExecutionContext.new(target: marker_proc, record: resource.record).handle
end
.compact
.filter do |coordinates|
coordinates[:latitude].present? && coordinates[:longitude].present?
end

return records_markers if map_options[:extra_markers].nil?

records_markers + Avo::ExecutionContext.new(target: map_options[:extra_markers]).handle
end

def resource_mapkick_options
Expand Down Expand Up @@ -102,7 +106,7 @@ def marker_proc
end

def resource_mappable?
map_options[:record_marker].present? || @resources.first.record.respond_to?(:coordinates)
map_options[:record_marker].present? || map_options[:extra_markers].present? || @resources.first.record.respond_to?(:coordinates)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/avo/debug_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def send_to_hq
body = params[:body]
body = {license_key: license_key, body: body, payload: Avo::Services::DebugService.debug_report(request).to_json}.to_json

HTTParty.post url, body: body, headers: {"Content-Type": "application/json"}, timeout: timeout
Avo::Licensing::Request.post url, body:, timeout:

render turbo_stream: turbo_stream.replace(:send_to_hq, plain: "Payload sent to Avo HQ.")
end
Expand Down
13 changes: 12 additions & 1 deletion app/controllers/avo/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def search_resource(resource)
results_count = query.reselect(resource.model_class.primary_key).count

# Get the results
query = query.limit(Avo.configuration.search_results_count)
query = query.limit(search_results_count(resource))

results = apply_search_metadata(query, resource)

Expand Down Expand Up @@ -201,5 +201,16 @@ def render_search_error(error)
}
}, status: 500
end

def search_results_count(resource)
if resource.search_results_count
Avo::ExecutionContext.new(
target: resource.search_results_count,
params: params
).handle
else
Avo.configuration.search_results_count
end
end
end
end
1 change: 0 additions & 1 deletion avo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ Gem::Specification.new do |spec|
spec.add_dependency "actionview", ">= 6.1"
spec.add_dependency "pagy", ">= 7.0.0"
spec.add_dependency "zeitwerk", ">= 2.6.12"
spec.add_dependency "httparty"
spec.add_dependency "active_link_to"
spec.add_dependency "view_component", ">= 3.7.0"
spec.add_dependency "turbo-rails", ">= 2.0.0"
Expand Down
1 change: 0 additions & 1 deletion gemfiles/rails_6.1_ruby_3.1.4.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "devise"
gem "awesome_print"
gem "zeitwerk"
gem "httparty"
gem "iso"
gem "active_link_to"
gem "addressable"
Expand Down
8 changes: 0 additions & 8 deletions gemfiles/rails_6.1_ruby_3.1.4.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ PATH
activesupport (>= 6.1)
addressable
docile
httparty
inline_svg
literal (~> 0.2)
meta-tags
Expand Down Expand Up @@ -256,10 +255,6 @@ GEM
listen (>= 3.0.0)
railties (>= 6.0.0)
htmlbeautifier (1.4.3)
httparty (0.22.0)
csv
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
i18n-tasks (1.0.14)
Expand Down Expand Up @@ -327,8 +322,6 @@ GEM
money (~> 6.13)
railties (>= 3.0)
msgpack (1.7.2)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
net-imap (0.4.14)
date
net-protocol
Expand Down Expand Up @@ -625,7 +618,6 @@ DEPENDENCIES
hightop
hotwire-livereload (~> 1.3.0)
htmlbeautifier
httparty
i18n-tasks (~> 1.0.12)
image_processing (~> 1.12)
iso
Expand Down
1 change: 0 additions & 1 deletion gemfiles/rails_6.1_ruby_3.3.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "devise"
gem "awesome_print"
gem "zeitwerk"
gem "httparty"
gem "iso"
gem "active_link_to"
gem "addressable"
Expand Down
8 changes: 0 additions & 8 deletions gemfiles/rails_6.1_ruby_3.3.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ PATH
activesupport (>= 6.1)
addressable
docile
httparty
inline_svg
literal (~> 0.2)
meta-tags
Expand Down Expand Up @@ -256,10 +255,6 @@ GEM
listen (>= 3.0.0)
railties (>= 6.0.0)
htmlbeautifier (1.4.3)
httparty (0.22.0)
csv
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
i18n-tasks (1.0.14)
Expand Down Expand Up @@ -327,8 +322,6 @@ GEM
money (~> 6.13)
railties (>= 3.0)
msgpack (1.7.2)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
net-imap (0.4.14)
date
net-protocol
Expand Down Expand Up @@ -625,7 +618,6 @@ DEPENDENCIES
hightop
hotwire-livereload (~> 1.3.0)
htmlbeautifier
httparty
i18n-tasks (~> 1.0.12)
image_processing (~> 1.12)
iso
Expand Down
1 change: 0 additions & 1 deletion gemfiles/rails_7.1_ruby_3.1.4.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "devise"
gem "awesome_print"
gem "zeitwerk"
gem "httparty"
gem "iso"
gem "active_link_to"
gem "addressable"
Expand Down
8 changes: 0 additions & 8 deletions gemfiles/rails_7.1_ruby_3.1.4.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ PATH
activesupport (>= 6.1)
addressable
docile
httparty
inline_svg
literal (~> 0.2)
meta-tags
Expand Down Expand Up @@ -273,10 +272,6 @@ GEM
listen (>= 3.0.0)
railties (>= 6.0.0)
htmlbeautifier (1.4.3)
httparty (0.22.0)
csv
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
i18n-tasks (1.0.14)
Expand Down Expand Up @@ -348,8 +343,6 @@ GEM
money (~> 6.13)
railties (>= 3.0)
msgpack (1.7.2)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
mutex_m (0.2.0)
net-imap (0.4.14)
date
Expand Down Expand Up @@ -656,7 +649,6 @@ DEPENDENCIES
hightop
hotwire-livereload (~> 1.3.0)
htmlbeautifier
httparty
i18n-tasks (~> 1.0.12)
image_processing (~> 1.12)
iso
Expand Down
1 change: 0 additions & 1 deletion gemfiles/rails_7.1_ruby_3.3.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "devise"
gem "awesome_print"
gem "zeitwerk"
gem "httparty"
gem "iso"
gem "active_link_to"
gem "addressable"
Expand Down
8 changes: 0 additions & 8 deletions gemfiles/rails_7.1_ruby_3.3.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ PATH
activesupport (>= 6.1)
addressable
docile
httparty
inline_svg
literal (~> 0.2)
meta-tags
Expand Down Expand Up @@ -273,10 +272,6 @@ GEM
listen (>= 3.0.0)
railties (>= 6.0.0)
htmlbeautifier (1.4.3)
httparty (0.22.0)
csv
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
i18n-tasks (1.0.14)
Expand Down Expand Up @@ -348,8 +343,6 @@ GEM
money (~> 6.13)
railties (>= 3.0)
msgpack (1.7.2)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
mutex_m (0.2.0)
net-imap (0.4.14)
date
Expand Down Expand Up @@ -656,7 +649,6 @@ DEPENDENCIES
hightop
hotwire-livereload (~> 1.3.0)
htmlbeautifier
httparty
i18n-tasks (~> 1.0.12)
image_processing (~> 1.12)
iso
Expand Down
Loading

0 comments on commit 3b5fa08

Please sign in to comment.