Skip to content

Commit

Permalink
Reader prototype bugfixes (#23228)
Browse files Browse the repository at this point in the history
* Hotfix/appeals 57826 (#22946)

* Add fix for filtered docs bug

* Revert component import paths to full path

* Revert glamor styles changes

* Update lodash imports to reduce size

* Replace lodash/get with javascript optional chaining

* Refactor previous/next doc logic without lodash

* Remove unused import from ReaderFooter

* Delete lodash logic in documentUtil and move ReaderToolbar functions to ReaderToolbar component

* Update prototype-footer css

* Adding regression tests for filtered document order.

* Adding label to filtered icon.

* Adding test for unfiltered content.

* Moving test up to previous.

* Fix merge conflict

* Fix merge conflict

* Fix empty arrow function lint error in ReaderFooter.test.js

* Add previous/next navigation with left/right arrow keys

---------

Co-authored-by: laurenyj <44596134+laurenyj@users.noreply.github.com>
Co-authored-by: Brian Bommarito <brian@bommarito.me>

* Remove alpha attribute from Page component to fix black boxes renderi… (#22947)

Co-authored-by: laurenyj <44596134+laurenyj@users.noreply.github.com>

* Hotfix/appeals 57877 (#22948)

* Add fix for filtered docs bug

* Revert component import paths to full path

* feature/APPEALS-34124-43428-29105-28925-33581 - Rails 6.1 upgrade (release) (#22813) (#22817)

* 🔧 Assume defaults for `config.action_dispatch.use_cookies_with_metadata` and `config.action_mailer.delivery_job`

The following config settings are not backwards compatible:

- config.action_dispatch.use_cookies_with_metadata
- config.action_mailer.delivery_job

Now that Rails 6.0 is stable on production, we can assume
their default values going forward.

* ✅ Fix flakey spec

* 🔧 Assume default for `config.action_dispatch.use_authenticated_cookie_encryption`

Since we are making other cookie configuration changes in this PR for Rails 6.0,
this is an opportune time to migrate this Rails 5.2 cookie setting to its
default value as well.

* ⏪️ Restore overrides for `config.action_dispatch.use_authenticated_cookie_encryption` and `config.action_dispatch.use_cookies_with_metadata`

While testing in PreProd, we discovered that, without these cookie config overrides,
re-authentication was broken -- after logging out, a user could not log back in.

Since the default settings are still optional going forward, we can restore these
overrides and devise a solution to migrate cookies later.

For more details, see Jira story APPEALS-54897:

https://jira.devops.va.gov/browse/APPEALS-54897

* ✨ Add new utility module for adding DB indexes concurrently

Introduces `Caseflow::Migrations::AddIndexConcurrently` as a replacement
for `Caseflow::Migration` for migrations on ActiveRecord 6.0 and beyond,
since `Caseflow::Migration` is forever coupled to ActiveRecord 5.1 due
to its extensive use on legacy migrations and should be deprecated moving
forward.

* 🗑️ Deprecate `Caseflow::Migration`

* 🔧 Add instructive error message for non-concurrent `add_index` migrations

* 🚨 Address linter / codeclimate complaints

* ✨ Introduce `SslRedirectExclusionPolicy`

To be used in the environment configuration settings for excluding exempt
request paths from SSL redirects when `config. force_ssl = true`

* ♻️ Replace deprecated controller-level `force_ssl`

Replace deprecated controller-level `force_ssl` with
equivalent configuration settings in preparation for
the Rails 6.1 upgrade.

* 🔥 Remove deprecated config setting `config.active_record.sqlite3.represent_boolean_as_integer`

This will have no implications for Caseflow, since we are only using the `sqlite3`
adapter nominally for the `demo_vacols` database, which is not actually being used
in our demo environments (demo environments are deployed as `development` envs).

* ⬆️ Update `caseflow-commons` to resolve sub-dependency conflicts

Removes unneeded gems `bourbon` and `neat`, which had a sub-dependency conflict on `thor`.

* ⬆️ Update rails and other gems as necessary

* 🐛 Fix 'uninitialized constant' error when loading app

* ⬆️ bin/rails app:update - Apply relevant changes

* 🔧 Override default for `config.active_record.has_many_inversing`

* 🔧 Assume default for `config.active_storage.track_variants`

We're not currently using ActiveStorage in Caseflow, so it
is safe to just assume the default here.

* 🔧 Override default for `config.active_job.retry_jitter`

The default jitter is probably safe, however, I'm not 100% sure that we
don't have any jobs that need to be requeued with exact wait times. So
we let's override this for now to stay on the safe side.

* 🔧 Assume default for `config.active_job.skip_after_callbacks_if_terminated`

We're not currently using `throw :abort` within any `before_enqueue`/`before_perform` 
callbacks on existing Caseflow jobs, so the default should be fine here.

For more background, see
https://lilyreile.medium.com/rails-6-1-new-framework-defaults-what-they-do-and-how-to-safely-uncomment-them-c546b70f0c5e#4c60

* 🔧 Assume default for `config.action_dispatch.cookies_same_site_protection`

This setting controls the `SameSite` optional attribute for the
`Set-Cookie` header.

`SameSite=Lax` means that the cookie is not sent on cross-site requests,
such as on requests to load images or frames, but is sent when a user is
navigating to the origin site from an external site (for example, when
following a link). This is the default behavior if the SameSite attribute
is not specified.

`Lax` is currently the default assumed by both Chrome and Edge browsers
when this attribute is left unspecified, so assuming this value
should be sensible. It allows us to have our cake (blocking CSRF attacks)
and eat it too (providing a logged-in experience when users navigate to
Caseflow  across origins).

For more background, see
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value
- https://lilyreile.medium.com/rails-6-1-new-framework-defaults-what-they-do-and-how-to-safely-uncomment-them-c546b70f0c5e#1f15

* 🔧 Assume default for `config.action_controller.urlsafe_csrf_tokens`

* 🔧 Assume default for `ActiveSupport.utc_to_local_returns_utc_offset_times`

We're not using `ActiveSupport::TimeZone.utc_to_local` anywhere,
so the default is safe to assume here.

* 🔧 Assume default for `config.action_dispatch.ssl_default_redirect_status`

The default is safe to assume.

For more background, see
https://lilyreile.medium.com/rails-6-1-new-framework-defaults-what-they-do-and-how-to-safely-uncomment-them-c546b70f0c5e#4c3e

* 🔧 Assume default for `config.active_record.legacy_connection_handling`

The default should be safe to assume here, as we do not do any
role or shard switching on database connections.

For more background, see
https://lilyreile.medium.com/rails-6-1-new-framework-defaults-what-they-do-and-how-to-safely-uncomment-them-c546b70f0c5e#8007

* 🔧 Assume default for `config.action_view.form_with_generates_remote_forms`

We don't use the `form_with` helper anywhere, so this behavior change is
inconsequential for us, and we can safely assume the new default.

* 🔧 Assume default for `config.active_storage.queues.analysis`

We do not use ActiveStorage, so the default is safe to assume here.

* 🔧 Assume default for `config.active_storage.queues.purge`

We do not use ActiveStorage, so the default is safe to assume here.

* 🔧 Assume default for `config.action_mailbox.queues.incineration`

We don't use ActionMailbox, so the new default is safe to assume here.

* 🔧 Assume default for `config.action_mailbox.queues.routing`

We do not use ActionMailbox, so the default is safe to assume here.

* 🔧 Assume default for `config.action_mailer.deliver_later_queue_name`

We're not using `ActionMailer::MessageDelivery #deliver_later` anywhere,
so the default is safe to assume.

* 🔧 Assume default for `config.action_view.preload_links_header`

This flag can be safely uncommented. Browsers that support Link
headers will get a performance boost. Browsers that don’t will
ignore them.

We override in `development` environments to avoid an edge case
leading to an HTTP response header overflow.

For more background, see
https://lilyreile.medium.com/rails-6-1-new-framework-defaults-what-they-do-and-how-to-safely-uncomment-them-c546b70f0c5e#3679

* 🔥 Remove 'new_framework_defaults_6_1.rb'

* 🔧 Load defaults for Rails 6.1

* ♻️ Extract constant

* ♻️ Migrate to new Rails deprecation config where applicable

* ♻️ Push members down now that there is only one subclass

* 🩹 Add forgotten disallowed deprecation warning

This deprecation warning was addressed by the following
PR, but we forgot to add it to the list of disallowed
deprecation warnings:

#21614

* 💡 Update comment

Task `rake routes` has been replaced with `rails routes`

* ✅ Update test to account for change to `ActionDispatch::Response#content_type` 

`ActionDispatch::Response#content_type` now returns the full Content-Type header

* 🚨 Exclude 'config.ru' from Rubocop cops

* 🚚 Move 'db/etl/migrate' to 'db/etl_migrate'

* 🚚 Move 'db/etl/schema.rb' to 'db/etl_schema.rb'

* ♻️ Arrange 'database.yml' configs by environment

Group DB configs by environment in anticipation of
reformatting for Rails 6+ multi-DB configuration.

* 🔧 Reformat 'database.yml' to Rails 6+ multi-DB conventions

* 🔧 Add etl migration paths to DB config

* 🔧 Update DB connection names in 'database_cleaner' config

* ♻️ Use new database-specific rake tasks

After migrating to the Rails 6+ native multi-database configuration,
the behavior of some DB management tasks, such as `rake db:migrate`
changed such that they now act on ALL databases and not just the
primary database. So we must replace the invocations of these
tasks with their new, database-specific counterparts.

* ➖ Remove 'multiverse' gem

Now that we have fiully transitioned to Rails-native
multi-database support, we are no longer reliant on
the 'multiverse' gem and can remove it.

* 🗃️ Prohibit execution of vacols DB and non-DB-specific rake tasks

After transitioning to Rails-native multi-DB support,
the behavior of some DB tasks changed such that they will now
act on ALL databases and not just the primary database
(ex. `rake db:migrate` will now migrate ALL databases).

To avoid accidents, we re-define these tasks here to no-op
and output a helpful message to redirect developers toward
using their new database-specific counterparts instead.

* ♻️ Create new environment for GH workflow 'Make-docs-to-webpage'

Instead of performing a bunch of hard-to-maintain `sed` gymnastics
to modify the existing 'test' environment, let's create a new
'make_docs' environment (based off of 'test') and configure it
appropriately for use by the 'Make-docs-to-webpage' GH workflow.

* 💚 Remove redundant DB migrations from CI workflow

Task `db:schema:load` already loads the checked in schema,
so there should be no need to run `db:migrate` afterwards.

* 🐛 Fix `spec/mailers/hearing_mailer_spec.rb` - `NoMethodError`

Addresses the following error:

  NoMethodError: undefined method `build_lookup_context' for ActionView::Base:Class

* 🐛 Fix `spec/workflows/post_decision_motion_updater_spec.rb` - `FrozenError`

Addresses the following error:

  FrozenError: can't modify frozen Hash: {}

* ✅ Add test for `RoSchedulePeriod`

* 🐛 Fix `spec/models/schedule_period_spec.rb` - `ActiveRecord::RecordInvalid`

Apparently, there were some changes to the inner workings of
`ActiveModel::Errors` in Rails 6.1, causing a model to be
considered invalid in the case that `errors[:base] == [[]]`.
This makes sense, as `[[]]` is not considered "empty".

Unfortunately, this was causing `RoSchedulePeriod #validate_spreadsheet`
to inadvertently mark the model as invalid upon creation.
`HearingSchedule::ValidateRoSpreadsheet #validate` returns an
empty array (`[]`) when valid, which gets pushes onto the
`RoSchedulePeriod` `errors[:base]` array, resulting in a
non-empty array (`[[]]`) and an erroneously invalid disposition.

Furthermore, calling `<<` to an `ActiveModel::Errors` message array
in order to add an error is a deprecated, so we can take this
opportunity to use the new `#add` API to hit two birds with one stone.

The change implemented here is not a pure refactoring, however the
end-user experience is unchanged in terms of how errors are presented
when attempting to upload a spreadsheet with multiple non-conformities.

Down the road, we may want to consider moving
`HearingSchedule::ValidateRoSpreadsheet` toward using
`ActiveModel::Validations` in order to leverage the
full `ActiveModel::Errors` API and construct the
errors object in the prescribed manner.

For more details see
- https://api.rubyonrails.org/v6.1.7.7/classes/ActiveModel/Validations.html
- https://api.rubyonrails.org/v6.1.7.7/classes/ActiveModel/Errors.html

* 🐛 Fix `spec/mailers/hearing_mailer_spec.rb` - `ActionView::Template::Error`

* ✅ Fix `spec/models/veteran_spec.rb`

* ✅ Fix `spec/sql/ama_cases_sql_spec.rb`

Addresses failures such as the below:

  0) AMA Cases Tableau data source expected report calculates age and AOD based on person.dob
     Failure/Error: expect(aod_case["aod_veteran.age"]).to eq("76")

       expected: "76"
            got: 0.76e2

* ✅ Fix multiple specs - `Minitest::UnexpectedError`

Test helper method `#perform_enqueued_jobs` now wraps exceptions
in an `Minitest::UnexpectedError`:

https://github.com/rails/rails/blob/914caca2d31bd753f47f9168f2a375921d9e91cc/activejob/lib/active_job/test_helper.rb#L591

So, to assert that a specific
exception is raised during execution of the `#perform_enqueued_jobs`
block, we must rescue the `Minitest::UnexpectedError` and make the
assertion on its error message instead.

* ✅ Fix `spec/lib/helpers/association_wrapper_spec.rb`

* ✅ Fix `spec/controllers/api/v1/jobs_controller_spec.rb`

In Rails 6.1, `ActiveJob #perform_now` was changed to
behave as it did once before (at the behest of GitHub),
returning the value fo the job instead of true/false.

See related GH issue: rails/rails#38040

* 🐛 Fix `spec/controllers/appeals_controller_spec.rb` - `NoMethodError`

Addresses error:

  NoMethodError: undefined method `workflow' for #<CaseSearchResultsForVeteranFileNumber:0x00007f9a030966c8>

  0) AppealsController GET appeals when current user is a System Admin when request header does not contain Veteran ID responds with an error
     Failure/Error: errors: errors.messages[:workflow],

     NoMethodError:
       undefined method `workflow' for #<CaseSearchResultsForVeteranFileNumber:0x00007f9a030966c8>
     # ./app/workflows/case_search_results_base.rb:31:in `search_call'

* 🐛 Fix `CaseSearchResultsBase` validations

Addresses test failures in `spec/controllers/appeals_controller_spec.rb`
similar to the below:

  AppealsController GET appeals when current user is a System Admin when request header does not contain Veteran ID responds with an error
     Failure/Error: expect(response_body["errors"][0]["title"]).to eq "Veteran file number missing"

       expected: "Veteran file number missing"
            got: nil

Using `ActiveModel::Errors` to store error data in an arbitrary format may have been
somewhat permissible in the past, but it is an abuse of the object's intended use and is
also proving incompatible with the more formalized `ActiveModels::Errors` API in Rails 6.1.

In order to preserve the existing response shape of the affected JSON endpoints,
we need to move away from the `ActiveModel::Validations` implementation on `CaseSearchResultsBase`
(and its descendent classes) to a more bespoke method of performing validations and aggregating
errors, since Rails 6.1 `ActiveModel::Errors` is no longer appropriate for  our needs here.

* ✅ Fix `spec/controllers/application_controller_spec.rb` -- Cache-Control error

Addresses the test failure below:

    ApplicationController no cache headers when toggle set sets Cache-Control etc
     Failure/Error: expect(response.headers["Cache-Control"]).to eq "no-cache, no-store"

       expected: "no-cache, no-store"
            got: "no-store"

       (compared using ==)
     # ./spec/controllers/application_controller_spec.rb:59:in `block (4 levels) in <top (required)>'

In Rails 6.1, the `no-store` directive is exclusive of any others
that are set on the `Cache-Control` header, which makes sense given
the specification https://datatracker.ietf.org/doc/html/rfc7234#section-3

This change was implemented in PR rails/rails#39461

Since it no longer makese sense to set both `no-store` and `no-cache` directives,
we will only set `no-store` here, as that is the stronger of the two.

* 🐛 Fix multiple specs - `ActiveRecord::EagerLoadPolymorphicError`

Addresses multiple test failures caused by the error below:

  QueueConfig.to_hash title when assigned to an org is formatted as expected
     Failure/Error:
       tasks.with_assignees.group("assignees.display_name").count(:all).each_pair.map do |option, count|
         label = self.class.format_option_label(option, count)
         self.class.filter_option_hash(option, label)
       end

     ActiveRecord::EagerLoadPolymorphicError:
       Cannot eagerly load the polymorphic association :appeal
     # ./app/models/queue_column.rb:110:in `assignee_options'

* 🐛 Fix `spec/models/task_spec.rb` - `update_all` clears query cache

In Rails 6.1.7.7, the method `ActiveRecord::Relation #update_all`
will now clear any records cached by the calling relation.

This was altering the behavior of `Task #cancel_task_and_child_subtasks`
and causing the following test failure:

  Task#cancel_task_and_child_subtasks cancels all tasks and child subtasks
     Failure/Error: expect(second_level_tasks[0].versions.count).to eq(initial_versions + 2)

       expected: 3
            got: 2

       (compared using ==)
     # ./spec/models/task_spec.rb:368:in `block (3 levels) in <top (required)>'

To remedy, we will now cache the necessary Task records in an Array, which can
be used for generating PaperTrail versions both before and after the `update_all`.

* 🐛 Fix `spec/services/hearings/calendar_service_spec.rb` - template rendering error

Addresses the following test failure:

  Hearings::CalendarService.confirmation_calendar_invite returns appropriate iCalendar event
     Failure/Error: expect(ical_event.description).to eq(expected_description)

       expected: "You're scheduled for a virtual hearing with a Veterans Law Judge of the Board of Veterans' Appeals.\...to reschedule or cancel your virtual hearing, contact us by email at bvahearingteamhotline@va.gov\n"
            got: #<Icalendar::Values::Text("You're scheduled for a virtual hearing with a Veterans Law Judge of the Bo... reschedule or cancel your virtual hearing, contact us by email at bvahearingteamhotline@va.gov\n")>

* 🐛 Fix YAML syntax error caused by whitespace in ENV var

Address the following error, found during demo deployment:

  rake aborted!
  Cannot load database configuration:
  YAML syntax error occurred while parsing /caseflow/config/database.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Error: (<unknown>): could not find expected ':' while scanning a simple key at line 49 column 5

* ⬆️ Update `caseflow-commons` dependency to latest ref

Removes `bourbon` and `neat` dependencies.

* Add arrow keys fix

* Pull filtered docs and doc navigation changes from laurenyj/APPEALS-58255 and add browser tab fix

* Update Document Viewer document title logic so document title updates when user clicks Next or Previous buttons

* Revert glamor styles changes

* Update lodash imports to reduce size

* Replace lodash/get with javascript optional chaining

* Refactor previous/next doc logic without lodash

* Remove unused import from ReaderFooter

* Delete lodash logic in documentUtil and move ReaderToolbar functions to ReaderToolbar component

* Update prototype-footer css

---------

Co-authored-by: laurenyj <44596134+laurenyj@users.noreply.github.com>
Co-authored-by: Jeremy Croteau <jcroteau@users.noreply.github.com>

* Hotfix/appeals 57831 (#22949)

* Add fix for the outer scroll bar in the DocumentList page

* Remove unnecessary conditional for outer scroll bar logic in DocumentViewer

---------

Co-authored-by: laurenyj <44596134+laurenyj@users.noreply.github.com>

* Hotfix/appeals 57827 57832 57836 (#22950)

* Add fix for filtered docs bug

* Revert component import paths to full path

* Revert glamor styles changes

* Update lodash imports to reduce size

* Replace lodash/get with javascript optional chaining

* Refactor previous/next doc logic without lodash

* Remove unused import from ReaderFooter

* Delete lodash logic in documentUtil and move ReaderToolbar functions to ReaderToolbar component

* Update prototype-footer css

* Adding regression tests for filtered document order.

* Adding label to filtered icon.

* Adding test for unfiltered content.

* Moving test up to previous.

* Fix merge conflict

* Fix merge conflict

* Fix empty arrow function lint error in ReaderFooter.test.js

---------

Co-authored-by: laurenyj <44596134+laurenyj@users.noreply.github.com>
Co-authored-by: Brian Bommarito <brian@bommarito.me>

* Andre/appeals 57834 (#22951)

* APPEALS-57834 Sidebar is defaulting to "close" instead of "open"

* Add test to detect sidebar is open

* Category test fixes/props cleanup.

* WIP for readersidebar

* finish up test to verify sidebar state persist to next document

---------

Co-authored-by: Andre Pollard <andre.pollard@va.gov>
Co-authored-by: Davy Wentworth <david.wentworth@va.gov>

* Andre/appeals 57833 (#22878)

* Update scaleFraction to allow single column on load

* create scaling equation for large screens

* Started test to detect single or two column loading on default

* update css to breakpoint at 1654px for most docs

* remove test as not changing code only css

* Andre/appeals 57834 (#22858)

* APPEALS-57834 Sidebar is defaulting to "close" instead of "open"

* Add test to detect sidebar is open

* Category test fixes/props cleanup.

* WIP for readersidebar

* finish up test to verify sidebar state persist to next document

---------

Co-authored-by: Davy Wentworth <david.wentworth@va.gov>

* Removed Line 30 (#22953)

Co-authored-by: Anusha Palliyil <palliyil_anusha@bah.com>

* Davywentwortht2it/appeals 57817 (#22954)

* APPEALS-57817. Rework Reader prototype Page logic to minimize race conditions when scaling/scrolling.

* APPEALS-57817. Minimal test coverage for Page component.

---------

Co-authored-by: Davy Wentworth <david.wentworth@va.gov>

* Update documentation replacing master with main (#22960)

* Update WINDOWS_11.md replacing master with main

* References to master are changed to main where applicable

* Add doc navigation test to ReaderFooter.test.js (#22969)

* APPEALS-54874: Update PG and Ruby-oci8 gems (#22506)

* update minimum version in gemfile and ran bundle install (#22503)

* require ruby-oci8 in config/boot.rb to fix SIGV fault

* APPEALS-36292: Conditionally render banner alerts based on which environment it is deployed on (#21367)

* Conditionally render alerts based on which environment is deployed

* setting Env alert banner sitewide

* separate colors for different envs using the same alert type

* lighter reds for prodtest alert so the text is more readable

* give demo banner more contrast

* adjust specific language for demo env

* adjust logic to accept proper env var. Add style for preprod (yellow)

* isolate env alert styles

* remove duplicate 'demo' Alert

* remove development env banner to fix tests

* making conditional logic a little more bulletproof against 'production'

* update CaseWorkerIndex snapshot

* fix env var

* update snapshot from hard 'uat' setting

* conditionally render env alert on only the home page

* sticky env header statuses

* getting development alert banners to work

* target correct frontend dependency for NavigationBar changes

* connecting new frontend package with better prod exclusion logic

* make the prodtest env badge a more readable color

* cleaning up testing code

* fix linting issues

* Remove unnecessary space

* new NavigationBar update

* yarn install of new FE dependency

* remove extra package.json

* remove development env logic due to NODE_ENV bug

* fixing broken logo link padding and colors

* hardening logic to exclude other inputs

* correcting operator logic

* remove testing var

* point caseflow-frontend to master

* point at most recent caseflow-frontend master

* linting issues fix

* update Route and CaseWorker snapshot

* update snapshot for process.env.DEPLOY_ENV

---------

Co-authored-by: Craig Reese <109101548+craigrva@users.noreply.github.com>

* Merge feature/APPEALS-41559 into release/FY24Q4.6.0 (#22979)

* Start feature work tracking PR with a TODO comment

* Remove TODO comment for CodeClimate

* SeanC/APPEALS-42315 | Create separate Remand table, model and seed data (#22220)

* added migration file for adding type column to supplemental claims table

* created stub for remand model

* added type to supplemental claim factory and new remand trait

* added remand sc's to vha seeds

* updated migration name and fixed typo

* Changed migration to inherit from Caseflow::Mirgration

* schema changes

* reverting schema

* changed the setting of the type column

* fixed schema and renamed migration file

* fixed migration and schema

* updated the remands factory and seeds

* fixed comment in schema

---------

Co-authored-by: Robert Travis Pierce <robert@roberttravispierce.com>

* TYLERB/APPEALS-42455: Display new and migrated Remands in Decision Review Queue tabs (#22206)

* Added support for remands to the business_line.rb model and the index.js util file that parses the decision review type filters for the decision review queue.

* Updated the business line spec file, the decision reviews controller spec tests, and the reviews spec feature test to support remands.

* Added a decision review polymorphic helper to DRY up some of the polymorphic appeal concerns.

* Overrode the remand model association to request issues so active record joins will work correctly.

* Added another helper for sti polymorphic relationships. Fixed filtering for STI decision review types for remands. Updated tests and added factories for testing.

* Code climate fixes and test fixes.

* Fixed more test failures. Removed the remand request issues relationship since it was incorrectly implemented. Added a scope to supplemental claims for remands. Fixed an issue where board grant effectuation tasks without request issues were missing from the new task type count method.

* Changed the UNION ALL to a UNION in the new task_type_count method to prevent duplicate row counts. Updated tests and fixed an issue where the board grant effectuation tasks were being counted for pending task queries.

* JHoang/APPEALS-42318 (#22270)

* some preliminary remand & sc model updates

* typo

* some preliminary hlr checks?

* undo seed change

* decision issue and sc updates

* attempt code climate fixes

* another code climate fix

* testing changes

* useless variable..

* fix conditional in decision issue

* fix undefined find_by method

* attempt rspec fix

* rspec fix attempt #2

* supplemental_claim_spec fix?

* remove comma

* code climate fix

* added comment for transparency on remand creation, attempt fix for remands route

* updated specs for decision_issue, hlr_spec, appeal_spec to account for remand creation type

* fix lint error

* fix lint error #2

---------

Co-authored-by: Jonathan Hoang <trinhjoanthan.hoang@va.gov>

* APPEALS-42458 (#22365)

* disable edit issues link for remands

* add banners explaining that remands are not editable

also makes sure that remands are not editable on the edit issues page

* TYLERB/APPEALS-44922: Update Generate task report page UI to include Remand in conditions (#22356)

* Initial commit. Changed the DecisionReviewType condition filter to a searchable dropdown and added the remands option to it as well. Updated the report page filter parsing to work with the searchable dropdown instead of checkboxes for the decision review type condition filter.

* Updated the ReportPage jest test and the report page feature test to work with the decision review type filter as a searchable dropdown instead of checkboxes.

* SeanC/APPEALS-42317 | Migrate existing Supplemental Claim Remands to Remand records via script (#22359)

* initial verison of update script

* remanded migration file

* updated sc spec with type

* schema

* fixed a few issues in the migration

* small fix to migration file

* moved the type column check into a seperate it block

* fixed wrong column in migration file

* created a new migration for creating the view

* updated the backfill migration file

---------

Co-authored-by: Brandon Lee Dorner <Brandondorner@yahoo.com>

* J hoang/appeals 44940 (#22428)

* initial

* some factory and spec updates

* change history query update and spec fixes

* code climate/lint fix

* change @claim_type identifier

* fix claim_history_event_spec.rb

* test coverage for change history with Remand claim type

* spec lint fixes

* refactor claim_type filtering to account for remand subtype

* business_line_spec fix

* decision_reviews_controller_spec update for remand claim type

* lint fixes for decision_reviews_controller_spec.rb

* comment updates in business_line.rb

* renamed mock data in change_history_reporter_spec

* trigger GA

* refactor claim type filter for less conditional handling

* business line spec fix

---------

Co-authored-by: Jonathan Hoang <trinhjoanthan.hoang@va.gov>

* Initial commit for the brakeman sql injection warning fixes. (#22598)

* Updated the business line reporter class to properly display Remands as a seperate type than SupplementalClaims. Also added additional testing logic for the business line reporter for hlr and scs since it was only covering appeals. (#22664)

Co-authored-by: Robert Travis Pierce <robert@roberttravispierce.com>

* Fixed a bug where the frontend would error due to calling .toLowerCase() on a null or undefined value which could happen sometimes if the api filter options are in an incorrect state. (#22796)

Co-authored-by: Robert Travis Pierce <robert@roberttravispierce.com>

* Updated the remand migration files to work with the rails 6 upgrade and the changes to Caseflow::Migration. (#22825)

* added fix for failing test in decision_reviews_controller_spec (#22829)

---------

Co-authored-by: Robert Travis Pierce <Pierce_Robert@ne.bah.com>
Co-authored-by: Sean Craig <110493538+seancva@users.noreply.github.com>
Co-authored-by: Tyler Broyles <109369527+TylerBroyles@users.noreply.github.com>
Co-authored-by: jonathanh-va <111081469+jonathanh-va@users.noreply.github.com>
Co-authored-by: Jonathan Hoang <trinhjoanthan.hoang@va.gov>
Co-authored-by: Brandon Lee Dorner <Brandondorner@yahoo.com>
Co-authored-by: Clay Sheppard <csheepy@gmail.com>

* APPEALS-50679 | Reassign Cases to Camo Change History (#22982)

* Al/APPEALS-45335 (#22228)

* added additional option to check box list

* fixed some tests and code clean up

* fixed more tests

* fixed jest tests

* changes per Pr feedback

* added custom error display

* fixed style for error message

---------

Co-authored-by: Sean Craig <sean.craig2@va.gov>

* adding logic to bring in issue-modification request and updating the … (#22238)

* adding logic to bring in issue-modification request and updating the csv logic

* refactor logic to get pending status and null to request addition

* pending status filter work fixing

* adding withdrawal date and adding logic to display request issue components

* getting edit of request rows and fixing cancelled data

* fixing linter and fixing the query to make test happy

* fixing specs failures

* removing byebug

* removing frontend changes, adding test, fixing the query to replace higherlevel review,adding new field in serializer

* making code climate happy by doing some minor refactor

* fixing the serializer spec failure

* After merging APPEALS-45335, filter for Requested issues were broken, so refactored it and removed the unnecessary methood that i created

* fixing code climate and spec was failing because of hard coded date

* refactor the edit of request logic to take from version, refactored business line query to remove coalesce and fix test

* fixing codeclimate, remove unnecessary field

* refactor to make first comment appear first in edit of request

* fixing linter issue, spec and refactor to fix the bug

* fixing pending status filter issue and adding test for business line

* fixing broken spec failure

* adding user facilty

* fixing the lead and lag function to prevent entry of pending status multiple times

* fixing an issue in which in progress event was not being made

* adding decision reason that was missed and fixing the event logic one more time

* fixing the multiple issue modification request after decision has been made

* refactor inprogress logic for approved data

* fixing spec failure

* fixing the first version logic to be more simpler and fixing name and adding spec

* fixing more inprogess event

* removing the disabled complexity and taking out the boolean condition to a separate method

* Al/APPEALS-45334 Individual change history table which includes Reassign Cases to CAMO events (#22483)

* added logic for claim history events table

* fixed linting errors

* fixing test failures

* added change Pr feedback

* PR feedback round 2

* changes from round 2 of PR feedback

* Added logic event data versions and tests to cover more edgecases

* changed RequestedIssueFragment

* Updated the individual claim history spec file for test failures. Updated an attribute in the IndividualClaimHistory page that was using the wrong getter. Fixed a code climate linting error.

* Removing unnecessary clear filter

* Combined some of the individual claim history tests into one test so it will run more quickly.

* fixing the withdrawal date versioning issue for different level changes

* fixing the spec failure and linter

---------

Co-authored-by: Brandon Lee Dorner <Brandondorner@yahoo.com>
Co-authored-by: = <tyler.broyles@va.gov>
Co-authored-by: Prajwal Amatya <pamatya@take2it.com>

* TYLERB/APPEALS-57367: change-history-updates (#22479)

* Initial commit with new tests cases for issue modification requests for change history.

* Added two cte queries to the business line change history query to properly work with a lead for the issue modification requests. Added new methods into the claim history event to work with this new lead and modified the existing issue modification in progress and pending event generation methods to better reflect the state of a claim that is going through the issue modficiation process.

* Cleaned up unused code and todos.

* Updated the claim history event create_imr_in_progress_status_event? with even more logic and edge cases.

* Fixed a possible error when with a greater than operator could be used on a null value.

* Fixed a few rspec tests.

* Renamed a method and fixed a few code climate issues.

* Fixed a bug in event status generation if there is a task with versions but no versions that change status.

* Updated tests to work with new logic and remove a todo statement.

* Fixed code complexity warnings.

* Updated serializer spec to work with the bug fix.

* Adjusted the pending method to prevent possible race conditions.

* Fixed a bug where the incorrect decision event user would be shown for an issue modification request creation if the request has been decided when it should be the requestor as the event user.

* Added the correct css ids to a few IMR change history events so that the filtering would work correctly. Also added some additional sql to properly filter based on css id and station id for requestor and decider joins.

* Updated the IMR business line logic so that the decided at fields would always account for cancelled status since it uses updated at instead of decided at to determine when the IMR was closed. Fixed a bit of logic in the claim history event IMR in progress event generation to work another edge case.

* Added in previous IMR edit versions for displaying it to the user.

* Added a test for the change history service class to verify that request edit events have the correct attributes from the previous edits.

* Fixed a typo for one of the table aliases in the business line query.

* Fixed another typo where the facilities filter was using css id instead of station id from a copy/paste error.

* adding changes for previous state array and some test modification

* adding test for previous data

* Fixed some outstanding test failures.

* Fixed a linting error. Removed some duplicated code that happened when merging in the feature branch. Updated a factorybot method that was causing tests to fail.

* Fixed a few code climate warnings.

* Removed some puts statements in the individual claim history feature test.

---------

Co-authored-by: Prajwal Amatya <pamatya@take2it.com>

* TYLERB/APPEALS-58656: Change History CSV and Version Parsing fix (#22874)

* Fixed a modification request claim history in progress event generation bug that could occur when 3-4 pending requests were all created at the same time and then later cancelled at the same time. Also fixed an issue count bug used when building the issue type filter due to additional duplicate rows being inserted into issue type count query due to the left join to the issue modification requests table.

* Altered the version parsing for change history to work with commas in the version strings since that was causing parsing errors. Altered the business line query to use '|||' as a delimeter instead of comma and also changed the array_agg functions to string agg to avoid the '{}' array type casting that was happening between postgres and rails. Updated tests to work with this new parsing.

* Updated vha seed data to have associations to intake data so those seeded claims can correctly generate change history.

* TYLERB/CHANGE-HISTORY-YAML-QUOTE-FIX (#22910)

* Made an update to the claim history parse versions method to work with double quotations after the array_agg to string_agg change.

* Updated the tests to work with the new string agg and version parsing method.

* Skip flakey tests

These are possibly flakey now due to the rails upgrade. We can come
back and fix these once the work has been confirmed in UAT.

* Add rubocop disables for line length

These should be removed when the skips are removed.

* Updated the report_page feature test to reduce flakyness in github actions. Also updated the DownloadHelpers module.

---------

Co-authored-by: Brandon Dorner <brandonleedorner@gmail.com>

* Fix testing error from merge conflict

---------

Co-authored-by: almorbah <149511814+almorbah@users.noreply.github.com>
Co-authored-by: Sean Craig <sean.craig2@va.gov>
Co-authored-by: Prajwal Amatya <122557351+pamatyatake2@users.noreply.github.com>
Co-authored-by: = <tyler.broyles@va.gov>
Co-authored-by: Prajwal Amatya <pamatya@take2it.com>
Co-authored-by: Tyler Broyles <109369527+TylerBroyles@users.noreply.github.com>

* Hotfix/appeals 57826.1 - Fix for alt+C placing comment and moving icon with arrow keys (#22985)

* Fix for icon appearing on alt+c and arrow key support for moving icon.

* Add test coverage

* Andre/appeals 57833 1 (#22990)

* Added test for checking the view layout based on the width of screen

* Add in test for default column

* Hotfix/appeals 37269 #2 (#22886)

* adds script and tests for the script

* adjust the way scheduled_for is created since the previous method was removed

* refactor some of the script

* rename test file to include _spec

* push empty commit to rerun tests

---------

Co-authored-by: Zackary Borges-Rowe <borges-rowe_zackary@bah.com>
Co-authored-by: Ron Wabukenda <130374706+ronwabVa@users.noreply.github.com>

* APPEALS-59294: Hearings seed file is creating DistributionTasks for legacy appeals (#22983)

* set parent task for legacy appeal hearing tasks to root task

* fix whitespace issue

* Fix alt+m hotkey for opening and closing sidebar (#22986)

* Fix alt+m hotkey for opening and closing sidebar

* Add fix for double search results bug and revert current page refactor

* Hotfix/appeals 57826.1 - Fix for alt+C placing comment and moving icon with arrow keys (#22985)

* Fix for icon appearing on alt+c and arrow key support for moving icon.

* Add test coverage

* Andre/appeals 57833 1 (#22990)

* Added test for checking the view layout based on the width of screen

* Add in test for default column

* Fix failing tests in ReaderFooter.test.js

---------

Co-authored-by: davywentwortht2it <david.wentworth@va.gov>
Co-authored-by: andrecolinone <146746795+andrecolinone@users.noreply.github.com>

* Making document reads persist. (#22936)

* Making document reads persist.

* Adding test to insure api is called.

* Change the store to use rootReducer.

* Fixing linting issues.

* Adding a test to make sure previous/next work.

* Hotfix/appeals 57830 (#22952)

* Persist zoom level between Reader documents

* component tests

* code cleanup

---------

Co-authored-by: Daniel Mage <dmage20@gmail.com>

* Add loading text in ReaderFooter (#23007)

* fix for persisting reader sidebar state between documents

* Fix failing tests; add factory for documents.

* bug fix for sidebar toggle persisting across documents

* remove commented out test to clean up pr

* Metrics collection for Reader Prototype

* Adding tests for both complete and incomplete document loads.

* Deleting PdfDocument test.

* Adding new test for metric logging.

* bug fix unsaved comment removed on doc change

* Fix for incorrect document title.

* Fix for ctrl-F not working on Windows.

* Ensure document title persists even when documents have the same type.

* Update paths in test due to new file location.

* Reader prototype combo branch (#23227)

* Use ctrl as meta key for 'find next' behavior. (#23214)

* Use ctrl as meta key for 'find next' behavior.

* Bugfix

* Fix text layer scale bug. (#23216)

---------

Co-authored-by: davywentwortht2it <david.wentworth@va.gov>

---------

Co-authored-by: laurenyj <44596134+laurenyj@users.noreply.github.com>
Co-authored-by: Brian Bommarito <brian@bommarito.me>
Co-authored-by: Jeremy Croteau <jcroteau@users.noreply.github.com>
Co-authored-by: Andre Pollard <andre.pollard@va.gov>
Co-authored-by: Davy Wentworth <david.wentworth@va.gov>
Co-authored-by: andrecolinone <146746795+andrecolinone@users.noreply.github.com>
Co-authored-by: Anusha Palliyil <palliyil_anusha@bah.com>
Co-authored-by: Raymond Hughes <131811099+raymond-hughes@users.noreply.github.com>
Co-authored-by: Craig Reese <109101548+craigrva@users.noreply.github.com>
Co-authored-by: seanrpa <155660052+seanrpa@users.noreply.github.com>
Co-authored-by: Robert Travis Pierce <robert@roberttravispierce.com>
Co-authored-by: Robert Travis Pierce <Pierce_Robert@ne.bah.com>
Co-authored-by: Sean Craig <110493538+seancva@users.noreply.github.com>
Co-authored-by: Tyler Broyles <109369527+TylerBroyles@users.noreply.github.com>
Co-authored-by: jonathanh-va <111081469+jonathanh-va@users.noreply.github.com>
Co-authored-by: Jonathan Hoang <trinhjoanthan.hoang@va.gov>
Co-authored-by: Brandon Lee Dorner <Brandondorner@yahoo.com>
Co-authored-by: Clay Sheppard <csheepy@gmail.com>
Co-authored-by: almorbah <149511814+almorbah@users.noreply.github.com>
Co-authored-by: Sean Craig <sean.craig2@va.gov>
Co-authored-by: Prajwal Amatya <122557351+pamatyatake2@users.noreply.github.com>
Co-authored-by: = <tyler.broyles@va.gov>
Co-authored-by: Prajwal Amatya <pamatya@take2it.com>
Co-authored-by: zborgesva <145717155+zborgesva@users.noreply.github.com>
Co-authored-by: Zackary Borges-Rowe <borges-rowe_zackary@bah.com>
Co-authored-by: Ron Wabukenda <130374706+ronwabVa@users.noreply.github.com>
Co-authored-by: Daniel Mage <dmage20@gmail.com>
  • Loading branch information
1 parent 2a4d94e commit 72d193e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion client/app/readerprototype/components/ReaderSearchBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ const ReaderSearchBar = () => {
// handle keyboard control of search results
useEffect(() => {
const keyHandler = (event) => {
if (event.metaKey && event.code === 'KeyG') {
const metaKey = navigator.appVersion.includes('Win') ? 'ctrlKey' : 'metaKey';

if (event[metaKey] && event.code === 'KeyG') {
event.preventDefault();
if (event.shiftKey) {
previous();
Expand Down
7 changes: 3 additions & 4 deletions client/app/readerprototype/components/TextLayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ const TextLayer = memo((props) => {
// tracking this, the search bar will report double the number of found instances
const [hasRenderedText, setHasRenderedText] = useState(false);

const viewport = page.getViewport({ scale: zoomLevel / 100 });
const viewport = page.getViewport({ scale: 1 });
const textLayerRef = useRef(null);
let positionX = 0;
let positionY = 0;
const fullSizeViewport = page.getViewport({ scale: 1 });

if (rotation.includes('90')) {
positionX = viewport.height;
Expand All @@ -30,8 +29,8 @@ const TextLayer = memo((props) => {
}

const textLayerStyle = {
width: `${fullSizeViewport.width}px`,
height: `${fullSizeViewport.height}px`,
width: `${viewport.width}px`,
height: `${viewport.height}px`,
transformOrigin: 'left top',
opacity: 1,
position: 'absolute',
Expand Down

0 comments on commit 72d193e

Please sign in to comment.