diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b74aed9c4c9..baa41278ab9 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -232,6 +232,7 @@ def admin_menu_items add_team_management_items(admin_urls) add_user_management_items(admin_urls) add_case_distribution_item(admin_urls) + add_test_seeds_item(admin_urls) admin_urls.flatten end diff --git a/app/controllers/case_distribution_levers_tests_controller.rb b/app/controllers/case_distribution_levers_tests_controller.rb index e7eed173af9..15100bf3d4f 100644 --- a/app/controllers/case_distribution_levers_tests_controller.rb +++ b/app/controllers/case_distribution_levers_tests_controller.rb @@ -153,6 +153,14 @@ def appeals_tied_to_avljs_and_vljs send_data csv_data, filename: filename end + def reset_all_appeals + RequestStore[:current_user] = current_user + DistributionTask.where(status: "assigned").map { |t| t.update!(status: "on_hold") } + VACOLS::Case.where(bfcurloc: %w[81 83]).map { |c| c.update!(bfcurloc: "testing") } + + head :ok + end + private def check_environment diff --git a/app/controllers/concerns/errors.rb b/app/controllers/concerns/errors.rb index e825f503396..45dcae65d7b 100644 --- a/app/controllers/concerns/errors.rb +++ b/app/controllers/concerns/errors.rb @@ -3,11 +3,12 @@ module Errors extend ActiveSupport::Concern def invalid_role_error - render json: { + { "errors": [ "title": "Role is Invalid", "detail": "User is not allowed to perform this action" - ] - }, status: :bad_request + ], + "status": "bad_request" + } end end diff --git a/app/controllers/legacy_tasks_controller.rb b/app/controllers/legacy_tasks_controller.rb index 8dab23ebfe4..7e10726cd57 100644 --- a/app/controllers/legacy_tasks_controller.rb +++ b/app/controllers/legacy_tasks_controller.rb @@ -136,7 +136,13 @@ def validate_user_id end def validate_user_role - return invalid_role_error unless ROLES.include?(user_role) + return true if ROLES.include?(user_role) + + Rails.logger.info("User with roles #{current_user.roles.join(', ')} "\ + "couldn't access #{request.original_url}: Error: #{invalid_role_error}") + + session["return_to"] = request.original_url + redirect_to "/unauthorized" end def user diff --git a/app/controllers/test/users_controller.rb b/app/controllers/test/users_controller.rb index ebcbfb8419b..f1fbc72e3b6 100644 --- a/app/controllers/test/users_controller.rb +++ b/app/controllers/test/users_controller.rb @@ -115,8 +115,15 @@ def reseed def optional_seed return unless Rails.deploy_env?(:demo) - system "bundle exec rake db:seed:optional" - head :ok + output = `bundle exec rake db:seed:optional` + + # Using named capture groups and conditional assignment + seeds_added = if output =~ /(?\d+) APPEALS_ADDED/ + Regexp.last_match[:count].to_i + else + 0 + end + render json: { message: "Seeds added successfully", seeds_added: seeds_added }, status: :ok end def toggle_feature diff --git a/app/controllers/test_docket_seeds_controller.rb b/app/controllers/test_docket_seeds_controller.rb index 207977c6439..300f0b7496f 100644 --- a/app/controllers/test_docket_seeds_controller.rb +++ b/app/controllers/test_docket_seeds_controller.rb @@ -4,12 +4,21 @@ class TestDocketSeedsController < ApplicationController before_action :check_environment # , :verify_access # before_action :current_user, only: [:reset_all_appeals] + # rubocop:disable Metrics/AbcSize + # rubocop:disable Metrics/MethodLength def seed_dockets JSON.parse(request.body.read).each do |row_entry| task_name = Constants.TEST_SEEDS.to_h[row_entry["seed_type"].to_sym] ENV["SEED_COUNT"] = row_entry["seed_count"].to_s ENV["DAYS_AGO"] = row_entry["days_ago"].to_s ENV["JUDGE_CSS_ID"] = row_entry["judge_css_id"].to_s + ENV["DISPOSITION"] = row_entry["disposition"].to_s + ENV["HEARING_TYPE"] = row_entry["hearing_type"].to_s + ENV["HEARING_DATE"] = row_entry["hearing_date"].to_s + ENV["AOD_BASED_ON_AGE"] = row_entry["aod_based_on_age"].to_s + ENV["CLOSEST_REGIONAL_OFFICE"] = row_entry["closest_regional_office"].to_s + ENV["UUID"] = row_entry["uuid"].to_s + ENV["DOCKET"] = row_entry["docket"].to_s Rake::Task[task_name].reenable Rake::Task[task_name].invoke @@ -17,7 +26,16 @@ def seed_dockets ENV.delete("SEED_COUNT") ENV.delete("DAYS_AGO") ENV.delete("JUDGE_CSS_ID") + ENV.delete("DISPOSITION") + ENV.delete("HEARING_TYPE") + ENV.delete("HEARING_DATE") + ENV.delete("AOD_BASED_ON_AGE") + ENV.delete("CLOSEST_REGIONAL_OFFICE") + ENV.delete("UUID") + ENV.delete("DOCKET") end + # rubocop:enable Metrics/AbcSize + # rubocop:enable Metrics/MethodLength head :ok end diff --git a/app/controllers/test_seeds_controller.rb b/app/controllers/test_seeds_controller.rb index a5ca03fc54a..db29879bbf4 100644 --- a/app/controllers/test_seeds_controller.rb +++ b/app/controllers/test_seeds_controller.rb @@ -12,6 +12,26 @@ def seeds render "/test/seeds" end + def run_demo + seed_type = params[:seed_type].to_sym + seed_count = params[:seed_count].to_i + test_seed_list = Constants.TEST_SEEDS.to_h + task_name = test_seed_list[seed_type] + + if task_name + Rake::Task[task_name].reenable + index = 0 + seed_count.times do + index += 1 + Rails.logger.info "Rake run count #{index}" + Rake::Task[task_name].execute + end + head :ok + else + render json: { error: "Invalid seed type" }, status: :bad_request + end + end + private def check_environment diff --git a/app/jobs/push_priority_appeals_to_judges_job.rb b/app/jobs/push_priority_appeals_to_judges_job.rb index 8a1e8cfff68..29f6e66503a 100644 --- a/app/jobs/push_priority_appeals_to_judges_job.rb +++ b/app/jobs/push_priority_appeals_to_judges_job.rb @@ -29,6 +29,7 @@ def perform slack_msg = "\n [ERROR] after running for #{duration}: #{error.message}" slack_service.send_notification(slack_msg, self.class.name) log_error(error) + Raven.capture_exception(error, extra: { error_uuid: SecureRandom.uuid }) ensure metrics_service_report_runtime(metric_group_name: "priority_appeal_push_job") end diff --git a/app/views/case_distribution_levers/test.html.erb b/app/views/case_distribution_levers/test.html.erb index f6be3c5eb98..272d1acd64c 100644 --- a/app/views/case_distribution_levers/test.html.erb +++ b/app/views/case_distribution_levers/test.html.erb @@ -6,6 +6,6 @@ feedbackUrl: feedback_url, acdLevers: @acd_levers, acdHistory: @acd_history, - returnedAppealJobs: @returned_appeal_jobs + returnedAppealJobs: @returned_appeal_jobs, }) %> <% end %> diff --git a/client/COPY.json b/client/COPY.json index ea8ce3e41c0..15aaa48271b 100644 --- a/client/COPY.json +++ b/client/COPY.json @@ -1601,6 +1601,83 @@ "MESSAGE": " correspondence have been created for the following Veteran file number(s): " } }, + "TEST_CLEAR_READY_TO_DISTRIBUTE_APPEALS_TITLE": "Clear Ready-to-Distribute Appeals", + "TEST_CLEAR_READY_TO_DISTRIBUTE_APPEALS_ALERTMSG": "Successfully cleared Ready-to-Distribute Appeals", + "TEST_CLEAR_READY_TO_DISTRIBUTE_APPEALS_DESCRIPTION": " - This process changes an appeal's status from Ready to Distribute. It will apply to all Ready to Distribute appeals. They will no longer be eligible for distribution. This may take a few minutes to complete.", + "TEST_RESEED_AOD_ALERTMSG": "Successfully Completed Seeding Aod Hearing Held Appeals.", + "TEST_RESEED_NON_AOD_ALERTMSG": "Successfully Completed Seeding Non Aod Hearing Held Appeals.", + "TEST_RESEED_AMA_DOCKET_GOALS_ALERTMSG": "Successfully Completed Seeding Ama Docket Time Goal Non Priority Appeals.", + "TEST_RESEED_AMA_DOCKET_PRIORITY_ALERTMSG": "Successfully Completed Seeding Docket Type Appeals.", + "TEST_RESEED_NONSSCAVLJAPPEALS_ALERTMSG": "Successfully Completed Seeding non-SSC AVLJ and Appeals.", + "TEST_RESEED_RETURN_LEGACY_APPEALS_ALERTMSG": "Successfully Completed Return Legacy Appeals To Board Job.", + "TEST_RESEED_GENERIC_FULL_SUITE_APPEALS_ALERTMSG": "Basic Seeds appeal creation is complete. {count} appeals have been created as of ", + "TEST_CASE_DISTRIBUTION_LEVERS_DASHBOARD_TITLE": "Case Distribution Levers Dashboard", + "TEST_CASE_DISTRIBUTION_LEVERS_DESCRIPTION": "This page is for lower env use only and provides a convient place to review Case Distribution related data", + "TEST_NAVIGATION_H2": "Navigation", + "TEST_CASE_DISTRIBUTION_LEVERS_BUTTON": "Case Distribution Levers", + "TEST_CASE_DISTRIBUTION_AUDIT_LEVERS_BUTTON": "Case Distribution Audit Levers", + "TEST_ACCESS_CSVS_BUTTON": "Access CSVs", + "TEST_DOWNLOAD_APPEALS_READY_BUTTON": "Download Appeals Ready to Distribute CSV", + "TEST_DOWNLOAD_DISTRIBUTED_APPEALS_BUTTON": "Download Distributed Appeals CSV", + "TEST_DOWNLOAD_INELIGIBLE_JUDGE_BUTTON": "Download Ineligible Judge List", + "TEST_DOWNLOAD_AMA_NON_PRIO_DISTR_BUTTON": "Download AMA Non-priority Distributable CSV", + "TEST_DOWNLOAD_APPEALS_TIED_NONSSC_AVLJS_BUTTON": "Download Appeals tied to Non-SSC AVLJs CSV", + "TEST_DOWNLOAD_APPEALS_TIED_AVLJ_VLJ_BUTTON": "Download Appeals Tied to AVLJ and VLJ CSV", + "TEST_DOWNLOAD_LOC_63_APPEALS_BUTTON": "Download Loc 63 Appeals Last 48 hrs CSV", + "TEST_DOWNLOAD_INELIGIBLE_JUDGE_BUTTON_DESCRIPTION": " - Very specific. Export of judges who are considered ineligible based on their current attributes. Eligible judges with a checkmark excluding them from receiving affinity appeals are not included in this list.", + "TEST_DOWNLOAD_AMA_NON_PRIO_DISTR_BUTTON_DESCRIPTION": " - Subset of Appeals Ready to Distribute. Only includes AMA non-priority appeals that are distributable based on the additional date criteria for Days Before Goal date. (If the lever is turned on, appeal meets goal date criteria; or any ready to distribute appeals in that docket if the lever is off).", + "TEST_DOWNLOAD_APPEALS_TIED_NONSSC_AVLJS_BUTTON_DESCRIPTION": " - List of legacy appeals for which the hearing judge, or the hearing and deciding judge is a Non-SSC AVLJ.", + "TEST_DOWNLOAD_APPEALS_TIED_AVLJ_VLJ_BUTTON_DESCRIPTION": " - List of legacy appeals tied to judges that are AVLJ and VLJ.", + "TEST_DOWNLOAD_LOC_63_APPEALS_BUTTON_DESCRIPTION": " - Very specific. Time-ordered list of legacy appeals for which the location changed to 63. Contains all appeals that met this criteria within the last rolling 48 hours.", + "TEST_CASE_MOVEMENT_BUTTON": "Case Movement", + "LOG_OF_MOST_RECENT_APPEALS_BUTTON": "Log of 15 most recent appeals moved to location 63", + "TEST_ID_TD": "ID", + "TEST_LEVER_ID_TD": "Lever ID", + "TEST_TITLE_TD": "Title", + "TEST_ITEM_TD": "Item", + "TEST_CONTROL_GROUP_TD": "Control Group", + "TEST_LEVER_GROUP_TD": "Lever Group", + "TEST_LEVER_GROUP_ORDER_TD": "Lever Group Order", + "TEST_DESCRIPTION_TD": "Description", + "TEST_DATA_TYPE_TD": "Data Type", + "TEST_VALUE_TD": "Value", + "TEST_MIN_MAX_VALUE_TD": "Min / Max Value", + "TEST_UNIT_TD": "Unit", + "TEST_OPTION_VALUES_TD": "Option Values", + "TEST_TOGGLE_ACTIVE_TD": "Toggle Active", + "TEST_DISABLED_IN_UI_TD": "Disabled In UI", + "TEST_ALGORITHMS_USED_TD": "Algorithms Use", + "TEST_CREATED_AT_TD": "Created At", + "TEST_UPDATED_AT_TD": "Updated At", + "TEST_PREVIOUS_VALUE_TD": "Previous Value", + "TEST_UPDATE_VALUE_TD": "Update Value", + "TEST_USER_CSS_ID_TD": "User CSS ID", + "TEST_USER_NAME_TD": "User CSS ID", + "TEST_LEVER_TITLE_TD": "Lever Title", + "TEST_LEVER_DATA_TYPE_TD": "Lever Data Type", + "TEST_LEVER_UNIT_TD": "Lever Unit", + "TEST_CASE_DISTRIBUTION_LEVERS_H2": " Case Distribution Levers ", + "TEST_CREATE_SEEDED_APPEALS_TITLE": "Create Seeded Appeals", + "TEST_WARNING_P1": "Clicking any button below creates specific appeals. The creation process triggered by any button click can take up to 20 minutes to complete.", + "TEST_WARNING_P2": "While appeals are being created, system performance is considerably slowed, and actions related to requesting appeals or CSVs in the Distribution Status section above will produce unexpected results.", + "TEST_WARNING_P3": "We recommend you only run the seed file identified for your specific testing effort.", + "TEST_RUN_DEMO_AOD_HEARING_HELD_TITLE": "Run Demo AOD Hearing Held Seeds", + "TEST_RUN_DEMO_AOD_HEARING_HELD_DESCRIPTION": " - Creates 204 appeals with an assigned at date. 75% are AMA AOD hearings with a mix of hearing judges (eligible and ineligible).", + "TEST_RUN_DEMO_NON_AOD_HEARING_HELD_TITLE": "Run Demo Non-AOD Hearing Held Seeds", + "TEST_RUN_DEMO_NON_AOD_HEARING_HELD_DESCRIPTION": " - Creates 192 appeals with an assigned at date. 80% are AMA non-priority hearings with a mix of hearing judges (eligible and ineligible).", + "TEST_RUN_DOCKET_TIME_GOAL_TITLE": "Run Docket Time Goal (AMA non-pri) Seeds", + "TEST_RUN_DOCKET_TIME_GOAL_DESCRIPTION": " - Creates 117 appeals with an assigned at date. 60% are AMA Non-priority appeals. Useful when testing Docket Time Goals.", + "TEST_RUN_DOCKET_TYPE_SEEDS_TITLE": "Run Docket-type Seeds", + "TEST_RUN_DOCKET_TYPE_SEEDS_DESCRIPTION": " - Creates 185 appeals with an assigned at date. 35% legacy, remainder mix of AMA original appeals.", + "TEST_RUN_NONSSC_AVLJ_APPEAL_TITLE": "Run Non-SSC AVLJ and Appeal Seeds", + "TEST_RUN_NONSSC_AVLJ_APPEAL_DESCRIPTION": " - Creates 66 assigned legacy appeals. About 50% assigned to Non-SSC AVLJs.", + "TEST_RUN_GENERIC_FULL_SUITE_APPEALS_TITLE": "Run Generic Full Suite Appeals Seeds", + "TEST_RUN_GENERIC_FULL_SUITE_APPEALS_DESCRIPTION": " - Creates over 4,000 appeals that includes those needed for Tasks, Hearings, Cavc AMA appeals, AMA Affinity Appeals, MST PACT Legacy, AMA Intake, Remanded AMA Appeals, and Remanded Legacy Appeals.", + "TEST_CASE_MOVEMENT_TITLE": "Case Movement", + "TEST_RETURN_LEGACY_APPEALS_TO_BOARD_JOB_TITLE": "Run ReturnLegacyAppealsToBoard job", + "TEST_RETURN_LEGACY_APPEALS_TO_BOARD_JOB_DESCRIPTION": " - Click to run the ReturnLegacyAppealsToBoard job. This job changes the location to 63 for qualifying legacy appeals.", + "TEST_LOG_OF_MOST_RECENT_APPEALS_MOVED_TITLE": "Log of 15 most recent appeals moved to location 63", + "TEST_BACK_TO_TOP_BUTTON": "Back to Top", "TEST_SEEDS_ALERT_MESSAGE": " in progress", "TEST_SEEDS_RUN_SEEDS": "Scenario Seeds", "TEST_SEEDS_CUSTOM_SEEDS": "Custom Seeds", diff --git a/client/app/caseDistribution/components/AffinityDays.jsx b/client/app/caseDistribution/components/AffinityDays.jsx index 06beeafa00f..feac1d474cc 100644 --- a/client/app/caseDistribution/components/AffinityDays.jsx +++ b/client/app/caseDistribution/components/AffinityDays.jsx @@ -115,7 +115,7 @@ const AffinityDays = () => { return (
-
+
{ id={`${lever.item}-${option.item}`} name={lever.item} onChange={onChangeRadio(lever, option)} + title={option.text} /> +
{option.text}
diff --git a/client/app/caseDistribution/components/testPage/ResetButton.jsx b/client/app/caseDistribution/components/testPage/ResetButton.jsx new file mode 100644 index 00000000000..a7c72898a3b --- /dev/null +++ b/client/app/caseDistribution/components/testPage/ResetButton.jsx @@ -0,0 +1,23 @@ +import React from 'react'; +import Button from '../../../components/Button'; +import PropTypes from 'prop-types'; + +const ResetButton = ({ onClick, loading }) => { + return ( + + {COPY.TEST_CASE_DISTRIBUTION_LEVERS_BUTTON}
  • - + {COPY.TEST_CASE_DISTRIBUTION_AUDIT_LEVERS_BUTTON}
  • - - + + {COPY.TEST_ACCESS_CSVS_BUTTON}
  • - + + {COPY.TEST_CREATE_SEEDED_APPEALS_TITLE} + +
  • +
  • + + {COPY.TEST_CASE_MOVEMENT_BUTTON} +
  • - + {COPY.LOG_OF_MOST_RECENT_APPEALS_BUTTON}
  • -

    Case Distribution Levers

    +

    {COPY.TEST_CASE_DISTRIBUTION_LEVERS_H2}

    - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -276,20 +325,20 @@ class CaseDistributionTest extends React.PureComponent {
    ID Title Item Control Group Lever Group Lever Group Order Description Data Type Value Min / Max Value Unit Option Values Toggle Active Disabled In UI Algorithms Used Created At Updated At {COPY.TEST_ID_TD} {COPY.TEST_TITLE_TD} {COPY.TEST_ITEM_TD} {COPY.TEST_CONTROL_GROUP_TD} {COPY.TEST_LEVER_GROUP_TD} {COPY.TEST_LEVER_GROUP_ORDER_TD} {COPY.TEST_DESCRIPTION_TD} {COPY.TEST_DATA_TYPE_TD} {COPY.TEST_VALUE_TD} {COPY.TEST_MIN_MAX_VALUE_TD} {COPY.TEST_UNIT_TD} {COPY.TEST_OPTION_VALUES_TD} {COPY.TEST_TOGGLE_ACTIVE_TD} {COPY.TEST_DISABLED_IN_UI_TD} {COPY.TEST_ALGORITHMS_USED_TD} {COPY.TEST_CREATED_AT_TD} {COPY.TEST_UPDATED_AT_TD}

    -

    Case Distribution Audit Levers

    +

    {COPY.TEST_CASE_DISTRIBUTION_AUDIT_LEVERS_BUTTON}

    - - - - - - - - - - + + + + + + + + + + @@ -313,121 +362,239 @@ class CaseDistributionTest extends React.PureComponent {
    ID Lever ID Created At Previous Value Update Value User CSS ID User Name Lever Title Lever Data Type Lever Unit {COPY.TEST_ID_TD} {COPY.TEST_LEVER_ID_TD} {COPY.TEST_CREATED_AT_TD} {COPY.TEST_PREVIOUS_VALUE_TD} {COPY.TEST_UPDATE_VALUE_TD} {COPY.TEST_USER_CSS_ID_TD} {COPY.TEST_USER_NAME_TD} {COPY.TEST_LEVER_TITLE_TD} {COPY.TEST_LEVER_DATA_TYPE_TD} {COPY.TEST_LEVER_UNIT_TD}

    -

    Distribution Status

    -
    +
    + + {COPY.TEST_DOWNLOAD_APPEALS_READY_BUTTON} + + {COPY.TEST_DOWNLOAD_APPEALS_READY_BUTTON_DESCRIPTION} +
    +
    - -
  • +
  • +
    + + {COPY.TEST_DOWNLOAD_AMA_NON_PRIO_DISTR_BUTTON} + + {COPY.TEST_DOWNLOAD_AMA_NON_PRIO_DISTR_BUTTON_DESCRIPTION} +
    +
    + {COPY.TEST_DOWNLOAD_APPEALS_TIED_NONSSC_AVLJS_BUTTON} + - -
  • - +
  • +
    + + {COPY.TEST_DOWNLOAD_APPEALS_TIED_NONSSC_AVLJS_BUTTON} + + {COPY.TEST_DOWNLOAD_APPEALS_TIED_NONSSC_AVLJS_BUTTON_DESCRIPTION} +
    +
    + + {COPY.TEST_DOWNLOAD_INELIGIBLE_JUDGE_BUTTON} + - -
  • +
  • +
    + + {COPY.TEST_DOWNLOAD_INELIGIBLE_JUDGE_BUTTON} + + {COPY.TEST_DOWNLOAD_INELIGIBLE_JUDGE_BUTTON_DESCRIPTION} +
    +
    + + + +
    +
    + + {COPY.TEST_DOWNLOAD_DISTRIBUTED_APPEALS_BUTTON} + + {COPY.TEST_DOWNLOAD_DISTRIBUTED_APPEALS_BUTTON_DESCRIPTION} +
    +
    - - +
    +
    + + {COPY.TEST_DOWNLOAD_LOC_63_APPEALS_BUTTON} + + {COPY.TEST_DOWNLOAD_LOC_63_APPEALS_BUTTON_DESCRIPTION} +
    +
    + + + +
    +
    + + {COPY.TEST_DOWNLOAD_APPEALS_TIED_AVLJ_VLJ_BUTTON} + + {COPY.TEST_DOWNLOAD_APPEALS_TIED_AVLJ_VLJ_BUTTON_DESCRIPTION} +
    +

    -

    Run Seed Files

    +

    {COPY.TEST_CREATE_SEEDED_APPEALS_TITLE}

    { this.state.showAlert && {this.state.alertMsg} } -
      -
    • +
      + +
      +
      + {COPY.TEST_CLEAR_READY_TO_DISTRIBUTE_APPEALS_TITLE} + {COPY.TEST_CLEAR_READY_TO_DISTRIBUTE_APPEALS_DESCRIPTION} +
      +
      + + + + +

      {COPY.TEST_WARNING_P1}

      +

      {COPY.TEST_WARNING_P2}

      +

      {COPY.TEST_WARNING_P3}

      +
      +
    • -
    • +
    +
    + {COPY.TEST_RUN_DEMO_AOD_HEARING_HELD_TITLE} + {COPY.TEST_RUN_DEMO_AOD_HEARING_HELD_DESCRIPTION} +
    +
    +
    + {COPY.TEST_RUN_DEMO_NON_AOD_HEARING_HELD_TITLE} + {COPY.TEST_RUN_DEMO_NON_AOD_HEARING_HELD_DESCRIPTION} +
    +
    +
    + {COPY.TEST_RUN_DOCKET_TIME_GOAL_TITLE} + {COPY.TEST_RUN_DOCKET_TIME_GOAL_DESCRIPTION} +
    +
    +
    + {COPY.TEST_RUN_DOCKET_TYPE_SEEDS_TITLE} + {COPY.TEST_RUN_DOCKET_TYPE_SEEDS_DESCRIPTION} +
    +
    +
    + {COPY.TEST_RUN_NONSSC_AVLJ_APPEAL_TITLE} + {COPY.TEST_RUN_NONSSC_AVLJ_APPEAL_DESCRIPTION} +
    +
    +
    +
    + {COPY.TEST_RUN_GENERIC_FULL_SUITE_APPEALS_TITLE} + {COPY.TEST_RUN_GENERIC_FULL_SUITE_APPEALS_DESCRIPTION} +
    +

    -

    Case Movement

    - { this.state.showLegacyAppealsAlert && - - {this.state.legacyAppealsAlertMsg} - - } - + +
    + + {COPY.TEST_RETURN_LEGACY_APPEALS_TO_BOARD_JOB_TITLE} + + {COPY.TEST_RETURN_LEGACY_APPEALS_TO_BOARD_JOB_DESCRIPTION} +
    +
    -

    Log of 15 most recent appeals moved to location 63

    +

    + {COPY.TEST_LOG_OF_MOST_RECENT_APPEALS_MOVED_TITLE} +


    - + + + ); diff --git a/client/app/styles/caseDistribution/_interactable_levers.scss b/client/app/styles/caseDistribution/_interactable_levers.scss index f241e716fcc..aef5a836646 100644 --- a/client/app/styles/caseDistribution/_interactable_levers.scss +++ b/client/app/styles/caseDistribution/_interactable_levers.scss @@ -47,6 +47,14 @@ margin-bottom: 5px; } +.radio-with-text { + display: flex; +} + +.hidden-label-text { + display: none; +} + .lever-head { width: 100%; border-bottom: 1px solid $color-gray-warm-light; diff --git a/client/app/styles/caseDistribution/_test_seeds.scss b/client/app/styles/caseDistribution/_test_seeds.scss index 257a9e240f8..b75a7f53a55 100644 --- a/client/app/styles/caseDistribution/_test_seeds.scss +++ b/client/app/styles/caseDistribution/_test_seeds.scss @@ -131,3 +131,18 @@ $case-movement-button-bg-color: #07648d; .usa-button-case-movement:hover { background: $case-movement-button-bg-color; } + +.csv-download-left { + width: 32%; + margin-bottom: 50px; +} + +.csv-download-right { + width: 65%; + margin-bottom: 50px; + vertical-align: top; +} + +.csv-download-alignment { + border-bottom: 0; +} diff --git a/client/app/test/TestSeeds.jsx b/client/app/test/TestSeeds.jsx new file mode 100644 index 00000000000..b0fd1f71129 --- /dev/null +++ b/client/app/test/TestSeeds.jsx @@ -0,0 +1,170 @@ +/* eslint-disable react/prop-types */ + +import React from 'react'; +import NavigationBar from '../components/NavigationBar'; +import { BrowserRouter } from 'react-router-dom'; +import PageRoute from '../components/PageRoute'; +import AppFrame from '../components/AppFrame'; +import AppSegment from '@department-of-veterans-affairs/caseflow-frontend-toolkit/components/AppSegment'; +import { LOGO_COLORS } from '../constants/AppConstants'; +import CaseSearchLink from '../components/CaseSearchLink'; +import ApiUtil from '../util/ApiUtil'; +import Button from '../components/Button'; +import cx from 'classnames'; +import TEST_SEEDS from '../../constants/TEST_SEEDS'; +import Alert from 'app/components/Alert'; +import COPY from '../../COPY'; + +class TestSeeds extends React.PureComponent { + constructor(props) { + super(props); + this.state = { + reseedingStatus: { + Aod: false, + NonAod: false, + Tasks: false, + Hearings: false, + Intake: false, + Dispatch: false, + Jobs: false, + Substitutions: false, + DecisionIssues: false, + CavcAmaAppeals: false, + SanitizedJsonSeeds: false, + VeteransHealthAdministration: false, + MTV: false, + Education: false, + PriorityDistributions: false, + TestCaseData: false, + CaseDistributionAuditLeverEntries: false, + Notifications: false, + CavcDashboardData: false, + VbmsExtClaim: false, + CasesTiedToJudgesNoLongerWithBoard: false, + StaticTestCaseData: false, + StaticDispatchedAppealsTestData: false, + RemandedAmaAppeals: false, + RemandedLegacyAppeals: false, + PopulateCaseflowFromVacols: false + }, + seedRunningStatus: false, + seedRunningMsg: 'Seeds running' + }; + this.seedCounts = {}; + } + + handleChange= (event, type) => { + this.seedCounts[type] = event.target.value; + } + + reseed = (type) => { + const seedCount = parseInt(this.seedCounts[type], 10) || 1; + + this.setState({ seedRunning: true, seedRunningMsg: '' }); + this.setState((prevState) => ({ + reseedingStatus: { ...prevState.reseedingStatus, [type]: true } + })); + + const endpoint = `/seeds/run-demo/${type}/${seedCount}`; + + ApiUtil.post(endpoint).then(() => { + this.setState({ seedRunning: false }); + this.setState((prevState) => ({ + reseedingStatus: { ...prevState.reseedingStatus, [type]: false } + })); + }). + catch((err) => { + console.warn(err); + this.setState({ seedRunning: false }); + this.setState((prevState) => ({ + reseedingStatus: { ...prevState.reseedingStatus, [type]: false } + })); + }); + }; + + formatSeedName = (name) => { + return name.split('-').map((word) => word.charAt(0).toUpperCase() + word.slice(1)). + join(' '); + }; + + render() { + const Router = this.props.router || BrowserRouter; + const seedTypes = Object.keys(TEST_SEEDS); + + return ( + +
    + } + appName="Caseflow Admin" + > + +
    + ( +
    + <> + {this.state.seedRunning && ( + + )} + +

    {COPY.TEST_SEEDS_RUN_SEEDS}

    +
      + {seedTypes.map((type) => ( +
    • +
      + this.handleChange(event, type)} + /> +
      +
      +
      + <> + {this.state.reseedingStatus[type] && ( +
      + {this.formatSeedName(type)} {COPY.TEST_SEEDS_ALERT_MESSAGE} +
      + )} + +
    • + ))} +
    +
    +
    + )} /> +
    +
    +
    +
    +
    +
    + ); + } +} + +export default TestSeeds; diff --git a/client/app/test/TestUsers.jsx b/client/app/test/TestUsers.jsx index 48cb5613a04..8d3ee9faca0 100644 --- a/client/app/test/TestUsers.jsx +++ b/client/app/test/TestUsers.jsx @@ -153,6 +153,11 @@ export default function TestUsers(props) { return
  • {readableName} + {name === 'case_distribution_dashboard' && ( + +  - Includes options to seed appeals + + )}
  • ; })} diff --git a/client/app/testSeeds/components/CustomSeeds.jsx b/client/app/testSeeds/components/CustomSeeds.jsx index 9f3cde5370a..0b099b594c3 100644 --- a/client/app/testSeeds/components/CustomSeeds.jsx +++ b/client/app/testSeeds/components/CustomSeeds.jsx @@ -60,6 +60,34 @@ const CustomSeeds = () => { obj.judge_css_id = colValue; break; + case 'Disposition': + obj.disposition = colValue; + break; + + case 'Hearing Type': + obj.hearing_type = colValue; + break; + + case 'Date/Time of Hearing': + obj.hearing_date = colValue; + break; + + case 'AOD based on age': + obj.aod_based_on_age = Number(colValue); + break; + + case 'Regional Office': + obj.closest_regional_office = colValue; + break; + + case 'UUID': + obj.uuid = colValue; + break; + + case 'Docket': + obj.docket = colValue; + break; + default: break; } @@ -214,6 +242,13 @@ const CustomSeeds = () => { Amount Days Ago Associated Judge + Disposition + Hearing Type + Date/Time of Hearing + AOD based on age + Regional Office + UUID + Docket