Skip to content

Commit

Permalink
make sure explore page loading animation is present until all source …
Browse files Browse the repository at this point in the history
…lookups are complete.
  • Loading branch information
AnalogJ committed Aug 12, 2023
1 parent 169dc28 commit b4ee83b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 41 deletions.
30 changes: 3 additions & 27 deletions frontend/src/app/pages/explore/explore.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -42,32 +44,6 @@ <h4 class="tx-purple mg-b-20">No Sources Found!</h4>
</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>
15 changes: 1 addition & 14 deletions frontend/src/app/pages/explore/explore.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ 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[]
forkJoin(connectedSources.map((source) => this.lighthouseApi.getLighthouseSource(source.source_type))).subscribe((connectedMetadata) => {
for(const ndx in connectedSources){
this.connectedSources.push({source: connectedSources[ndx], metadata: connectedMetadata[ndx]})
}
this.loading = false
})
}, error => {
this.loading = false
Expand All @@ -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)}`;
// });
}

}

0 comments on commit b4ee83b

Please sign in to comment.