Skip to content

Commit

Permalink
Merge pull request #1383 from RoundingWell/attachment-download
Browse files Browse the repository at this point in the history
Add `target="_blank"` to attachment download button link
  • Loading branch information
paulfalgout authored Jan 16, 2025
2 parents 1d3a741 + 2478f10 commit acfd9b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ const AttachmentView = View.extend({
downloadTemplate: hbs`
<a class="action-sidebar__attachment-filename" target="_blank" href="{{_view}}">{{filename}}</a>
<div class="flex">
<a class="action-sidebar__attachment-action flex-grow" href="{{_download}}" download>
<a class="action-sidebar__attachment-action flex-grow" target="_blank" href="{{_download}}" download>
{{far "download"}} <span>{{ @intl.patients.sidebar.action.actionSidebarAttachmentsViews.attachmentView.downloadText }}</span>
</a>
{{#if canRemoveAttachments}}
{{#if canRemoveAttachments}}
<a class="action-sidebar__attachment-action js-remove">
{{far "trash-can"}} <span>{{ @intl.patients.sidebar.action.actionSidebarAttachmentsViews.attachmentView.removeText }}</span>
</a>
Expand Down
5 changes: 5 additions & 0 deletions test/integration/patients/sidebar/action-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,11 @@ context('action sidebar', function() {
.should('have.attr', 'href')
.and('contain', `https://www.bucket_name.s3.amazonaws.com/patients/${ testPatient.id }/download/HRA%20v2.pdf`);

cy
.get('@attachmentDownload')
.should('have.attr', 'target')
.and('contain', '_blank');

cy
.get('@attachmentDownload')
.should('have.attr', 'download');
Expand Down

0 comments on commit acfd9b3

Please sign in to comment.