Skip to content

Commit

Permalink
Merge branch 'main' into feature/APPEALS-53424
Browse files Browse the repository at this point in the history
  • Loading branch information
brandondorner authored Oct 23, 2024
2 parents 764f7f3 + 9a2c9d3 commit a5e9c78
Show file tree
Hide file tree
Showing 251 changed files with 65,195 additions and 549,148 deletions.
18 changes: 18 additions & 0 deletions .reek.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ detectors:
exclude:
- Address
- Api::V3::DecisionReviews::ContestableIssueFinder#initialize
- ExternalApi::WebexService::RecordingsListResponse::Recording#initialize
DataClump:
exclude:
- ForeignKeyPolymorphicAssociationJob
Expand Down Expand Up @@ -135,6 +136,11 @@ detectors:
- ExternalApi::PexipService#send_pexip_request
- ControllerSchema#remove_unknown_keys
- BusinessLineReporter#as_csv
- Hearings::DownloadTranscriptionFileJob#build_error_explanation
- Hearings::RefreshWebexAccessTokenJob#perform
- TranscriptionFile#update_status!
- ExternalApi::WebexService#create_conference
- TranscriptionTransformer
InstanceVariableAssumption:
exclude:
- Appeal
Expand All @@ -143,6 +149,7 @@ detectors:
- Api::V3::DecisionReviews::HigherLevelReviewIntakeProcessor
- ETL::Syncer
- User
- Hearings::DownloadTranscriptionFileJob
IrresponsibleModule:
enabled: false
LongParameterList:
Expand All @@ -163,6 +170,8 @@ detectors:
- LegacyDocket#distribute_priority_appeals
- LegacyDocket#distribute_nonpriority_appeals
- ExternalApi::MPIService#search_people_info
- Hearings::FetchWebexRecordingsDetailsJob#send_file
- ExternalApi::WebexService#initialize
ManualDispatch:
exclude:
- Api::V3::DecisionReviews::IntakeError#potential_error_code
Expand All @@ -180,6 +189,7 @@ detectors:
max_allowed_nesting: 2
exclude:
- AsyncableJobsReporter
- TranscriptionTransformer#create_transcription_pages
NilCheck:
enabled: false
RepeatedConditional:
Expand All @@ -199,6 +209,8 @@ detectors:
- Veteran
- LegacyDocket
- Test::UsersController
- Fakes::WebexService
- Hearings::DownloadTranscriptionFileJob
TooManyConstants:
exclude:
- Fakes::BGSServicePOA
Expand All @@ -216,6 +228,8 @@ detectors:
- Api::V3::DecisionReviews::IntakeError
- ControllerSchema::Field
- HearingEmailStatusMailer
- ExternalApi::WebexService
- TranscriptionFileIssuesMailer
TooManyMethods:
enabled: false
TooManyStatements:
Expand Down Expand Up @@ -255,10 +269,14 @@ detectors:
- UpdatePOAConcern
- VBMSCaseflowLogger#log
- LegacyDocket
- ExternalApi::PexipService#not_found_response
- WebexConcern
UnusedParameters:
exclude:
- Docket#distribute_appeals
- HearingRequestDocket#distribute_appeals
- Fakes::WebexService#fetch_recording_details
- Fakes::WebexService#fetch_room_details


### Directory specific configuration
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ gem "rack", "~> 2.2.6.2"
gem "rails", "6.1.7.7"
# Used to colorize output for rake tasks
gem "rainbow"
gem "rcredstash", "~> 1.1.0"
# React
gem "react_on_rails", "11.3.0"
gem "redis-mutex"
Expand All @@ -83,6 +84,7 @@ gem "request_store"
gem "roo", "~> 2.7"
gem "rswag-api"
gem "rswag-ui"
gem "rtf"
gem "ruby_claim_evidence_api", git: "https://github.com/department-of-veterans-affairs/ruby_claim_evidence_api.git", ref: "fed623802afe7303f4b8b5fe27cff0e903699873"
# Use SCSS for stylesheets
gem "sass-rails", "~> 5.0"
Expand All @@ -99,6 +101,7 @@ gem "tzinfo", "~> 2.0"
# Use Uglifier as compressor for JavaScript assets
gem "uglifier", ">= 1.3.0"
gem "validates_email_format_of"
gem "webvtt-ruby"
gem "ziptz"

