make sure explore page loading animation is present until all source lookups are complete.

This commit is contained in:
Jason Kulatunga 2023-08-12 07:30:19 -06:00
parent 169dc28776
commit b4ee83b0a1
2 changed files with 4 additions and 41 deletions

View File

@ -5,7 +5,9 @@
<!-- Header Row -->
<report-header [reportHeaderTitle]="'Explore'" [reportHeaderSubTitle]="'Explore your Medical Records'"></report-header>
<ng-container [ngTemplateOutlet]="loading ? isLoadingTemplate : (connectedSources.length == 0) ? emptyReport : report"></ng-container>
<ng-container [ngTemplateOutlet]="loading ? isLoadingTemplate :
(connectedSources.length == 0) ? emptyReport :
report"></ng-container>
<ng-template #report>
<div class="row">
@ -42,32 +44,6 @@
</div>
</ng-template>
<ng-template #contentModalRef let-modal>
<div class="modal-header">
<h4 class="modal-title" id="modal-basic-title"></h4>
<button type="button" class="btn btn-close" aria-label="Close" (click)="modal.dismiss('Cross click')">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<h6>Manage Source</h6>
<p>Existing connections can be "Synced", "Reconnected" or "Deleted"</p>
<ul>
<li><p><strong>Sync</strong> - Download all resources from this healthcare provider, storing them securely in Fasten</p></li>
<li><p><strong>Reconnect</strong> - If your healthcare connection has expired, you can use this button to reconnect</p></li>
<li><p><strong>Delete</strong> - Delete all resources for this healthcare provider. This will ONLY effect data stored in Fasten</p></li>
</ul>
</div>
<div class="modal-footer">
<!-- <button (click)="sourceSyncHandler(modalSelectedSourceListItem.source)" type="button" class="btn btn-indigo">Sync</button>-->
<!-- <button (click)="connectHandler($event, modalSelectedSourceListItem.source['source_type'])" type="button" class="btn btn-outline-light">Reconnect</button>-->
<button type="button" class="btn disabled btn-outline-danger">Delete</button>
<button (click)="modal.dismiss('Close click')" type="button" class="btn btn-outline-light">Close</button>
</div>
</ng-template>
</div>
</div>
</div>

View File

@ -24,7 +24,6 @@ export class ExploreComponent implements OnInit {
ngOnInit(): void {
this.loading = true
this.fastenApi.getSources().subscribe(results => {
this.loading = false
//handle connected sources sources
const connectedSources = results as Source[]
@ -32,6 +31,7 @@ export class ExploreComponent implements OnInit {
for(const ndx in connectedSources){
this.connectedSources.push({source: connectedSources[ndx], metadata: connectedMetadata[ndx]})
}
this.loading = false
})
}, error => {
this.loading = false
@ -44,19 +44,6 @@ export class ExploreComponent implements OnInit {
state: sourceListItem.source
});
// if(this.status[sourceListItem.metadata.source_type] || !sourceListItem.source){
// //if this source is currently "loading" dont open the modal window
// return
// }
//
// this.modalSelectedSourceListItem = sourceListItem
// this.modalService.open(contentModalRef, {ariaLabelledBy: 'modal-basic-title'}).result.then((result) => {
// this.modalSelectedSourceListItem = null
// this.modalCloseResult = `Closed with: ${result}`;
// }, (reason) => {
// this.modalSelectedSourceListItem = null
// this.modalCloseResult = `Dismissed ${this.getDismissReason(reason)}`;
// });
}
}