Skip to content

Commit

Permalink
Back merge STG > DEV (#4518)
Browse files Browse the repository at this point in the history
* skip unstable

* STG //  Fix RDI import dmd json field (#4504)

* fix rdi import dmd data json

* add migration

* fix test

* imports

* more fixes

* remove generateroles from upgrade, update generateroles based on admin history for these roles

* [STG] Payment Plan export xlsx: added FSP template doc types list (#4508)

* upd get_column_value_from_payment & fsp template doc types

* document_types ⭐

* fix 🌟

* Dashboard fix

* 215787_drop_cash_assist_migration_script_fix (#4509)

* 2226242_Payment_verification_page_not_accessible (#4514)

* rollback generateroles to upgrade, skip updating existing roles

* Back merge PROD > STG (#4516)

* skip unstable

* 2226242_Payment_verification_page_not_accessible (#4514)

---------

Co-authored-by: Jan Romaniak <[email protected]>
Co-authored-by: Marek Biczysko <[email protected]>

* add correct permission for cycles page

* fe fix

* just new line

* Master into stg (#4534)

* AB#226656 Error Cannot read properties of undefined Grievance ticket

* Fixes to managers for migretable models

* added unicef id

* fix frontend lint

* unique unicef_id constraint

* fix test_double_entries

* fix household test_models

* change exclusion for importing hh and inds to another program

* fix test_create_pending_objects_from_objects

* fix linters

* fix test_create_targeting_for_people

* add models for new constraints

* fix test

* remove one time scripts which are not valid with new contraint

* fixed format

* change unique name

* fixed tests

* fix more tests

* fix laast e2e tests

---------

Co-authored-by: Jan Romaniak <[email protected]>
Co-authored-by: Jan Romaniak <[email protected]>
Co-authored-by: Paulina Kujawa <[email protected]>
Co-authored-by: Paulina Kujawa <[email protected]>

* fix test & migration

---------

Co-authored-by: Jan Romaniak <[email protected]>
Co-authored-by: Domenico <[email protected]>
Co-authored-by: Paulina Kujawa <[email protected]>
Co-authored-by: Paulina Kujawa <[email protected]>
Co-authored-by: Allan Stockman Rugano <[email protected]>
Co-authored-by: Marek Biczysko <[email protected]>
Co-authored-by: Allan Stockman RUGANO <[email protected]>
Co-authored-by: Maciej Szewczyk <[email protected]>
Co-authored-by: Jan Romaniak <[email protected]>
  • Loading branch information
10 people authored Dec 23, 2024
1 parent 1ab7f66 commit 9099556
Show file tree
Hide file tree
Showing 44 changed files with 368 additions and 541 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ distribution = true

[project]
name = "hope"
version = "2.15.0"
version = "2.16.0"
description = "HCT MIS is UNICEF's humanitarian cash transfer platform."
authors = [
{ name = "Tivix" },
Expand Down
14 changes: 9 additions & 5 deletions src/frontend/fixtures/paymentmodule/fakeApolloPaymentPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export const fakeApolloPaymentPlan: PaymentPlanQuery['paymentPlan'] = {
version: 1000,
unicefId: 'PP-0060-22-00000001',
status: PaymentPlanStatus.Locked,
programCycle: {
id: 'UHJvZ3JhbUN5Y2xlOjljNDMzZWQzLTcwZjUtNDRhOC1iZmQ5LTA1Mjg3YTAwNzQxNQ==',
},
isFollowUp: false,
sourcePaymentPlan: null,
excludedHouseholds: null,
Expand Down Expand Up @@ -43,7 +46,7 @@ export const fakeApolloPaymentPlan: PaymentPlanQuery['paymentPlan'] = {
name: 'Report should property early adult.',
__typename: 'TargetPopulationNode',
},
currency: "PLN",
currency: 'PLN',
currencyName: 'Polish złoty',
startDate: '2020-10-27',
endDate: '2021-09-08',
Expand Down Expand Up @@ -301,7 +304,8 @@ export const fakeApolloPaymentPlan: PaymentPlanQuery['paymentPlan'] = {
__typename: 'PaymentPlanNode',
};

export const fakeApolloPaymentPlanWithWrongBackgroundActionStatus: PaymentPlanQuery['paymentPlan'] = {
...fakeApolloPaymentPlan,
backgroundActionStatus: PaymentPlanBackgroundActionStatus.XlsxExporting,
};
export const fakeApolloPaymentPlanWithWrongBackgroundActionStatus: PaymentPlanQuery['paymentPlan'] =
{
...fakeApolloPaymentPlan,
backgroundActionStatus: PaymentPlanBackgroundActionStatus.XlsxExporting,
};
2 changes: 1 addition & 1 deletion src/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "2.15.0",
"version": "2.16.0",
"private": true,
"type": "module",
"scripts": {
Expand Down
5 changes: 4 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.

3 changes: 3 additions & 0 deletions src/frontend/src/apollo/queries/paymentmodule/PaymentPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export const PAYMENT_PLAN_QUERY = gql`
version
unicefId
status
programCycle {
id
}
canCreateFollowUp
backgroundActionStatus
canCreatePaymentVerificationPlan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,41 @@ export function GrievancesSidebar({
const shouldShowReassignBoxDataChange = (): boolean => {
let { individual, household } = ticket;
const { category, issueType, status } = ticket;

if (category.toString() === GRIEVANCE_CATEGORIES.NEEDS_ADJUDICATION) {
individual = ticket.needsAdjudicationTicketDetails.selectedIndividual;
household =
ticket.needsAdjudicationTicketDetails.selectedIndividual?.household;
}
const isOneIndividual = household?.activeIndividualsCount === 1;

const isOneIndividual = household?.activeIndividualsCount === 1;
if (isOneIndividual) return false;
const isRightCategory =
(category.toString() === GRIEVANCE_CATEGORIES.DATA_CHANGE &&
issueType.toString() === GRIEVANCE_ISSUE_TYPES.DELETE_INDIVIDUAL) ||
(category.toString() === GRIEVANCE_CATEGORIES.DATA_CHANGE &&
issueType.toString() === GRIEVANCE_ISSUE_TYPES.EDIT_INDIVIDUAL) ||
(category.toString() === GRIEVANCE_CATEGORIES.SYSTEM_FLAGGING &&
ticket?.systemFlaggingTicketDetails?.approveStatus) ||
(category.toString() === GRIEVANCE_CATEGORIES.NEEDS_ADJUDICATION &&
ticket?.needsAdjudicationTicketDetails?.selectedIndividual);

const isRightCategory = [
{
category: GRIEVANCE_CATEGORIES.DATA_CHANGE,
issueType: GRIEVANCE_ISSUE_TYPES.DELETE_INDIVIDUAL,
},
{
category: GRIEVANCE_CATEGORIES.DATA_CHANGE,
issueType: GRIEVANCE_ISSUE_TYPES.EDIT_INDIVIDUAL,
},
{
category: GRIEVANCE_CATEGORIES.SYSTEM_FLAGGING,
approveStatus: ticket?.systemFlaggingTicketDetails?.approveStatus,
},
{
category: GRIEVANCE_CATEGORIES.NEEDS_ADJUDICATION,
selectedIndividual:
ticket?.needsAdjudicationTicketDetails?.selectedIndividual,
},
].some(
(condition) =>
category.toString() === condition.category &&
(issueType.toString() === condition.issueType ||
condition.approveStatus ||
condition.selectedIndividual),
);

if (!isRightCategory) return false;

Expand All @@ -47,23 +65,22 @@ export function GrievancesSidebar({

const householdsAndRoles = individual?.householdsAndRoles || [];
const isHeadOfHousehold = individual?.id === household?.headOfHousehold?.id;
const hasRolesToReassign =
householdsAndRoles?.filter((el) => el.role !== 'NO_ROLE').length > 0;
const hasRolesToReassign = householdsAndRoles.some(
(el) => el.role !== 'NO_ROLE',
);

let isProperDataChange = true;
if (
category.toString() === GRIEVANCE_CATEGORIES.DATA_CHANGE &&
issueType.toString() === GRIEVANCE_ISSUE_TYPES.EDIT_INDIVIDUAL
) {
if (
isEmpty(ticket.individualDataUpdateTicketDetails.individualData.role) &&
isEmpty(
ticket.individualDataUpdateTicketDetails.individualData.relationship,
)
) {
const { role, relationship } =
ticket.individualDataUpdateTicketDetails.individualData;
if (isEmpty(role) && isEmpty(relationship)) {
isProperDataChange = false;
}
}

return (
(isHeadOfHousehold || hasRolesToReassign) &&
isProperDataChange &&
Expand Down
Loading

0 comments on commit 9099556

Please sign in to comment.