Skip to content

Commit 6042b76

Browse files
app-rails: Update template-application-rails to version 0.4.0.post9.dev0+6dbe98a
1 parent 03b4ece commit 6042b76

File tree

11 files changed

+122
-6
lines changed

11 files changed

+122
-6
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: v0.4.0-8-g85a45e2
2+
_commit: v0.4.0-9-g6dbe98a
33
_src_path: https://github.com/navapbc/template-application-rails
44
app_local_port: 3100
55
app_name: app-rails

app-rails/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ gem "faraday"
7171
# Create fake data (outside of dev/test block to support seeding lower environments)
7272
gem "faker", "~> 3.2"
7373

74+
gem "lookbook", ">= 2.3.9"
75+
7476
group :development, :test do
7577
gem "guard-rspec", require: false
7678

@@ -83,6 +85,10 @@ group :development, :test do
8385
# Testing framework
8486
gem "factory_bot_rails"
8587
gem "rspec-rails", "~> 6.1.0"
88+
89+
# Required by Lookbook
90+
gem "listen"
91+
gem "actioncable"
8692
end
8793

8894
group :development do

app-rails/Gemfile.lock

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ GEM
132132
concurrent-ruby (1.3.5)
133133
connection_pool (2.5.0)
134134
crass (1.0.6)
135+
css_parser (1.21.1)
136+
addressable
135137
cssbundling-rails (1.4.1)
136138
railties (>= 6.0.0)
137139
date (3.4.1)
@@ -191,6 +193,8 @@ GEM
191193
guard (~> 2.1)
192194
guard-compat (~> 1.1)
193195
rspec (>= 2.99.0, < 4.0)
196+
htmlbeautifier (1.4.3)
197+
htmlentities (4.3.4)
194198
i18n (1.14.7)
195199
concurrent-ruby (~> 1.0)
196200
importmap-rails (2.1.0)
@@ -224,6 +228,18 @@ GEM
224228
loofah (2.24.0)
225229
crass (~> 1.0.2)
226230
nokogiri (>= 1.12.0)
231+
lookbook (2.3.9)
232+
activemodel
233+
css_parser
234+
htmlbeautifier (~> 1.3)
235+
htmlentities (~> 4.3.4)
236+
marcel (~> 1.0)
237+
railties (>= 5.0)
238+
redcarpet (~> 3.5)
239+
rouge (>= 3.26, < 5.0)
240+
view_component (>= 2.0)
241+
yard (~> 0.9)
242+
zeitwerk (~> 2.5)
227243
lumberjack (1.2.10)
228244
mail (2.8.1)
229245
mini_mime (>= 0.1.1)
@@ -351,13 +367,15 @@ GEM
351367
ffi (~> 1.0)
352368
rdoc (6.12.0)
353369
psych (>= 4.0.0)
370+
redcarpet (3.6.1)
354371
regexp_parser (2.10.0)
355372
reline (0.6.0)
356373
io-console (~> 0.5)
357374
responders (3.1.1)
358375
actionpack (>= 5.2)
359376
railties (>= 5.2)
360377
rexml (3.4.1)
378+
rouge (4.5.2)
361379
route_translator (14.2.0)
362380
actionpack (>= 6.1)
363381
activesupport (>= 6.1)
@@ -456,6 +474,10 @@ GEM
456474
unicode-emoji (4.0.4)
457475
uri (1.0.3)
458476
useragent (0.16.11)
477+
view_component (3.21.0)
478+
activesupport (>= 5.2.0, < 8.1)
479+
concurrent-ruby (~> 1.0)
480+
method_source (~> 1.0)
459481
warden (1.2.9)
460482
rack (>= 2.0.9)
461483
web-console (4.2.1)
@@ -470,6 +492,7 @@ GEM
470492
websocket-extensions (0.1.5)
471493
xpath (3.2.0)
472494
nokogiri (~> 1.8)
495+
yard (0.9.37)
473496
zeitwerk (2.7.2)
474497

