Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ann-aot committed Feb 23, 2021
1 parent dace5e8 commit c9543fb
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 37 deletions.
29 changes: 3 additions & 26 deletions api/app/resources/bookings/appointment/appointment_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,33 +142,10 @@ def post(self):
ches_token = generate_ches_token()
except Exception as exc:
pprint(f'Error on token generation - {exc}')

is_stat = (json_data.get('stat_flag', False))

#below feature inside if is no longer needed - new reqmt -> Stop blackouts from cancelling items (offices will call and cancel people individually if we have to close)
# once tested remove below if statement and adjust Indentation of code inside else statement.
if is_blackout_appt:
# If staff user is creating a blackout event then send email to all of the citizens with appointments for that period
# appointment_ids_to_delete = []
# appointments_for_the_day = Appointment.get_appointment_conflicts(office_id, json_data.get('start_time'),
# json_data.get('end_time'))
# for (cancelled_appointment, office, timezone, user) in appointments_for_the_day:
# if cancelled_appointment.appointment_id != appointment.appointment_id and not cancelled_appointment.checked_in_time:
# appointment_ids_to_delete.append(cancelled_appointment.appointment_id)

# # Send blackout email
# try:
# pprint('Sending email for appointment cancellation due to blackout')
# send_email(ches_token,
# *get_blackout_email_contents(appointment, cancelled_appointment, office, timezone,
# user))
# except Exception as exc:
# pprint(f'Error on email sending - {exc}')

# # Delete appointments
# if len(appointment_ids_to_delete) > 0:
# Appointment.delete_appointments(appointment_ids_to_delete)
pass

else:
if ((not is_stat) and (not is_blackout_appt)):
# Send confirmation email and sms
try:
ches_token = generate_ches_token()
Expand Down
12 changes: 11 additions & 1 deletion frontend/src/components/Appointments/appointments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<!-- </v-card> -->
</div>
</div>
<ApptBookingModal :clickedTime="clickedTime" :clickedAppt="clickedAppt" />
<ApptBookingModal v-if="!is_stat" :clickedTime="clickedTime" :clickedAppt="clickedAppt" />
<AppointmentBlackoutModal />
<CheckInModal :clickedAppt="clickedAppt" />
<LoadingModal v-if="show_loading" />
Expand Down Expand Up @@ -180,6 +180,8 @@ export default class Appointments extends Vue {
value: any = ''
// events: any = []
currentDay: any = moment().format('YYYY-MM-DD')// new Date()
is_stat: boolean = false
get events () {
if (this.searchTerm) {
Expand Down Expand Up @@ -343,6 +345,14 @@ export default class Appointments extends Vue {
}
selectEvent (event) {
this.is_stat = false
this.getAppointments().then((each) => {
const bb = each.find(element => ((moment(event.date).format('YYYY-MM-DD') === moment(element.start_time).format('YYYY-MM-DD')) && (element.stat_flag)));
console.log(bb)
if (bb) {
this.is_stat = true
}
})
this.checkRescheduleCancel()
this.blockEventSelect = true
// this.unselect()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@
</DatePicker>
</b-col>
<b-col cols="6">
<b-form-input v-model="input.note" placeholder="Note"/>
<b-form-input maxlength="255" v-model="input.note" placeholder="Note"/>
</b-col>
</b-form-row>
<b-form-row>
Expand Down Expand Up @@ -1332,7 +1332,7 @@ export default class AppointmentBlackoutModal extends Vue {
// stat for rooms
if (self.only_appointments.length === 0) {
const office_room = await getOfficeRooms({'office_id': self.$store.state.user.office.office_id})
office_room.forEach(function (room) {
await office_room.forEach(function (room) {
const blackout_booking: any = {}
if (room.id == '_offsite') {
blackout_booking.start_time = moment.tz(date+' '+start, self.$store.state.user.office.timezone.timezone_name).format('YYYY-MM-DD HH:mm:ssZ')
Expand Down Expand Up @@ -1365,7 +1365,7 @@ export default class AppointmentBlackoutModal extends Vue {
}
else if (self.only_this_office.length == 0) {
// stat for appointments
all_offices.forEach(async function(office) {
await all_offices.forEach(async function(office) {
const e: any = {
start_time: moment.tz(date+' '+start, office.timezone.timezone_name).format('YYYY-MM-DD HH:mm:ssZ'),
end_time: moment.tz(date+' '+end, office.timezone.timezone_name).format('YYYY-MM-DD HH:mm:ssZ'),
Expand All @@ -1380,7 +1380,7 @@ export default class AppointmentBlackoutModal extends Vue {
// stat for rooms
const office_room = await getOfficeRooms({'office_id': office.office_id})
office_room.forEach(function (room) {
await office_room.forEach(function (room) {
const blackout_booking: any = {}
if (room.id == '_offsite') {
blackout_booking.start_time = moment.tz(date+' '+start, office.timezone.timezone_name).format('YYYY-MM-DD HH:mm:ssZ')
Expand Down Expand Up @@ -1442,6 +1442,13 @@ export default class AppointmentBlackoutModal extends Vue {
this.hideCollapse('collapse-information-audit')
this.show_stat_next = false
this.stat_submit = false
this.stat_dates = [{note:""}]
this.show_next = true
this.only_this_office = []
this.only_appointments = []
}
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class="disabled btn-primary ml-2"
v-if="(submitDisabled) && (!submitStat)"
@click="validate = true"
>Submit1</b-button
>Submit</b-button
>
<b-button
class="btn-primary ml-2"
Expand Down Expand Up @@ -52,9 +52,8 @@
<span
v-if="!this.editDeleteSeries && !online_flag"
style="font-size: 1.75rem"
>Book Service Appointment</span
><br />

>Book Service Appointment</span>
<br />
<b-form autocomplete="off" v-if="!stat_flag">
<!-- Citizen Name and Contact Info row -->
<b-form-row>
Expand Down Expand Up @@ -233,7 +232,7 @@
<b-col >
<b-form-group class="mb-0 mt-2">
<label class="mb-0">Note</label><br />
<b-form-input v-if="is_Support" v-model="comments" />
<b-form-input v-if="is_Support" v-model="comments" maxlength="255"/>
<b-form-input v-else :value="comments" disabled/>
</b-form-group>
</b-col>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Booking/booking-blackout-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
</DatePicker>
</b-col>
<b-col cols="6">
<b-form-input v-model="input.note" placeholder="Note"/>
<b-form-input maxlength="255" v-model="input.note" placeholder="Note"/>
</b-col>
</b-form-row>
<b-form-row>
Expand Down

0 comments on commit c9543fb

Please sign in to comment.