Skip to content
Merged
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
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ group :development do
gem "brakeman"
gem 'bullet'
gem "bundler-audit"
gem 'faker', git: 'https://github.com/faker-ruby/faker.git', branch: 'main'
gem 'listen'
gem 'rails-erd'
gem "rubocop-rails"
Expand Down
37 changes: 25 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ GIT
multi_json (~> 1.14)
omniauth (~> 2.0)

GIT
remote: https://github.com/faker-ruby/faker.git
revision: 3a65e1e2e567cb3be3f6b9582484ba4d5ee5d8c6
branch: main
specs:
faker (3.5.1)
i18n (>= 1.8.11, < 2)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -102,8 +110,8 @@ GEM
public_suffix (>= 2.0.2, < 7.0)
aes_key_wrap (1.1.0)
ast (2.4.2)
aws-eventstream (1.3.0)
aws-partitions (1.1048.0)
aws-eventstream (1.3.1)
aws-partitions (1.1050.0)
aws-record (2.13.2)
aws-sdk-dynamodb (~> 1, >= 1.85.0)
aws-sdk-core (3.218.1)
Expand Down Expand Up @@ -222,7 +230,7 @@ GEM
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
diff-lcs (1.5.1)
diff-lcs (1.6.0)
docile (1.4.1)
dotenv (3.1.7)
drb (2.2.1)
Expand Down Expand Up @@ -275,8 +283,8 @@ GEM
i18n (1.14.7)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
image_processing (1.13.0)
mini_magick (>= 4.9.5, < 5)
image_processing (1.14.0)
mini_magick (>= 4.9.5, < 6)
ruby-vips (>= 2.0.17, < 3)
importmap-rails (2.1.0)
actionpack (>= 6.0.0)
Expand All @@ -295,7 +303,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.10.0)
json (2.10.1)
json-jwt (1.16.7)
activesupport (>= 4.2)
aes_key_wrap
Expand All @@ -321,10 +329,11 @@ GEM
kramdown (2.5.1)
rexml (>= 3.3.9)
language_server-protocol (3.17.0.4)
lint_roller (1.1.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.5)
logger (1.6.6)
logstop (0.4.1)
logger
loofah (2.24.0)
Expand All @@ -342,7 +351,9 @@ GEM
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2025.0204)
mini_magick (4.13.2)
mini_magick (5.1.2)
benchmark
logger
mini_mime (1.1.5)
mini_portile2 (2.8.8)
minitest (5.25.4)
Expand Down Expand Up @@ -425,7 +436,7 @@ GEM
puma (6.6.0)
nio4r (~> 2.0)
racc (1.8.1)
rack (3.1.9)
rack (3.1.10)
rack-attack (6.7.0)
rack (>= 1.0, < 4)
rack-cors (2.0.2)
Expand Down Expand Up @@ -521,9 +532,10 @@ GEM
rspec-support (3.13.2)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.71.2)
rubocop (1.72.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
Expand Down Expand Up @@ -587,7 +599,7 @@ GEM
ssrf_filter (1.2.0)
stimulus-rails (1.3.4)
railties (>= 6.0.0)
stringio (3.1.2)
stringio (3.1.3)
thor (1.3.2)
thread_safe (0.3.6)
tilt (2.6.0)
Expand Down Expand Up @@ -660,6 +672,7 @@ DEPENDENCIES
devise (>= 4.8.1)
dotenv
factory_bot_rails
faker!
fog-aws (>= 3.15.0)
image_processing (~> 1.12)
importmap-rails (>= 2.0.0)
Expand Down
18 changes: 6 additions & 12 deletions app/assets/stylesheets/site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,10 @@ footer {
}

// For the extra-wide Responses table
.table-scroll {
position:relative;
max-width: 100%;
margin: auto;
}
.table-wrap {
width:100%;
overflow:auto;
}
.table-scroll table {
width:100%;
}
.table-scroll th,
.table-scroll td {
max-width: 600px;
}

.dark-blue-bg {
background-color: #162D50;
Expand Down Expand Up @@ -617,4 +605,10 @@ abbr[title=required] {
z-index: 1000;
padding: 10px;
border-bottom: 1px solid #ccc;
}

.usa-table.submissions tbody tr:hover,
.usa-table.submissions tbody tr:hover td {
cursor: pointer !important;

}
23 changes: 8 additions & 15 deletions app/controllers/admin/forms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class FormsController < AdminController
archive
reset
add_tag remove_tag
update_ui_truncation
update_title update_instructions update_disclaimer_text
update_success_text update_display_logo
update_notification_emails
Expand Down Expand Up @@ -187,7 +186,8 @@ def export
start_date = params[:start_date] ? Date.parse(params[:start_date]).to_date.beginning_of_day : Time.zone.now.beginning_of_quarter
end_date = params[:end_date] ? Date.parse(params[:end_date]).to_date.end_of_day : Time.zone.now.end_of_quarter

count = Form.find_by_short_uuid(@form.short_uuid).non_flagged_submissions(start_date:, end_date:).count
count = Form.find_by_short_uuid(@form.short_uuid)
.reportable_submissions(start_date:, end_date:).count
if count > MAX_ROWS_TO_EXPORT
render status: :bad_request, plain: "Your response set contains #{helpers.number_with_delimiter count} responses and is too big to be exported from the Touchpoints app. Consider using the Touchpoints API to download large response sets (over #{helpers.number_with_delimiter MAX_ROWS_TO_EXPORT} responses)."
return
Expand Down Expand Up @@ -223,6 +223,8 @@ def questions
end

def responses
@search_params = search_params
@search_params.merge!(form_id: @form.short_uuid)
FormCache.invalidate_reports(@form.short_uuid) if params['use_cache'].present? && params['use_cache'] == 'false'
ensure_response_viewer(form: @form) unless @form.template?
end
Expand Down Expand Up @@ -315,18 +317,6 @@ def copy_by_id
copy
end

def update_ui_truncation
ensure_response_viewer(form: @form)

respond_to do |format|
if @form.update(ui_truncate_text_responses: !@form.ui_truncate_text_responses)
format.json { render json: {}, status: :ok, location: @form }
else
format.json { render json: @form.errors, status: :unprocessable_entity }
end
end
end

def update
ensure_form_manager(form: @form)

Expand Down Expand Up @@ -537,7 +527,6 @@ def form_params
:load_css,
:tag_list,
:verify_csrf,
:ui_truncate_text_responses,
:question_text_01,
:question_text_02,
:question_text_03,
Expand Down Expand Up @@ -610,5 +599,9 @@ def transition_state
def invite_params
params.require(:user).permit(:refer_user)
end

def search_params
params.permit(:form_id, :flagged, :spam, :archived, :deleted)
end
end
end
4 changes: 3 additions & 1 deletion app/controllers/admin/reporting_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ def hisps
end

def lifespan
@form_lifespans = Submission.select('form_id, count(*) as num_submissions, (max(submissions.created_at) - min(submissions.created_at)) as lifespan').group(:form_id)
@form_lifespans = Submission
.select('form_id, count(*) as num_submissions, (max(submissions.created_at) - min(submissions.created_at)) as lifespan')
.group("form_id")
@forms = Form.select(:id, :name, :organization_id, :uuid, :short_uuid).where('exists (select id from submissions where submissions.form_id = forms.id)')
@orgs = Organization.order(:name)
@org_summary = []
Expand Down
Loading
Loading