Skip to content

Commit

Permalink
CM-457: initial deduplication task preview (#6)
Browse files Browse the repository at this point in the history
* CM-457: added searcher for BenefitPlanDeduplication Task

* CM-457: initial deduplication task body

---------

Co-authored-by: sniedzielski <[email protected]>
Co-authored-by: Jan <[email protected]>
  • Loading branch information
3 people authored Jan 25, 2024
1 parent 6ed5754 commit 87798b9
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/components/tasks/DeduplicationResolutionTask.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from 'react';

function BeneficiaryDeduplicationTaskDisplay({
businessData,
}) {
return (
<div>
<div>
{JSON.stringify(businessData.column_values)}
{' '}
,
count:
{' '}
{businessData.count}
</div>
<div>
headers
</div>
<div>
{businessData.ids.map((id) => <div>{id}</div>)}
</div>
</div>
);
}

const DeduplicationResolutionTaskTableHeaders = () => [];

const DeduplicationResolutionItemFormatters = () => [
(businessData) => <BeneficiaryDeduplicationTaskDisplay businessData={businessData} />,
];

export { DeduplicationResolutionTaskTableHeaders, DeduplicationResolutionItemFormatters };
12 changes: 12 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
import React from 'react';
import { FormattedMessage } from '@openimis/fe-core';
import messagesEn from './translations/en.json';
import DeduplicationFieldSelectionDialog from './components/dialogs/DeduplicationFieldSelectionDialog';
import reducer from './reducer';
import {
DeduplicationResolutionItemFormatters,
DeduplicationResolutionTaskTableHeaders,
} from './components/tasks/DeduplicationResolutionTask';

const DEFAULT_CONFIG = {
translations: [{ key: 'en', messages: messagesEn }],
reducers: [{ key: 'deduplication', reducer }],
'deduplication.deduplicationFieldSelectionDialog': [
DeduplicationFieldSelectionDialog,
],
'tasksManagement.tasks': [{
text: <FormattedMessage module="deduplication" id="tasks.deduplication.title" />,
tableHeaders: DeduplicationResolutionTaskTableHeaders,
itemFormatters: DeduplicationResolutionItemFormatters,
taskSource: ['CreateDeduplicationReviewTasksService'],
}],
};

// eslint-disable-next-line import/prefer-default-export
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"deduplication.deduplicate.button.createDeduplicationReviewTask": "Create Deduplication Review Tasks",
"deduplication.deduplicationSummaryTable.group": "Group",
"deduplication.deduplicationSummaryTable.duplicates": "Duplicates",
"deduplication.tasks.deduplication.title": "Benefit Plan Deduplication Task",
"deduplication.deduplicate.mutation.createTasks": "Deduplication tasks have been created."
}

0 comments on commit 87798b9

Please sign in to comment.