From 1751ca5a5c558d6f2e9aa01dfb95e1c4b3d3c043 Mon Sep 17 00:00:00 2001 From: AdamShawBAH Date: Sun, 25 Aug 2024 09:52:00 -0400 Subject: [PATCH 01/21] React Dependency upgrade --- client/package.json | 4 ++-- client/yarn.lock | 32 +++++++++++++------------------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/client/package.json b/client/package.json index f6c1c6c67a7..f132e14b37f 100644 --- a/client/package.json +++ b/client/package.json @@ -105,10 +105,10 @@ "pluralize": "^7.0.0", "prop-types": "^15.7.2", "rc-collapse": "^1.11.8", - "react": "^16.13.1", + "react": "18.2.0", "react-copy-to-clipboard": "^5.0.1", "react-csv": "^1.1.1", - "react-dom": "^16.13.1", + "react-dom": "18.2.0", "react-draft-wysiwyg": "^1.12.11", "react-highlight-words": "^0.8.0", "react-hook-form": "^6.14.2", diff --git a/client/yarn.lock b/client/yarn.lock index 43195de976b..46105393355 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -13994,15 +13994,13 @@ react-docgen@^5.0.0: node-dir "^0.1.10" strip-indent "^3.0.0" -react-dom@^16.13.1: - version "16.13.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f" - integrity sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag== +react-dom@18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" + integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" - prop-types "^15.6.2" - scheduler "^0.19.1" + scheduler "^0.23.0" react-dom@^16.9.0: version "16.9.0" @@ -14331,14 +14329,12 @@ react-virtualized@^9.21.2: prop-types "^15.6.0" react-lifecycles-compat "^3.0.4" -react@^16.13.1: - version "16.13.1" - resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e" - integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w== +react@18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" + integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" - prop-types "^15.6.2" react@^16.9.0: version "16.9.0" @@ -15132,13 +15128,12 @@ scheduler@^0.18.0: loose-envify "^1.1.0" object-assign "^4.1.1" -scheduler@^0.19.1: - version "0.19.1" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" - integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA== +scheduler@^0.23.0: + version "0.23.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3" + integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" schema-utils@2.7.0, schema-utils@^2.6.5, schema-utils@^2.7.0: version "2.7.0" @@ -17658,4 +17653,3 @@ zwitch@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== - \ No newline at end of file From 1dfdd3ae995f3606dd739fd4f34749b978b81b36 Mon Sep 17 00:00:00 2001 From: AdamShawBAH Date: Tue, 27 Aug 2024 15:42:31 -0400 Subject: [PATCH 02/21] Fix for bva_dispatch_return_flow_spec --- .../2.0/components/shared/ErrorBoundary.jsx | 1 + client/app/index.js | 6 +++++- .../caseEvaluation/CaseTimelinessTimeline.jsx | 5 +++++ .../caseEvaluation/EvaluateDecisionView.jsx | 19 ++++++++++++++----- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/client/app/2.0/components/shared/ErrorBoundary.jsx b/client/app/2.0/components/shared/ErrorBoundary.jsx index 34e72e4c02f..a3910614dd2 100644 --- a/client/app/2.0/components/shared/ErrorBoundary.jsx +++ b/client/app/2.0/components/shared/ErrorBoundary.jsx @@ -19,6 +19,7 @@ export class ErrorBoundary extends React.Component { error, info, }); + console.log("Error caught:", error, info); } render() { diff --git a/client/app/index.js b/client/app/index.js index 2b7de044bc9..e5d6ae92e8e 100644 --- a/client/app/index.js +++ b/client/app/index.js @@ -10,6 +10,7 @@ import 'pdfjs-dist/web/pdf_viewer.css'; import React, { Suspense } from 'react'; import ReactOnRails from 'react-on-rails'; import { render } from 'react-dom'; +import { createRoot } from 'react-dom/client'; import { forOwn } from 'lodash'; import { BrowserRouter, Switch } from 'react-router-dom'; @@ -156,8 +157,11 @@ const componentWrapper = (component) => (props, railsContext, domNodeId) => { const renderApp = (Component) => { const element = wrapComponent(Component); + const container = document.getElementById(domNodeId); + const root = createRoot(container); - render(element, document.getElementById(domNodeId)); + root.render(element); + // render(element, document.getElementById(domNodeId)); }; renderApp(component); diff --git a/client/app/queue/caseEvaluation/CaseTimelinessTimeline.jsx b/client/app/queue/caseEvaluation/CaseTimelinessTimeline.jsx index 0c002f0ef4b..5293e6701ff 100644 --- a/client/app/queue/caseEvaluation/CaseTimelinessTimeline.jsx +++ b/client/app/queue/caseEvaluation/CaseTimelinessTimeline.jsx @@ -5,6 +5,7 @@ import COPY from '../../../COPY'; import { AttorneyDaysWorked } from './AttorneyDaysWorked'; import { AttorneyTasksTreeTimeline } from './AttorneyTasksTreeTimeline'; import { LegacyCaseTimeline } from './LegacyCaseTimeline'; +import ErrorMessage from '../../certification/components/ErrorMessage'; export const CaseTimelinessTimeline = (props) => { const { appeal, @@ -14,6 +15,10 @@ export const CaseTimelinessTimeline = (props) => { displayCaseTimelinessTimeline, } = props; + if (!task) { + return ; + } + let dateAssigned = moment(task.previousTaskAssignedOn); const decisionSubmitted = moment(task.assignedOn); diff --git a/client/app/queue/caseEvaluation/EvaluateDecisionView.jsx b/client/app/queue/caseEvaluation/EvaluateDecisionView.jsx index 60d48ea53e5..c4e0ba085e6 100644 --- a/client/app/queue/caseEvaluation/EvaluateDecisionView.jsx +++ b/client/app/queue/caseEvaluation/EvaluateDecisionView.jsx @@ -320,14 +320,23 @@ const mapStateToProps = (state, ownProps) => { attorneyChildrenTasks = getLegacyTaskTree(state, { appealId: appeal.externalId, judgeDecisionReviewTask }); } else { - // Get all tasks under the JudgeDecisionReviewTask - // Filters out those without a closedAt date or that are hideFromCaseTimeline - attorneyChildrenTasks = getTaskTreesForAttorneyTasks(state, { - appealId: appeal.externalId, judgeDecisionReviewTaskId: judgeDecisionReviewTask.uniqueId - }); + if (judgeDecisionReviewTask && judgeDecisionReviewTask.uniqueId) { + // Get all tasks under the JudgeDecisionReviewTask + // Filters out those without a closedAt date or that are hideFromCaseTimeline + attorneyChildrenTasks = getTaskTreesForAttorneyTasks(state, { + appealId: appeal.externalId, judgeDecisionReviewTaskId: judgeDecisionReviewTask.uniqueId + }); + } else { + console.error('Judge Decision Review Task or uniqueId is undefined'); + attorneyChildrenTasks = []; + } } } + console.log('State:', state); + console.log('Task ID:', ownProps.taskId); + console.log('Judge Decision Review Task:', judgeDecisionReviewTask); + return { appeal, attorneyChildrenTasks, From 9c4fcf174cd4e74b80a5df4a3b21e62601e12350 Mon Sep 17 00:00:00 2001 From: AdamShawBAH Date: Tue, 27 Aug 2024 20:23:52 -0400 Subject: [PATCH 03/21] fixed spec method to click pdf --- spec/feature/reader/reader_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/feature/reader/reader_spec.rb b/spec/feature/reader/reader_spec.rb index e28272314e6..f4330da1f66 100644 --- a/spec/feature/reader/reader_spec.rb +++ b/spec/feature/reader/reader_spec.rb @@ -23,7 +23,7 @@ def add_comment_without_clicking_save(text) click_on "button-AddComment" # text-${pageIndex} is the id of the first page's CommentLayer - page.execute_script("document.querySelectorAll('[id^=\"comment-layer-0\"]')[0].click()") + find('[id^="comment-layer-0"]').click expect(page).to have_css("#addComment", visible: true) From ff223edc79eb7e0b99be0832d2ec4af482219267 Mon Sep 17 00:00:00 2001 From: AdamShawBAH Date: Thu, 29 Aug 2024 13:06:24 -0400 Subject: [PATCH 04/21] Fixed task_queue_spec.rb --- .../app/queue/colocatedTasks/AddColocatedTaskView.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/app/queue/colocatedTasks/AddColocatedTaskView.jsx b/client/app/queue/colocatedTasks/AddColocatedTaskView.jsx index a335329b206..4ebe457187e 100644 --- a/client/app/queue/colocatedTasks/AddColocatedTaskView.jsx +++ b/client/app/queue/colocatedTasks/AddColocatedTaskView.jsx @@ -119,9 +119,15 @@ class AddColocatedTaskView extends React.PureComponent { this.props.setAppealAttrs(task.externalAppealId, { location: 'CASEFLOW' }); this.props.deleteTask(task.uniqueId); } + + const nextStepUrl = this.getNextStepUrl(); + if (nextStepUrl) { + this.props.history.push(nextStepUrl); + } }). - catch(() => { - // handle the error from the frontend + catch((error) => { + console.error('Error in goToNextStep:', error); + // Handle the error appropriately }); }; From 36e72d2c8507eaa9172185e0b62bd04719a9abdd Mon Sep 17 00:00:00 2001 From: hawkespoulterva Date: Thu, 29 Aug 2024 17:23:31 -0400 Subject: [PATCH 05/21] add indicated_for_contested_claims flag to legacy appeals --- app/models/legacy_appeal.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/legacy_appeal.rb b/app/models/legacy_appeal.rb index be859405409..3cbb10d458b 100644 --- a/app/models/legacy_appeal.rb +++ b/app/models/legacy_appeal.rb @@ -399,6 +399,8 @@ def outcoded_by_name end def contested_claim + return false unless FeatureToggle.enabled?(:indicator_for_contested_claims) + vacols_representatives&.any? do |r| VACOLS::Representative::CONTESTED_REPTYPES.values.pluck(:code).include?(r.reptype) end From 972a23642e98d1d1dcf71d6aeeab358f994bfa5d Mon Sep 17 00:00:00 2001 From: hawkespoulterva Date: Fri, 30 Aug 2024 11:11:17 -0400 Subject: [PATCH 06/21] update legacy appeal spec --- spec/models/legacy_appeal_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/models/legacy_appeal_spec.rb b/spec/models/legacy_appeal_spec.rb index ad9b107919d..656220c39ac 100644 --- a/spec/models/legacy_appeal_spec.rb +++ b/spec/models/legacy_appeal_spec.rb @@ -1969,6 +1969,9 @@ context "#contested_claim" do subject { appeal.contested_claim } + before { FeatureToggle.enable!(:indicator_for_contested_claims) } + after { FeatureToggle.disable!(:indicator_for_contested_claims) } + context "when there is no representative" do let(:vacols_case) { create(:case) } it { is_expected.to eq false } From 95a7d3721710614d416b33bd4ff8fe57c23403ab Mon Sep 17 00:00:00 2001 From: AdamShawBAH Date: Tue, 3 Sep 2024 11:25:06 -0400 Subject: [PATCH 07/21] fix for scm_judge_assignment_spec.rb --- client/app/queue/QueueLoadingScreen.jsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/client/app/queue/QueueLoadingScreen.jsx b/client/app/queue/QueueLoadingScreen.jsx index 566563b0e11..2044cf949b4 100644 --- a/client/app/queue/QueueLoadingScreen.jsx +++ b/client/app/queue/QueueLoadingScreen.jsx @@ -45,7 +45,6 @@ class QueueLoadingScreen extends React.PureComponent { if (role === 'sct_coordinator' && userIsSCTCoordinator && type === 'assign') { return this.props.fetchSpecialtyCaseTeamTasks(chosenUserId, userRole, type); } - return this.props.fetchAmaTasksOfUser(chosenUserId, userRole, type); } @@ -102,12 +101,16 @@ class QueueLoadingScreen extends React.PureComponent { if (this.isUserId(userUrlParam)) { const targetUserId = parseInt(userUrlParam, 10); - return ApiUtil.get(`/user?id=${targetUserId}`).then((resp) => - this.props.setTargetUser(resp.body.user)); + return ApiUtil.get(`/user?id=${targetUserId}`).then((resp) => { + this.props.setTargetUser(resp.body.user); + return resp.body.user; // Ensure the user is returned + }); } - return ApiUtil.get(`/user?css_id=${userUrlParam}`).then((resp) => - this.props.setTargetUser(resp.body.user)); + return ApiUtil.get(`/user?css_id=${userUrlParam}`).then((resp) => { + this.props.setTargetUser(resp.body.user); + return resp.body.user; // Ensure the user is returned + }); } isUserId = (str) => { @@ -125,8 +128,8 @@ class QueueLoadingScreen extends React.PureComponent { } createLoadPromise = () => { - return this.maybeLoadTargetUserInfo().then(() => { - const chosenUserId = this.props.targetUserId || this.props.userId; + return this.maybeLoadTargetUserInfo().then((result) => { + const chosenUserId = result?.id || this.props.targetUserId || this.props.userId; const userIsCamoEmployee = this.props.userIsCamoEmployee; return Promise.all([ From 3d6525fd54f137edc66829695270d34f861acb66 Mon Sep 17 00:00:00 2001 From: hawkespoulterva Date: Tue, 3 Sep 2024 15:21:16 -0400 Subject: [PATCH 08/21] force state update --- client/app/queue/UserManagement.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/app/queue/UserManagement.jsx b/client/app/queue/UserManagement.jsx index 7bbbae669b1..6619e4b3ce3 100644 --- a/client/app/queue/UserManagement.jsx +++ b/client/app/queue/UserManagement.jsx @@ -1,4 +1,5 @@ import React from 'react'; +import { flushSync } from 'react-dom'; import { css } from 'glamor'; import { sprintf } from 'sprintf-js'; @@ -33,6 +34,7 @@ export default class UserManagement extends React.PureComponent { // Search functions asyncLoadUser = (inputValue) => { // don't search till we have min length input + if (inputValue.length < 2) { this.setState({ remainingUsers: [] }); @@ -42,7 +44,9 @@ export default class UserManagement extends React.PureComponent { return ApiUtil.get(`/users?css_id=${inputValue}`).then((response) => { const users = response.body.users.data; - this.setState({ remainingUsers: users }); + flushSync(() => { + this.setState({ remainingUsers: users }); + }); return this.dropdownOptions(); }); @@ -68,7 +72,7 @@ export default class UserManagement extends React.PureComponent { } }); }); - } + }; // Status functions From ab792ac750c60074801f8f41f9f680906cf94871 Mon Sep 17 00:00:00 2001 From: AdamShawBAH Date: Wed, 4 Sep 2024 13:32:36 -0400 Subject: [PATCH 09/21] fixed admin_ui_spec.rb --- .../case_distribution_levers/admin_ui_spec.rb | 80 +++++++++++++++---- 1 file changed, 64 insertions(+), 16 deletions(-) diff --git a/spec/feature/case_distribution_levers/admin_ui_spec.rb b/spec/feature/case_distribution_levers/admin_ui_spec.rb index a52390941d7..28324b5330b 100644 --- a/spec/feature/case_distribution_levers/admin_ui_spec.rb +++ b/spec/feature/case_distribution_levers/admin_ui_spec.rb @@ -95,16 +95,18 @@ step "cancelling lever changes resets values" do # Capybara locally is not setting clearing the field prior to entering the new value so fill with "" - fill_in ama_direct_reviews_field, with: "" + clear_field_completely(ama_direct_reviews_field) + clear_field_completely(alternative_batch_size_field) - fill_in ama_direct_reviews_field, with: "123" + set_field_value_with_delay(ama_direct_reviews_field, "123") expect(page).to have_field(ama_direct_reviews_field, with: "123") + click_cancel_button expect(page).to have_field(ama_direct_reviews_field, with: "365") - fill_in ama_direct_reviews_field, with: "123" - fill_in alternative_batch_size_field, with: "" - fill_in alternative_batch_size_field, with: "12" + set_field_value_with_delay(ama_direct_reviews_field, "123") + set_field_value_with_delay(alternative_batch_size_field, "12") + expect(page).to have_field(ama_direct_reviews_field, with: "123") expect(page).to have_field(alternative_batch_size_field, with: "12") @@ -114,8 +116,12 @@ end step "cancelling changes on confirm modal returns user to page without resetting the values in the fields" do - fill_in ama_direct_reviews_field, with: "123" - fill_in alternative_batch_size_field, with: "13" + clear_field_completely(ama_direct_reviews_field) + clear_field_completely(alternative_batch_size_field) + + set_field_value_with_delay(ama_direct_reviews_field, "123") + set_field_value_with_delay(alternative_batch_size_field, "13") + expect(page).to have_field(ama_direct_reviews_field, with: "123") expect(page).to have_field(alternative_batch_size_field, with: "13") @@ -143,9 +149,11 @@ expect(find("#lever-history-table").has_no_content?("300 days")).to eq(true) # Change two levers at once to satisfy a previously separate test - fill_in ama_direct_reviews_field, with: "" - fill_in ama_direct_reviews_field, with: "123" - fill_in ama_evidence_submissions_field, with: "456" + clear_field_completely(ama_direct_reviews_field) + clear_field_completely(ama_evidence_submissions_field) + + set_field_value_with_delay(ama_direct_reviews_field, "123") + set_field_value_with_delay(ama_evidence_submissions_field, "456") click_save_button click_modal_confirm_button expect(page).to have_content(COPY::CASE_DISTRIBUTION_SUCCESS_BANNER_TITLE) @@ -165,9 +173,13 @@ expect(page).to have_field("#{batch_size_per_attorney}-field", readonly: false) expect(page).to have_field("#{request_more_cases_minimum}-field", readonly: false) - fill_in "#{alternate_batch_size}-field", with: "ABC" - fill_in "#{batch_size_per_attorney}-field", with: "-1" - fill_in "#{request_more_cases_minimum}-field", with: "(*&)" + clear_field_completely("#{batch_size_per_attorney}-field") + clear_field_completely("#{request_more_cases_minimum}-field") + clear_field_completely("#{alternate_batch_size}-field") + + set_field_value_with_delay("#{alternate_batch_size}-field", "ABC") + set_field_value_with_delay("#{batch_size_per_attorney}-field", "-1") + set_field_value_with_delay("#{request_more_cases_minimum}-field", "(*&)") expect(page).to have_field("#{alternate_batch_size}-field", with: "") expect(page).to have_field("#{batch_size_per_attorney}-field", with: "1") @@ -178,9 +190,13 @@ end step "batch size lever section errors clear with valid inputs" do - fill_in "#{alternate_batch_size}-field", with: "42" - fill_in "#{batch_size_per_attorney}-field", with: "32" - fill_in "#{request_more_cases_minimum}-field", with: "25" + clear_field_completely("#{batch_size_per_attorney}-field") + clear_field_completely("#{request_more_cases_minimum}-field") + clear_field_completely("#{alternate_batch_size}-field") + + set_field_value_with_delay("#{alternate_batch_size}-field", "42") + set_field_value_with_delay("#{batch_size_per_attorney}-field", "32") + set_field_value_with_delay("#{request_more_cases_minimum}-field", "25") expect(page).not_to have_content(EMPTY_ERROR_MESSAGE) end @@ -202,4 +218,36 @@ def click_cancel_button def click_modal_cancel_button find("#save-modal-cancel").click end + + # Added this method to handle the delay in setting the field value + # Possibly caused by issue with Chromdirver and Capybara not allowing the field to be cleared before setting the new value + # Issue causes the field to be set with the previous value and the new value + # In addition to each individual character needing being sent with a delay + def set_field_value_with_delay(field_id, value) + area = find("##{field_id}") + area.click + area.native.clear # Clear the field using the native clear method + + # Send keys with delay + value.each_char do |char| + area.send_keys char + sleep 0.1 # 100 ms delay between keystrokes + end + end + + # This method ensures that the field is cleared completely and no lingering values are present + def clear_field_completely(field) + max_attempts = 10 + attempts = 0 + + while find_field(field).value.present? && attempts < max_attempts + find_field(field).set("") + sleep 0.1 # Small delay to allow the field to update + attempts += 1 + end + + if attempts == max_attempts + raise "Failed to clear the field after #{max_attempts} attempts" + end + end end From 6383aa7f59c8416de04e66e2a4f896b78b8598f1 Mon Sep 17 00:00:00 2001 From: AdamShawBAH Date: Thu, 5 Sep 2024 11:26:38 -0400 Subject: [PATCH 10/21] fixed user_organization_spec.rb --- spec/feature/queue/user_organization_spec.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/spec/feature/queue/user_organization_spec.rb b/spec/feature/queue/user_organization_spec.rb index d144870e093..16167a51b5a 100644 --- a/spec/feature/queue/user_organization_spec.rb +++ b/spec/feature/queue/user_organization_spec.rb @@ -50,7 +50,9 @@ expect(page).to have_content(format(COPY::USER_MANAGEMENT_PAGE_TITLE, organization.name)) find(".cf-select__control", text: COPY::USER_MANAGEMENT_ADD_USER_TO_ORG_DROPDOWN_TEXT).click - fill_in("Add user", with: user_with_role.css_id) + + set_field_value_with_delay('#add-user', user_with_role.css_id) + expect(page).to have_content(user_with_role.full_name) expect(page).to_not have_content(user_without_role.full_name) @@ -162,3 +164,14 @@ end end end + +def set_field_value_with_delay(selector, value) + area = find(selector) + area.click + + value.each_char do |char| + area.send_keys char + sleep 0.2 + end + area.send_keys :space +end From f32052b9c8e6445935b6a8c6e6f4e1a61bc89fcb Mon Sep 17 00:00:00 2001 From: hawkespoulterva Date: Fri, 6 Sep 2024 10:23:19 -0400 Subject: [PATCH 11/21] flow modal refactor to functional component and fix state renders, remove null saveSuccessful --- client/app/components/FlowModal.jsx | 136 +++++++++--------- .../HearingScheduledInErrorModal.jsx | 3 + spec/feature/queue/motion_to_vacate_spec.rb | 3 +- 3 files changed, 73 insertions(+), 69 deletions(-) diff --git a/client/app/components/FlowModal.jsx b/client/app/components/FlowModal.jsx index 99ce9a2ddb0..020bdbaa58a 100644 --- a/client/app/components/FlowModal.jsx +++ b/client/app/components/FlowModal.jsx @@ -1,93 +1,91 @@ -import React from 'react'; +import React, { useState, useEffect } from 'react'; import Modal from './Modal'; import Alert from './Alert'; import COPY from '../../COPY'; import PropTypes from 'prop-types'; +import { highlightInvalidFormItems } from '../queue/uiReducer/uiActions'; -export default class FlowModal extends React.PureComponent { - constructor(props) { - super(props); - this.state = { - loading: false, - pathAfterSubmit: this.props.pathAfterSubmit - }; - } +const FlowModal = ({ + title = '', + button = COPY.MODAL_SUBMIT_BUTTON, + children, + error, + success, + submitDisabled = false, + submitButtonClassNames = ['usa-button', 'usa-button-hover', 'usa-button-warning'], + pathAfterSubmit = '/queue', + history, + onCancel, + submit, + validateForm, + saveSuccessful, + resetSaveState +}) => { + const [loading, setLoading] = useState(false); + const [pathAfterSubmitState] = useState(pathAfterSubmit); + const [submitSuccess, setSubmitSuccess] = useState(null); - componentDidMount = () => { - if (this.props.highlightInvalidFormItems) { - this.props.highlightInvalidFormItems(false); + useEffect(() => { + if (highlightInvalidFormItems) { + highlightInvalidFormItems(false); } - } + }, [highlightInvalidFormItems]); - cancelHandler = () => this.props.onCancel ? this.props.onCancel() : this.props.history.goBack(); + const cancelHandler = () => onCancel ? onCancel() : history.goBack(); - closeHandler = () => this.props.history.replace(this.state.pathAfterSubmit); - - setLoading = (loading) => this.setState({ loading }); - - submit = () => { - const { validateForm } = this.props; + const closeHandler = () => history.replace(pathAfterSubmitState); + const handleSubmit = () => { if (validateForm && !validateForm()) { - return this.props.highlightInvalidFormItems(true); + return highlightInvalidFormItems(true); } - if (this.props.highlightInvalidFormItems) { - this.props.highlightInvalidFormItems(false); + if (highlightInvalidFormItems) { + highlightInvalidFormItems(false); } - this.setState({ loading: true }); - this.props. - submit(). + setLoading(true); + + submit(). then(() => { - // Not every component that uses queue flow modal sets saveSuccessful, so we may have a null here. Until every - // component sets saveSuccessful on success or failure, this cannot be updated to saveSuccessful === true - if (this.props.saveSuccessful !== false) { - this.closeHandler(); - } + setSubmitSuccess(saveSuccessful); }). finally(() => { - this.props.resetSaveState(); - this.setState({ loading: false }); + resetSaveState(); + setLoading(false); }); }; - render = () => { - const { title, button, children, error, success, submitDisabled, submitButtonClassNames } = this.props; - - return ( - - {error && {error.detail}} - {success && {success.detail}} - {children} - - ); - }; -} + useEffect(() => { + if (submitSuccess) { + closeHandler(); + } + }, [submitSuccess]); -FlowModal.defaultProps = { - button: COPY.MODAL_SUBMIT_BUTTON, - submitButtonClassNames: ['usa-button', 'usa-button-hover', 'usa-button-warning'], - pathAfterSubmit: '/queue', - submitDisabled: false, - title: '', + return ( + + {error && {error.detail}} + {success && {success.detail}} + {children} + + ); }; FlowModal.propTypes = { @@ -110,3 +108,5 @@ FlowModal.propTypes = { PropTypes.string ) }; + +export default FlowModal; diff --git a/client/app/queue/components/HearingScheduledInErrorModal.jsx b/client/app/queue/components/HearingScheduledInErrorModal.jsx index d99a7ba7a82..72815302101 100644 --- a/client/app/queue/components/HearingScheduledInErrorModal.jsx +++ b/client/app/queue/components/HearingScheduledInErrorModal.jsx @@ -43,6 +43,7 @@ const HearingScheduledInErrorModal = (props) => { } = props; const [afterDispositionUpdateAction, setAfterDispositionUpdateAction] = useState(''); + const [saveSuccessful, setSaveSuccessful] = useState(true); const [isPosting, setIsPosting] = useState(false); const hearing = find(appeal.hearings, { externalId: task.externalHearingId }); @@ -93,6 +94,7 @@ const HearingScheduledInErrorModal = (props) => { // This is a failed Promise to prevent `QueueFlowModal` from thinking the // request completed successfully, and redirecting back to the `CaseDetails` page. + setSaveSuccessful(false); return Promise.resolve(); } else if (afterDispositionUpdateAction === ACTIONS.SCHEDULE_LATER) { if (isPosting) { @@ -126,6 +128,7 @@ const HearingScheduledInErrorModal = (props) => { title={COPY.HEARING_SCHEDULED_IN_ERROR_MODAL_TITLE} submit={submit} validateForm={() => true} + saveSuccessful={saveSuccessful} resetSaveState={resetSaveState} pathAfterSubmit={`/queue/appeals/${appeal.externalId}`} > diff --git a/spec/feature/queue/motion_to_vacate_spec.rb b/spec/feature/queue/motion_to_vacate_spec.rb index b9bd44d9551..972e5d086f5 100644 --- a/spec/feature/queue/motion_to_vacate_spec.rb +++ b/spec/feature/queue/motion_to_vacate_spec.rb @@ -669,8 +669,9 @@ def return_to_lit_support(disposition:) fill_in "Document ID:", with: valid_document_id expect(page).to have_content(judge.full_name) fill_in "notes", with: "all done" + binding.pry click_on "Submit" - + binding.pry expect(page).to have_content( "Thank you for drafting #{appeal.veteran_full_name}'s decision. It's been "\ "sent to #{judge.full_name} for review." From 5400912d806ffba20a730e5786b8ff4203320b52 Mon Sep 17 00:00:00 2001 From: AdamShawBAH Date: Fri, 6 Sep 2024 13:36:58 -0400 Subject: [PATCH 12/21] fixed motion_to_vacate_spec.rb --- .../app/queue/mtv/checkout/MotionToVacateFlowContainer.jsx | 5 +++-- client/app/queue/mtv/checkout/mtvCheckoutSteps.js | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client/app/queue/mtv/checkout/MotionToVacateFlowContainer.jsx b/client/app/queue/mtv/checkout/MotionToVacateFlowContainer.jsx index 983dc150c1b..ec3ad372c32 100644 --- a/client/app/queue/mtv/checkout/MotionToVacateFlowContainer.jsx +++ b/client/app/queue/mtv/checkout/MotionToVacateFlowContainer.jsx @@ -21,11 +21,12 @@ export const MotionToVacateFlowContainer = () => { const appeal = useSelector((state) => appealWithDetailSelector(state, { appealId })); - const steps = useMemo(() => getSteps(appeal), [appeal.type, appeal.vacateType]); + // const steps = useMemo(() => getSteps(appeal), [appeal.type, appeal.vacateType]); + const steps = useMemo(() => getSteps(appeal), [appeal?.type, appeal?.vacateType]); const initialState = { // cloning the individual issues - decisionIssues: appeal.decisionIssues.map((issue) => ({ ...issue })), + decisionIssues: appeal?.decisionIssues.map((issue) => ({ ...issue })), steps, getNextUrl: (current) => (getNextStep(current, steps) ? `${basePath}/${getNextStep(current, steps)}` : null), getPrevUrl: (current) => (getPrevStep(current, steps) ? `${basePath}/${getPrevStep(current, steps)}` : null) diff --git a/client/app/queue/mtv/checkout/mtvCheckoutSteps.js b/client/app/queue/mtv/checkout/mtvCheckoutSteps.js index 7ee784d09f5..3d9cf615da1 100644 --- a/client/app/queue/mtv/checkout/mtvCheckoutSteps.js +++ b/client/app/queue/mtv/checkout/mtvCheckoutSteps.js @@ -6,7 +6,9 @@ export const views = { }; // This might be more elegantly modeled w/ a finite state machine lib like xstate -export const getSteps = ({ caseType, vacateType }) => { +export const getSteps = (appeal = {}) => { + const { caseType = '', vacateType = '' } = appeal; + switch (vacateType?.toLowerCase()) { case 'straight_vacate': return ['review_vacatures', 'submit']; From eae6536eec76bd2c31ac0647718a13d4894197ba Mon Sep 17 00:00:00 2001 From: hawkespoulterva Date: Fri, 6 Sep 2024 13:49:18 -0400 Subject: [PATCH 13/21] revert changes --- client/app/components/FlowModal.jsx | 136 ++++++++++++++-------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/client/app/components/FlowModal.jsx b/client/app/components/FlowModal.jsx index 020bdbaa58a..99ce9a2ddb0 100644 --- a/client/app/components/FlowModal.jsx +++ b/client/app/components/FlowModal.jsx @@ -1,91 +1,93 @@ -import React, { useState, useEffect } from 'react'; +import React from 'react'; import Modal from './Modal'; import Alert from './Alert'; import COPY from '../../COPY'; import PropTypes from 'prop-types'; -import { highlightInvalidFormItems } from '../queue/uiReducer/uiActions'; -const FlowModal = ({ - title = '', - button = COPY.MODAL_SUBMIT_BUTTON, - children, - error, - success, - submitDisabled = false, - submitButtonClassNames = ['usa-button', 'usa-button-hover', 'usa-button-warning'], - pathAfterSubmit = '/queue', - history, - onCancel, - submit, - validateForm, - saveSuccessful, - resetSaveState -}) => { - const [loading, setLoading] = useState(false); - const [pathAfterSubmitState] = useState(pathAfterSubmit); - const [submitSuccess, setSubmitSuccess] = useState(null); +export default class FlowModal extends React.PureComponent { + constructor(props) { + super(props); + this.state = { + loading: false, + pathAfterSubmit: this.props.pathAfterSubmit + }; + } - useEffect(() => { - if (highlightInvalidFormItems) { - highlightInvalidFormItems(false); + componentDidMount = () => { + if (this.props.highlightInvalidFormItems) { + this.props.highlightInvalidFormItems(false); } - }, [highlightInvalidFormItems]); + } - const cancelHandler = () => onCancel ? onCancel() : history.goBack(); + cancelHandler = () => this.props.onCancel ? this.props.onCancel() : this.props.history.goBack(); - const closeHandler = () => history.replace(pathAfterSubmitState); + closeHandler = () => this.props.history.replace(this.state.pathAfterSubmit); + + setLoading = (loading) => this.setState({ loading }); + + submit = () => { + const { validateForm } = this.props; - const handleSubmit = () => { if (validateForm && !validateForm()) { - return highlightInvalidFormItems(true); + return this.props.highlightInvalidFormItems(true); } - if (highlightInvalidFormItems) { - highlightInvalidFormItems(false); + if (this.props.highlightInvalidFormItems) { + this.props.highlightInvalidFormItems(false); } + this.setState({ loading: true }); - setLoading(true); - - submit(). + this.props. + submit(). then(() => { - setSubmitSuccess(saveSuccessful); + // Not every component that uses queue flow modal sets saveSuccessful, so we may have a null here. Until every + // component sets saveSuccessful on success or failure, this cannot be updated to saveSuccessful === true + if (this.props.saveSuccessful !== false) { + this.closeHandler(); + } }). finally(() => { - resetSaveState(); - setLoading(false); + this.props.resetSaveState(); + this.setState({ loading: false }); }); }; - useEffect(() => { - if (submitSuccess) { - closeHandler(); - } - }, [submitSuccess]); + render = () => { + const { title, button, children, error, success, submitDisabled, submitButtonClassNames } = this.props; - return ( - - {error && {error.detail}} - {success && {success.detail}} - {children} - - ); + return ( + + {error && {error.detail}} + {success && {success.detail}} + {children} + + ); + }; +} + +FlowModal.defaultProps = { + button: COPY.MODAL_SUBMIT_BUTTON, + submitButtonClassNames: ['usa-button', 'usa-button-hover', 'usa-button-warning'], + pathAfterSubmit: '/queue', + submitDisabled: false, + title: '', }; FlowModal.propTypes = { @@ -108,5 +110,3 @@ FlowModal.propTypes = { PropTypes.string ) }; - -export default FlowModal; From 08207579b241ab60e3fc74a71464cf2ae4d2bc07 Mon Sep 17 00:00:00 2001 From: hawkespoulterva Date: Fri, 6 Sep 2024 13:55:04 -0400 Subject: [PATCH 14/21] revert all changes --- client/app/queue/components/HearingScheduledInErrorModal.jsx | 3 --- spec/feature/queue/motion_to_vacate_spec.rb | 2 -- 2 files changed, 5 deletions(-) diff --git a/client/app/queue/components/HearingScheduledInErrorModal.jsx b/client/app/queue/components/HearingScheduledInErrorModal.jsx index 72815302101..d99a7ba7a82 100644 --- a/client/app/queue/components/HearingScheduledInErrorModal.jsx +++ b/client/app/queue/components/HearingScheduledInErrorModal.jsx @@ -43,7 +43,6 @@ const HearingScheduledInErrorModal = (props) => { } = props; const [afterDispositionUpdateAction, setAfterDispositionUpdateAction] = useState(''); - const [saveSuccessful, setSaveSuccessful] = useState(true); const [isPosting, setIsPosting] = useState(false); const hearing = find(appeal.hearings, { externalId: task.externalHearingId }); @@ -94,7 +93,6 @@ const HearingScheduledInErrorModal = (props) => { // This is a failed Promise to prevent `QueueFlowModal` from thinking the // request completed successfully, and redirecting back to the `CaseDetails` page. - setSaveSuccessful(false); return Promise.resolve(); } else if (afterDispositionUpdateAction === ACTIONS.SCHEDULE_LATER) { if (isPosting) { @@ -128,7 +126,6 @@ const HearingScheduledInErrorModal = (props) => { title={COPY.HEARING_SCHEDULED_IN_ERROR_MODAL_TITLE} submit={submit} validateForm={() => true} - saveSuccessful={saveSuccessful} resetSaveState={resetSaveState} pathAfterSubmit={`/queue/appeals/${appeal.externalId}`} > diff --git a/spec/feature/queue/motion_to_vacate_spec.rb b/spec/feature/queue/motion_to_vacate_spec.rb index 972e5d086f5..92150a16f4b 100644 --- a/spec/feature/queue/motion_to_vacate_spec.rb +++ b/spec/feature/queue/motion_to_vacate_spec.rb @@ -669,9 +669,7 @@ def return_to_lit_support(disposition:) fill_in "Document ID:", with: valid_document_id expect(page).to have_content(judge.full_name) fill_in "notes", with: "all done" - binding.pry click_on "Submit" - binding.pry expect(page).to have_content( "Thank you for drafting #{appeal.veteran_full_name}'s decision. It's been "\ "sent to #{judge.full_name} for review." From 8083683ef97ee8fb6dfcb66afba03de2cd0d77bc Mon Sep 17 00:00:00 2001 From: hawkespoulterva Date: Fri, 6 Sep 2024 14:10:13 -0400 Subject: [PATCH 15/21] stop letting null pass --- client/app/components/FlowModal.jsx | 4 +--- client/app/queue/components/HearingScheduledInErrorModal.jsx | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/app/components/FlowModal.jsx b/client/app/components/FlowModal.jsx index 99ce9a2ddb0..449a42687cf 100644 --- a/client/app/components/FlowModal.jsx +++ b/client/app/components/FlowModal.jsx @@ -40,9 +40,7 @@ export default class FlowModal extends React.PureComponent { this.props. submit(). then(() => { - // Not every component that uses queue flow modal sets saveSuccessful, so we may have a null here. Until every - // component sets saveSuccessful on success or failure, this cannot be updated to saveSuccessful === true - if (this.props.saveSuccessful !== false) { + if (this.props.saveSuccessful === true) { this.closeHandler(); } }). diff --git a/client/app/queue/components/HearingScheduledInErrorModal.jsx b/client/app/queue/components/HearingScheduledInErrorModal.jsx index d99a7ba7a82..b787732fc82 100644 --- a/client/app/queue/components/HearingScheduledInErrorModal.jsx +++ b/client/app/queue/components/HearingScheduledInErrorModal.jsx @@ -43,6 +43,7 @@ const HearingScheduledInErrorModal = (props) => { } = props; const [afterDispositionUpdateAction, setAfterDispositionUpdateAction] = useState(''); + const [saveSuccessful, setSaveSuccessful] = useState(true); const [isPosting, setIsPosting] = useState(false); const hearing = find(appeal.hearings, { externalId: task.externalHearingId }); @@ -93,6 +94,8 @@ const HearingScheduledInErrorModal = (props) => { // This is a failed Promise to prevent `QueueFlowModal` from thinking the // request completed successfully, and redirecting back to the `CaseDetails` page. + setSaveSuccessful(false); + return Promise.resolve(); } else if (afterDispositionUpdateAction === ACTIONS.SCHEDULE_LATER) { if (isPosting) { @@ -125,6 +128,7 @@ const HearingScheduledInErrorModal = (props) => { history={props.history} title={COPY.HEARING_SCHEDULED_IN_ERROR_MODAL_TITLE} submit={submit} + saveSuccessful={saveSuccessful} validateForm={() => true} resetSaveState={resetSaveState} pathAfterSubmit={`/queue/appeals/${appeal.externalId}`} From 01e388c137963e72623572e070871e44a3567e86 Mon Sep 17 00:00:00 2001 From: hawkespoulterva Date: Fri, 6 Sep 2024 14:43:37 -0400 Subject: [PATCH 16/21] revert more changes --- client/app/components/FlowModal.jsx | 4 +++- client/app/queue/components/HearingScheduledInErrorModal.jsx | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/client/app/components/FlowModal.jsx b/client/app/components/FlowModal.jsx index 449a42687cf..99ce9a2ddb0 100644 --- a/client/app/components/FlowModal.jsx +++ b/client/app/components/FlowModal.jsx @@ -40,7 +40,9 @@ export default class FlowModal extends React.PureComponent { this.props. submit(). then(() => { - if (this.props.saveSuccessful === true) { + // Not every component that uses queue flow modal sets saveSuccessful, so we may have a null here. Until every + // component sets saveSuccessful on success or failure, this cannot be updated to saveSuccessful === true + if (this.props.saveSuccessful !== false) { this.closeHandler(); } }). diff --git a/client/app/queue/components/HearingScheduledInErrorModal.jsx b/client/app/queue/components/HearingScheduledInErrorModal.jsx index b787732fc82..d99a7ba7a82 100644 --- a/client/app/queue/components/HearingScheduledInErrorModal.jsx +++ b/client/app/queue/components/HearingScheduledInErrorModal.jsx @@ -43,7 +43,6 @@ const HearingScheduledInErrorModal = (props) => { } = props; const [afterDispositionUpdateAction, setAfterDispositionUpdateAction] = useState(''); - const [saveSuccessful, setSaveSuccessful] = useState(true); const [isPosting, setIsPosting] = useState(false); const hearing = find(appeal.hearings, { externalId: task.externalHearingId }); @@ -94,8 +93,6 @@ const HearingScheduledInErrorModal = (props) => { // This is a failed Promise to prevent `QueueFlowModal` from thinking the // request completed successfully, and redirecting back to the `CaseDetails` page. - setSaveSuccessful(false); - return Promise.resolve(); } else if (afterDispositionUpdateAction === ACTIONS.SCHEDULE_LATER) { if (isPosting) { @@ -128,7 +125,6 @@ const HearingScheduledInErrorModal = (props) => { history={props.history} title={COPY.HEARING_SCHEDULED_IN_ERROR_MODAL_TITLE} submit={submit} - saveSuccessful={saveSuccessful} validateForm={() => true} resetSaveState={resetSaveState} pathAfterSubmit={`/queue/appeals/${appeal.externalId}`} From 53d6879a1a4276c5d0a72d853eb8fcb398709e98 Mon Sep 17 00:00:00 2001 From: hawkespoulterva Date: Fri, 6 Sep 2024 17:20:46 -0400 Subject: [PATCH 17/21] test null condition --- client/app/queue/components/QueueFlowModal.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/app/queue/components/QueueFlowModal.jsx b/client/app/queue/components/QueueFlowModal.jsx index 50b49ff70d5..13a0292c966 100644 --- a/client/app/queue/components/QueueFlowModal.jsx +++ b/client/app/queue/components/QueueFlowModal.jsx @@ -13,7 +13,7 @@ const QueueFlowModal = (props) => { }; const mapStateToProps = (state) => ({ - saveSuccessful: state.ui.saveState.saveSuccessful, + saveSuccessful: state.ui.saveState.saveSuccessful || false, success: state.ui.messages.success, error: state.ui.messages.error }); From 33e063180435c1aaed768d84c9a6f19dfdebad3c Mon Sep 17 00:00:00 2001 From: hawkespoulterva Date: Fri, 6 Sep 2024 17:27:33 -0400 Subject: [PATCH 18/21] comment --- client/app/queue/components/QueueFlowModal.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/client/app/queue/components/QueueFlowModal.jsx b/client/app/queue/components/QueueFlowModal.jsx index 13a0292c966..43483acae76 100644 --- a/client/app/queue/components/QueueFlowModal.jsx +++ b/client/app/queue/components/QueueFlowModal.jsx @@ -13,6 +13,7 @@ const QueueFlowModal = (props) => { }; const mapStateToProps = (state) => ({ + //comment to rerun saveSuccessful: state.ui.saveState.saveSuccessful || false, success: state.ui.messages.success, error: state.ui.messages.error From fe9b2e60d78a5a1b4216f324c7595e87a452451c Mon Sep 17 00:00:00 2001 From: hawkespoulterva Date: Fri, 6 Sep 2024 18:01:57 -0400 Subject: [PATCH 19/21] revert test --- client/app/queue/components/QueueFlowModal.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/app/queue/components/QueueFlowModal.jsx b/client/app/queue/components/QueueFlowModal.jsx index 43483acae76..50b49ff70d5 100644 --- a/client/app/queue/components/QueueFlowModal.jsx +++ b/client/app/queue/components/QueueFlowModal.jsx @@ -13,8 +13,7 @@ const QueueFlowModal = (props) => { }; const mapStateToProps = (state) => ({ - //comment to rerun - saveSuccessful: state.ui.saveState.saveSuccessful || false, + saveSuccessful: state.ui.saveState.saveSuccessful, success: state.ui.messages.success, error: state.ui.messages.error }); From d3daaa67235897becf9e81f31b1d8cfe280c1132 Mon Sep 17 00:00:00 2001 From: hawkespoulterva Date: Mon, 9 Sep 2024 12:38:14 -0400 Subject: [PATCH 20/21] add flushsync --- client/app/queue/components/AssignToAttorneyWidget.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/app/queue/components/AssignToAttorneyWidget.jsx b/client/app/queue/components/AssignToAttorneyWidget.jsx index 1360896f60e..fcf39c0ce02 100644 --- a/client/app/queue/components/AssignToAttorneyWidget.jsx +++ b/client/app/queue/components/AssignToAttorneyWidget.jsx @@ -1,4 +1,5 @@ import React, { useEffect } from 'react'; +import { flushSync } from 'react-dom'; import { useSelector, useDispatch } from 'react-redux'; import { useHistory } from 'react-router-dom'; import { css } from 'glamor'; @@ -390,10 +391,10 @@ const AssignToAttorneyWidgetContainer = (props) => { setSelectedAssigneeSecondary={(val) => dispatch(setSelectedAssigneeSecondary(val))} showErrorMessage={(val) => dispatch(showErrorMessage(val))} resetErrorMessages={(val) => dispatch(resetErrorMessages(val))} - showSuccessMessage={(val) => dispatch(showSuccessMessage(val))} + showSuccessMessage={(val) => flushSync(() => dispatch(showSuccessMessage(val)))} resetSuccessMessages={(val) => dispatch(resetSuccessMessages(val))} resetAssignees={() => dispatch(resetAssignees())} - saveFailure={() => dispatch({ type: ACTIONS.SAVE_FAILURE })} + saveFailure={() => flushSync(() => dispatch({ type: ACTIONS.SAVE_FAILURE }))} {...props} /> ); From 825b3045354a4c0d017e01533704b6ec849bb790 Mon Sep 17 00:00:00 2001 From: hawkespoulterva Date: Mon, 9 Sep 2024 15:08:04 -0400 Subject: [PATCH 21/21] remove extra line --- client/app/queue/components/AssignToAttorneyWidget.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/app/queue/components/AssignToAttorneyWidget.jsx b/client/app/queue/components/AssignToAttorneyWidget.jsx index fcf39c0ce02..7fccd7d5808 100644 --- a/client/app/queue/components/AssignToAttorneyWidget.jsx +++ b/client/app/queue/components/AssignToAttorneyWidget.jsx @@ -391,7 +391,7 @@ const AssignToAttorneyWidgetContainer = (props) => { setSelectedAssigneeSecondary={(val) => dispatch(setSelectedAssigneeSecondary(val))} showErrorMessage={(val) => dispatch(showErrorMessage(val))} resetErrorMessages={(val) => dispatch(resetErrorMessages(val))} - showSuccessMessage={(val) => flushSync(() => dispatch(showSuccessMessage(val)))} + showSuccessMessage={(val) => dispatch(showSuccessMessage(val))} resetSuccessMessages={(val) => dispatch(resetSuccessMessages(val))} resetAssignees={() => dispatch(resetAssignees())} saveFailure={() => flushSync(() => dispatch({ type: ACTIONS.SAVE_FAILURE }))}