Skip to content

Commit

Permalink
CM-380: add update individual task table (#31)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan <[email protected]>
  • Loading branch information
jdolkowski and Jan authored Dec 28, 2023
1 parent b7a75ef commit 71af2b0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/components/tasks/IndividualUpdateTasks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import { FormattedMessage } from '@openimis/fe-core';

const IndividualUpdateTaskTableHeaders = () => [
<FormattedMessage module="individual" id="individual.firstName" />,
<FormattedMessage module="individual" id="individual.lastName" />,
<FormattedMessage module="individual" id="individual.dob" />,
];

const IndividualUpdateTaskItemFormatters = () => [
(individual) => individual?.first_name,
(individual) => individual?.last_name,
(individual) => individual?.dob,
];

export { IndividualUpdateTaskTableHeaders, IndividualUpdateTaskItemFormatters };
12 changes: 12 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/* eslint-disable camelcase */
/* eslint-disable import/prefer-default-export */
import flatten from 'flat';
import { FormattedMessage } from '@openimis/fe-core';
import React from 'react';
import messages_en from './translations/en.json';
import reducer from './reducer';
import IndividualsMainMenu from './menus/IndividualsMainMenu';
Expand All @@ -13,6 +15,10 @@ import { IndividualsListTabLabel, IndividualsListTabPanel } from './components/I
import getBenefitPlansListTab from './contributions/getBenefitPlansListTab';
import GroupIndividualSearcher from './components/GroupIndividualSearcher';
import { clearIndividualExport, downloadIndividuals, fetchIndividuals } from './actions';
import {
IndividualUpdateTaskItemFormatters,
IndividualUpdateTaskTableHeaders,
} from './components/tasks/IndividualUpdateTasks';

const ROUTE_INDIVIDUALS = 'individuals';
const ROUTE_INDIVIDUAL = 'individuals/individual';
Expand Down Expand Up @@ -53,6 +59,12 @@ const DEFAULT_CONFIG = {
],
'individual.BenefitPlansListTabLabel': [BENEFIT_PLAN_TABS_LABEL_REF_KEY],
'individual.BenefitPlansListTabPanel': [BENEFIT_PLAN_TABS_PANEL_REF_KEY],
'tasksManagement.tasks': [{
text: <FormattedMessage module="individual" id="individual.tasks.update.title" />,
tableHeaders: IndividualUpdateTaskTableHeaders,
itemFormatters: IndividualUpdateTaskItemFormatters,
taskSource: ['IndividualService'],
}],
};

export const IndividualModule = (cfg) => ({ ...DEFAULT_CONFIG, ...cfg });
5 changes: 5 additions & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
"individualsList": {
"label": "MEMBERS"
},
"tasks": {
"update": {
"title": "Individual Update Tasks"
}
},
"any": "ANY",
"ok": "ok"
},
Expand Down

0 comments on commit 71af2b0

Please sign in to comment.