Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
305ff0e
setup dev db with sql files
jmilljr24 Nov 12, 2025
b83c4d6
use db config
jmilljr24 Nov 12, 2025
57bbf42
Community News crud and tests (#339)
maebeale Nov 13, 2025
98280c0
DRAFT: Organization profile (#337)
maebeale Nov 13, 2025
fe009c3
Community News crud and tests (#341)
maebeale Nov 13, 2025
d97a8a4
Update dashboard with new objects (#340)
maebeale Nov 13, 2025
646512b
Add more details to projects (#344)
maebeale Nov 13, 2025
c679f58
Remove unused files (#343)
maebeale Nov 13, 2025
5f2e876
Update events index with text from website (#348)
maebeale Nov 13, 2025
a288ef2
Remove bootstrap-will-paginate (#351)
maebeale Nov 13, 2025
bd28bc4
Cleanup stories display (#353)
maebeale Nov 13, 2025
861bf6d
Make publicly-visible an admin-only field (#354)
maebeale Nov 13, 2025
8223d15
Add additional fields to project and rearrange form (#346)
maebeale Nov 13, 2025
5dc4de0
Update workshop dashboard display (#352)
maebeale Nov 13, 2025
05d38ce
Add event registration via turbo (#338)
jmilljr24 Nov 13, 2025
30f4b9c
Fixes to dashboard (#355)
maebeale Nov 14, 2025
65779b4
Fix resource bookmark (#364)
jmilljr24 Nov 14, 2025
f5ee0dc
Fix workshop show time display (#373)
maebeale Nov 14, 2025
8086ee6
Change inactive/not published text to 'Hidden' (#374)
maebeale Nov 14, 2025
0e9539b
Rearrange/adjust nav items (#377)
maebeale Nov 14, 2025
75bca22
Fix workshop edit dropdowns (#372)
jmilljr24 Nov 14, 2025
6119c53
Added Help menu to faqs float (#345)
diti0-dot Nov 14, 2025
5aac240
Dismiss controller (#378)
jmilljr24 Nov 14, 2025
5ee77c8
Apply user scope (#382)
maebeale Nov 15, 2025
cd73ad7
Allow admin CRUD of EventRegistrations (#381)
maebeale Nov 15, 2025
2768aae
Superuser OR author are only editors of workshop logs (#384)
maebeale Nov 15, 2025
b63b9aa
Delete admin-related files. Rename/move admin notification. (#385)
maebeale Nov 15, 2025
5071296
Add back in bootstrap-will_paginate gem bc it allows will_paginate cu…
maebeale Nov 15, 2025
1821865
Change calls to .count to .size for performance increase (#388)
maebeale Nov 15, 2025
2149208
Member since to facilitator since (#387)
maebeale Nov 15, 2025
9c8fa0f
Adjust constants (#390)
maebeale Nov 16, 2025
22da642
Add registration controller for events (#389)
jmilljr24 Nov 16, 2025
25eaa41
Make all new buttons have similar styling and admin wrapper when need…
maebeale Nov 16, 2025
011ab5f
Remove footer model (#395)
maebeale Nov 16, 2025
87951fc
Remove organization (#397)
maebeale Nov 16, 2025
40e0918
Remove Permission and UserPermission from code (leaving tables until …
maebeale Nov 16, 2025
2a6aea6
Workshop filter ux (#394)
jmilljr24 Nov 16, 2025
69e68af
Fix flaky project tests (#399)
jmilljr24 Nov 16, 2025
861d129
Remove annotation (#408)
maebeale Nov 16, 2025
7c20853
Remove workshop assn from MediaFile (#425)
maebeale Nov 17, 2025
2bff987
Change project_user position from dropdown to a string input (#426)
maebeale Nov 17, 2025
ee6599d
Move address data out of Organization and in to associated Address mo…
maebeale Nov 17, 2025
b6de0f2
Add custom TailwindPaginationRenderer (#428)
maebeale Nov 17, 2025
9aec350
Update windows type views (#429)
maebeale Nov 17, 2025
210d50c
Further scope workshop_log data to @project.workshop_logs (#407)
maebeale Nov 17, 2025
7d59e2d
Upgrade from beta to release of Rails 8.1 (#297)
johnpaulashenfelter Nov 17, 2025
76bf2ce
Remove impersonate user functionality (#430)
maebeale Nov 17, 2025
508f8e9
Remove liaison (#431)
maebeale Nov 17, 2025
6da1136
If a StoryIdea has been promoted to Story, change what's editable and…
maebeale Nov 18, 2025
050cd11
Changing to double quotes to avoid fighting w editors (#439)
maebeale Nov 18, 2025
18c03fc
Normalize WindowsType display to always use short_name (#441)
maebeale Nov 18, 2025
ff2bd82
Add featured to Story so we can intentionally put it on Dashboard (#442)
maebeale Nov 18, 2025
2a4a586
Add calendar links (#379)
diti0-dot Nov 19, 2025
afb23bd
Add website_url to Story to link back to public website (#443)
maebeale Nov 19, 2025
78ed47d
Stimulus carousel (#444)
jmilljr24 Nov 19, 2025
0ef12f9
Change pagination styling (#445)
maebeale Nov 19, 2025
d5fc710
Show featured as a badge on indexes (#446)
maebeale Nov 19, 2025
3d80525
Fix workshop filters (#447)
maebeale Nov 19, 2025
e27c34a
Update dashboard styling (#448)
maebeale Nov 19, 2025
ea06a52
Fix pagination deprecation (#449)
maebeale Nov 19, 2025
1f43791
Udpate events index styling (#456)
maebeale Nov 19, 2025
e6fa9e6
use bookmark icon partial (#455)
jmilljr24 Nov 19, 2025
d441f1e
add turbo flash to faq update (#454)
jmilljr24 Nov 19, 2025
5dabb45
pass object to partial - not decorator (#453)
jmilljr24 Nov 19, 2025
c7f5007
change workshop_id query (#458)
jmilljr24 Nov 20, 2025
f91c4c3
Fix more bookmarks to not use decorator (#459)
maebeale Nov 20, 2025
e2ff48b
Update UX (#460)
maebeale Nov 20, 2025
6f2171f
Convert resources to stories (#462)
maebeale Nov 20, 2025
6136eb4
Show all active orgs on workshop logs dropdown (#461)
maebeale Nov 20, 2025
f697a8b
Add digitalocean s3-compatible DO Spaces config (#301)
johnpaulashenfelter Nov 21, 2025
24e1652
Rename reference url to youtube url on workshop variation (#464)
maebeale Nov 22, 2025
3e66cd0
Change where new Sector association shows up on Organization form #42…
diti0-dot Nov 22, 2025
f7ed71a
Update storage migration task (#467)
jmilljr24 Nov 22, 2025
4e49b08
changing url config (#469)
jmilljr24 Nov 22, 2025
a5c3574
revert url options (#470)
jmilljr24 Nov 22, 2025
23fe648
set default host (#471)
jmilljr24 Nov 22, 2025
5a13fe8
add fallback for evn for build (#472)
jmilljr24 Nov 22, 2025
b99b1b8
Add icons nav #342 (#466)
diti0-dot Nov 23, 2025
24d2abc
Update Storage migration task for reports and ckeditor (#473)
jmilljr24 Nov 23, 2025
8d3691d
Change models to use assn instead of direct attachments (#476)
maebeale Nov 24, 2025
bca3e82
Update story idea form (#474)
maebeale Nov 24, 2025
793a15b
Add image migration audit page (#477)
maebeale Nov 24, 2025
c0c9eec
Update ckeditor urls to do (#479)
jmilljr24 Nov 25, 2025
5e7015c
add more url types (#483)
jmilljr24 Nov 26, 2025
9f69242
remove workshop formatted image method (#481)
jmilljr24 Nov 26, 2025
9d8343e
Update rich text links (#489)
jmilljr24 Nov 26, 2025
b6e79ac
Update recent activity methods (#491)
maebeale Nov 26, 2025
e89824c
Update quote crud (#493)
maebeale Nov 26, 2025
818bab7
Show quotes on workshop logs (#495)
maebeale Nov 26, 2025
71f25fb
Show attachments on resources form -- this is until prod data migrati…
maebeale Nov 26, 2025
1781452
Change pr template text (so gh will automatically close associated is…
maebeale Nov 26, 2025
48c1dee
Add helper for migration tasks (#498)
jmilljr24 Nov 26, 2025
f704639
add zip and word doc types (#499)
jmilljr24 Nov 26, 2025
f477002
Remove dupe models (already under images namespace) (#497)
maebeale Nov 27, 2025
6290035
Update audit controller to (1) include Attachment/Image/MediaFile and…
maebeale Nov 27, 2025
18f199e
[482] update workshop variation show view to use youtube_url (#484)
brodyf42 Nov 27, 2025
dcb901b
Remove old legacy migration code (#500)
maebeale Nov 27, 2025
de68c20
Add category type (#501)
maebeale Nov 27, 2025
1ab535e
Update workshop show (#502)
maebeale Nov 27, 2025
4f7dca9
Widen dropdowns and add some whitespace-nowrap (#503)
maebeale Nov 27, 2025
4812b00
Update for activities (#504)
maebeale Nov 27, 2025
5529038
Add includes to dashboard collections (#505)
maebeale Nov 27, 2025
d1d70f2
Fix workshops index and references to metadata/metadatum (#506)
maebeale Nov 27, 2025
886e912
Fix workshops index and references to metadata/metadatum (#509)
maebeale Nov 27, 2025
a00e7e2
Remove age range references (#510)
maebeale Nov 27, 2025
5dd6fca
Remove hard-coded references for WindowsType (#511)
maebeale Nov 27, 2025
a692abf
Put more params on New WorkshopLog button (#512)
maebeale Nov 27, 2025
d01a039
Decorate quotes before showing them on workshop_log show (#513)
maebeale Nov 27, 2025
6141617
Remove 'anchor' methods bc they're not being used on workshop show an…
maebeale Nov 27, 2025
16c5284
WindowsType CRUD with tests (#515)
maebeale Nov 27, 2025
1b35904
Bump actions/checkout from 5 to 6 (#478)
dependabot[bot] Nov 27, 2025
065e15c
Show title or position for project_users (#527)
maebeale Nov 28, 2025
8e99217
Merge branch 'main' into fresh-setup-with-sql-data
jmilljr24 Nov 28, 2025
d3cf2d1
use find_or_create_by
jmilljr24 Nov 28, 2025
bb5ff87
Merge branch 'main' into fresh-setup-with-sql-data
jmilljr24 Jan 1, 2026
83fb1a6
Merge branch 'main' into fresh-setup-with-sql-data
jmilljr24 Jan 23, 2026
ba9450e
remove sql load
jmilljr24 Jan 23, 2026
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
70 changes: 58 additions & 12 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,75 @@ def system!(*args)
system(*args, exception: true)
end

# def run_sql_file(path)
# puts "== Running SQL file: #{path} =="
#
# config = ActiveRecord::Base.connection_db_config.configuration_hash
#
# command = [
# db_client,
# "-h", config[:host] || "127.0.0.1",
# "-P", (config[:port] || 3306).to_s,
# "-u", config[:username] || "root",
# "-D", config[:database]
# ].join(" ")
#
# command << " -p#{config[:password]}" if config[:password]
#
# # Use shell input redirection
# system!("#{command} < #{path}")
# puts "✓ Successfully executed #{path}"
# rescue => e
# puts "Warning: failed to run #{path}: #{e.message}"
# end

# Choose mariadb or mysql client
def db_client
if system("command -v mariadb > /dev/null", out: File::NULL)
"mariadb"
elsif system("command -v mysql > /dev/null", out: File::NULL)
"mysql"
else
raise "No MySQL/MariaDB client found on PATH. Install mariadb-clients or mysql-client."
end
end

# ------------------------------------------------------------------------------
# Main setup sequence
# ------------------------------------------------------------------------------
FileUtils.chdir APP_ROOT do
# This script is a way to set up or update your development environment automatically.
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.
require_relative "../config/environment"

puts "== Installing dependencies =="
system("bundle check") || system!("bundle install")

# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end
if File.exist?("package.json")
puts "\n== Installing npm packages =="
system!("npm install")
end

puts "\n== Preparing database =="
system! "bin/rails db:prepare"
system! "bin/rails db:reset" if ARGV.include?("--reset")
system! "bin/rails db:drop"
system! "bin/rails db:create"

# puts "\n== Running SQL files in db/init =="
# Dir["db/init/*.sql"].sort.each { |file| run_sql_file(file) }

puts "\n== Running Rails migrations and seeds =="
system! "bin/rails db:migrate"
system! "bin/rails db:seed"

puts "\n== Preparing test database =="
system! "RAILS_ENV=test bin/rails db:drop"
system! "RAILS_ENV=test bin/rails db:create"
system! "RAILS_ENV=test bin/rails db:migrate"

puts "\n== Removing old logs and tempfiles =="
puts "\n== Cleaning logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"

unless ARGV.include?("--skip-server")
puts "\n== Starting development server =="
STDOUT.flush # flush the output before exec(2) so that it displays
exec "bin/dev"
STDOUT.flush
exec "mise server"
end
end
1 change: 0 additions & 1 deletion db/init/04_create_test_db.sql

This file was deleted.

37 changes: 26 additions & 11 deletions db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
puts "Creating Users…"
admin = User.where(first_name: "Umberto", last_name: "User",
email: "umberto.user@example.com",
super_user: true)
.first_or_create!(password: "password")
nonadmin = User.where(first_name: "Amy", last_name: "User",
email: "amy.user@example.com",
super_user: false)
.first_or_create!(password: "password")
User.where(first_name: "Orphaned Reports", last_name: "User",
email: "orphaned_reports@awbw.org").first_or_create!(password: "password")
user_password = Devise::Encryptor.digest(User, 'password')

# Admin
User.find_or_create_by!(email: "umberto.user@example.com") do |user|
user.first_name = "Umberto"
user.last_name = "User"
user.password = "password"
user.super_user = true
end

# Non-Admin
User.find_or_create_by!(email: "amy.user@example.com") do |user|
user.first_name = "Amy"
user.last_name = "User"
user.password = "password"
user.super_user = false
end

# Orphaned
User.find_or_create_by!(email: "orphaned_reports@awbw.org") do |user|
user.first_name = "Orphaned Reports"
user.last_name = "User"
user.password = "password"
user.super_user = false
end

user_password = Devise::Encryptor.digest(User, "password")
User.in_batches do |batch|
batch.update_all(encrypted_password: user_password)
end
Expand Down