From 3d1eac1682eb4e5225e2dce698539bb03bd51621 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Thu, 5 Jan 2023 08:38:46 -0800 Subject: [PATCH] working loading spinner component. --- .../loading-spinner.component.html | 11 +++ .../loading-spinner.component.scss | 0 .../loading-spinner.component.spec.ts | 23 ++++++ .../loading-spinner.component.ts | 17 ++++ frontend/src/app/components/shared.module.ts | 77 ++++++++++--------- .../medical-sources.component.html | 7 +- 6 files changed, 92 insertions(+), 43 deletions(-) create mode 100644 frontend/src/app/components/loading-spinner/loading-spinner.component.html create mode 100644 frontend/src/app/components/loading-spinner/loading-spinner.component.scss create mode 100644 frontend/src/app/components/loading-spinner/loading-spinner.component.spec.ts create mode 100644 frontend/src/app/components/loading-spinner/loading-spinner.component.ts diff --git a/frontend/src/app/components/loading-spinner/loading-spinner.component.html b/frontend/src/app/components/loading-spinner/loading-spinner.component.html new file mode 100644 index 00000000..771e1cea --- /dev/null +++ b/frontend/src/app/components/loading-spinner/loading-spinner.component.html @@ -0,0 +1,11 @@ +
+
+
+

{{loadingTitle}}

+
+ Loading... +
+
+
+
+ diff --git a/frontend/src/app/components/loading-spinner/loading-spinner.component.scss b/frontend/src/app/components/loading-spinner/loading-spinner.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/frontend/src/app/components/loading-spinner/loading-spinner.component.spec.ts b/frontend/src/app/components/loading-spinner/loading-spinner.component.spec.ts new file mode 100644 index 00000000..a1e65305 --- /dev/null +++ b/frontend/src/app/components/loading-spinner/loading-spinner.component.spec.ts @@ -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; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ LoadingSpinnerComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(LoadingSpinnerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/components/loading-spinner/loading-spinner.component.ts b/frontend/src/app/components/loading-spinner/loading-spinner.component.ts new file mode 100644 index 00000000..faed05c5 --- /dev/null +++ b/frontend/src/app/components/loading-spinner/loading-spinner.component.ts @@ -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 { + } + +} diff --git a/frontend/src/app/components/shared.module.ts b/frontend/src/app/components/shared.module.ts index aae51468..f7215973 100644 --- a/frontend/src/app/components/shared.module.ts +++ b/frontend/src/app/components/shared.module.ts @@ -42,6 +42,7 @@ import {FilterPipe} from '../pipes/filter.pipe'; import { ReportMedicalHistoryConditionComponent } from './report-medical-history-condition/report-medical-history-condition.component'; import { ReportLabsObservationComponent } from './report-labs-observation/report-labs-observation.component'; import { ChartsModule } from 'ng2-charts'; +import { LoadingSpinnerComponent } from './loading-spinner/loading-spinner.component'; @NgModule({ imports: [ @@ -90,45 +91,47 @@ import { ChartsModule } from 'ng2-charts'; FilterPipe, ReportMedicalHistoryConditionComponent, ReportLabsObservationComponent, + LoadingSpinnerComponent, ], - exports: [ - ComponentsSidebarComponent, - ListAllergyIntoleranceComponent, - ListAdverseEventComponent, - ListCarePlanComponent, - ListCommunicationComponent, - ListConditionComponent, - ListEncounterComponent, - ListAppointmentComponent, - ListGenericResourceComponent, - ListImmunizationComponent, - ListMedicationAdministrationComponent, - ListMedicationComponent, - ListMedicationDispenseComponent, - ListMedicationRequestComponent, - ListNutritionOrderComponent, - ListObservationComponent, - ListPatientComponent, - ListProcedureComponent, - ListDeviceRequestComponent, - UtilitiesSidebarComponent, - ListCoverageComponent, - ListServiceRequestComponent, - ListDocumentReferenceComponent, - ListDeviceComponent, - ListDiagnosticReportComponent, - ListGoalComponent, - ResourceListComponent, - ResourceListOutletDirective, - ToastComponent, - ReportHeaderComponent, - ReportMedicalHistoryEditorComponent, - FhirPathPipe, - FilterPipe, - ReportMedicalHistoryConditionComponent, - ReportLabsObservationComponent + exports: [ + ComponentsSidebarComponent, + ListAllergyIntoleranceComponent, + ListAdverseEventComponent, + ListCarePlanComponent, + ListCommunicationComponent, + ListConditionComponent, + ListEncounterComponent, + ListAppointmentComponent, + ListGenericResourceComponent, + ListImmunizationComponent, + ListMedicationAdministrationComponent, + ListMedicationComponent, + ListMedicationDispenseComponent, + ListMedicationRequestComponent, + ListNutritionOrderComponent, + ListObservationComponent, + ListPatientComponent, + ListProcedureComponent, + ListDeviceRequestComponent, + UtilitiesSidebarComponent, + ListCoverageComponent, + ListServiceRequestComponent, + ListDocumentReferenceComponent, + ListDeviceComponent, + ListDiagnosticReportComponent, + ListGoalComponent, + ResourceListComponent, + ResourceListOutletDirective, + ToastComponent, + ReportHeaderComponent, + ReportMedicalHistoryEditorComponent, + FhirPathPipe, + FilterPipe, + ReportMedicalHistoryConditionComponent, + ReportLabsObservationComponent, + LoadingSpinnerComponent - ] + ] }) export class SharedModule { } diff --git a/frontend/src/app/pages/medical-sources/medical-sources.component.html b/frontend/src/app/pages/medical-sources/medical-sources.component.html index 73e01950..edb6eb28 100644 --- a/frontend/src/app/pages/medical-sources/medical-sources.component.html +++ b/frontend/src/app/pages/medical-sources/medical-sources.component.html @@ -136,12 +136,7 @@
-
-

Please wait, loading sources...

-
- Loading... -
-
+