Skip to content

Commit

Permalink
enable more api responses
Browse files Browse the repository at this point in the history
enable more api responses
  • Loading branch information
ryanwoldatwork authored Aug 15, 2024
2 parents 494d8f8 + 624fe54 commit ab9ea58
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 27 deletions.
22 changes: 11 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ GEM
aes_key_wrap (1.1.0)
ast (2.4.2)
aws-eventstream (1.3.0)
aws-partitions (1.961.0)
aws-partitions (1.963.0)
aws-record (2.13.1)
aws-sdk-dynamodb (~> 1, >= 1.85.0)
aws-sdk-core (3.201.3)
aws-sdk-core (3.201.4)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
Expand Down Expand Up @@ -157,7 +157,7 @@ GEM
bigdecimal (3.1.8)
bindata (2.5.0)
bindex (0.8.1)
bootsnap (1.18.3)
bootsnap (1.18.4)
msgpack (~> 1.2)
brakeman (6.1.2)
racc
Expand Down Expand Up @@ -188,7 +188,7 @@ GEM
activesupport
choice (0.2.0)
coderay (1.1.3)
concurrent-ruby (1.3.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crass (1.0.6)
database_cleaner (2.0.2)
Expand Down Expand Up @@ -229,7 +229,7 @@ GEM
fog-core (~> 2.1)
fog-json (~> 1.1)
fog-xml (~> 0.1)
fog-core (2.4.0)
fog-core (2.5.0)
builder
excon (~> 0.71)
formatador (>= 0.2, < 2.0)
Expand Down Expand Up @@ -309,7 +309,7 @@ GEM
method_source (1.1.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0702)
mime-types-data (3.2024.0806)
mini_magick (4.13.2)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
Expand Down Expand Up @@ -363,8 +363,8 @@ GEM
paper_trail (15.1.0)
activerecord (>= 6.1)
request_store (~> 1.4)
parallel (1.25.1)
parser (3.3.4.0)
parallel (1.26.2)
parser (3.3.4.2)
ast (~> 2.4.1)
racc
pg (1.5.7)
Expand Down Expand Up @@ -449,7 +449,7 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.4)
rexml (3.3.5)
strscan
rolify (6.0.1)
rspec-core (3.13.0)
Expand Down Expand Up @@ -482,14 +482,14 @@ GEM
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
rubocop-ast (1.32.0)
parser (>= 3.3.1.0)
rubocop-rails (2.25.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (3.0.3)
rubocop-rspec (3.0.4)
rubocop (~> 1.61)
ruby-graphviz (1.2.5)
rexml
Expand Down
7 changes: 7 additions & 0 deletions app/assets/stylesheets/site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -605,3 +605,10 @@ abbr[title=required] {
padding-left: 1rem;
padding-right: 0.5rem;
}

// Center the dropdown button in a table
@media (min-width: 64em) {
.usa-table .usa-nav__primary button[aria-expanded=false] span::after {
right: auto;
}
}
2 changes: 1 addition & 1 deletion app/controllers/api/v1/cx_responses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CxResponsesController < ::ApiController
def index
page_number = params.dig(:page, :number).to_i.nonzero? || 1
page_size = params.dig(:page, :size).to_i.nonzero? || 500
page_size = 500 if page_size <= 0 || page_size > 500
page_size = 500 if page_size <= 0 || page_size > 5000

begin
start_date = params[:start_date] ? Date.parse(params[:start_date]).to_date : Date.parse("2023-10-01").to_date
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def submit_touchpoint_uuid_url(form)
end

def format_time(time, timezone)
I18n.l time.to_time.in_time_zone(timezone), format: :long
I18n.l time.to_time.in_time_zone(timezone), format: :with_timezone
end

def timezone_abbreviation(timezone)
Expand Down
7 changes: 5 additions & 2 deletions app/models/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ class Organization < ApplicationRecord
validates :name, presence: true
validates :name, uniqueness: true
validates :domain, presence: true
validates :abbreviation, presence: true
validates :abbreviation, uniqueness: true
validates :abbreviation,
presence: true,
uniqueness: true,
length: { maximum: 10 },
format: { with: /\A[a-zA-Z0-9]*\z/, message: "only allows letters and numbers" }

def parent
parent_id ? Organization.find(parent_id) : nil
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/forms/_list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<th data-sortable scope="col">
Name
</th>
<th>
<th data-sortable scope="col">
Status
</th>
<th data-sortable scope="col">
Expand Down
11 changes: 8 additions & 3 deletions app/views/admin/organizations/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
<h2>
<%= pluralize(organization.errors.count, "error") %> prohibited this organization from being saved:
</h2>
<ul class="usa-list">
<% organization.errors.full_messages.each do |message| %>
<li><%= message %></li>
<div class="usa-alert usa-alert--error">
<div class="usa-alert__body">
<h3 class="usa-alert__heading">Error</h3>
<p class="usa-alert__text">
<%= message %>
</p>
</div>
</div>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/submissions/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
Received at
</td>
<td>
<%= @submission.created_at %> -
<%= format_time(@submission.created_at, current_user.time_zone) %> -
<%= time_ago_in_words(@submission.created_at) %> ago
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion app/views/components/_question_title.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class="help-text margin-top-1"
>
<small>
<%= question.help_text %>
<%= sanitize(question.help_text) %>
</small>
</div>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/components/_question_title_label.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class="help-text margin-top-1"
>
<small>
<%= question.help_text %>
<%= sanitize(question.help_text) %>
</small>
</div>
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion app/views/components/_question_title_legend.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class="help-text margin-top-1"
>
<small>
<%= question.help_text %>
<%= sanitize(question.help_text) %>
</small>
</div>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/components/forms/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="grid-col-12">
<%- if form.disclaimer_text? %>
<small class="fba-dialog-privacy">
<%= form.disclaimer_text.html_safe %>
<%= sanitize(form.disclaimer_text) %>
</small>
<% end -%>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<div class="usa-alert">
<div class="usa-alert__body">
<h3 class="usa-alert__heading">
<%= sanitize(question.text) %>
<%= question.text.html_safe %>
</h3>
<%- if question.help_text %>
<%- if question.help_text.present? %>
<p class="usa-alert__text">
<%= sanitize(question.help_text) %>
<%= question.help_text.html_safe %>
</p>
<% end %>
</div>
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ en-US:
formats:
default: "%a, %d %b %Y %I:%M:%S %p %Z"
long: "%B %d, %Y %I:%M %p"
with_timezone: "%B %d, %Y %I:%M %p (%Z - UTC%:z)"
short: "%d %b %I:%M %p"
pm: pm
date:
Expand Down
1 change: 1 addition & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ es:
formats:
default: "%-d/%-m/%Y"
long: "%-d de %B de %Y"
with_timezone: "%-d de %B de %Y (UTC%:z)"
short: "%-d de %b"
month_names:
-
Expand Down
1 change: 1 addition & 0 deletions config/locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ zh-CN:
formats:
default: "%Y-%m-%d"
long: "%Y年%m月%d日"
with_timezone: "%Y年%m月%d日 (%:z)"
short: "%m月%d日"
month_names:
-
Expand Down

0 comments on commit ab9ea58

Please sign in to comment.