+
\ No newline at end of file
diff --git a/src/app/pass-management/pass-search/pass-search.component.spec.ts b/src/app/pass-management/pass-search/pass-search.component.spec.ts
index 97999e1f..6f2159d8 100644
--- a/src/app/pass-management/pass-search/pass-search.component.spec.ts
+++ b/src/app/pass-management/pass-search/pass-search.component.spec.ts
@@ -38,18 +38,4 @@ describe('PassSearchComponent', () => {
expect(component).toBeTruthy();
});
- it('gets opening hour text', async () => {
- component.facility = mockFacility;
- expect(component.bookingOpeningHourText).toEqual('7 AM');
- component.facility = null;
- expect(component.bookingOpeningHourText).toEqual('8 AM');
- });
-
- it('gets booking days ahead text', async () => {
- component.facility = mockFacility;
- expect(component.bookingDaysAheadText).toEqual('2 days');
- component.facility = null;
- expect(component.bookingDaysAheadText).toEqual('Same Day');
-
- });
});
diff --git a/src/app/pass-management/pass-search/pass-search.component.ts b/src/app/pass-management/pass-search/pass-search.component.ts
index fb9b07b8..2577e1eb 100644
--- a/src/app/pass-management/pass-search/pass-search.component.ts
+++ b/src/app/pass-management/pass-search/pass-search.component.ts
@@ -3,6 +3,7 @@ import { Subscription } from 'rxjs';
import { ConfigService } from 'src/app/services/config.service';
import { DataService } from 'src/app/services/data.service';
import { FacilityService } from 'src/app/services/facility.service';
+import { ParkService } from 'src/app/services/park.service';
import { Constants } from 'src/app/shared/utils/constants';
import { Utils } from 'src/app/shared/utils/utils';
@@ -13,61 +14,32 @@ import { Utils } from 'src/app/shared/utils/utils';
})
export class PassSearchComponent {
private subscriptions = new Subscription();
- public facility;
public Utils = new Utils();
+ public currentFacility;
+ public currentPark;
+ public currentDate;
+ public currentPassType;
constructor(
protected dataService: DataService,
protected configService: ConfigService,
- protected facilityService: FacilityService
+ protected facilityService: FacilityService,
+ protected parkService: ParkService
) {
this.subscriptions.add(
dataService
- .watchItem(Constants.dataIds.CURRENT_FACILITY_KEY)
+ .watchItem(Constants.dataIds.PASS_SEARCH_PARAMS)
.subscribe((res) => {
if (res) {
- this.facility = this.facilityService.getCachedFacility(res);
+ this.currentFacility = res.facilityName;
+ this.currentPark = this.parkService.getCachedPark({pk: 'park', sk: res.park})?.name;
+ this.currentDate = res.date;
+ this.currentPassType = res.passType;
}
})
);
}
- get bookingOpeningHourText() {
- const facilityBookingOpeningHour = this.facility
- ? this.facility.bookingOpeningHour
- : null;
- const advanceBookingHour =
- facilityBookingOpeningHour ||
- parseInt(this.configService.config['ADVANCE_BOOKING_HOUR'], 10);
- const { hour, amPm } = this.Utils.convert24hTo12hTime(advanceBookingHour);
-
- if (hour && amPm) {
- return `${hour} ${amPm}`;
- }
- return '';
- }
-
- get bookingDaysAheadText() {
- let advanceBookingDays = this.facility
- ? this.facility.bookingDaysAhead
- : null;
- if (advanceBookingDays !== 0 && !advanceBookingDays) {
- advanceBookingDays = parseInt(
- this.configService.config['ADVANCE_BOOKING_LIMIT'],
- 10
- );
- }
-
- if (advanceBookingDays === 0) {
- return 'Same Day';
- }
- if (advanceBookingDays === 1) {
- return '1 day';
- }
-
- return `${advanceBookingDays} days`;
- }
-
ngOnDestroy(): void {
this.subscriptions.unsubscribe();
}
diff --git a/src/app/pass-management/pass-search/passes-capacity-bar/passes-capacity-bar.component.html b/src/app/pass-management/pass-search/passes-capacity-bar/passes-capacity-bar.component.html
index f8ca0a18..315333b1 100644
--- a/src/app/pass-management/pass-search/passes-capacity-bar/passes-capacity-bar.component.html
+++ b/src/app/pass-management/pass-search/passes-capacity-bar/passes-capacity-bar.component.html
@@ -20,15 +20,17 @@
{{ data.overbooked }} passes overbooked