Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhanc: keep calendar always open #6322

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 73 additions & 43 deletions src/views/Appointments/Booking.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,40 @@
:display-name="userInfo.displayName"
:disable-tooltip="true"
:disable-menu="true"
:size="180" />
:size="44" />
<div class="booking__display-name">
<strong>{{ userInfo.displayName }}</strong>
</div>
<h2 class="booking__name">
<h5 class="booking__name">
{{ config.name }}
</h2>
</h5>
<!-- 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 +82,7 @@
NcDateTimePicker as DateTimePicker,
NcTimezonePicker as TimezonePicker,
NcGuestContent,
NcEmptyContent,
} from '@nextcloud/vue'
import jstz from 'jstz'
import MDILoading from 'vue-material-design-icons/Loading.vue'
Expand Down Expand Up @@ -110,6 +115,7 @@
AppointmentBookingConfirmation,
NcGuestContent,
Loading,
NcEmptyContent,

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

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L118

Added line #L118 was not covered by tests
},
props: {
config: {
Expand Down Expand Up @@ -246,45 +252,69 @@
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%;
flex-grow: 1;
}

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

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

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

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L272

Added line #L272 was not covered by tests
}

.booking__description {
white-space: break-spaces;
}

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

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L277

Added line #L277 was not covered by tests

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

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

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

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L286-L287

Added lines #L286 - L287 were not covered by tests

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

&__config-user-info {
flex-grow: 1;
padding-right: 120px;
}
.booking__slot-selection .material-design-icon.loading-icon.animation-rotate {
animation: rotate var(--animation-duration, 0.8s) linear infinite;
}

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

&__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;
}

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

View check run for this annotation

Codecov / codecov/patch

src/views/Appointments/Booking.vue#L306

Added line #L306 was not covered by tests

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

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

</style>
Loading