From 47f21f0b929b9f25345c972d80960715c8f60981 Mon Sep 17 00:00:00 2001 From: mikefinneran <110622959+mikefinneran@users.noreply.github.com> Date: Thu, 7 Sep 2023 18:22:41 -0400 Subject: [PATCH] Revert "Revert "add reader banner"" --- app/controllers/application_controller.rb | 5 +++ app/views/reader/appeal/index.html.erb | 2 + client/app/reader/DecisionReviewer.jsx | 4 ++ .../DocumentList/DocumentListActions.js | 7 ++-- .../DocumentList/DocumentListReducer.js | 6 +-- client/app/reader/LastRetrievalAlert.jsx | 42 ++++++++++++------- client/app/reader/LastRetrievalInfo.jsx | 20 ++++----- client/app/reader/PdfListView.jsx | 23 ++++++---- config/environments/demo.rb | 3 ++ 9 files changed, 70 insertions(+), 42 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f1e67283d53..bb3e4cc7797 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -380,6 +380,11 @@ def feedback_url end helper_method :feedback_url + def efolder_express_url + Rails.application.config.efolder_url.to_s + end + helper_method :efolder_express_url + def help_url { "certification" => certification_help_path, diff --git a/app/views/reader/appeal/index.html.erb b/app/views/reader/appeal/index.html.erb index 8201c415679..f117e4de330 100644 --- a/app/views/reader/appeal/index.html.erb +++ b/app/views/reader/appeal/index.html.erb @@ -7,6 +7,8 @@ applicationUrls: application_urls, page: "DecisionReviewer", feedbackUrl: feedback_url, + efolderExpressUrl: efolder_express_url, + userHasEfolderRole: current_user.can?('Download eFolder'), featureToggles: { interfaceVersion2: FeatureToggle.enabled?(:interface_version_2, user: current_user), windowSlider: FeatureToggle.enabled?(:window_slider, user: current_user), diff --git a/client/app/reader/DecisionReviewer.jsx b/client/app/reader/DecisionReviewer.jsx index 2d676eb5e62..33052f21277 100644 --- a/client/app/reader/DecisionReviewer.jsx +++ b/client/app/reader/DecisionReviewer.jsx @@ -92,6 +92,8 @@ export class DecisionReviewer extends React.PureComponent { annotations={this.props.annotations} vacolsId={vacolsId}> ({ } }); -export const onReceiveManifests = (manifestVbmsFetchedAt, manifestVvaFetchedAt) => ({ +export const onReceiveManifests = (manifestVbmsFetchedAt) => ({ type: Constants.RECEIVE_MANIFESTS, - payload: { manifestVbmsFetchedAt, - manifestVvaFetchedAt } + payload: { + manifestVbmsFetchedAt, + } }); diff --git a/client/app/reader/DocumentList/DocumentListReducer.js b/client/app/reader/DocumentList/DocumentListReducer.js index dd96cc2539e..1107e7cea8b 100644 --- a/client/app/reader/DocumentList/DocumentListReducer.js +++ b/client/app/reader/DocumentList/DocumentListReducer.js @@ -54,8 +54,7 @@ const initialState = { category: false } }, - manifestVbmsFetchedAt: null, - manifestVvaFetchedAt: null + manifestVbmsFetchedAt: null }; const documentListReducer = (state = initialState, action = {}) => { @@ -181,9 +180,6 @@ const documentListReducer = (state = initialState, action = {}) => { return update(state, { manifestVbmsFetchedAt: { $set: action.payload.manifestVbmsFetchedAt - }, - manifestVvaFetchedAt: { - $set: action.payload.manifestVvaFetchedAt } }); case Constants.UPDATE_FILTERED_RESULTS: diff --git a/client/app/reader/LastRetrievalAlert.jsx b/client/app/reader/LastRetrievalAlert.jsx index 880296536b5..fc2dcf726f8 100644 --- a/client/app/reader/LastRetrievalAlert.jsx +++ b/client/app/reader/LastRetrievalAlert.jsx @@ -1,6 +1,7 @@ import _ from 'lodash'; import moment from 'moment'; import React from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import Alert from '../components/Alert'; import { css } from 'glamor'; @@ -13,36 +14,40 @@ const alertStyling = css({ class LastRetrievalAlert extends React.PureComponent { + displaySupportMessage = () => this.props.userHasEfolderRole ? ( + <>Please visit eFolder Express to fetch the latest list of documents or submit a support ticket via YourIT to sync their eFolder with Reader. + ) : ( + <>Please submit a support ticket via YourIT to sync their eFolder with Reader. + ); + render() { - // Check that document manifests have been recieved from VVA and VBMS - if (!this.props.manifestVbmsFetchedAt || !this.props.manifestVvaFetchedAt) { + // Check that document manifests have been recieved from VBMS + if (!this.props.manifestVbmsFetchedAt) { return
- Some of {this.props.appeal.veteran_full_name}'s documents are not available at the moment due to - a loading error from VBMS or VVA. As a result, you may be viewing a partial list of claims folder documents. -
+ Some of {this.props.appeal.veteran_full_name}'s documents are unavailable at the moment due to + a loading error from their eFolder. As a result, you may be viewing a partial list of eFolder documents.
- Please refresh your browser at a later point to view a complete list of documents in the claims - folder. + {this.displaySupportMessage()}
; } const staleCacheTime = moment().subtract(CACHE_TIMEOUT_HOURS, 'h'), - vbmsManifestTimestamp = moment(this.props.manifestVbmsFetchedAt, 'MM/DD/YY HH:mma Z'), - vvaManifestTimestamp = moment(this.props.manifestVvaFetchedAt, 'MM/DD/YY HH:mma Z'); + vbmsManifestTimestamp = moment(this.props.manifestVbmsFetchedAt, 'MM/DD/YY HH:mma Z'); // Check that manifest results are fresh - if (vbmsManifestTimestamp.isBefore(staleCacheTime) || vvaManifestTimestamp.isBefore(staleCacheTime)) { + if (vbmsManifestTimestamp.isBefore(staleCacheTime)) { const now = moment(), - vbmsDiff = now.diff(vbmsManifestTimestamp, 'hours'), - vvaDiff = now.diff(vvaManifestTimestamp, 'hours'); + vbmsDiff = now.diff(vbmsManifestTimestamp, 'hours'); return
- We last synced with VBMS and VVA {Math.max(vbmsDiff, vvaDiff)} hours ago. If you'd like to check for new - documents, refresh the page. + Reader last synced the list of documents with {this.props.appeal.veteran_full_name}'s + eFolder {vbmsDiff} hours ago. +
+ {this.displaySupportMessage()}
; } @@ -51,6 +56,13 @@ class LastRetrievalAlert extends React.PureComponent { } } +LastRetrievalAlert.propTypes = { + manifestVbmsFetchedAt: PropTypes.string, + efolderExpressUrl: PropTypes.string, + appeal: PropTypes.object, + userHasEfolderRole: PropTypes.bool, +}; + export default connect( - (state) => _.pick(state.documentList, ['manifestVvaFetchedAt', 'manifestVbmsFetchedAt']) + (state) => _.pick(state.documentList, ['manifestVbmsFetchedAt']) )(LastRetrievalAlert); diff --git a/client/app/reader/LastRetrievalInfo.jsx b/client/app/reader/LastRetrievalInfo.jsx index 01e43efda38..a2aa3cd6177 100644 --- a/client/app/reader/LastRetrievalInfo.jsx +++ b/client/app/reader/LastRetrievalInfo.jsx @@ -1,5 +1,6 @@ import _ from 'lodash'; import React from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; class UnconnectedLastRetrievalInfo extends React.PureComponent { @@ -7,22 +8,19 @@ class UnconnectedLastRetrievalInfo extends React.PureComponent { return [ this.props.manifestVbmsFetchedAt ?
- Last VBMS retrieval: {this.props.manifestVbmsFetchedAt.slice(0, -5)} -
: + Last synced with {this.props.appeal.veteran_full_name}'s eFolder: {this.props.manifestVbmsFetchedAt.slice(0, -5)} :
- Unable to display VBMS documents at this time -
, - this.props.manifestVvaFetchedAt ? -
- Last VVA retrieval: {this.props.manifestVvaFetchedAt.slice(0, -5)} -
: -
- Unable to display VVA documents at this time + Unable to display eFolder documents at this time
]; } } +UnconnectedLastRetrievalInfo.propTypes = { + appeal: PropTypes.object, + manifestVbmsFetchedAt: PropTypes.string, +}; + export default connect( - (state) => _.pick(state.documentList, ['manifestVvaFetchedAt', 'manifestVbmsFetchedAt']) + (state) => _.pick(state.documentList, ['manifestVbmsFetchedAt']) )(UnconnectedLastRetrievalInfo); diff --git a/client/app/reader/PdfListView.jsx b/client/app/reader/PdfListView.jsx index 8ac596eba42..3cea83ee32a 100644 --- a/client/app/reader/PdfListView.jsx +++ b/client/app/reader/PdfListView.jsx @@ -68,7 +68,10 @@ export class PdfListView extends React.Component {
- + - +
; } } @@ -89,7 +92,6 @@ const mapStateToProps = (state, props) => { state.pdfViewer.loadedAppeal, caseSelectedAppeal: state.caseSelect.selectedAppeal, manifestVbmsFetchedAt: state.documentList.manifestVbmsFetchedAt, - manifestVvaFetchedAt: state.documentList.manifestVvaFetchedAt, queueRedirectUrl: state.documentList.queueRedirectUrl, queueTaskType: state.documentList.queueTaskType }; @@ -102,12 +104,17 @@ const mapDispatchToProps = (dispatch) => ( }, dispatch) ); -export default connect( - mapStateToProps, mapDispatchToProps -)(PdfListView); - PdfListView.propTypes = { documents: PropTypes.arrayOf(PropTypes.object).isRequired, onJumpToComment: PropTypes.func, - sortBy: PropTypes.string + sortBy: PropTypes.string, + appeal: PropTypes.object, + efolderExpressUrl: PropTypes.string, + userHasEfolderRole: PropTypes.bool, }; + + +export default connect( + mapStateToProps, mapDispatchToProps +)(PdfListView); + diff --git a/config/environments/demo.rb b/config/environments/demo.rb index eb2df052944..1815b62083b 100644 --- a/config/environments/demo.rb +++ b/config/environments/demo.rb @@ -82,6 +82,9 @@ ENV["DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL"] ||= "true" + # eFolder Express URL for demo environment used as a mock link + ENV["EFOLDER_EXPRESS_URL"] ||= "http://localhost:4000" + # BatchProcess ENVs # priority_ep_sync ENV["BATCH_PROCESS_JOB_DURATION"] ||= "1" # Number of hours the job will run for