Skip to content

Commit

Permalink
#added READ ME build intructions (#1557)
Browse files Browse the repository at this point in the history
POC-122: color code Clinical testing Build

Co-authored-by: Kipchumba C. Bett <[email protected]>
  • Loading branch information
hiqedme and corneliouzbett authored Mar 21, 2023
1 parent d742122 commit 756741f
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 23 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Recommended setup:

- Install [chrome](https://www.google.com/chrome/).
- Install and setup [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) on your local machine.
- Install [npm and nodeJS](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).NodeJS version 10-12 and Npm version 6 recommended.
- Install [npm and nodeJS](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).NodeJS version 10-12 and Npm version 6 recommended.
- Install [visual studio code](https://code.visualstudio.com/).

### Setup
Expand All @@ -39,6 +39,14 @@ npm start

Fire up your chrome and go to `https://localhost:3000`. You should see a login screen with the AMPATH logo.

### Building for deployment

When building for production environment use:
`npm run build-prod`
When building for staging or test environment use:
`npm run build-staging`
This assists the team to differentiate which environment they are working on

### Running tests

```
Expand Down
42 changes: 24 additions & 18 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
"src/manifest.json",
"src/combined-worker.js"
],
"styles": [
"src/styles.css",
"src/assets/css/material.font.css"
],
"styles": ["src/styles.css", "src/assets/css/material.font.css"],
"scripts": [
"src/assets/rgbcolor/index.js",
"src/assets/StackBlur/StackBlur.js",
Expand Down Expand Up @@ -58,6 +55,24 @@
"vendorChunk": false,
"buildOptimizer": true,
"serviceWorker": true
},
"staging": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.staging.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"serviceWorker": true
}
}
},
Expand Down Expand Up @@ -86,9 +101,7 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.css"
],
"styles": ["src/styles.css"],
"scripts": [
"src/assets/rgbcolor/index.js",
"src/assets/StackBlur/StackBlur.js",
Expand All @@ -111,13 +124,8 @@
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
}
}
}
Expand All @@ -137,13 +145,11 @@
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
"exclude": ["**/node_modules/**"]
}
}
}
}
},
"defaultProject": "ngx-amrs"
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"lint": "ng lint",
"e2e": "ng e2e",
"stats": "webpack-bundle-analyzer dist/ngx-amrs/stats.json",
"build-prod": "node version.js && bash ./scripts/ng.sh build --prod --aot --optimization=false",
"build-prod": "node version.js && bash ./scripts/ng.sh build --prod --configuration=production --aot --optimization=false",
"build-staging": "node version.js && bash ./scripts/ng.sh build --prod --configuration=staging --aot --optimization=false",
"build-prod:stats": "npm run build-prod -- --statsJson=true && npm run stats",
"serve:prod": "http-server dist/ngx-amrs/ -P https://ngx.ampath.or.ke",
"prebuild": "node version.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
background-color: #d9edf7;
padding: 15px;
}

/* background-color: #d9edf7; */
.banner-test {
color: #214a5f;
width: 100%;
background-color: #eacbf4;
padding: 15px;
}
.banner-danger {
color: #fff;
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
<div class="row">
<div
class="container-fluid patient-banner-partially hidden-sm hidden-md hidden-lg hidden-xl {{
patient.person.dead ? 'banner-danger' : 'banner-info'
patient.person.dead
? 'banner-danger'
: isStaging
? 'banner-test'
: 'banner-info'
}}"
*ngIf="patient"
style="padding: 4px 26px"
Expand Down Expand Up @@ -236,7 +240,11 @@
</div>-->
<div
class="container-fluid patient-banner-partially hidden-xs {{
patient.person.dead ? 'banner-danger' : 'banner-info'
patient.person.dead
? 'banner-danger'
: isStaging
? 'banner-test'
: 'banner-info'
}}"
*ngIf="patient"
style="padding: 12px 26px"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { UserDefaultPropertiesService } from 'src/app/user-default-properties/us
import { FamilyTestingService } from 'src/app/etl-api/family-testing-resource.service';
import { EncounterResourceService } from 'src/app/openmrs-api/encounter-resource.service';
import { PersonAttributeResourceService } from './../../../openmrs-api/person-attribute-resource.service';
import { environment } from 'src/environments/environment';
@Component({
selector: 'patient-banner',
templateUrl: './patient-banner.component.html',
Expand All @@ -37,12 +38,14 @@ export class PatientBannerComponent implements OnInit, OnDestroy, OnChanges {
public searchIdentifiers: any;
public attributes: any;
public birthdate;

public formattedPatientAge;
private subscription: Subscription;
private subs = [];
private patientServiceSubscription: Subscription;
public relationships: any = [];
public relationship: Relationship;
public isStaging = true;
public ovcEnrollment = false;
public isPatientVerified = false;
public verificationStatus = false;
Expand Down Expand Up @@ -84,6 +87,9 @@ export class PatientBannerComponent implements OnInit, OnDestroy, OnChanges {
patient.enrolledPrograms,
patient.person.birthdate
);
if (environment.production) {
this.isStaging = false;
}
const attributes = patient.person.attributes;
_.each(attributes, (attribute) => {
// get the test patient attribute
Expand Down
3 changes: 3 additions & 0 deletions src/environments/environment.staging.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const environment = {
production: false
};

0 comments on commit 756741f

Please sign in to comment.