From 87798b91af0b8dc3f01f6e799908705151eac028 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 25 Jan 2024 09:47:06 +0100 Subject: [PATCH] CM-457: initial deduplication task preview (#6) * CM-457: added searcher for BenefitPlanDeduplication Task * CM-457: initial deduplication task body --------- Co-authored-by: sniedzielski Co-authored-by: Jan --- .../tasks/DeduplicationResolutionTask.js | 32 +++++++++++++++++++ src/index.js | 12 +++++++ src/translations/en.json | 1 + 3 files changed, 45 insertions(+) create mode 100644 src/components/tasks/DeduplicationResolutionTask.js diff --git a/src/components/tasks/DeduplicationResolutionTask.js b/src/components/tasks/DeduplicationResolutionTask.js new file mode 100644 index 0000000..cf791c5 --- /dev/null +++ b/src/components/tasks/DeduplicationResolutionTask.js @@ -0,0 +1,32 @@ +import React from 'react'; + +function BeneficiaryDeduplicationTaskDisplay({ + businessData, +}) { + return ( +
+
+ {JSON.stringify(businessData.column_values)} + {' '} + , + count: + {' '} + {businessData.count} +
+
+ headers +
+
+ {businessData.ids.map((id) =>
{id}
)} +
+
+ ); +} + +const DeduplicationResolutionTaskTableHeaders = () => []; + +const DeduplicationResolutionItemFormatters = () => [ + (businessData) => , +]; + +export { DeduplicationResolutionTaskTableHeaders, DeduplicationResolutionItemFormatters }; diff --git a/src/index.js b/src/index.js index 5d5fdd7..6a12c51 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,12 @@ +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 }], @@ -8,6 +14,12 @@ const DEFAULT_CONFIG = { 'deduplication.deduplicationFieldSelectionDialog': [ DeduplicationFieldSelectionDialog, ], + 'tasksManagement.tasks': [{ + text: , + tableHeaders: DeduplicationResolutionTaskTableHeaders, + itemFormatters: DeduplicationResolutionItemFormatters, + taskSource: ['CreateDeduplicationReviewTasksService'], + }], }; // eslint-disable-next-line import/prefer-default-export diff --git a/src/translations/en.json b/src/translations/en.json index d1d4fbb..56c84be 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -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." } \ No newline at end of file