Skip to content
Open
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
11 changes: 8 additions & 3 deletions src/app/app-modules/lab/workarea/workarea.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1014,9 +1014,14 @@
fileID: result,
};
this.labService.viewFileContent(fileID).subscribe((res: any) => {
if (res && res.data && res.data.statusCode === 200) {
const fileContent = res.data.data?.response;
location.href = fileContent;
if (res && res.statusCode === 200) {

Check warning on line 1017 in src/app/app-modules/lab/workarea/workarea.component.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer using an optional chain expression instead, as it's more concise and easier to read.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-UI&issues=AZ1ovN2QzsBjmD1pwO_k&open=AZ1ovN2QzsBjmD1pwO_k&pullRequest=149
const fileContent = res.data?.response;
const a = document.createElement('a');
a.href = fileContent;
a.target = '_blank';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);

Check warning on line 1024 in src/app/app-modules/lab/workarea/workarea.component.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-UI&issues=AZ1ovN2QzsBjmD1pwO_l&open=AZ1ovN2QzsBjmD1pwO_l&pullRequest=149
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,14 @@
};
this.labService.viewFileContent(fileID).subscribe(
(res: any) => {
if (res.data.statusCode === 200) {
const fileContent = res.data.data.response;
location.href = fileContent;
if (res.statusCode === 200) {
const fileContent = res.data.response;
const a = document.createElement('a');
a.href = fileContent;
a.target = '_blank';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);

Check warning on line 515 in src/app/app-modules/nurse-doctor/case-record/general-case-record/test-and-radiology/test-and-radiology.component.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-UI&issues=AZ1ovN0dzsBjmD1pwO_i&open=AZ1ovN0dzsBjmD1pwO_i&pullRequest=149
}
},
(err) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,14 @@
fileID: result,
};
this.labService.viewFileContent(fileID).subscribe((res: any) => {
if (res && res.data && res.data.statusCode === 200) {
const fileContent = res.data.data?.response;
location.href = fileContent;
if (res && res.statusCode === 200) {
const fileContent = res.data?.response;
const a = document.createElement('a');
a.href = fileContent;
a.target = '_blank';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);

Check warning on line 326 in src/app/app-modules/nurse-doctor/visit-details/upload-files/upload-files.component.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-UI&issues=AZ1ovN1lzsBjmD1pwO_j&open=AZ1ovN1lzsBjmD1pwO_j&pullRequest=149
}
});
}
Expand Down
Loading