Skip to content

Commit

Permalink
Adds Action to history table based on template printed
Browse files Browse the repository at this point in the history
  • Loading branch information
tareq89 committed Oct 22, 2024
1 parent a6d1a10 commit f814ace
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/client/src/i18n/messages/views/certificate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ interface ICertificateMessages
receiptPaidAmount: MessageDescriptor
receiptService: MessageDescriptor
selectSignature: MessageDescriptor
selectedCertificateTemplateLabel: MessageDescriptor
service: MessageDescriptor
amountDue: MessageDescriptor
typeOfID: MessageDescriptor
Expand Down Expand Up @@ -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: <strong>Birth registration after {service, plural, =0 {0 month} one {1 month} other{{service} months}} of D.o.B.</strong><br/>Amount Due:',
Expand Down
2 changes: 2 additions & 0 deletions packages/client/src/tests/languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -1202,6 +1203,7 @@
"buttons.yes": "হ্যাঁ",
"certificate.confirmCorrect": "অনুগ্রহ করে নিশ্চিত করুন যে নিবন্ধনটি পর্যালোচনা হয়েছে তার তথ্য সঠিক এবং আপনি মুদ্রণ করতে প্রস্তুত",
"certificate.selectTemplate": "নিবন্ধন টেমপ্লেট নির্বাচন করুন",
"certificate.selectedTemplate": "নির্বাচিত নিবন্ধন টেমপ্লেট",
"certificate.isCertificateCorrect": "জন্ম নিবন্ধনটি কি সঠিক?",
"certificate.label.birth": "জন্ম",
"certificate.label.death": "মৃত্যু",
Expand Down
32 changes: 32 additions & 0 deletions packages/client/src/views/RecordAudit/ActionDetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -609,6 +630,17 @@ const ActionDetailsModalListTable = ({
onPageChange={pageChangeHandler}
/>
)}
{!isEmpty(collectorData) && !!actionDetailsData.certTemplateId && (
<Table
noResultText=" "
columns={selectedCertificateTemplate}
content={[selectedCertificateTemplateName]}
pageSize={10}
totalItems={1}
currentPage={currentPage}
onPageChange={pageChangeHandler}
/>
)}

{/* Matched to */}
{actionDetailsData.potentialDuplicates &&
Expand Down

0 comments on commit f814ace

Please sign in to comment.