Skip to content

Commit

Permalink
[SIMPLE_FORMS] fix: add form id to pdf download link copy (#32884)
Browse files Browse the repository at this point in the history
* add form id to pdf download link copy

* add formId to SavePdfDownloadWithContext component initialization
  • Loading branch information
pennja authored Nov 6, 2024
1 parent 6263d4e commit bf53392
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export const ConfirmationView = props => {
<SavePdfDownload
pdfUrl={pdfUrl}
trackingPrefix={formConfig.trackingPrefix}
formId={formConfig.formId}
/>
<ChapterSectionCollection formConfig={formConfig} />
<PrintThisPage />
Expand All @@ -144,6 +145,7 @@ export const ConfirmationView = props => {

ConfirmationView.propTypes = {
formConfig: PropTypes.shape({
formId: PropTypes.string,
trackingPrefix: PropTypes.string,
chapters: PropTypes.object,
}).isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,12 @@ WhatsNextProcessListWithContext.propTypes = {
item2Header: PropTypes.string,
};

export const SavePdfDownload = ({ pdfUrl, trackingPrefix, className }) => {
export const SavePdfDownload = ({
pdfUrl,
trackingPrefix,
className,
formId,
}) => {
const onClick = () => {
recordEvent({
event: `${trackingPrefix}confirmation-pdf-download`,
Expand All @@ -254,14 +259,15 @@ export const SavePdfDownload = ({ pdfUrl, trackingPrefix, className }) => {
filetype="PDF"
href={pdfUrl}
onClick={onClick}
text="Download a copy of your VA Form"
text={`Download a copy of your VA Form ${formId}`}
/>
</div>
) : null;
};

SavePdfDownload.propTypes = {
className: PropTypes.string,
formId: PropTypes.string,
pdfUrl: PropTypes.string,
trackingPrefix: PropTypes.string,
};
Expand All @@ -274,6 +280,7 @@ export const SavePdfDownloadWithContext = ({ className }) => {
pdfUrl={pdfUrl}
trackingPrefix={formConfig.trackingPrefix}
className={className}
formId={formConfig.formId}
/>
);
};
Expand Down

0 comments on commit bf53392

Please sign in to comment.