group :production, :staging, :ssh_forwarding, :development, :test do
Expand Down
15 changes: 12 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ GEM
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.6)
d3-rails (7.0.0)
d3-rails (7.8.5)
railties (>= 3.1)
danger (6.2.2)
claide (~> 1.0)
Expand Down Expand Up @@ -1651,8 +1651,8 @@ GEM
immigrant (0.3.6)
activerecord (>= 3.0)
jaro_winkler (1.5.6)
jmespath (1.3.1)
jquery-rails (4.5.1)
jmespath (1.6.2)
jquery-rails (4.6.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
Expand Down Expand Up @@ -1898,6 +1898,10 @@ GEM
ffi (~> 1.0)
rb-readline (0.5.5)
rchardet (1.8.0)
rcredstash (1.1.0)
aws-sdk-dynamodb
aws-sdk-kms
thor
react_on_rails (11.3.0)
addressable
connection_pool
Expand Down Expand Up @@ -1974,6 +1978,7 @@ GEM
rswag-ui (2.13.0)
actionpack (>= 3.1, < 7.2)
railties (>= 3.1, < 7.2)
rtf (0.3.3)
rubocop (0.83.0)
parallel (~> 1.10)
parser (>= 2.7.0.1)
Expand Down Expand Up @@ -2111,6 +2116,7 @@ GEM
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
webvtt-ruby (0.4.0)
xmldsig (0.3.2)
nokogiri
xmlenc (0.8.0)
Expand Down Expand Up @@ -2211,6 +2217,7 @@ DEPENDENCIES
rails-erd
rainbow
rb-readline
rcredstash (~> 1.1.0)
react_on_rails (= 11.3.0)
redis-mutex
redis-namespace (~> 1.11.0)
Expand All @@ -2225,6 +2232,7 @@ DEPENDENCIES
rswag-api
rswag-specs
rswag-ui
rtf
rubocop (= 0.83)
rubocop-performance
rubocop-rails
Expand Down Expand Up @@ -2254,6 +2262,7 @@ DEPENDENCIES
validates_email_format_of
webdrivers
webmock
webvtt-ruby
ziptz

BUNDLED WITH
Expand Down
10 changes: 6 additions & 4 deletions app/controllers/hearings/hearing_day_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def show
hearings: hearing_day.hearings_for_user(current_user).map { |hearing| hearing.quick_to_hash(current_user.id) }
)
}
rescue VirtualHearings::LinkService::PINKeyMissingError,
VirtualHearings::LinkService::URLHostMissingError,
VirtualHearings::LinkService::URLPathMissingError => error
rescue VirtualHearings::PexipLinkService::PINKeyMissingError,
VirtualHearings::PexipLinkService::URLHostMissingError,
VirtualHearings::PexipLinkService::URLPathMissingError => error
log_error(error)
render json: {
hearing_day: hearing_day.to_hash(include_conference_link: false).merge(
Expand Down Expand Up @@ -89,7 +89,9 @@ def create

def update
hearing_day.update!(update_params)
render json: hearing_day.to_hash
render json: hearing_day.to_hash.merge(
conference_link: ::HearingDaySerializer.serialize_conference_link(hearing_day.conference_link)
)
end

def destroy
Expand Down
25 changes: 25 additions & 0 deletions app/controllers/hearings/transcription_files_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

class Hearings::TranscriptionFilesController < ApplicationController
include HearingsConcerns::VerifyAccess

rescue_from ActiveRecord::RecordNotFound, with: :render_page_not_found
before_action :verify_access_to_hearings, only: [:download_transcription_file]

# Downloads file and sends to user's local computer
def download_transcription_file
tmp_location = file.fetch_file_from_s3!
File.open(tmp_location, "r") { |stream| send_data stream.read, filename: file.file_name }
file.clean_up_tmp_location
end

def render_page_not_found
redirect_to "/404"
end

private

def file
@file ||= TranscriptionFile.find(params[:file_id])
end
end
1 change: 1 addition & 0 deletions app/controllers/hearings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def virtual_hearing_job_status
alias_with_host: hearing.virtual_hearing&.formatted_alias_or_alias_with_host,
guest_link: hearing.virtual_hearing&.guest_link,
host_link: hearing.virtual_hearing&.host_link,
co_host_link: hearing.virtual_hearing&.co_host_hearing_link,
guest_pin: hearing.virtual_hearing&.guest_pin,
host_pin: hearing.virtual_hearing&.host_pin
}
Expand Down
9 changes: 9 additions & 0 deletions app/controllers/organizations/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def update
adjust_admin_rights
end

update_user_conference_provider
render json: { users: json_administered_users([user_to_modify]) }, status: :ok
end

Expand Down Expand Up @@ -67,6 +68,14 @@ def adjust_admin_rights
end
end

def update_user_conference_provider
new_conference_provider = params.dig(:attributes, :conference_provider)

if organization["url"] == HearingsManagement.singleton.url && new_conference_provider
OrganizationsUser.update_user_conference_provider(user_to_modify, new_conference_provider)
end
end

def organization_url
params[:organization_url]
end
Expand Down
27 changes: 27 additions & 0 deletions app/jobs/hearings/create_non_virtual_conference_job.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true

# This job creates a Webex conference & link for a non virtual hearing

class Hearings::CreateNonVirtualConferenceJob < CaseflowJob
# We are not using ensure_current_user_is_set because of some
# potential for rollbacks if the set user is not the system user

queue_with_priority :high_priority
application_attr :hearing_schedule

attr_reader :hearing

# Retry if Webex returns an invalid response.
retry_on(Caseflow::Error::WebexApiError, wait: :exponentially_longer) do |job, exception|
job.log_error(exception)
end

def perform(hearing:)
RequestStore.store[:current_user] = User.system_user
WebexConferenceLink.find_or_create_by!(
hearing: hearing,
created_by: hearing.created_by,
updated_by: hearing.created_by
)
end
end
Loading

0 comments on commit a5e9c78

Please sign in to comment.