Skip to content

Commit

Permalink
fix pp queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Szewczyk committed Dec 20, 2024
1 parent d75f30f commit 82d3015
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 39 deletions.
13 changes: 12 additions & 1 deletion src/frontend/src/__generated__/graphql.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export const AllPaymentPlansForTable = gql`
$totalHouseholdsCountWithValidPhoneNoMax: Int
$createdAtRange: String
$statusNot: String
$isPaymentPlan: Boolean
$isTargetPopulation: Boolean
) {
allPaymentPlans(
after: $after
Expand All @@ -42,6 +44,8 @@ export const AllPaymentPlansForTable = gql`
totalHouseholdsCountWithValidPhoneNoMax: $totalHouseholdsCountWithValidPhoneNoMax
createdAtRange: $createdAtRange
statusNot: $statusNot
isPaymentPlan: $isPaymentPlan
isTargetPopulation: $isTargetPopulation
) {
pageInfo {
hasNextPage
Expand Down
35 changes: 0 additions & 35 deletions src/frontend/src/components/targeting/TargetPopulationDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@ export function TargetPopulationDetails({
const { createdBy, program, programCycle } = targetPopulation;
const { t } = useTranslation();

//TODO: ?? replace it with some other?
// const closeDate = changeDate ? (
// <UniversalMoment>{changeDate}</UniversalMoment>
// ) : (
// '-'
// );
// const sendBy = sentForFinanceReleaseBy
// ? `${sentForFinanceReleaseBy.firstName} ${sentForFinanceReleaseBy.lastName}`
// : '-';
// const sendDate = sentForFinanceReleaseDate ? (
// <UniversalMoment>{sentForFinanceReleaseDate}</UniversalMoment>
// ) : (
// '-'
// );
const programName = program?.name ? program.name : '-';
return (
<ContainerColumnWithBorder data-cy="target-population-details-container">
Expand All @@ -60,13 +46,6 @@ export function TargetPopulationDetails({
value={`${createdBy.firstName} ${createdBy.lastName}`}
/>
</Grid>
{/* <Grid item xs={4}>
<LabelizedField
dataCy="close-date"
label={t('Programme population close date')}
value={closeDate}
/>
</Grid> */}
<Grid item xs={4}>
<LabelizedField
dataCy="program-name"
Expand All @@ -81,20 +60,6 @@ export function TargetPopulationDetails({
value={programCycle?.title ?? '-'}
/>
</Grid>
{/* <Grid item xs={4}>
<LabelizedField
dataCy="send-by"
label={t('Send by')}
value={sendBy}
/>
</Grid>
<Grid item xs={4}>
<LabelizedField
dataCy="send-date"
label={t('Send date')}
value={sendDate}
/>
</Grid> */}
</Grid>
</OverviewContainer>
</ContainerColumnWithBorder>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const LookUpTargetPopulationTableCommunication = ({
max: filter.createdAtRangeMax || null,
}),
statusNot: PaymentPlanStatus.Open,
isTargetPopulation: true,
};

const handleRadioChange = (id: string): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export function LookUpTargetPopulationTableSurveys({
max: filter.createdAtRangeMax || null,
}),
statusNot: PaymentPlanStatus.Open,
isTargetPopulation: true,
};

const handleRadioChange = (id: string): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function PaymentPlansTable({
dispersionEndDate: filter.dispersionEndDate || null,
isFollowUp: filter.isFollowUp ? true : null,
program: programId,
isPaymentPlan: true,
};
const replacements = {
totalHouseholdsCount: (_beneficiaryGroup) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const PeoplePaymentPlansTable = ({
dispersionEndDate: filter.dispersionEndDate || null,
isFollowUp: filter.isFollowUp ? true : null,
program: programId,
isPaymentPlan: true,
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ export function TargetPopulationHouseholdTable({
replacements,
);

//TODO: adjust headcells and renderRow

return (
<TableWrapper>
<UniversalTable
Expand Down
1 change: 0 additions & 1 deletion src/frontend/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ export function paymentPlanStatusToColor(
return theme.palette.error.main;
}

//TODO: check if some statuses need to be moved to PP
export function paymentPlanBuildStatusToColor(
theme: typeof themeObj,
status: string,
Expand Down

0 comments on commit 82d3015

Please sign in to comment.