Update environments

test
dan 2019-07-24 22:33:06 -06:00
parent bda0b385ae
commit d25377cdbe
6 changed files with 33 additions and 3 deletions

View File

@ -29,6 +29,14 @@
"scripts": [] "scripts": []
}, },
"configurations": { "configurations": {
"test": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.test.ts"
}
]
},
"production": { "production": {
"fileReplacements": [ "fileReplacements": [
{ {

View File

@ -18,7 +18,7 @@
</p> </p>
<br><br> <br><br>
<form [formGroup]="form" (ngSubmit)="onSubmit()"> <form [formGroup]="form" (ngSubmit)="onSubmit()">
<mat-form-field class="w-50"> <mat-form-field class="w-50" [class.background-error]="hasErrors('name')">
<mat-label>Name</mat-label> <mat-label>Name</mat-label>
<input matInput type="text" formControlName="name" required> <input matInput type="text" formControlName="name" required>
</mat-form-field> </mat-form-field>
@ -205,7 +205,7 @@
</mat-form-field> </mat-form-field>
<label id="fellowshipAssociationLabel">Do you claim identity with any group or fellowship such as BBF, GARB, FBF, Other?</label> <label id="fellowshipAssociationLabel">Do you claim identity with any group or fellowship such as BBF, GARB, FBF, Other?</label>
<mat-form-field class="w-100" floatLabel="never"> <mat-form-field class="w-100" floatLabel="never">
<textarea matInput type="text" placeholder="Your Answer" formControlName="fellowshipAssocation" required></textarea> <textarea matInput type="text" placeholder="Your Answer" formControlName="fellowshipAssociation" required></textarea>
</mat-form-field> </mat-form-field>
<label id="collegeRecommendationsLabel">To a young person asking you to recommend a Christian College, list two or three Christian Colleges, in order of preference, which you would recommend?</label> <label id="collegeRecommendationsLabel">To a young person asking you to recommend a Christian College, list two or three Christian Colleges, in order of preference, which you would recommend?</label>
<label class="sub">Please list the name, city, and state for each</label> <label class="sub">Please list the name, city, and state for each</label>

View File

@ -120,6 +120,14 @@ export class MissionaryFormPageComponent implements OnInit {
} }
} }
hasErrors(formControlName: string): boolean {
let res = this.form.get(formControlName) && typeof this.form.get(formControlName).errors !== 'undefined';
if (res === true) {
res = this.form.get(formControlName).dirty || (this.form.get(formControlName).touched && this.form.get(formControlName).valid === false);
}
return res;
}
onSubmit(){ onSubmit(){
this.errorMessages = []; this.errorMessages = [];
if (this.errorMessages.length > 0){ return; } if (this.errorMessages.length > 0){ return; }

View File

@ -1,5 +1,6 @@
export const environment = { export const environment = {
production: true, production: true,
environment: 'prod',
baseUrl: "", baseUrl: "",
baseApi: "https://ofbbutte.com/2/api" baseApi: "https://ofbbutte.com/2/api"
}; };

View File

@ -0,0 +1,7 @@
export const environment = {
production: false,
environment: 'test',
baseUrl: "",
baseApi: "https://test.ofbbutte.com/2/api"
};

View File

@ -29,7 +29,13 @@ if [ "$BUILD_ANGULAR" = true ]; then
echo "Installing Client Node Modules" echo "Installing Client Node Modules"
../../bin/node ../../bin/npm install --silent --scripts-prepend-node-path ../../bin/node ../../bin/npm install --silent --scripts-prepend-node-path
echo "Building Angular Application" echo "Building Angular Application"
../../bin/node node_modules/@angular/cli/bin/ng build --prod if [ "$BRANCH" = master ]; then
../../bin/node node_modules/@angular/cli/bin/ng build --prod --configuration=production
fi
if [ "$BRANCH" = test ]; then
../../bin/node node_modules/@angular/cli/bin/ng build --prod --configuration=test
fi
cd ../../ cd ../../
rm -r -f www/ rm -r -f www/
mv tempcheckout/Server/www/ www/ mv tempcheckout/Server/www/ www/