Skip to content

Commit

Permalink
Upgraded to angular 6
Browse files Browse the repository at this point in the history
  • Loading branch information
nkimaina authored and enyachoke committed Dec 18, 2018
1 parent a8acb48 commit e974044
Show file tree
Hide file tree
Showing 179 changed files with 797 additions and 1,307 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ before_install:
# Updating NPM to relevant version >= 3 on Node.JS LTS
- npm i -g brfs
script:
- npm run build
- npm run build-prod
#- npm run test
sudo: required
addons:
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"test-debug": "ng test --browsers ChromeDebug",
"lint": "ng lint",
"e2e": "ng e2e",
"build-prod": "node version.js && bash ./scripts/ng.sh build --prod --aot",
"serve:prod": "http-server dist/ngx-amrs/ -P https://ngx.ampath.or.ke",
"prebuild": "node version.js",
"prestart": "node version.js"
Expand Down Expand Up @@ -77,7 +78,7 @@
"ngx-cookie": "^4.0.2",
"ngx-file-uploader": "git+https://github.com/enyachoke/ngx-file-uploader.git#0.0.9",
"ngx-mydatepicker": "^0.1.0",
"ngx-openmrs-formentry": "git+https://github.com/AMPATH/ngx-openmrs-formentry.git#v2.9.7-alpha5",
"ngx-openmrs-formentry": "git+https://github.com/AMPATH/ngx-openmrs-formentry.git#v2.9.7-alpha6",
"ngx-pagination": "^3.1.1",
"ngx-select": "^0.0.1",
"ngx-toastr": "^6.5.0",
Expand Down
15 changes: 15 additions & 0 deletions scripts/ng.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac

