Skip to content

Commit

Permalink
Merge branch 'feature/contracts' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
radulescuandrew committed Sep 30, 2024
2 parents 6143b68 + c454b90 commit 2e984a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions frontend/src/components/DocumentContractsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ const DocumentContractsTable = ({ query, setQuery }: DocumentContractsTableBasic
case DocumentContractStatusForFilter.REJECTED_VOLUNTEER:
case DocumentContractStatusForFilter.PENDING_APPROVAL_NGO:
case DocumentContractStatusForFilter.PENDING_NGO_REPRESENTATIVE_SIGNATURE:
case DocumentContractStatusForFilter.ACTIVE:
case DocumentContractStatusForFilter.NOT_STARTED:
case DocumentContractStatusForFilter.EXPIRED:
return contractsMenuItems;
default:
return [];
Expand Down
7 changes: 6 additions & 1 deletion mobile/src/common/utils/document-contracts.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ export const renderContractInfoText = (contract: DocumentContract, t: any) => {
};

export const isIdentityDataIncomplete = (userProfile: IUserProfile) => {
if (!userProfile || !userProfile?.userPersonalData) {
return true;
}
// required fields for all users
const defaultRequiredFields = [
'cnp',
Expand All @@ -145,7 +148,9 @@ export const isIdentityDataIncomplete = (userProfile: IUserProfile) => {
'address',
];

const isUserOver16 = isOver16FromCNP(userProfile ? userProfile?.userPersonalData.cnp : '');
const isUserOver16 = isOver16FromCNP(
userProfile && userProfile?.userPersonalData.cnp ? userProfile?.userPersonalData?.cnp : '',
);

// check if all required fields are present in userProfile.userPersonalData object
const isMissingRequiredFields = defaultRequiredFields.some(
Expand Down

0 comments on commit 2e984a2

Please sign in to comment.