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
1e025c79
Commit
1e025c79
authored
Nov 26, 2019
by
jackie / Andrea Ida Malkah Klaura
Browse files
refactoring ShowManager playlist modal
parent
c9fa9f05
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/components/ShowManager.vue
View file @
1e025c79
...
...
@@ -833,10 +833,12 @@ export default {
let
playlistTitle
=
''
if
(
this
.
current
.
timeslots
[
i
].
playlist_id
!==
null
)
{
let
playlist
=
this
.
current
.
playlists
.
find
(
list
=>
list
.
id
===
this
.
current
.
timeslots
[
i
].
playlist_id
)
if
(
playlist
&&
playlist
.
description
.
length
>
0
)
{
playlistTitle
=
playlist
.
description
}
else
{
playlistTitle
=
playlist
.
id
if
(
playlist
)
{
if
(
playlist
.
description
.
length
>
0
)
{
playlistTitle
=
playlist
.
description
}
else
{
playlistTitle
=
playlist
.
id
}
}
}
...
...
@@ -1075,7 +1077,7 @@ export default {
},
editTimeslotPlaylist
:
function
(
show
,
schedule
,
timeslot
)
{
this
.
$refs
.
appModalPlaylist
.
open
(
show
,
schedule
,
timeslot
)
this
.
$refs
.
appModalPlaylist
.
open
(
show
,
schedule
,
timeslot
,
this
.
current
.
playlists
)
},
// For a given timeslot ID return the corresponding note, if there is one
...
...
src/components/ShowManagerModalPlaylist.vue
View file @
1e025c79
...
...
@@ -19,7 +19,7 @@
</p>
<p>
Available playlists:
</p>
<div
v-if=
"loaded
.playlists
"
>
<div
v-if=
"loaded"
>
<b-table
ref=
"playlistsTable"
striped
...
...
@@ -81,9 +81,7 @@ export default {
timeslot
:
null
,
timeslotObject
:
null
,
playlists
:
null
,
loaded
:
{
playlists
:
false
,
},
loaded
:
false
,
playlistsTableFields
:
[
{
key
:
'
id
'
,
label
:
'
Index
'
},
...
...
@@ -108,12 +106,13 @@ export default {
},
methods
:
{
open
(
show
,
schedule
,
timeslot
)
{
open
(
show
,
schedule
,
timeslot
,
playlists
)
{
this
.
show
=
show
this
.
schedule
=
schedule
this
.
timeslot
=
timeslot
this
.
playlists
=
playlists
this
.
timeslotObject
=
this
.
getTimeslotObject
(
timeslot
)
this
.
load
Playlists
()
this
.
load
ed
=
true
this
.
$refs
.
modalShowManagerPlaylist
.
show
()
},
...
...
@@ -154,24 +153,6 @@ export default {
return
text
},
loadPlaylists
()
{
this
.
loaded
.
playlists
=
false
let
uri
=
process
.
env
.
VUE_APP_API_TANK
+
'
shows/
'
+
this
.
show
.
slug
+
'
/playlists
'
axios
.
get
(
uri
,
{
withCredentials
:
true
,
headers
:
{
'
Authorization
'
:
'
Bearer
'
+
this
.
$parent
.
$parent
.
user
.
access_token
}
}).
then
(
response
=>
{
// we don't have to check separately, if there are playlists, because tank
// always provides an empty array if there are no playlists (or even if there is no corresponding show)
this
.
playlists
=
response
.
data
.
results
this
.
loaded
.
playlists
=
true
}).
catch
(
error
=>
{
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not fetch playlists from tank. See console for details.
'
)
})
},
notYetImplemented
:
function
()
{
alert
(
'
By the mighty witchcraftry of the mother of time!
\n\n
This feature is not implemented yet.
'
)
},
...
...
Write
Preview
Markdown
is supported
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