Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AURA
dashboard
Commits
d2fbfa9f
Commit
d2fbfa9f
authored
Aug 08, 2019
by
jackie / Andrea Ida Malkah Klaura
Browse files
FIX: refetch timeslots when calendar view changes
parent
2e9d2285
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/components/ShowManagerModalSchedules.vue
View file @
d2fbfa9f
...
...
@@ -18,6 +18,7 @@
default-view=
"agendaWeek"
:events=
"calendarSlots"
:config=
"calendarConfig"
@
view-render=
"renderView"
/>
</b-modal>
</div>
...
...
@@ -40,7 +41,7 @@ export default {
calendarSlots
:
[],
// this is the whole configuration for our schedule calendar, including
//
re
nder
ing functions and all
//
simple event ha
nd
l
er
s that do not need the whole components scope
calendarConfig
:
{
height
:
600
,
firstDay
:
1
,
...
...
@@ -99,23 +100,34 @@ export default {
}
},
// this is called when the user changes the calendar view, so we just
// refetch the timeslots with the updated visible date range
renderView
(
view
)
{
this
.
$log
.
debug
(
view
.
start
.
format
()
+
'
'
+
view
.
end
.
format
())
if
(
this
.
loaded
.
shows
)
{
this
.
$log
.
debug
(
'
refetching
'
)
this
.
loadTimeslots
(
view
.
start
.
format
(),
view
.
end
.
format
())
}
},
loadTimeslots
(
start
,
end
)
{
this
.
loaded
.
timeslots
=
false
this
.
calendarSlots
=
[]
let
uri
=
process
.
env
.
VUE_APP_API_STEERING
+
'
timeslots?start=
'
+
start
+
'
&end=
'
+
end
axios
.
get
(
uri
,
{
withCredentials
:
true
,
headers
:
{
'
Authorization
'
:
'
Bearer
'
+
this
.
$parent
.
$parent
.
user
.
access_token
}
}).
then
(
response
=>
{
let
slots
=
response
.
data
for
(
let
i
in
slots
)
{
this
.
time
slots
=
response
.
data
for
(
let
i
in
this
.
time
slots
)
{
let
highlighting
=
'
otherShow
'
if
(
slots
[
i
].
show
===
this
.
show
.
id
)
{
if
(
this
.
time
slots
[
i
].
show
===
this
.
show
.
id
)
{
highlighting
=
'
currentShow
'
}
this
.
calendarSlots
.
push
({
start
:
slots
[
i
].
start
,
end
:
slots
[
i
].
end
,
title
:
this
.
getShowTitleById
(
slots
[
i
].
show
),
start
:
this
.
time
slots
[
i
].
start
,
end
:
this
.
time
slots
[
i
].
end
,
title
:
this
.
getShowTitleById
(
this
.
time
slots
[
i
].
show
),
className
:
highlighting
})
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment