This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#2): improve deferred loading ux
- Loading branch information
1 parent
4669ded
commit bd0a194
Showing
5 changed files
with
87 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/app/pages/advertise/admin-appointments/admin-appointments.page.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@import "../../../../theme/spinner"; | ||
|
||
[ion-fixed] { | ||
height: 100%; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/app/services/core/appointment/admin-appoinments-service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import {Injectable} from '@angular/core'; | ||
|
||
// Model | ||
import {Appointment} from '../../model/appointment/appointment'; | ||
import {PickAppointmentExistingDates} from '../../model/utils/pickAppointments'; | ||
import {Item} from '../../model/item/item'; | ||
|
||
// Services | ||
import {AppointmentService} from './appointment-service'; | ||
|
||
|
||
export interface AdminScheduledDates { | ||
selectedAppointmentsStartTime: number[]; | ||
selectedDates: number[]; | ||
unavailableAppointmentDates: number[]; | ||
} | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class AdminAppointmentsService { | ||
|
||
constructor(private appointmentService: AppointmentService) { | ||
|
||
} | ||
|
||
init(item: Item, appointment: Appointment): Promise<AdminScheduledDates> { | ||
return new Promise<AdminScheduledDates>((resolve) => { | ||
this.appointmentService.buildExistingDates(item, appointment).then((result: PickAppointmentExistingDates) => { | ||
resolve({ | ||
selectedAppointmentsStartTime: result.scheduledDates != null ? result.scheduledDates : new Array(), | ||
selectedDates: result.scheduledDates != null ? result.scheduledDates : new Array(), | ||
unavailableAppointmentDates: result.unavailableAppointmentDates | ||
}); | ||
}); | ||
}); | ||
} | ||
} |