475498
PLATFORMS
@@ -489,6 +512,7 @@ PLATFORMS
489512
x86_64-linux-musl
490513

491514
DEPENDENCIES
515+
actioncable
492516
active_storage_validations
493517
aws-sdk-cognitoidentityprovider (~> 1.88)
494518
aws-sdk-rails
@@ -507,6 +531,8 @@ DEPENDENCIES
507531
jbuilder
508532
jwt
509533
letter_opener
534+
listen
535+
lookbook (>= 2.3.9)
510536
pg (~> 1.1)
511537
pg-aws_rds_iam (~> 0.7.0)
512538
puma (>= 5.0)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class BreadcrumbsPreview < Lookbook::Preview
2+
layout "component_preview"
3+
4+
def default
5+
render template: "application/_breadcrumbs", locals: { crumbs: [
6+
{ name: "Passport applications", url: "default" }
7+
], current_name: "New passport application" }
8+
end
9+
end

app-rails/app/views/application/_header.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
<% end %>
3030

3131
<li class="usa-nav__primary-item">
32-
<%= render partial: "language-toggle", locals: { container_class: "display-block desktop:display-none relative" } %>
32+
<%= render partial: "application/language-toggle", locals: { container_class: "display-block desktop:display-none relative" } %>
3333
</li>
3434
</ul>
3535
</div>
3636
</nav>
3737

38-
<%= render partial: "language-toggle", locals: { container_class: "usa-language-container display-none desktop:display-block" } %>
38+
<%= render partial: "application/language-toggle", locals: { container_class: "usa-language-container display-none desktop:display-block" } %>
3939
</div>
40-
</header>
40+
</header>

app-rails/app/views/layouts/application.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020

2121
<body>
2222
<div class="display-flex flex-column minh-viewport">
23-
<%= render partial: 'header' %>
23+
<%= render partial: 'application/header' %>
2424

2525
<main id="main-content" class="grid-col-fill display-flex flex-column">
2626
<div class="grid-col-fill <%= yield :main_col_class %>">
2727
<section class="usa-section">
2828
<div class="grid-container">
29-
<%= render partial: 'flash' %>
29+
<%= render partial: 'application/flash' %>
3030

3131
<div class="grid-row grid-gap">
3232
<%= yield :before_content_col %>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<%# Layout for Lookbook previews of component partials %>
2+
<!DOCTYPE html>
3+
<html lang="<%= I18n.locale %>">
4+
<head>
5+
<meta name="viewport" content="width=device-width,initial-scale=1">
6+
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
7+
<%= javascript_importmap_tags %>
8+
<%= javascript_include_tag '@uswds/uswds/dist/js/uswds-init.min.js' %>
9+
</head>
10+
11+
<body>
12+
<div class="display-flex flex-column minh-viewport">
13+
<main id="main-content" class="grid-col-fill display-flex flex-column">
14+
<div class="grid-col-fill <%= yield :main_col_class %>">
15+
<div class="grid-container">
16+
<%= content_for?(:content) ? yield(:content) : yield %>
17+
</div>
18+
</div>
19+
</main>
20+
</div>
21+
22+
<%= javascript_include_tag '@uswds/uswds/dist/js/uswds.min.js' %>
23+
</body>
24+
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Rails.application.configure do
2+
config.lookbook.preview_paths = [ Rails.root.join("app", "previews") ]
3+
end

app-rails/config/routes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
# Keep the default /up rails endpoint.
88
get "up" => "rails/health#show"
99

10+
mount Lookbook::Engine, at: "/lookbook" if ENV["ENABLE_LOOKBOOK"].present?
11+
1012
# Support locale prefixes for these routes:
1113
localized do
1214
# Defines the root path route ("/")

app-rails/local.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@ DB_HOST=127.0.0.1
4242
DB_NAME=app
4343
DB_USER=app
4444
DB_PASSWORD=secret123
45+
46+
############################
47+
# Lookbook
48+
############################
49+
50+
ENABLE_LOOKBOOK=true

0 commit comments

Comments
 (0)