From f814aceae52c84ca6628e64c3b26b95e54af5674 Mon Sep 17 00:00:00 2001 From: tareq89 Date: Tue, 22 Oct 2024 18:42:36 +0600 Subject: [PATCH] Adds Action to history table based on template printed --- .../src/i18n/messages/views/certificate.ts | 6 ++++ packages/client/src/tests/languages.json | 2 ++ .../views/RecordAudit/ActionDetailsModal.tsx | 32 +++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/packages/client/src/i18n/messages/views/certificate.ts b/packages/client/src/i18n/messages/views/certificate.ts index 062d679af8f..a6261039957 100644 --- a/packages/client/src/i18n/messages/views/certificate.ts +++ b/packages/client/src/i18n/messages/views/certificate.ts @@ -59,6 +59,7 @@ interface ICertificateMessages receiptPaidAmount: MessageDescriptor receiptService: MessageDescriptor selectSignature: MessageDescriptor + selectedCertificateTemplateLabel: MessageDescriptor service: MessageDescriptor amountDue: MessageDescriptor typeOfID: MessageDescriptor @@ -336,6 +337,11 @@ const messagesToDefine: ICertificateMessages = { description: 'The label for choose signature select', id: 'print.certificate.selectSignature' }, + selectedCertificateTemplateLabel: { + defaultMessage: 'Selected certificate template', + description: 'The title of selected certificate template label', + id: 'certificate.selectedTemplate' + }, service: { defaultMessage: 'Service: Birth registration after {service, plural, =0 {0 month} one {1 month} other{{service} months}} of D.o.B.
Amount Due:', diff --git a/packages/client/src/tests/languages.json b/packages/client/src/tests/languages.json index 57c24fea6df..ab5d4e0bf42 100644 --- a/packages/client/src/tests/languages.json +++ b/packages/client/src/tests/languages.json @@ -53,6 +53,7 @@ "buttons.yes": "Yes", "certificate.confirmCorrect": "Please confirm that the informant has reviewed that the information on the certificate is correct and that you are ready to print.", "certificate.selectTemplate": "Select certificate template", + "certificate.selectedTemplate": "Selected certificate template", "certificate.isCertificateCorrect": "Is the {event} certificate correct?", "certificate.label.birth": "Birth", "certificate.label.death": "Death", @@ -1202,6 +1203,7 @@ "buttons.yes": "হ্যাঁ", "certificate.confirmCorrect": "অনুগ্রহ করে নিশ্চিত করুন যে নিবন্ধনটি পর্যালোচনা হয়েছে তার তথ্য সঠিক এবং আপনি মুদ্রণ করতে প্রস্তুত", "certificate.selectTemplate": "নিবন্ধন টেমপ্লেট নির্বাচন করুন", + "certificate.selectedTemplate": "নির্বাচিত নিবন্ধন টেমপ্লেট", "certificate.isCertificateCorrect": "জন্ম নিবন্ধনটি কি সঠিক?", "certificate.label.birth": "জন্ম", "certificate.label.death": "মৃত্যু", diff --git a/packages/client/src/views/RecordAudit/ActionDetailsModal.tsx b/packages/client/src/views/RecordAudit/ActionDetailsModal.tsx index 0ea39cd6490..0dedc1e498e 100644 --- a/packages/client/src/views/RecordAudit/ActionDetailsModal.tsx +++ b/packages/client/src/views/RecordAudit/ActionDetailsModal.tsx @@ -452,6 +452,27 @@ const ActionDetailsModalListTable = ({ width: 100 } ] + + const selectedCertificateTemplate = [ + { + key: 'certTemplate', + label: intl.formatMessage( + certificateMessages.selectedCertificateTemplateLabel + ), + width: 200 + } + ] + + const certificateTemplateMessageDescriptor = + offlineData.templates?.certificates?.find( + (x) => x.id === actionDetailsData.certTemplateId + )?.label + + const selectedCertificateTemplateName = { + certTemplate: certificateTemplateMessageDescriptor + ? intl.formatMessage(certificateTemplateMessageDescriptor) + : '' + } const pageChangeHandler = (cp: number) => setCurrentPage(cp) const content = prepareComments(actionDetailsData, draft) const requesterLabel = requesterLabelMapper( @@ -609,6 +630,17 @@ const ActionDetailsModalListTable = ({ onPageChange={pageChangeHandler} /> )} + {!isEmpty(collectorData) && !!actionDetailsData.certTemplateId && ( + + )} {/* Matched to */} {actionDetailsData.potentialDuplicates &&