if [ -x "$basedir/node" ]; then
"$basedir/node" --max_old_space_size=8192 "./node_modules/@angular/cli/bin/ng" "$@"
ret=$?
else
node --max_old_space_size=8192 "./node_modules/@angular/cli/bin/ng" "$@"
ret=$?
fi
exit $ret
2 changes: 1 addition & 1 deletion src/app/Motd/motd-notification.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { of } from 'rxjs';
import { AppSettingsService } from './../app-settings';
import { AppSettingsService } from './../app-settings/app-settings.service';
import { FakeAppSettingsService } from '../etl-api/moh-731-patientlist-resource.service.spec';
import { LocalStorageService } from '../utils/local-storage.service';
import { ComponentFixture, TestBed, async , inject } from '@angular/core/testing';
Expand Down
2 changes: 1 addition & 1 deletion src/app/authentication/login.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ResponseOptions
} from '@angular/http';
import { AuthenticationService } from '../openmrs-api/authentication.service';
import { AppSettingsService } from '../app-settings';
import { AppSettingsService } from '../app-settings/app-settings.service';
import { SessionService } from '../openmrs-api/session.service';
import { LocalStorageService } from '../utils/local-storage.service';
import { SessionStorageService } from '../utils/session-storage.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import { DateRangeComponent } from './date-range/date-range.component';
import { GenderSelectComponent } from './gender-selector/gender-selector.component';
import { IndicatorSelectComponent } from './indicator-selector/indicator-selector.component';
import { RangeSliderComponent } from './range-slider/range-slider.component';
import {
VisualizationComponent
} from '../hiv/clinical-summary-visualization/visualization-component';
// import {
// VisualizationComponent
// } from '../hiv/clinical-summary-visualization/visualization-component';
import { ClinicDashboardCacheService } from '../services/clinic-dashboard-cache.service';
import {
ClinicalSummaryVisualizationResourceService
} from '../../etl-api/clinical-summary-visualization-resource.service';
import { AppSettingsService } from '../../app-settings';
import { AppSettingsService } from '../../app-settings/app-settings.service';
import { DataCacheService } from '../../shared/services/data-cache.service';
import { Http } from '@angular/http';
import {
Expand Down Expand Up @@ -92,7 +92,7 @@ export class FakeClinicalSummaryVisualizationResourceService {
DashboardFiltersComponent,
DateRangeComponent,
GenderSelectComponent,
VisualizationComponent,
// VisualizationComponent,
FakeHivCareOverview,
FakeArtOverviewChart,
FakepatientStatusOverviewChart,
Expand Down Expand Up @@ -120,7 +120,7 @@ export class FakeClinicalSummaryVisualizationResourceService {
component.updateStartDate(moment([2016, 2, 22]).format());
component.updateEndDate(moment([2017, 2, 22]).format());
fixture.detectChanges();
component.onDateChange.take(1).subscribe((v) => {
component.onDateChange.subscribe((v) => {
parentComponent.filterModel = {};
setTimeout(() => {
parentComponent.onDateChanged(v);
Expand All @@ -133,7 +133,7 @@ export class FakeClinicalSummaryVisualizationResourceService {
gender_select: false
};
parentFixture.detectChanges();
parentComponent.filterModelChange.take(1).subscribe((vv) => {
parentComponent.filterModelChange.subscribe((vv) => {
setTimeout(() => {
expect(moment(parentComponent.filterModel.startDate)
.format('DD/MM/YYYY')).toBe('22/03/2016');
Expand All @@ -150,7 +150,7 @@ export class FakeClinicalSummaryVisualizationResourceService {
let component = fixture.componentInstance;
expect(component.selectedGender.length).toEqual(0);
component.onGenderSelected(['F']);
component.onGenderChange.take(1).subscribe((gender) => {
component.onGenderChange.subscribe((gender) => {
parentComponent.filterModel = {};
setTimeout(() => {
expect(component.selectedGender.length).toEqual(1);
Expand All @@ -165,7 +165,7 @@ export class FakeClinicalSummaryVisualizationResourceService {
gender_select: true
};
fixture.detectChanges();
parentComponent.filterModelChange.take(1).subscribe((vv) => {
parentComponent.filterModelChange.subscribe((vv) => {
setTimeout(() => {
expect(parentComponent.filterModel.gender).toBeDefined();
expect(parentComponent.filterModel.gender[0]).toEqual('F');
Expand All @@ -180,7 +180,7 @@ export class FakeClinicalSummaryVisualizationResourceService {
let component = fixture.componentInstance;
expect(component.selectedIndicators.length).toEqual(0);
component.onIndicatorSelected(['indicator']);
component.onIndicatorChange.take(1).subscribe((indicators) => {
component.onIndicatorChange.subscribe((indicators) => {
parentComponent.filterModel = {};
setTimeout(() => {
expect(component.selectedIndicators.length).toEqual(1);
Expand All @@ -194,7 +194,7 @@ export class FakeClinicalSummaryVisualizationResourceService {
range_slider: false,
gender_select: false
};
parentComponent.filterModelChange.take(1).subscribe((vv) => {
parentComponent.filterModelChange.subscribe((vv) => {
setTimeout(() => {
expect(parentComponent.filterModel.indicators).toBeDefined();
expect(parentComponent.filterModel.indicators[0]).toEqual('indicator');
Expand All @@ -209,7 +209,7 @@ export class FakeClinicalSummaryVisualizationResourceService {
let component = fixture.componentInstance;
component.start = 11;
component.end = 13;
component.onAgeChangeFinish.take(1).subscribe((age) => {
component.onAgeChangeFinish.subscribe((age) => {
parentComponent.filterModel = {};
setTimeout(() => {
expect(component.start).toEqual(11);
Expand All @@ -224,7 +224,7 @@ export class FakeClinicalSummaryVisualizationResourceService {
gender_select: false
};
fixture.detectChanges();
parentComponent.filterModelChange.take(1).subscribe((vv) => {
parentComponent.filterModelChange.subscribe((vv) => {
setTimeout(() => {
expect(parentComponent.filterModel.ageFrom).toBeDefined();
expect(parentComponent.filterModel.ageTo).toBeDefined();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ <h4 class="component-title" style="color: green;"><span class="icon-i-pathology"


<button class="btn btn-primary"
(click)="downloadPdf()" [disabled]="!results.length>0">
(click)="downloadPdf()" [disabled]="!(results.length>0)">
<i class="fa fa-download">
</i> Download PDF
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SpyLocation } from '@angular/common/testing';

import { AppFeatureAnalytics } from '../../../shared/app-analytics/app-feature-analytics.service';
import { FakeAppFeatureAnalytics } from '../../../shared/app-analytics/app-feature-analytcis.mock';
import { AppSettingsService } from '../../../app-settings';
import { AppSettingsService } from '../../../app-settings/app-settings.service';
import { LocalStorageService } from '../../../utils/local-storage.service';
import { ClinicLabOrdersComponent } from './clinic-lab-orders.component';
import { ClinicLabOrdersResourceService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export class ClinicLabOrdersComponent implements OnInit, OnDestroy {
public totalSampleNotCollected: any;
public startDate: any;
public endDate: any;
public isLoadingReport: boolean = false;
public filterCollapsed: any;
public isLoadingReport = false;
public parentIsBusy = false;
public totalCounts: any;
@Input() public selectedDate: any;
public errors: any = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { DefaulterListComponent } from './defaulter-list.component';
import { AppFeatureAnalytics } from '../../../shared/app-analytics/app-feature-analytics.service';
import { FakeAppFeatureAnalytics } from '../../../shared/app-analytics/app-feature-analytcis.mock';
import { AppSettingsService } from '../../../app-settings';
import { AppSettingsService } from '../../../app-settings/app-settings.service';
import { LocalStorageService } from '../../../utils/local-storage.service';
import { NgBusyModule } from 'ng-busy';
import { NgamrsSharedModule } from '../../../shared/ngamrs-shared.module';
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit e974044

Please sign in to comment.