Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/44469 #21672

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions client/app/components/LoadingDataDisplay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -13,8 +17,19 @@ const PROMISE_RESULTS = {

const accessDeniedTitle = { title: COPY.ACCESS_DENIED_TITLE };
const accessDeniedMsg = <div>
It looks like you do not have the necessary level of access to view this information.<br />
Please check with your application administrator before trying again.</div>;
VBA employs a sensitive access system and to access records at any designated level requires approval for the same or
higher-level access.<br />
You are receiving this message because you do not have an authorized access level required to view this page.<br />
<br />
To request access, please click the button below
<div><a href="https://leaf.va.gov/VBA/335/sensitive_level_access_request/">
<button className="btn btn-default">Request Access &nbsp;
<span {...ICON_POSITION_FIX}><ExternalLinkIcon /></span>
</button>
</a></div><br />
If you have any questions or need assistance with the request form linked above, please contact the Restricted
Portfolio Management team at <a href="mailto:VBA.RPM@va.gov">VBA.RPM@va.gov</a>.
</div>;

const duplicateNumberTitle = { title: COPY.DUPLICATE_PHONE_NUMBER_TITLE };
const duplicateNumberMsg = <div>
Expand Down
3 changes: 1 addition & 2 deletions client/app/reader/ReaderLoadingScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}

Expand Down
16 changes: 16 additions & 0 deletions spec/feature/reader/reader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading