-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #486 from udsm-dhis2-lab/feature/improve-lis-menu
Add lis price-list module and fix null pointer when setting price of …
- Loading branch information
Showing
19 changed files
with
167 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...ratory/modules/settings/components/lab-price-list-home/lab-price-list-home.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div *ngIf="{ paymentTypes: paymentTypes$ | async } as params"> | ||
<mat-progress-bar | ||
*ngIf="!params?.paymentTypes" | ||
mode="indeterminate" | ||
></mat-progress-bar> | ||
<app-price-list | ||
[paymentTypes]="params?.paymentTypes" | ||
[hideDepartmentsSelection]="true" | ||
*ngIf="params?.paymentTypes && params?.paymentTypes.length > 0" | ||
></app-price-list> | ||
<div | ||
class="text-danger text-center" | ||
*ngIf="params?.paymentTypes && params?.paymentTypes.length === 0" | ||
> | ||
<p>Payment types not set</p> | ||
</div> | ||
</div> |
Empty file.
23 changes: 23 additions & 0 deletions
23
...ory/modules/settings/components/lab-price-list-home/lab-price-list-home.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { LabPriceListHomeComponent } from './lab-price-list-home.component'; | ||
|
||
describe('LabPriceListHomeComponent', () => { | ||
let component: LabPriceListHomeComponent; | ||
let fixture: ComponentFixture<LabPriceListHomeComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [LabPriceListHomeComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(LabPriceListHomeComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
24 changes: 24 additions & 0 deletions
24
...boratory/modules/settings/components/lab-price-list-home/lab-price-list-home.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Component, Input, OnInit } from "@angular/core"; | ||
import { select, Store } from "@ngrx/store"; | ||
import { Observable } from "rxjs"; | ||
import { initiatePaymentTypes } from "src/app/store/actions/payment-type.actions"; | ||
import { AppState } from "src/app/store/reducers"; | ||
import { getAllPaymentTypes } from "src/app/store/selectors/payment-type.selectors"; | ||
|
||
@Component({ | ||
selector: "app-lab-price-list-home", | ||
templateUrl: "./lab-price-list-home.component.html", | ||
styleUrl: "./lab-price-list-home.component.scss", | ||
}) | ||
export class LabPriceListHomeComponent implements OnInit { | ||
@Input() paymentCategories: any[]; | ||
paymentTypes$: Observable<any>; | ||
constructor(private store: Store<AppState>) {} | ||
ngOnInit(): void { | ||
this.store.dispatch( | ||
initiatePaymentTypes({ paymentCategories: this.paymentCategories }) | ||
); | ||
|
||
this.paymentTypes$ = this.store.pipe(select(getAllPaymentTypes)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...ngs/containers/lab-price-list-home-container/lab-price-list-home-container.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div | ||
*ngIf="{ | ||
paymentCategories: paymentCategories$ | async | ||
} as params" | ||
> | ||
<mat-progress-bar | ||
*ngIf="!params?.paymentCategories" | ||
mode="indeterminate" | ||
></mat-progress-bar> | ||
<app-lab-price-list-home | ||
[paymentCategories]="params?.paymentCategories?.setMembers" | ||
*ngIf="params?.paymentCategories" | ||
></app-lab-price-list-home> | ||
</div> |
Empty file.
23 changes: 23 additions & 0 deletions
23
.../containers/lab-price-list-home-container/lab-price-list-home-container.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { LabPriceListHomeContainerComponent } from './lab-price-list-home-container.component'; | ||
|
||
describe('LabPriceListHomeContainerComponent', () => { | ||
let component: LabPriceListHomeContainerComponent; | ||
let fixture: ComponentFixture<LabPriceListHomeContainerComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [LabPriceListHomeContainerComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(LabPriceListHomeContainerComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
28 changes: 28 additions & 0 deletions
28
...tings/containers/lab-price-list-home-container/lab-price-list-home-container.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Component, OnInit } from "@angular/core"; | ||
import { Store } from "@ngrx/store"; | ||
import { Observable } from "rxjs"; | ||
import { loadConceptByUuid } from "src/app/store/actions"; | ||
import { AppState } from "src/app/store/reducers"; | ||
import { getConceptById } from "src/app/store/selectors"; | ||
|
||
@Component({ | ||
selector: "app-lab-price-list-home-container", | ||
templateUrl: "./lab-price-list-home-container.component.html", | ||
styleUrl: "./lab-price-list-home-container.component.scss", | ||
}) | ||
export class LabPriceListHomeContainerComponent implements OnInit { | ||
paymentCategories$: Observable<any>; | ||
constructor(private store: Store<AppState>) {} | ||
ngOnInit(): void { | ||
// TODO: Save the uuid on global properties, and switch-map accordingly | ||
this.store.dispatch( | ||
loadConceptByUuid({ | ||
uuid: "c95c1065-bcea-4a35-aee0-ca62906ec8e2", | ||
fields: "custom:(uuid,display,setMembers:(uuid,display)", | ||
}) | ||
); | ||
this.paymentCategories$ = this.store.select(getConceptById, { | ||
id: "c95c1065-bcea-4a35-aee0-ca62906ec8e2", | ||
}); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
ui/src/app/modules/laboratory/modules/settings/settings-routing.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
ui/src/app/shared/components/price-list/price-list.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
|
||
.price-list-container { | ||
padding: 8px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters