fixing tests.
This commit is contained in:
parent
36902b59e1
commit
a2937a42e4
|
@ -1,3 +1,3 @@
|
|||
<div>
|
||||
<pre>{{displayModel.content}}</pre>
|
||||
<pre>{{displayModel?.content}}</pre>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div>
|
||||
<span>{{coding.display}}</span>
|
||||
<span *ngIf="has_additional_info" [title]="coding.system">
|
||||
({{coding.code || '?'}})
|
||||
<span>{{coding?.display}}</span>
|
||||
<span *ngIf="has_additional_info" [title]="coding?.system">
|
||||
({{coding?.code || '?'}})
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,7 @@ export class HtmlComponent implements OnInit {
|
|||
constructor(private sanitized: DomSanitizer) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.contentMarkup = this.sanitized.bypassSecurityTrustHtml(this.displayModel.content);
|
||||
this.contentMarkup = this.sanitized.bypassSecurityTrustHtml(this.displayModel?.content);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<div>
|
||||
<img src="data:${{displayModel.content_type}};base64,${{displayModel.data}}" alt=""/>
|
||||
<img src="data:${{displayModel?.content_type}};base64,${{displayModel?.data}}" alt=""/>
|
||||
</div>
|
||||
|
|
|
@ -18,6 +18,8 @@ describe('ImgComponent', () => {
|
|||
});
|
||||
|
||||
it('should create', () => {
|
||||
|
||||
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div>
|
||||
<embed
|
||||
src="data:${{displayModel.content_type}};base64,${{displayModel.data}}"
|
||||
type="${{displayModel.content_type}}"
|
||||
type="${{displayModel?.content_type}}"
|
||||
[style]="{
|
||||
width: '100%',
|
||||
height: height
|
||||
|
|
|
@ -14,8 +14,11 @@ export class PdfComponent implements OnInit {
|
|||
|
||||
ngOnInit(): void {
|
||||
const maxHeight = 600;
|
||||
const contentHeight = (1111 * this.displayModel.data.length) / (24996 / 7.5);
|
||||
this.height = Math.min(maxHeight, contentHeight);
|
||||
if (this.displayModel){
|
||||
const contentHeight = (1111 * this.displayModel?.data.length) / (24996 / 7.5);
|
||||
this.height = Math.min(maxHeight, contentHeight);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<ng-container [ngTemplateOutlet]="
|
||||
displayModel.content_type == 'application/pdf' ? showPdf :
|
||||
displayModel.content_type == 'image/jpeg' ? showImg :
|
||||
(displayModel.content_type == 'text/html' || displayModel.content_type == 'application/html') ? showHtml :
|
||||
(displayModel.content_type == 'application/xml' || displayModel.content_type == 'application/json') ? showText :
|
||||
displayModel?.content_type == 'application/pdf' ? showPdf :
|
||||
displayModel?.content_type == 'image/jpeg' ? showImg :
|
||||
(displayModel?.content_type == 'text/html' || displayModel?.content_type == 'application/html') ? showHtml :
|
||||
(displayModel?.content_type == 'application/xml' || displayModel?.content_type == 'application/json') ? showText :
|
||||
showEmpty
|
||||
"></ng-container>
|
||||
|
||||
|
|
Loading…
Reference in New Issue