working loading spinner component.

This commit is contained in:
Jason Kulatunga 2023-01-05 08:38:46 -08:00
parent 4294880d79
commit 3d1eac1682
6 changed files with 92 additions and 43 deletions

View File

@ -0,0 +1,11 @@
<div class="card bg-gray-100">
<div class="card-body">
<div class="text-center tx-indigo">
<p class="pb-3">{{loadingTitle}}</p>
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
</div><!-- card-body -->
</div>

View File

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LoadingSpinnerComponent } from './loading-spinner.component';
describe('LoadingSpinnerComponent', () => {
let component: LoadingSpinnerComponent;
let fixture: ComponentFixture<LoadingSpinnerComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LoadingSpinnerComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(LoadingSpinnerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,17 @@
import {Component, Input, OnInit} from '@angular/core';
@Component({
selector: 'app-loading-spinner',
templateUrl: './loading-spinner.component.html',
styleUrls: ['./loading-spinner.component.scss']
})
export class LoadingSpinnerComponent implements OnInit {
@Input() loadingTitle: string = "Please wait, loading..."
@Input() loadingSubTitle: string = ""
constructor() { }
ngOnInit(): void {
}
}

View File

@ -42,6 +42,7 @@ import {FilterPipe} from '../pipes/filter.pipe';
import { ReportMedicalHistoryConditionComponent } from './report-medical-history-condition/report-medical-history-condition.component'; import { ReportMedicalHistoryConditionComponent } from './report-medical-history-condition/report-medical-history-condition.component';
import { ReportLabsObservationComponent } from './report-labs-observation/report-labs-observation.component'; import { ReportLabsObservationComponent } from './report-labs-observation/report-labs-observation.component';
import { ChartsModule } from 'ng2-charts'; import { ChartsModule } from 'ng2-charts';
import { LoadingSpinnerComponent } from './loading-spinner/loading-spinner.component';
@NgModule({ @NgModule({
imports: [ imports: [
@ -90,45 +91,47 @@ import { ChartsModule } from 'ng2-charts';
FilterPipe, FilterPipe,
ReportMedicalHistoryConditionComponent, ReportMedicalHistoryConditionComponent,
ReportLabsObservationComponent, ReportLabsObservationComponent,
LoadingSpinnerComponent,
], ],
exports: [ exports: [
ComponentsSidebarComponent, ComponentsSidebarComponent,
ListAllergyIntoleranceComponent, ListAllergyIntoleranceComponent,
ListAdverseEventComponent, ListAdverseEventComponent,
ListCarePlanComponent, ListCarePlanComponent,
ListCommunicationComponent, ListCommunicationComponent,
ListConditionComponent, ListConditionComponent,
ListEncounterComponent, ListEncounterComponent,
ListAppointmentComponent, ListAppointmentComponent,
ListGenericResourceComponent, ListGenericResourceComponent,
ListImmunizationComponent, ListImmunizationComponent,
ListMedicationAdministrationComponent, ListMedicationAdministrationComponent,
ListMedicationComponent, ListMedicationComponent,
ListMedicationDispenseComponent, ListMedicationDispenseComponent,
ListMedicationRequestComponent, ListMedicationRequestComponent,
ListNutritionOrderComponent, ListNutritionOrderComponent,
ListObservationComponent, ListObservationComponent,
ListPatientComponent, ListPatientComponent,
ListProcedureComponent, ListProcedureComponent,
ListDeviceRequestComponent, ListDeviceRequestComponent,
UtilitiesSidebarComponent, UtilitiesSidebarComponent,
ListCoverageComponent, ListCoverageComponent,
ListServiceRequestComponent, ListServiceRequestComponent,
ListDocumentReferenceComponent, ListDocumentReferenceComponent,
ListDeviceComponent, ListDeviceComponent,
ListDiagnosticReportComponent, ListDiagnosticReportComponent,
ListGoalComponent, ListGoalComponent,
ResourceListComponent, ResourceListComponent,
ResourceListOutletDirective, ResourceListOutletDirective,
ToastComponent, ToastComponent,
ReportHeaderComponent, ReportHeaderComponent,
ReportMedicalHistoryEditorComponent, ReportMedicalHistoryEditorComponent,
FhirPathPipe, FhirPathPipe,
FilterPipe, FilterPipe,
ReportMedicalHistoryConditionComponent, ReportMedicalHistoryConditionComponent,
ReportLabsObservationComponent ReportLabsObservationComponent,
LoadingSpinnerComponent
] ]
}) })
export class SharedModule { } export class SharedModule { }

View File

@ -136,12 +136,7 @@
<ng-template #isLoadingTemplate> <ng-template #isLoadingTemplate>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="text-center"> <app-loading-spinner [loadingTitle]="'Please wait, loading sources...'"></app-loading-spinner>
<p class="pb-3">Please wait, loading sources...</p>
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
</div> </div>
</div> </div>
</ng-template> </ng-template>