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

My-VA | 88436 | My-VA Maintenance windows #33196

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
143 changes: 56 additions & 87 deletions src/applications/personalization/dashboard/components/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ import {
RequiredLoginLoader,
} from '~/platform/user/authorization/components/RequiredLoginView';
import backendServices from '~/platform/user/profile/constants/backendServices';
import {
DowntimeNotification,
externalServices,
} from '~/platform/monitoring/DowntimeNotification';

import NameTag from '~/applications/personalization/components/NameTag';
import MPIConnectionError from '~/applications/personalization/components/MPIConnectionError';
import NotInMPIError from '~/applications/personalization/components/NotInMPIError';
Expand All @@ -42,7 +37,6 @@ import { signInServiceName } from '~/platform/user/authentication/selectors';
import { fetchTotalDisabilityRating as fetchTotalDisabilityRatingAction } from '../../common/actions/ratedDisabilities';
import { hasTotalDisabilityServerError } from '../../common/selectors/ratedDisabilities';
import { API_NAMES } from '../../common/constants';
import useDowntimeApproachingRenderMethod from '../useDowntimeApproachingRenderMethod';
import ClaimsAndAppeals from './claims-and-appeals/ClaimsAndAppeals';
import HealthCare from './health-care/HealthCare';
import CTALink from './CTALink';
Expand All @@ -51,7 +45,6 @@ import Debts from './debts/Debts';
import { getAllPayments } from '../actions/payments';
import Notifications from './notifications/Notifications';
import { canAccess } from '../../common/selectors';
import RenderClaimsWidgetDowntimeNotification from './RenderClaimsWidgetDowntimeNotification';
import BenefitApplications from './benefit-application-drafts/BenefitApplications';
import EducationAndTraining from './education-and-training/EducationAndTraining';

