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

CM-820: added adjustments for custom filters and download #94

Merged
merged 2 commits into from
May 27, 2024
Merged
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
46 changes: 8 additions & 38 deletions src/components/BenefitPackageMembersSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@
DialogContent,
} from '@material-ui/core';
import VisibilityIcon from '@material-ui/icons/Visibility';
import HistoryIcon from '@material-ui/icons/History';
import SentimentVeryDissatisfiedIcon from '@material-ui/icons/SentimentVeryDissatisfied';
import { connect, useDispatch } from 'react-redux';
import {
BENEFIT_PLAN_LABEL,

Check failure on line 23 in src/components/BenefitPackageMembersSearcher.js

View workflow job for this annotation

GitHub Actions / lint

'BENEFIT_PLAN_LABEL' is defined but never used
DEFAULT_PAGE_SIZE, EMPTY_STRING, MODULE_NAME, RIGHT_INDIVIDUAL_UPDATE, ROWS_PER_PAGE_OPTIONS,
DEFAULT_PAGE_SIZE, EMPTY_STRING, INDIVIDUAL_LABEL, INDIVIDUAL_MODULE_NAME, MODULE_NAME, RIGHT_INDIVIDUAL_UPDATE, ROWS_PER_PAGE_OPTIONS,

Check failure on line 24 in src/components/BenefitPackageMembersSearcher.js

View workflow job for this annotation

GitHub Actions / lint

This line has a length of 137. Maximum allowed is 120

Check failure on line 24 in src/components/BenefitPackageMembersSearcher.js

View workflow job for this annotation

GitHub Actions / lint

'MODULE_NAME' is defined but never used
} from '../constants';
import BenefitPackageMembersFilters from './BenefitPackageMembersFilters';
import { applyNumberCircle } from '../util/searcher-utils';
Expand All @@ -43,7 +41,7 @@
errorMembers,
membersExport,
errorMembersExport,
benefitPlan,

Check failure on line 44 in src/components/BenefitPackageMembersSearcher.js

View workflow job for this annotation

GitHub Actions / lint

'benefitPlan' is defined but never used
}) {
const dispatch = useDispatch();

Expand Down Expand Up @@ -79,34 +77,6 @@
(individual) => individual.lastName,
(individual) => (individual.dob ? formatDateFromISO(modulesManager, intl, individual.dob) : EMPTY_STRING),
];
if (rights.includes(RIGHT_INDIVIDUAL_UPDATE)) {
formatters.push(() => (
<Tooltip title={formatMessage(intl, 'socialProtection', 'benefitPackage.members.tooltip.paymentHistory')}>
{ /* TODO: Implement payments */ }
{ /* Blocked by: Payments has to be implemented to show payments history */ }
{ /* Additional notes: Right in if statement has to be adjusted */}
<IconButton
disabled
>
<HistoryIcon />
</IconButton>
</Tooltip>
));
}
if (rights.includes(RIGHT_INDIVIDUAL_UPDATE)) {
formatters.push(() => (
<Tooltip title={formatMessage(intl, 'socialProtection', 'benefitPackage.members.tooltip.grievanceHistory')}>
{ /* TODO: Implement grievances */ }
{ /* Blocked by: Grievances has to be implemented to show grievances history */ }
{ /* Additional notes: Right in if statement has to be adjusted */}
<IconButton
disabled
>
<SentimentVeryDissatisfiedIcon />
</IconButton>
</Tooltip>
));
}
if (rights.includes(RIGHT_INDIVIDUAL_UPDATE)) {
formatters.push((individual) => (
<Tooltip title={formatMessage(intl, 'socialProtection', 'benefitPackage.members.tooltip.viewDetails')}>
Expand Down Expand Up @@ -220,9 +190,9 @@
exportFieldLabel={formatMessage(intl, 'individual', 'export.label')}
cacheFiltersKey="individualsFilterCache"
isCustomFiltering
objectForCustomFiltering={benefitPlan}
moduleName={MODULE_NAME}
objectType={BENEFIT_PLAN_LABEL}
additionalCustomFilterParams={{ type: 'INDIVIDUAL' }}
moduleName={INDIVIDUAL_MODULE_NAME}
objectType={INDIVIDUAL_LABEL}
appliedCustomFilters={appliedCustomFilters}
setAppliedCustomFilters={setAppliedCustomFilters}
appliedFiltersRowStructure={appliedFiltersRowStructure}
Expand Down Expand Up @@ -256,10 +226,10 @@
membersPageInfo: state.individual.individualsPageInfo,
membersTotalCount: state.individual.individualsTotalCount,
fetchingMembersExport: state.individual.fetchingIndividualsExport,
fetchedGroupsExport: state.individual.fetchedIndividualsExport,
membersExport: state.individual.individualsExport,
membersExportPageInfo: state.individual.individualsExportPageInfo,
errorMembersGroup: state.individual.errorIndividualsExport,
fetchedGroupsExport: state.individual.fetchedIndividualExport,
membersExport: state.individual.individualExport,
membersExportPageInfo: state.individual.individualExportPageInfo,
errorMembersGroup: state.individual.errorIndividualExport,
});

export default injectIntl(connect(mapStateToProps, null)(BenefitPackageMembersSearcher));
2 changes: 2 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,5 @@ export const BENEFIT_PLAN_TASK_TAB_VALUE = 'BenefitPlanTaskTab';
export const BENEFITS_CONTRIBUTION_KEY = 'payroll.benefitConsumptionPayrollSearcher';
export const PYTHON_DEFAULT_IMPORT_WORKFLOW = 'Python Beneficiaries Upload';
export const BENEFICIARIES_QUANTITY_LIMIT = 100;
export const INDIVIDUAL_LABEL = 'Individual';
export const INDIVIDUAL_MODULE_NAME = 'individual';
Loading