Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
dashboard
Commits
176a4cd2
Commit
176a4cd2
authored
1 year ago
by
Konrad Mohrfeldt
Browse files
Options
Downloads
Patches
Plain Diff
refactor: simplify PlaylistSelector logic
parent
ed43a7ea
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/shows/PlaylistSelector.vue
+8
-17
8 additions, 17 deletions
src/components/shows/PlaylistSelector.vue
src/components/shows/TimeSlotRow.vue
+2
-2
2 additions, 2 deletions
src/components/shows/TimeSlotRow.vue
with
10 additions
and
19 deletions
src/components/shows/PlaylistSelector.vue
+
8
−
17
View file @
176a4cd2
...
@@ -106,15 +106,16 @@ import { mapGetters } from 'vuex'
...
@@ -106,15 +106,16 @@ import { mapGetters } from 'vuex'
import
prettyDate
from
'
@/mixins/prettyDate
'
import
prettyDate
from
'
@/mixins/prettyDate
'
import
playlist
from
'
@/mixins/playlist
'
import
playlist
from
'
@/mixins/playlist
'
import
{
useTimeSlotStore
}
from
'
@/stores/timeslots
'
export
default
{
export
default
{
mixins
:
[
prettyDate
,
playlist
],
mixins
:
[
prettyDate
,
playlist
],
props
:
{
timeslot
:
{
type
:
Object
,
required
:
true
}
,
}
,
data
()
{
data
()
{
return
{
return
{
scheduleId
:
null
,
scheduleId
:
null
,
timeslot
:
null
,
audioFile
:
null
,
audioFile
:
null
,
audioUpload
:
false
,
audioUpload
:
false
,
audioUploadError
:
''
,
audioUploadError
:
''
,
...
@@ -167,7 +168,6 @@ export default {
...
@@ -167,7 +168,6 @@ export default {
getTimeslotById
:
'
shows/getTimeslotById
'
,
getTimeslotById
:
'
shows/getTimeslotById
'
,
}
),
}
),
}
,
}
,
methods
:
{
methods
:
{
upload
(
event
)
{
upload
(
event
)
{
event
.
preventDefault
()
event
.
preventDefault
()
...
@@ -211,15 +211,14 @@ export default {
...
@@ -211,15 +211,14 @@ export default {
this
.
audioUpload
=
!
this
.
audioUpload
this
.
audioUpload
=
!
this
.
audioUpload
}
,
}
,
open
(
scheduleId
,
timeslotId
)
{
open
(
scheduleId
)
{
this
.
audioFile
=
null
this
.
audioFile
=
null
this
.
audioUpload
=
false
this
.
audioUpload
=
false
this
.
scheduleId
=
scheduleId
this
.
scheduleId
=
scheduleId
this
.
timeslot
=
this
.
getTimeslotById
(
timeslotId
)
this
.
$refs
.
modalPlaylistSelector
.
show
()
this
.
$refs
.
modalPlaylistSelector
.
show
()
}
,
}
,
choose
(
data
)
{
async
choose
(
data
)
{
const
{
item
}
=
data
||
{
}
const
{
item
}
=
data
||
{
}
const
{
id
}
=
item
||
{
}
const
{
id
}
=
item
||
{
}
let
confirmed
=
true
let
confirmed
=
true
...
@@ -229,16 +228,8 @@ export default {
...
@@ -229,16 +228,8 @@ export default {
}
}
if
(
confirmed
)
{
if
(
confirmed
)
{
const
ts
=
{
...
this
.
timeslot
}
const
timeslotStore
=
useTimeSlotStore
()
ts
.
playlistId
=
id
await
timeslotStore
.
partialUpdate
(
this
.
timeslot
.
id
,
{
playlistId
:
id
??
null
}
)
this
.
$store
.
dispatch
(
'
shows/updateTimeslot
'
,
{
showId
:
this
.
selectedShow
.
id
,
scheduleId
:
this
.
scheduleId
,
timeslot
:
ts
,
callback
:
()
=>
{
this
.
timeslot
=
this
.
getTimeslotById
(
ts
.
id
)
}
,
}
)
}
}
}
,
}
,
...
...
This diff is collapsed.
Click to expand it.
src/components/shows/TimeSlotRow.vue
+
2
−
2
View file @
176a4cd2
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
</tr>
</tr>
<Teleport
to=
"body"
>
<Teleport
to=
"body"
>
<PlaylistModal
ref=
"playlistModal"
/>
<PlaylistModal
ref=
"playlistModal"
:timeslot=
"timeslot"
/>
<NoteEditorModal
<NoteEditorModal
v-model=
"localNoteId"
v-model=
"localNoteId"
:is-open=
"showNoteEditor"
:is-open=
"showNoteEditor"
...
@@ -132,6 +132,6 @@ function editNote() {
...
@@ -132,6 +132,6 @@ function editNote() {
}
}
function
editPlaylist
()
{
function
editPlaylist
()
{
playlistModal
.
value
.
open
(
props
.
timeslot
.
scheduleId
,
props
.
timeslot
.
id
)
playlistModal
.
value
.
open
(
props
.
timeslot
.
scheduleId
)
}
}
</
script
>
</
script
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment