Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(CB2-11453): prevent download .zip file in seperate window (as this may be blocked) #1476

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/forms/custom-sections/adr/adr.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
background-color: transparent;
box-shadow: none;
cursor: pointer;
font-family: 'GDS Transport', arial, sans-serif;

&:hover {
text-decoration: underline;
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/documents/documents.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('DocumentsService', () => {
const simulateClickSpy = jest.spyOn(service, 'simulateClick');

const fakeAnchorZip = domParser
.parseFromString('<a download="fileName.zip" href="Response body" target="_blank" />', 'text/html')
.parseFromString('<a download="fileName.zip" href="Response body" />', 'text/html')
.querySelector('a');

service.openDocumentFromResponse(fileName, responseBody, 'zip');
Expand Down
1 change: 0 additions & 1 deletion src/app/services/documents/documents.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export class DocumentsService {
const link: HTMLAnchorElement = document.createElement('a');

link.href = (responseBody as string).toString();
link.target = '_blank';
link.download = `${fileName}.${fileType}`;

this.simulateClick(link);
Expand Down
Loading