Expand Down Expand Up @@ -215,7 +208,6 @@ const Dashboard = ({
user,
...props
}) => {
const downtimeApproachingRenderMethod = useDowntimeApproachingRenderMethod();
const dispatch = useDispatch();

const [welcomeModalVisible, setWelcomeModalVisible] = useState(
Expand Down Expand Up @@ -287,89 +279,68 @@ const Dashboard = ({
user={user}
showProfileErrorMessage
>
<DowntimeNotification
appTitle="user dashboard"
loadingIndicator={<RequiredLoginLoader />}
dependencies={[
externalServices.mvi,
externalServices.mhv,
externalServices.appeals,
]}
render={downtimeApproachingRenderMethod}
>
{showLoader && <RequiredLoginLoader />}
{!showLoader && (
<div className="dashboard">
{showNameTag && (
<div id="name-tag">
<NameTag
totalDisabilityRating={props.totalDisabilityRating}
totalDisabilityRatingServerError={
props.totalDisabilityRatingServerError
}
{showLoader && <RequiredLoginLoader />}
{!showLoader && (
<div className="dashboard">
{showNameTag && (
<div id="name-tag">
<NameTag
totalDisabilityRating={props.totalDisabilityRating}
totalDisabilityRatingServerError={
props.totalDisabilityRatingServerError
}
/>
</div>
)}
<div className="vads-l-grid-container vads-u-padding-x--1 vads-u-padding-bottom--3 medium-screen:vads-u-padding-x--2 medium-screen:vads-u-padding-bottom--4">
<DashboardHeader
showNotifications={showNotifications}
user={props.user}
/>

{showMPIConnectionError && (
<div className="vads-l-row">
<MPIConnectionError className="vads-l-col--12 medium-screen:vads-l-col--8 medium-screen:vads-u-padding-right--3 vads-u-margin-top--3" />
</div>
)}

{showNotInMPIError && (
<div className="vads-l-row">
<NotInMPIError
className="vads-l-col--12 medium-screen:vads-l-col--8 medium-screen:vads-u-padding-right--3 vads-u-margin-top--3"
level={2}
/>
</div>
)}
<div className="vads-l-grid-container vads-u-padding-x--1 vads-u-padding-bottom--3 medium-screen:vads-u-padding-x--2 medium-screen:vads-u-padding-bottom--4">
<DashboardHeader
showNotifications={showNotifications}
user={props.user}

{/* LOA1 user experience */}
{isLOA1 && (
<LOA1Content
isLOA1={isLOA1}
isVAPatient={isVAPatient}
welcomeModalVisible={welcomeModalVisible}
dismissWelcomeModal={dismissWelcomeModal}
user={user}
/>
)}

{showMPIConnectionError && (
<div className="vads-l-row">
<MPIConnectionError className="vads-l-col--12 medium-screen:vads-l-col--8 medium-screen:vads-u-padding-right--3 vads-u-margin-top--3" />
</div>
)}

{showNotInMPIError && (
<div className="vads-l-row">
<NotInMPIError
className="vads-l-col--12 medium-screen:vads-l-col--8 medium-screen:vads-u-padding-right--3 vads-u-margin-top--3"
level={2}
/>
</div>
)}

{/* LOA1 user experience */}
{isLOA1 && (
<LOA1Content
isLOA1={isLOA1}
isVAPatient={isVAPatient}
welcomeModalVisible={welcomeModalVisible}
dismissWelcomeModal={dismissWelcomeModal}
user={user}
{/* LOA3 user experience */}
{props.showClaimsAndAppeals && <ClaimsAndAppeals />}
{isLOA3 && (
<>
<HealthCare isVAPatient={isVAPatient} />
<Debts />
<BenefitPayments
payments={payments}
showNotifications={showNotifications}
/>
)}

{/* LOA3 user experience */}
{props.showClaimsAndAppeals && (
<DowntimeNotification
dependencies={[
externalServices.mhv,
externalServices.appeals,
]}
render={RenderClaimsWidgetDowntimeNotification}
>
<ClaimsAndAppeals />
</DowntimeNotification>
)}
{isLOA3 && (
<>
<HealthCare isVAPatient={isVAPatient} />
<Debts />
<BenefitPayments
payments={payments}
showNotifications={showNotifications}
/>
<EducationAndTraining />
<BenefitApplications />
</>
)}
</div>
<EducationAndTraining />
<BenefitApplications />
</>
)}
</div>
)}
</DowntimeNotification>
</div>
)}
</RequiredLoginView>
);
};
Expand All @@ -383,7 +354,6 @@ const isAppealsAvailableSelector = createIsServiceAvailableSelector(
);

const mapStateToProps = state => {
const { isReady: hasLoadedScheduledDowntime } = state.scheduledDowntime;
const isLOA3 = isLOA3Selector(state);
const isLOA1 = isLOA1Selector(state);
const isVAPatient = isVAPatientSelector(state);
Expand Down Expand Up @@ -416,8 +386,7 @@ const mapStateToProps = state => {

const togglesAreLoaded = !toggleValues(state)?.loading;

const showLoader =
!hasLoadedScheduledDowntime || !hasLoadedAllData || !togglesAreLoaded;
const showLoader = !hasLoadedAllData || !togglesAreLoaded;
const showValidateIdentityAlert = isLOA1;
const showNameTag = isLOA3 && isEmpty(hero?.errors);
const showMPIConnectionError = hasMPIConnectionError(state);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import { filterOutExpiredForms } from '~/applications/personalization/dashboard/

import { getEnrollmentStatus as getEnrollmentStatusAction } from '~/platform/user/profile/actions/hca';

import {
DowntimeNotification,
externalServices,
} from '@department-of-veterans-affairs/platform-monitoring/DowntimeNotification';
import { fetchFormStatuses } from '../../actions/form-status';
import ApplicationsInProgress from './ApplicationsInProgress';

Expand Down Expand Up @@ -71,7 +75,12 @@ const BenefitApplications = ({
? 'Benefit applications and forms'
: 'Benefit application drafts'}
</h2>
<ApplicationsInProgress hideH3 />
<DowntimeNotification
appTitle="benefit application drafts"
dependencies={[externalServices.VBMS_APPEALS]}
>
<ApplicationsInProgress hideH3 />
</DowntimeNotification>
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import PropTypes from 'prop-types';
import { subDays } from 'date-fns';
import recordEvent from '~/platform/monitoring/record-event';
import { useFeatureToggle } from '~/platform/utilities/feature-toggles';
import {
DowntimeNotification,
externalServices,
} from '@department-of-veterans-affairs/platform-monitoring/DowntimeNotification';
import PaymentsCard from './PaymentsCard';
import DashboardWidgetWrapper from '../DashboardWidgetWrapper';
import IconCTALink from '../IconCTALink';
Expand Down Expand Up @@ -117,17 +121,27 @@ const BenefitPayments = ({
<div className="vads-l-row">
{lastPayment && (
<>
<DashboardWidgetWrapper>
<PaymentsCard lastPayment={lastPayment} />
</DashboardWidgetWrapper>
<DowntimeNotification
appTitle="benefit application drafts"
dependencies={[externalServices.BGS_PAYMENT_HISTORY]}
>
<DashboardWidgetWrapper>
<PaymentsCard lastPayment={lastPayment} />
</DashboardWidgetWrapper>
</DowntimeNotification>
<DashboardWidgetWrapper>
<PopularActionsForPayments />
</DashboardWidgetWrapper>
</>
)}
{!lastPayment && (
<DashboardWidgetWrapper>
{paymentsError ? <PaymentsError /> : <NoRecentPaymentText />}
<DowntimeNotification
appTitle="benefit application drafts"
dependencies={[externalServices.BGS_PAYMENT_HISTORY]}
>
{paymentsError ? <PaymentsError /> : <NoRecentPaymentText />}
</DowntimeNotification>
<PopularActionsForPayments
showPaymentHistoryLink={
(payments && !!payments.length) || paymentsError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import {
createIsServiceAvailableSelector,
selectProfile,
} from '~/platform/user/selectors';
import {
DowntimeNotification,
externalServices,
} from '@department-of-veterans-affairs/platform-monitoring/DowntimeNotification';
import IconCTALink from '../IconCTALink';
import { getAppeals as getAppealsAction } from '../../actions/appeals';
import { getClaims as getClaimsAction } from '../../actions/claims';
Expand Down Expand Up @@ -152,23 +156,31 @@ const ClaimsAndAppeals = ({
<div data-testid="dashboard-section-claims-and-appeals">
<h2>Claims and appeals</h2>
<div className="vads-l-row">
<DashboardWidgetWrapper>
{hasAPIError && <ClaimsAndAppealsError />}
{!hasAPIError && (
<>
{highlightedClaimOrAppeal && !isLOA1 ? (
<HighlightedClaimAppeal
claimOrAppeal={highlightedClaimOrAppeal}
/>
) : (
<>
{!isLOA1 && <NoClaimsOrAppealsText />}
<PopularActionsForClaimsAndAppeals isLOA1={isLOA1} />
</>
)}
</>
)}
</DashboardWidgetWrapper>
<DowntimeNotification
appTitle="claims and appeals"
dependencies={[
externalServices.VBMS_APPEALS,
externalServices.LIGHTHOUSE_BENEFITS_CLAIMS,
]}
>
<DashboardWidgetWrapper>
{hasAPIError && <ClaimsAndAppealsError />}
{!hasAPIError && (
<>
{highlightedClaimOrAppeal && !isLOA1 ? (
<HighlightedClaimAppeal
claimOrAppeal={highlightedClaimOrAppeal}
/>
) : (
<>
{!isLOA1 && <NoClaimsOrAppealsText />}
<PopularActionsForClaimsAndAppeals isLOA1={isLOA1} />
</>
)}
</>
)}
</DashboardWidgetWrapper>
</DowntimeNotification>
{highlightedClaimOrAppeal &&
!hasAPIError &&
!isLOA1 && (
Expand Down
Loading
Loading