Skip to content

Commit 0c5b7f8

Browse files
authored
Fix broken angular build (#57)
* Fix broken angular build * Fix calculator not calculating dependents * Update build-image.yml Signed-off-by: Brad Bodine <bbodine1@gmail.com> --------- Signed-off-by: Brad Bodine <bbodine1@gmail.com>
1 parent 7b660b2 commit 0c5b7f8

File tree

5 files changed

+106
-72
lines changed

5 files changed

+106
-72
lines changed

.github/workflows/build-image.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ jobs:
3535
run: |
3636
SHORT_SHA=$(echo $GITHUB_SHA | head -c7)
3737
REPO=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')
38-
TAG=${{ env.GIT_BRANCH_NAME }}-$(echo $GITHUB_SHA | head -c7)
38+
# Sanitize the branch name by replacing '/' with '-'
39+
CLEAN_BRANCH_NAME=$(echo "${{ env.GIT_BRANCH_NAME }}" | sed 's/\//-/g')
40+
TAG="${CLEAN_BRANCH_NAME}-${SHORT_SHA}"
3941
IMAGE=ideacrew/$REPO
4042
echo "tagged_image=${IMAGE}:${TAG}" >> $GITHUB_OUTPUT
4143
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT

clients/html/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
"build:prod:dc": "ng build --configuration=dc-production --prod --output-path=dist --base-href /get-a-quote/"
1616
},
1717
"private": true,
18+
"engine": {
19+
"node": ">=12.22.12 <13.0.0",
20+
"npm": ">=6.14.16 <7.0.0"
21+
},
1822
"dependencies": {
1923
"@agm/core": "^1.1.0",
2024
"@angular/animations": "^8.2.14",

clients/html/src/app/employer-details/employer-details.component.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as XLSX from 'xlsx';
77
import Swal from 'sweetalert2';
88

99
import { EmployerDetailsService } from './../services/employer-details.service';
10-
import zipcodes from '../../data/zipCode.json';
10+
import zipcodes from '../../data/zipCodeME.json';
1111
import sics from '../../data/sic.json';
1212
import sicCodes from '../../data/sicCodes.json';
1313
import { SelectedSicService } from '../services/selected-sic.service';
@@ -47,7 +47,7 @@ export class EmployerDetailsComponent implements OnInit {
4747
zipKeyword = 'zipCode';
4848
sics = sics;
4949
zipcodes = zipcodes;
50-
availableCounties = zipcodes;
50+
availableCounties = Array.isArray(zipcodes) ? zipcodes : [];
5151
defaultSelect: boolean;
5252
uploadData: any;
5353
employee: any;
@@ -78,7 +78,7 @@ export class EmployerDetailsComponent implements OnInit {
7878
relationOptions = [
7979
{ key: 'Spouse', value: 'Spouse' },
8080
{ key: 'Domestic Partner', value: 'Domestic Partner' },
81-
{ key: 'Child', value: 'Child' },
81+
{ key: 'Child', value: 'Child' }
8282
];
8383

8484
config = {
@@ -99,7 +99,6 @@ export class EmployerDetailsComponent implements OnInit {
9999
private dpConfig: NgbDatepickerConfig,
100100
private selectedSicService: SelectedSicService
101101
) {
102-
103102
this.setAlerts();
104103

105104
const sicValidator = this.isSicCodesEnabled ? Validators.required : null;
@@ -183,7 +182,6 @@ export class EmployerDetailsComponent implements OnInit {
183182

184183
localStorage.setItem('is_benefit_model_enabled', JSON.stringify(response['is_benefit_model_enabled']));
185184
localStorage.setItem('is_find_my_doctor_enabled', JSON.stringify(response['is_find_my_doctor_enabled']));
186-
187185
});
188186
this.effectiveDateOptions = dates;
189187
}
@@ -193,12 +191,15 @@ export class EmployerDetailsComponent implements OnInit {
193191
}
194192

195193
setAlerts() {
196-
this.alerts = [{
197-
type: 'warning',
198-
feature: "Late rates",
199-
enabled: true,
200-
message: "Due to a delay, premiums for some coverage effective dates are not available yet. Please check again soon to see if this information has been updated. You can also contact Customer Service or your broker if you need help."
201-
}];
194+
this.alerts = [
195+
{
196+
type: 'warning',
197+
feature: 'Late rates',
198+
enabled: true,
199+
message:
200+
'Due to a delay, premiums for some coverage effective dates are not available yet. Please check again soon to see if this information has been updated. You can also contact Customer Service or your broker if you need help.'
201+
}
202+
];
202203
}
203204

204205
getZipCodes() {

clients/html/src/app/plan-filter/plan-filter.component.ts

Lines changed: 58 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ export class PlanFilterComponent implements OnInit {
8888
filteredPlansByMetalLevel: any;
8989
filteredPlansByProductTypes: any;
9090
public availableProducts: any;
91-
get sortFilter() { return this.sortDirection ? 'asc' : 'desc'; }
91+
get sortFilter() {
92+
return this.sortDirection ? 'asc' : 'desc';
93+
}
9294

9395
public planOptions = [
9496
{ key: 'single_issuer', value: 'One Carrier', view: 'health' },
@@ -144,8 +146,8 @@ export class PlanFilterComponent implements OnInit {
144146

145147
employee.dependents.forEach(function(dependent) {
146148
employeeJson.roster_dependents.push({
147-
dob: new Date(dependent.dob),
148-
relationship: dependent.relationship
149+
dob: new Date(dependent.dependentDob),
150+
relationship: dependent.dependentRelationship
149151
});
150152
});
151153

@@ -259,7 +261,12 @@ export class PlanFilterComponent implements OnInit {
259261

260262
private calculator(date, contributionModel, isTiredCalculator?: boolean): QuoteCalculator {
261263
if (isTiredCalculator) {
262-
const calc = new this.clientPreferences.tiered_quote_calculator(date, contributionModel, this.sponsorRoster, this.planType);
264+
const calc = new this.clientPreferences.tiered_quote_calculator(
265+
date,
266+
contributionModel,
267+
this.sponsorRoster,
268+
this.planType
269+
);
263270

264271
return calc;
265272
} else {
@@ -278,7 +285,7 @@ export class PlanFilterComponent implements OnInit {
278285
switch (type) {
279286
case 'metalLevel':
280287
if (event.target.checked) {
281-
this.selectedMetalLevels.push({key: 'metal_level', value: value});
288+
this.selectedMetalLevels.push({ key: 'metal_level', value: value });
282289
this.filterKeysSelected.push(type);
283290
} else {
284291
this.selectedMetalLevels = this.selectedMetalLevels.filter((ml) => ml.value != value);
@@ -288,7 +295,7 @@ export class PlanFilterComponent implements OnInit {
288295
break;
289296
case 'productType':
290297
if (event.target.checked) {
291-
this.selectedProductTypes.push({key: 'product_type', value: value});
298+
this.selectedProductTypes.push({ key: 'product_type', value: value });
292299
this.filterKeysSelected.push(type);
293300
} else {
294301
this.selectedProductTypes = this.selectedProductTypes.filter((ml) => ml.value != value);
@@ -298,7 +305,7 @@ export class PlanFilterComponent implements OnInit {
298305
break;
299306
case 'insuranceCompany':
300307
if (event.target.checked) {
301-
this.selectedInsuranceCompanies.push({key: 'provider_name', value: value});
308+
this.selectedInsuranceCompanies.push({ key: 'provider_name', value: value });
302309
this.filterKeysSelected.push(type);
303310
} else {
304311
this.selectedInsuranceCompanies = this.selectedInsuranceCompanies.filter((ml) => ml.value != value);
@@ -308,7 +315,7 @@ export class PlanFilterComponent implements OnInit {
308315
break;
309316
case 'hsa':
310317
if (event.target.checked) {
311-
this.selectedHSAs.push({key: 'hsa_eligible', value: value});
318+
this.selectedHSAs.push({ key: 'hsa_eligible', value: value });
312319
this.filterKeysSelected.push(type);
313320
} else {
314321
this.selectedHSAs = this.selectedHSAs.filter((ml) => ml.value != value);
@@ -321,8 +328,7 @@ export class PlanFilterComponent implements OnInit {
321328
}
322329

323330
combineArray(arr) {
324-
return [].concat.apply([], arr)
325-
.reduce((unique, item) => (unique.includes(item) ? unique : [...unique, item]), []);
331+
return [].concat.apply([], arr).reduce((unique, item) => (unique.includes(item) ? unique : [...unique, item]), []);
326332
}
327333

328334
filterCarriers() {
@@ -335,71 +341,75 @@ export class PlanFilterComponent implements OnInit {
335341
let filtered;
336342

337343
if (this.selectedMetalLevels.length > 0) {
338-
this.selectedMetalLevels.map(ml => {
339-
mlArray.push(plans.filter(plan => plan['product_information'][ml.key] === ml.value));
344+
this.selectedMetalLevels.map((ml) => {
345+
mlArray.push(plans.filter((plan) => plan['product_information'][ml.key] === ml.value));
340346
selected = this.combineArray(mlArray);
341347
});
342348
}
343349

344350
if (this.selectedProductTypes.length > 0) {
345-
this.selectedProductTypes.map(pt => {
346-
ptArray.push(plans.filter(plan => plan['product_information'][pt.key] === pt.value));
351+
this.selectedProductTypes.map((pt) => {
352+
ptArray.push(plans.filter((plan) => plan['product_information'][pt.key] === pt.value));
347353
selected = this.combineArray(ptArray);
348354
});
349355
}
350356

351357
if (this.selectedInsuranceCompanies.length > 0) {
352-
this.selectedInsuranceCompanies.map(ic => {
353-
icArray.push(plans.filter(plan => plan['product_information'][ic.key] === ic.value));
358+
this.selectedInsuranceCompanies.map((ic) => {
359+
icArray.push(plans.filter((plan) => plan['product_information'][ic.key] === ic.value));
354360
selected = this.combineArray(icArray);
355361
});
356362
}
357363

358364
if (this.selectedHSAs.length > 0) {
359-
this.selectedHSAs.map(hsa => {
360-
hsaArray.push(plans.filter(plan => plan['product_information'][hsa.key] === hsa.value));
365+
this.selectedHSAs.map((hsa) => {
366+
hsaArray.push(plans.filter((plan) => plan['product_information'][hsa.key] === hsa.value));
361367
selected = this.combineArray(hsaArray);
362368
});
363369
}
364370

365371
if (this.selectedInsuranceCompanies.length > 0 && this.selectedProductTypes.length > 0) {
366372
selected = this.selectedProductTypes.reduce((currentValue, pt) => {
367-
filtered = this.combineArray(icArray).filter(plan => plan['product_information'][pt.key] === pt.value);
373+
filtered = this.combineArray(icArray).filter((plan) => plan['product_information'][pt.key] === pt.value);
368374
return [...currentValue, ...filtered];
369375
}, []);
370376
}
371377

372378
if (this.selectedInsuranceCompanies.length > 0 && this.selectedHSAs.length > 0) {
373379
selected = this.selectedHSAs.reduce((currentValue, hsa) => {
374-
filtered = this.combineArray(icArray).filter(plan => plan['product_information'][hsa.key] === hsa.value);
380+
filtered = this.combineArray(icArray).filter((plan) => plan['product_information'][hsa.key] === hsa.value);
375381
return [...currentValue, ...filtered];
376382
}, []);
377383
}
378384

379385
if (this.selectedMetalLevels.length > 0 && this.selectedInsuranceCompanies.length > 0) {
380386
selected = this.selectedInsuranceCompanies.reduce((currentValue, ic) => {
381-
filtered = this.combineArray(mlArray).filter(plan => plan['product_information'][ic.key] === ic.value);
387+
filtered = this.combineArray(mlArray).filter((plan) => plan['product_information'][ic.key] === ic.value);
382388
return [...currentValue, ...filtered];
383389
}, []);
384390
}
385391

386392
if (this.selectedMetalLevels.length > 0 && this.selectedProductTypes.length > 0) {
387393
selected = this.selectedProductTypes.reduce((currentValue, pt) => {
388-
filtered = this.combineArray(mlArray).filter(plan => plan['product_information'][pt.key] === pt.value);
394+
filtered = this.combineArray(mlArray).filter((plan) => plan['product_information'][pt.key] === pt.value);
389395
return [...currentValue, ...filtered];
390396
}, []);
391397
}
392398

393399
if (this.selectedMetalLevels.length > 0 && this.selectedHSAs.length > 0) {
394400
selected = this.selectedHSAs.reduce((currentValue, hsa) => {
395-
filtered = this.combineArray(mlArray).filter(plan => plan['product_information'][hsa.key] === hsa.value);
401+
filtered = this.combineArray(mlArray).filter((plan) => plan['product_information'][hsa.key] === hsa.value);
396402
return [...currentValue, ...filtered];
397403
}, []);
398404
}
399405

400-
if (this.selectedMetalLevels.length > 0 && this.selectedProductTypes.length > 0 && this.selectedInsuranceCompanies.length > 0) {
406+
if (
407+
this.selectedMetalLevels.length > 0 &&
408+
this.selectedProductTypes.length > 0 &&
409+
this.selectedInsuranceCompanies.length > 0
410+
) {
401411
selected = this.selectedInsuranceCompanies.reduce((currentValue, ic) => {
402-
filtered = selected.filter(plan => plan['product_information'][ic.key] === ic.value);
412+
filtered = selected.filter((plan) => plan['product_information'][ic.key] === ic.value);
403413
return [...currentValue, ...filtered];
404414
}, []);
405415
}
@@ -409,33 +419,43 @@ export class PlanFilterComponent implements OnInit {
409419
}
410420

411421
if (this.yearlyMedicalDeductibleFrom && !this.yearlyMedicalDeductibleTo) {
412-
selected = selected.filter(plan => parseInt(plan['product_information']['deductible']
413-
.replace('$', '').replace(',', ''), 0) >= this.yearlyMedicalDeductibleFrom);
422+
selected = selected.filter(
423+
(plan) =>
424+
parseInt(plan['product_information']['deductible'].replace('$', '').replace(',', ''), 0) >=
425+
this.yearlyMedicalDeductibleFrom
426+
);
414427
}
415428

416429
if (!this.yearlyMedicalDeductibleFrom && this.yearlyMedicalDeductibleTo) {
417-
selected = selected.filter(plan => parseInt(plan['product_information']['deductible']
418-
.replace('$', '').replace(',', ''), 0) <= this.yearlyMedicalDeductibleTo);
430+
selected = selected.filter(
431+
(plan) =>
432+
parseInt(plan['product_information']['deductible'].replace('$', '').replace(',', ''), 0) <=
433+
this.yearlyMedicalDeductibleTo
434+
);
419435
}
420436

421437
if (this.yearlyMedicalDeductibleFrom && this.yearlyMedicalDeductibleTo) {
422-
selected = selected.filter(plan => parseInt(plan['product_information']['deductible']
423-
.replace('$', '').replace(',', ''), 0) >= this.yearlyMedicalDeductibleFrom && parseInt(plan['product_information']['deductible']
424-
.replace('$', '').replace(',', ''), 0) <= this.yearlyMedicalDeductibleTo);
438+
selected = selected.filter(
439+
(plan) =>
440+
parseInt(plan['product_information']['deductible'].replace('$', '').replace(',', ''), 0) >=
441+
this.yearlyMedicalDeductibleFrom &&
442+
parseInt(plan['product_information']['deductible'].replace('$', '').replace(',', ''), 0) <=
443+
this.yearlyMedicalDeductibleTo
444+
);
425445
}
426446

427447
if (this.planPremiumsFrom && !this.planPremiumsTo) {
428-
selected = selected.filter(plan => plan['total_cost'] >= this.planPremiumsFrom);
448+
selected = selected.filter((plan) => plan['total_cost'] >= this.planPremiumsFrom);
429449
}
430450

431451
if (!this.planPremiumsFrom && this.planPremiumsTo) {
432-
selected = selected.filter(plan => plan['total_cost'] <= this.planPremiumsTo);
452+
selected = selected.filter((plan) => plan['total_cost'] <= this.planPremiumsTo);
433453
}
434454

435455
if (this.planPremiumsFrom && this.planPremiumsTo) {
436-
selected = selected.filter(plan => plan['total_cost']
437-
>= this.planPremiumsFrom && plan['total_cost']
438-
<= this.planPremiumsTo);
456+
selected = selected.filter(
457+
(plan) => plan['total_cost'] >= this.planPremiumsFrom && plan['total_cost'] <= this.planPremiumsTo
458+
);
439459
}
440460

441461
this.filterCarriersResults = selected;
@@ -549,7 +569,7 @@ export class PlanFilterComponent implements OnInit {
549569
}
550570

551571
validateNumber(event) {
552-
const charCode = (event.which) ? event.which : event.keyCode;
572+
const charCode = event.which ? event.which : event.keyCode;
553573
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
554574
return false;
555575
}

0 commit comments

Comments
 (0)