Skip to content

Commit

Permalink
enhanc: keep calendar always open
Browse files Browse the repository at this point in the history
Signed-off-by: greta <[email protected]>
  • Loading branch information
GretaD committed Nov 28, 2024
1 parent 074516b commit 454e65d
Showing 1 changed file with 74 additions and 43 deletions.
117 changes: 74 additions & 43 deletions src/views/Appointments/Booking.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,40 @@
:display-name="userInfo.displayName"
:disable-tooltip="true"
:disable-menu="true"
:size="180" />
:size="44" />

Check warning on line 14 in src/views/Appointments/Booking.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L14

Added line #L14 was not covered by tests
<div class="booking__display-name">
<strong>{{ userInfo.displayName }}</strong>
</div>
<h2 class="booking__name">
<h5 class="booking__name">
{{ config.name }}
</h2>
</h5>

Check warning on line 20 in src/views/Appointments/Booking.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L20

Added line #L20 was not covered by tests
<!-- Description needs to stay inline due to its whitespace -->
<span class="booking__description">{{ config.description }}</span>
</div>
<div class="booking__date-selection">
<h3>{{ $t('calendar', 'Select date') }}</h3>
<h5 class="booking__date-header">
{{ $t('calendar', 'Select a date') }}
</h5>
<div class="booking__date">
<DateTimePicker v-model="selectedDate"
:disabled-date="disabledDate"
type="date"
:open="true"
@change="fetchSlots" />
</div>
<div class="booking__time-zone">
<TimezonePicker v-model="timeZone" @change="fetchSlots" />
<TimezonePicker v-model="timeZone"
:aria-label="$t('calendar', 'Select a date')"
@change="fetchSlots" />
</div>
</div>
<div class="booking__slot-selection">
<h3>{{ $t('calendar', 'Select slot') }}</h3>

<h5>{{ $t('calendar', 'Select slot') }}</h5>
<div class="booking__slots">
<Loading v-if="loadingSlots" :size="24" />
<div v-else-if="slots.length === 0 && !loadingSlots">
{{ $t('calendar', 'No slots available') }}
</div>
<Loading v-if="loadingSlots" class="loading" :size="24" />
<NcEmptyContent v-else-if="slots.length === 0 && !loadingSlots"
:title="$t('calendar', 'No slots available')"
:description="$t('calendar', 'No slots available')" />
<template v-else>
<AppointmentSlot v-for="slot in slots"
:key="slot.start"
Expand Down Expand Up @@ -78,6 +83,7 @@ import {
NcDateTimePicker as DateTimePicker,
NcTimezonePicker as TimezonePicker,
NcGuestContent,
NcEmptyContent,

Check warning on line 86 in src/views/Appointments/Booking.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L86

Added line #L86 was not covered by tests
} from '@nextcloud/vue'
import jstz from 'jstz'
import MDILoading from 'vue-material-design-icons/Loading.vue'
Expand Down Expand Up @@ -110,6 +116,7 @@ export default {
AppointmentBookingConfirmation,
NcGuestContent,
Loading,
NcEmptyContent,
},
props: {
config: {
Expand Down Expand Up @@ -246,45 +253,69 @@ export default {
display: flex;
flex-direction: row;
flex-wrap: wrap;
max-width: 800px;
width: 900px;
min-height: 500px;
margin-bottom: 50px;
justify-content: space-between;
}

.booking > div {
flex-basis: 33.33%;

Check warning on line 263 in src/views/Appointments/Booking.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L263

Added line #L263 was not covered by tests
flex-grow: 1;
}

.booking__config-user-info {
flex-grow: 1;

Check warning on line 268 in src/views/Appointments/Booking.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L268

Added line #L268 was not covered by tests
}

.booking__date-selection {
display: flex;
flex-direction: column;
}

Check warning on line 275 in src/views/Appointments/Booking.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L274-L275

Added lines #L274 - L275 were not covered by tests
.booking__description {
white-space: break-spaces;
}

&__date-selection {
display: flex;
flex-direction: column;
}
.booking__date-selection,
.booking__slot-selection {
padding: 0 10px;
}

Check warning on line 283 in src/views/Appointments/Booking.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L283

Added line #L283 was not covered by tests

&__description {
white-space: break-spaces;
}
.booking__time-zone {
margin-top: 280px;
position: relative;
}

&__config-user-info,
&__date-selection,
&__slot-selection {
padding: 10px;
flex-grow: 1;
}
.booking__date-header {
position: relative;
margin-left: 16px;
}

&__config-user-info {
flex-grow: 1;
padding-right: 120px;
}
.booking__slot-selection .material-design-icon.loading-icon.animation-rotate {

Check warning on line 295 in src/views/Appointments/Booking.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L295

Added line #L295 was not covered by tests
animation: rotate var(--animation-duration, 0.8s) linear infinite;
}

&__date-selection,
&__slot-selection {
flex-grow: 2;
}
.booking__slots {
display: flex;
flex-direction: column;
max-height: 440px;
overflow-y: auto;
}

&__time-zone {
max-width: 250px;
}
:deep(.mx-input-wrapper) {
display: none;
}

&__slot-selection .material-design-icon.loading-icon.animation-rotate {
animation: rotate var(--animation-duration, 0.8s) linear infinite;
}
:deep(.mx-datepicker-main) {

Check warning on line 310 in src/views/Appointments/Booking.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L310

Added line #L310 was not covered by tests
border: 0;
}

Check warning on line 312 in src/views/Appointments/Booking.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L312

Added line #L312 was not covered by tests

&__slots {
display: flex;
flex-direction: column;
}
h2, h3, h4, h5 {
margin-top: 0;
}
.booking__date {

Check warning on line 317 in src/views/Appointments/Booking.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L317

Added line #L317 was not covered by tests
margin-top: -25px;
}

Check warning on line 320 in src/views/Appointments/Booking.vue

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L319-L320

Added lines #L319 - L320 were not covered by tests
</style>

0 comments on commit 454e65d

Please sign in to comment.