Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
598 changes: 598 additions & 0 deletions .forestadmin-schema.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -27,7 +27,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -67,7 +67,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libjemalloc2 libvips sqlite3

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.6
3.3.8
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem "sprockets-rails"
# Use sqlite3 as the database for Active Record
#gem "sqlite3", ">= 1.4"

Check failure on line 8 in Gemfile

View workflow job for this annotation

GitHub Actions / lint

Layout/LeadingCommentSpace: Missing space after `#`.
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", ">= 5.0"
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
Expand All @@ -26,8 +26,14 @@
# gem "bcrypt", "~> 3.1.7"

gem "pg"
gem 'dotenv'

Check failure on line 29 in Gemfile

View workflow job for this annotation

GitHub Actions / lint

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

gem "forest_admin_rails"
gem "forest_admin_agent"
gem "forest_admin_datasource_toolkit"
gem "forest_admin_datasource_active_record"
gem "forest_admin_datasource_customizer"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ windows jruby ]

Expand Down
135 changes: 135 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,13 @@ GEM
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
aes_key_wrap (1.1.0)
ast (2.4.3)
attr_required (1.0.2)
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.3.1)
bindata (2.5.1)
bindex (0.8.1)
bootsnap (1.18.6)
msgpack (~> 1.2)
Expand All @@ -100,21 +103,93 @@ GEM
debug (1.11.0)
irb (~> 1.10)
reline (>= 0.3.8)
deepsort (0.4.5)
domain_name (0.6.20240107)
dotenv (3.1.8)
drb (2.2.3)
dry-configurable (1.3.0)
dry-core (~> 1.1)
zeitwerk (~> 2.6)
dry-container (0.11.0)
concurrent-ruby (~> 1.0)
dry-core (1.1.0)
concurrent-ruby (~> 1.0)
logger
zeitwerk (~> 2.6)
email_validator (2.2.4)
activemodel
erb (5.1.1)
erubi (1.13.1)
faker (3.5.2)
i18n (>= 1.8.11, < 2)
faraday (2.14.0)
faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-follow_redirects (0.4.0)
faraday (>= 1, < 3)
faraday-net_http (3.4.1)
net-http (>= 0.5.0)
ffi (1.17.2-aarch64-linux-gnu)
ffi (1.17.2-aarch64-linux-musl)
ffi (1.17.2-arm-linux-gnu)
ffi (1.17.2-arm-linux-musl)
ffi (1.17.2-arm64-darwin)
ffi (1.17.2-x86_64-darwin)
ffi (1.17.2-x86_64-linux-gnu)
ffi (1.17.2-x86_64-linux-musl)
ffi-compiler (1.3.2)
ffi (>= 1.15.5)
rake
filecache (1.0.3)
forest_admin_agent (1.8.1)
activesupport (>= 6.1)
deepsort (~> 0.4.5)
dry-container (~> 0.11)
faraday (~> 2.7)
filecache (~> 1.0)
ipaddress (~> 0.8.3)
jsonapi-serializers (~> 1.0)
jwt (~> 2.7)
ld-eventsource (~> 2.2)
mono_logger (~> 1.1)
openid_connect (~> 2.2)
rack-cors (~> 2.0)
rake (~> 13.0)
zeitwerk (~> 2.3)
forest_admin_datasource_active_record (1.8.1)
activerecord (>= 6.1)
activesupport (>= 6.1)
zeitwerk (~> 2.3)
forest_admin_datasource_customizer (1.8.1)
activesupport (>= 6.1)
marcel (~> 1.0, >= 1.0.4)
zeitwerk (~> 2.3)
forest_admin_datasource_toolkit (1.8.1)
activesupport (>= 6.1)
zeitwerk (~> 2.3)
forest_admin_rails (1.8.1)
dry-configurable (~> 1.1)
rails (>= 6.1)
zeitwerk (~> 2.3)
globalid (1.3.0)
activesupport (>= 6.1)
http (5.3.1)
addressable (~> 2.8)
http-cookie (~> 1.0)
http-form_data (~> 2.2)
llhttp-ffi (~> 0.5.0)
http-cookie (1.1.0)
domain_name (~> 0.5)
http-form_data (2.3.0)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
importmap-rails (2.2.2)
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
railties (>= 6.0.0)
io-console (0.8.1)
ipaddress (0.8.3)
irb (1.15.2)
pp (>= 0.6.0)
rdoc (>= 4.0.0)
Expand All @@ -123,8 +198,25 @@ GEM
actionview (>= 7.0.0)
activesupport (>= 7.0.0)
json (2.13.2)
json-jwt (1.17.0)
activesupport (>= 4.2)
aes_key_wrap
base64
bindata
faraday (~> 2.0)
faraday-follow_redirects
jsonapi-serializers (1.0.1)
activesupport
jwt (2.10.2)
base64
language_server-protocol (3.17.0.5)
ld-eventsource (2.3.0)
concurrent-ruby (~> 1.0)
http (>= 4.4.1, < 6.0.0)
lint_roller (1.1.0)
llhttp-ffi (0.5.1)
ffi-compiler (~> 1.0)
rake (~> 13.0)
logger (1.7.0)
loofah (2.24.1)
crass (~> 1.0.2)
Expand All @@ -138,7 +230,10 @@ GEM
matrix (0.4.3)
mini_mime (1.1.5)
minitest (5.26.0)
mono_logger (1.1.2)
msgpack (1.8.0)
net-http (0.6.0)
uri
net-imap (0.5.12)
date
net-protocol
Expand All @@ -165,6 +260,19 @@ GEM
racc (~> 1.4)
nokogiri (1.18.10-x86_64-linux-musl)
racc (~> 1.4)
openid_connect (2.3.1)
activemodel
attr_required (>= 1.0.0)
email_validator
faraday (~> 2.0)
faraday-follow_redirects
json-jwt (>= 1.16)
mail
rack-oauth2 (~> 2.2)
swd (~> 2.0)
tzinfo
validate_url
webfinger (~> 2.0)
parallel (1.27.0)
parser (3.3.9.0)
ast (~> 2.4.1)
Expand All @@ -188,6 +296,15 @@ GEM
nio4r (~> 2.0)
racc (1.8.1)
rack (3.1.18)
rack-cors (2.0.2)
rack (>= 2.0.0)
rack-oauth2 (2.2.1)
activesupport
attr_required
faraday (~> 2.0)
faraday-follow_redirects
json-jwt (>= 1.11.0)
rack (>= 2.1.0)
rack-session (2.1.1)
base64 (>= 0.1.0)
rack (>= 3.0.0)
Expand Down Expand Up @@ -284,6 +401,11 @@ GEM
stimulus-rails (1.3.4)
railties (>= 6.0.0)
stringio (3.1.7)
swd (2.0.3)
activesupport (>= 3)
attr_required (>= 0.0.5)
faraday (~> 2.0)
faraday-follow_redirects
thor (1.4.0)
timeout (0.4.3)
tsort (0.2.0)
Expand All @@ -295,12 +417,20 @@ GEM
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.1.0)
uri (1.0.4)
useragent (0.16.11)
validate_url (1.0.15)
activemodel (>= 3.0.0)
public_suffix
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webfinger (2.1.3)
activesupport
faraday (~> 2.0)
faraday-follow_redirects
websocket (1.2.11)
websocket-driver (0.8.0)
base64
Expand Down Expand Up @@ -329,6 +459,11 @@ DEPENDENCIES
debug
dotenv
faker
forest_admin_agent
forest_admin_datasource_active_record
forest_admin_datasource_customizer
forest_admin_datasource_toolkit
forest_admin_rails
importmap-rails
jbuilder
pg
Expand Down
16 changes: 16 additions & 0 deletions app/lib/forest_admin_rails/create_agent.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module ForestAdminRails
class CreateAgent
def self.setup!
database_configuration = Rails.configuration.database_configuration
datasource = ForestAdminDatasourceActiveRecord::Datasource.new(database_configuration[Rails.env])

@create_agent = ForestAdminAgent::Builder::AgentFactory.instance.add_datasource(datasource)
customize
@create_agent.build
end

def self.customize
# @create_agent.add_datasource....
end
end
end
4 changes: 4 additions & 0 deletions config/initializers/forest_admin_rails.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ForestAdminRails.configure do |config|
config.auth_secret = 'ef75546b3795e38106ecaa9dc0d8e56240f9c093'

Check failure on line 2 in config/initializers/forest_admin_rails.rb

View workflow job for this annotation

GitHub Actions / lint

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
config.env_secret = '27abe7946a84c48acc3387f53d020fe5adedaec2b654a84b04a7593a92d25106'

Check failure on line 3 in config/initializers/forest_admin_rails.rb

View workflow job for this annotation

GitHub Actions / lint

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
end
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Rails.application.routes.draw do
mount ForestAdminRails::Engine => "#{ForestAdminRails.config[:prefix]}"
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
Expand Down
Loading
Loading