From c68c996743740c23e760e744e7e10d65f357a86a Mon Sep 17 00:00:00 2001 From: Drew Fugate Date: Thu, 21 Mar 2024 10:06:55 -0500 Subject: [PATCH] feat: improvements to UI Changed format of UI elements, added scrolling for available times --- backend/service/meeting/meeting_service.go | 2 +- frontend/public/index.html | 18 ++- frontend/src/App.vue | 41 ++++-- frontend/src/components/CalendarView.vue | 15 ++- frontend/src/components/ScheduleMeeting.vue | 132 +++++++++++--------- frontend/src/main.js | 3 + 6 files changed, 131 insertions(+), 80 deletions(-) diff --git a/backend/service/meeting/meeting_service.go b/backend/service/meeting/meeting_service.go index e6b79a9..e9b610a 100644 --- a/backend/service/meeting/meeting_service.go +++ b/backend/service/meeting/meeting_service.go @@ -41,7 +41,7 @@ func (s *MeetingService) GetMeetingsByDate(date string) ([]model.Meetings, error } func (s *MeetingService) GetAvailableTimeBlocks(meeting model.Meetings, date time.Time) ([]model.TimePreference, error) { - if date.Day() <= time.Now().Day() { + if date.Before(time.Now()) { return []model.TimePreference{}, fmt.Errorf("cannot schedule a meeting less than one day in advance") } diff --git a/frontend/public/index.html b/frontend/public/index.html index 3e5a139..1539f2c 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -1,15 +1,23 @@ - - - - + + + + <%= htmlWebpackPlugin.options.title %> +
diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 5008bfc..5c9591a 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,12 +1,23 @@ @@ -52,7 +63,21 @@ export default { this.availableTimeSlots = []; } }, - handleScheduleConfirmed() { + async handleScheduleMeeting( + selectedTimeSlot, + candidateName, + candidateEmail + ) { + try { + await axios.post(`/api/meeting/schedule`, { + meeting_id: this.meeting.id, + time_slot: selectedTimeSlot, + candidate_name: candidateName, + candidate_email: candidateEmail, + }); + } catch (error) { + console.error("Error scheduling meeting:", error); + } alert("Meeting scheduled!"); }, }, diff --git a/frontend/src/components/CalendarView.vue b/frontend/src/components/CalendarView.vue index 57a85f2..cfd848c 100644 --- a/frontend/src/components/CalendarView.vue +++ b/frontend/src/components/CalendarView.vue @@ -1,10 +1,13 @@ - - diff --git a/frontend/src/main.js b/frontend/src/main.js index 5e183d1..7290603 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -7,6 +7,9 @@ import * as components from "vuetify/components"; import * as directives from "vuetify/directives"; const vuetify = createVuetify({ + theme: { + defaultTheme: "dark", + }, components, directives, });