Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/adjust-pp-model' into adjust-pp-…
Browse files Browse the repository at this point in the history
…model
  • Loading branch information
pavlo-mk committed Dec 23, 2024
2 parents 4804bb7 + f395ef6 commit 41b3dba
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function PaymentDetails({
/>
</Grid>
<Grid item xs={3}>
<LabelizedField label={t('TARGET POPULATION')}>
<LabelizedField label={t('Payment Plan')}>
<BlackLink
to={`/${businessArea}/programs/${programId}/target-population/${payment.parent.id}`}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function PaymentDetails({
/>
</Grid>
<Grid item xs={3}>
<LabelizedField label={t('TARGET POPULATION')}>
<LabelizedField label={t('Payment Plan')}>
<BlackLink
to={`/${businessArea}/programs/${programId}/target-population/${payment.parent.id}`}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
import { Box, Button, Tooltip } from '@mui/material';
import { FileCopy } from '@mui/icons-material';
import { ReactElement, useState } from 'react';
import { useTranslation } from 'react-i18next';
import styled from 'styled-components';
import { LoadingButton } from '@components/core/LoadingButton';
import { useSnackbar } from '@hooks/useSnackBar';
import {
Action,
BusinessAreaDataQuery,
PaymentPlanQuery,
ProgramStatus,
} from '@generated/graphql';
import { usePaymentPlanAction } from '@hooks/usePaymentPlanAction';
import { useSnackbar } from '@hooks/useSnackBar';
import { FileCopy } from '@mui/icons-material';
import { Box, Button, Tooltip } from '@mui/material';
import { ReactElement, useState } from 'react';
import { useTranslation } from 'react-i18next';
import styled from 'styled-components';
import { useProgramContext } from '../../../programContext';
import { DuplicateTargetPopulation } from '../../dialogs/targetPopulation/DuplicateTargetPopulation';
import { FinalizeTargetPopulationPaymentPlan } from '../../dialogs/targetPopulation/FinalizeTargetPopulationPaymentPlan';
import { useProgramContext } from '../../../programContext';
import { usePaymentPlanAction } from '@hooks/usePaymentPlanAction';
import { useNavigate } from 'react-router-dom';
import { useBaseUrl } from '@hooks/useBaseUrl';

const IconContainer = styled.span`
button {
Expand Down Expand Up @@ -45,17 +43,14 @@ export function LockedTargetPopulationHeaderButtons({
businessAreaData,
}: ApprovedTargetPopulationHeaderButtonsPropTypes): ReactElement {
const { t } = useTranslation();
const navigate = useNavigate();
const { baseUrl } = useBaseUrl();
const [openDuplicate, setOpenDuplicate] = useState(false);
const [openFinalizePaymentPlan, setOpenFinalizePaymentPlan] = useState(false);
const { showMessage } = useSnackbar();
const { isActiveProgram } = useProgramContext();

const { mutatePaymentPlanAction: unlockAction, loading: loadingUnlock } =
usePaymentPlanAction(Action.TpUnlock, targetPopulation.id, () => {
showMessage(t('Target Population Finalized'));
navigate(`/${baseUrl}/target-population/`);
showMessage(t('Target Population Unlocked'));
});

const { isPaymentPlanApplicable } = businessAreaData.businessArea;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const TargetPopulationDetailsPage = (): ReactElement => {
/>
<TargetPopulationDetails targetPopulation={paymentPlan} />
<TargetPopulationCore
id={paymentPlan.id}
id={paymentPlan?.id}
targetPopulation={paymentPlan}
isStandardDctType={isStandardDctType}
isSocialDctType={isSocialDctType}
Expand Down

0 comments on commit 41b3dba

Please sign in to comment.