From 43b0d20c6ebb4f13a1028b0b7fbdc326f32c71bd Mon Sep 17 00:00:00 2001 From: Brian Bommarito Date: Wed, 15 May 2024 13:49:41 -0400 Subject: [PATCH 1/5] Adding 403 and 404 functionality to Reader. --- client/app/components/LoadingDataDisplay.jsx | 12 ++++++++++-- client/app/reader/ReaderLoadingScreen.jsx | 3 +-- spec/feature/reader/reader_spec.rb | 16 ++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/client/app/components/LoadingDataDisplay.jsx b/client/app/components/LoadingDataDisplay.jsx index f9d63b59081..5990500af78 100644 --- a/client/app/components/LoadingDataDisplay.jsx +++ b/client/app/components/LoadingDataDisplay.jsx @@ -13,8 +13,16 @@ const PROMISE_RESULTS = { const accessDeniedTitle = { title: COPY.ACCESS_DENIED_TITLE }; const accessDeniedMsg =
- It looks like you do not have the necessary level of access to view this information.
- Please check with your application administrator before trying again.
; + VBA employs a sensitive access system and to access records at any designated level requires approval for the same or + higher-level access.
+ You are receiving this message because you do not have an authorized access level required to view this page.
+
+ To request access, please click the button below +
+

+ If you have any questions or need assistance with the request form linked above, please contact the Restricted + Portfolio Management team at VBA.RPM@va.gov. +; const duplicateNumberTitle = { title: COPY.DUPLICATE_PHONE_NUMBER_TITLE }; const duplicateNumberMsg =
diff --git a/client/app/reader/ReaderLoadingScreen.jsx b/client/app/reader/ReaderLoadingScreen.jsx index f53c77478e2..16c29e1c927 100644 --- a/client/app/reader/ReaderLoadingScreen.jsx +++ b/client/app/reader/ReaderLoadingScreen.jsx @@ -32,8 +32,7 @@ export class ReaderLoadingScreen extends React.Component { this.props.onReceiveAnnotations(annotations); }). catch((err) => { - // allow HTTP errors to fall on the floor via the console. - console.error(new Error(`Problem with GET /reader/appeal/${this.props.vacolsId}/documents?json ${err}`)); + throw err; }); } diff --git a/spec/feature/reader/reader_spec.rb b/spec/feature/reader/reader_spec.rb index ad34afcf3ee..e28272314e6 100644 --- a/spec/feature/reader/reader_spec.rb +++ b/spec/feature/reader/reader_spec.rb @@ -1346,6 +1346,22 @@ def open_search_bar visit "/reader/appeal/#{appeal.vacols_id}/documents/#{documents[0].id}" expect(page).to have_content("Unable to load document") end + + scenario "a document that is not accessible by user displays error message" do + allow_any_instance_of(Reader::DocumentsController).to receive(:index) + .and_raise(Caseflow::Error::EfolderAccessForbidden.new(code: 403, message: "error")) + + visit "/reader/appeal/#{appeal.vacols_id}/documents/#{documents[0].id}" + expect(page).to have_content("Additional access") + end + + scenario "a document that is not fouund displays error message" do + allow_any_instance_of(Reader::DocumentsController).to receive(:index) + .and_raise(ActiveRecord::RecordNotFound) + + visit "/reader/appeal/#{appeal.vacols_id}/documents/#{documents[0].id}" + expect(page).to have_content("Information cannot be found") + end end end From 3c9b0569f0d41b8a7ac442fa5c689e942148f588 Mon Sep 17 00:00:00 2001 From: Brian Bommarito Date: Thu, 16 May 2024 16:16:58 -0400 Subject: [PATCH 2/5] Adding icon to button. --- client/app/components/LoadingDataDisplay.jsx | 19 +++++++++++++------ client/app/queue/CaseDetailsView.jsx | 1 + 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/client/app/components/LoadingDataDisplay.jsx b/client/app/components/LoadingDataDisplay.jsx index 5990500af78..7b2e38d6131 100644 --- a/client/app/components/LoadingDataDisplay.jsx +++ b/client/app/components/LoadingDataDisplay.jsx @@ -5,6 +5,10 @@ import LoadingScreen from './LoadingScreen'; import StatusMessage from './StatusMessage'; import COPY from '../../COPY'; import { recordAsyncMetrics } from '../util/Metrics'; +import {ExternalLinkIcon} from "./icons"; +import {css} from "glamor"; + +const ICON_POSITION_FIX = css({ position: 'relative', top: 3 }); const PROMISE_RESULTS = { SUCCESS: 'SUCCESS', @@ -14,17 +18,20 @@ const PROMISE_RESULTS = { const accessDeniedTitle = { title: COPY.ACCESS_DENIED_TITLE }; const accessDeniedMsg =
VBA employs a sensitive access system and to access records at any designated level requires approval for the same or - higher-level access.
- You are receiving this message because you do not have an authorized access level required to view this page.
-
+ higher-level access.
+ You are receiving this message because you do not have an authorized access level required to view this page.
+
To request access, please click the button below
-

+ +

If you have any questions or need assistance with the request form linked above, please contact the Restricted - Portfolio Management team at VBA.RPM@va.gov. + Portfolio Management team at VBA.RPM@va.gov.
; -const duplicateNumberTitle = { title: COPY.DUPLICATE_PHONE_NUMBER_TITLE }; +const duplicateNumberTitle = {title: COPY.DUPLICATE_PHONE_NUMBER_TITLE }; const duplicateNumberMsg =
Duplicate phone numbers documented.
{ COPY.DUPLICATE_PHONE_NUMBER_MESSAGE }
; diff --git a/client/app/queue/CaseDetailsView.jsx b/client/app/queue/CaseDetailsView.jsx index 8e87d22828f..1497c714533 100644 --- a/client/app/queue/CaseDetailsView.jsx +++ b/client/app/queue/CaseDetailsView.jsx @@ -91,6 +91,7 @@ const editAppellantInformationLinkStyling = css({ const topAlertStyles = css({ marginBottom: '2.4rem' }); + export const CaseDetailsView = (props) => { const { push } = useHistory(); const { appealId, featureToggles, canViewCavcDashboards } = props; From c356b2bbf269ff4d21fecdbbc299de9ca019bb0c Mon Sep 17 00:00:00 2001 From: Brian Bommarito Date: Fri, 17 May 2024 09:35:58 -0400 Subject: [PATCH 3/5] Fixing linting issues. --- client/app/components/LoadingDataDisplay.jsx | 14 +++++++------- client/app/queue/CaseDetailsView.jsx | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/client/app/components/LoadingDataDisplay.jsx b/client/app/components/LoadingDataDisplay.jsx index 7b2e38d6131..ed1d27db9ed 100644 --- a/client/app/components/LoadingDataDisplay.jsx +++ b/client/app/components/LoadingDataDisplay.jsx @@ -5,8 +5,8 @@ import LoadingScreen from './LoadingScreen'; import StatusMessage from './StatusMessage'; import COPY from '../../COPY'; import { recordAsyncMetrics } from '../util/Metrics'; -import {ExternalLinkIcon} from "./icons"; -import {css} from "glamor"; +import { ExternalLinkIcon } from './icons'; +import { css } from 'glamor'; const ICON_POSITION_FIX = css({ position: 'relative', top: 3 }); @@ -18,20 +18,20 @@ const PROMISE_RESULTS = { const accessDeniedTitle = { title: COPY.ACCESS_DENIED_TITLE }; const accessDeniedMsg =
VBA employs a sensitive access system and to access records at any designated level requires approval for the same or - higher-level access.
- You are receiving this message because you do not have an authorized access level required to view this page.
-
+ higher-level access.
+ You are receiving this message because you do not have an authorized access level required to view this page.
+
To request access, please click the button below
-

+

If you have any questions or need assistance with the request form linked above, please contact the Restricted Portfolio Management team at VBA.RPM@va.gov. ; -const duplicateNumberTitle = {title: COPY.DUPLICATE_PHONE_NUMBER_TITLE }; +const duplicateNumberTitle = { title: COPY.DUPLICATE_PHONE_NUMBER_TITLE }; const duplicateNumberMsg =
Duplicate phone numbers documented.
{ COPY.DUPLICATE_PHONE_NUMBER_MESSAGE }
; diff --git a/client/app/queue/CaseDetailsView.jsx b/client/app/queue/CaseDetailsView.jsx index 1497c714533..8e87d22828f 100644 --- a/client/app/queue/CaseDetailsView.jsx +++ b/client/app/queue/CaseDetailsView.jsx @@ -91,7 +91,6 @@ const editAppellantInformationLinkStyling = css({ const topAlertStyles = css({ marginBottom: '2.4rem' }); - export const CaseDetailsView = (props) => { const { push } = useHistory(); const { appealId, featureToggles, canViewCavcDashboards } = props; From 2affe161ca16c99b41e49523ea8760622b541feb Mon Sep 17 00:00:00 2001 From: Brian Bommarito Date: Tue, 4 Jun 2024 11:06:44 -0400 Subject: [PATCH 4/5] Using the Link component and moving href into constant --- client/app/components/LoadingDataDisplay.jsx | 35 ++++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/client/app/components/LoadingDataDisplay.jsx b/client/app/components/LoadingDataDisplay.jsx index ed1d27db9ed..4b904c2ab6c 100644 --- a/client/app/components/LoadingDataDisplay.jsx +++ b/client/app/components/LoadingDataDisplay.jsx @@ -7,14 +7,18 @@ import COPY from '../../COPY'; import { recordAsyncMetrics } from '../util/Metrics'; import { ExternalLinkIcon } from './icons'; import { css } from 'glamor'; +import Link from "./Link"; const ICON_POSITION_FIX = css({ position: 'relative', top: 3 }); + const PROMISE_RESULTS = { SUCCESS: 'SUCCESS', FAILURE: 'FAILURE' }; +const ESCALATION_FORM_URL = "https://leaf.va.gov/VBA/335/sensitive_level_access_request/" + const accessDeniedTitle = { title: COPY.ACCESS_DENIED_TITLE }; const accessDeniedMsg =
VBA employs a sensitive access system and to access records at any designated level requires approval for the same or @@ -22,13 +26,30 @@ const accessDeniedMsg =
You are receiving this message because you do not have an authorized access level required to view this page.

To request access, please click the button below -
- If you have any questions or need assistance with the request form linked above, please contact the Restricted - Portfolio Management team at VBA.RPM@va.gov. +
+ + + +
+
+If +you +have +any +questions +or +need +assistance +with the request +form +linked +above, please +contact +the +Restricted +Portfolio Management team at VBA.RPM@va.gov.
; const duplicateNumberTitle = { title: COPY.DUPLICATE_PHONE_NUMBER_TITLE }; From a554873691eebee7dc1493133d9692e69dea14b3 Mon Sep 17 00:00:00 2001 From: mikefinneran <110622959+mikefinneran@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:03:32 -0400 Subject: [PATCH 5/5] fix linter issues --- client/app/components/LoadingDataDisplay.jsx | 28 +++++--------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/client/app/components/LoadingDataDisplay.jsx b/client/app/components/LoadingDataDisplay.jsx index 4b904c2ab6c..2a7cd046896 100644 --- a/client/app/components/LoadingDataDisplay.jsx +++ b/client/app/components/LoadingDataDisplay.jsx @@ -7,17 +7,16 @@ import COPY from '../../COPY'; import { recordAsyncMetrics } from '../util/Metrics'; import { ExternalLinkIcon } from './icons'; import { css } from 'glamor'; -import Link from "./Link"; +import Link from './Link'; const ICON_POSITION_FIX = css({ position: 'relative', top: 3 }); - const PROMISE_RESULTS = { SUCCESS: 'SUCCESS', FAILURE: 'FAILURE' }; -const ESCALATION_FORM_URL = "https://leaf.va.gov/VBA/335/sensitive_level_access_request/" +const ESCALATION_FORM_URL = 'https://leaf.va.gov/VBA/335/sensitive_level_access_request/'; const accessDeniedTitle = { title: COPY.ACCESS_DENIED_TITLE }; const accessDeniedMsg =
@@ -29,27 +28,14 @@ const accessDeniedMsg =
-
-If -you -have -any -questions -or -need -assistance -with the request -form -linked -above, please -contact -the -Restricted -Portfolio Management team at VBA.RPM@va.gov. +
+ If you have any questions or need assistance with the request form linked above, + please contact the Restricted Portfolio Management team at + VBA.RPM@va.gov.
; const duplicateNumberTitle = { title: COPY.DUPLICATE_PHONE_NUMBER_TITLE };