Commit e9eefc93 authored by jackie / Andrea Ida Malkah Klaura's avatar jackie / Andrea Ida Malkah Klaura
Browse files

use show selector component in show manager to fix #28

parent a290e85d
<template> <template>
<b-container> <b-container>
<!-- <show-selector
The show picker including the modal to add new shows should also be ref="showSelector"
refactored into an own component, so we can reuse it in the file and title="Radio shows"
emission managers :callback="showHasSwitched"
--> />
<addShowModal ref="addShowModal" />
<b-row>
<b-col>
<h3>Sendungen verwalten</h3>
</b-col>
<b-col align="right">
<b-button
v-if="$parent.user.steeringUser.is_superuser"
v-b-popover.hover.top="'Add a new show'"
variant="info"
@click="$refs.addShowModal.openModal()"
>
+
</b-button>
&nbsp;
<b-dropdown
id="ddshows"
text="Sendereihe auswählen"
variant="outline-info"
>
<b-dropdown-item
v-for="(show, index) in shows"
:key="show.id"
@click="switchShow(index)"
>
{{ show.name }}
</b-dropdown-item>
</b-dropdown>
</b-col>
</b-row>
<hr> <hr>
<!-- The jumbotron is used to display the name and description of the <!-- The jumbotron is used to display the name and description of the
...@@ -79,20 +48,20 @@ import showMetaSimpleTypes from './shows/MetaSimpleTypes.vue' ...@@ -79,20 +48,20 @@ import showMetaSimpleTypes from './shows/MetaSimpleTypes.vue'
import showMetaArrays from './shows/MetaArrays.vue' import showMetaArrays from './shows/MetaArrays.vue'
import showMetaOwners from './shows/MetaOwners.vue' import showMetaOwners from './shows/MetaOwners.vue'
import showMetaImages from './shows/MetaImages.vue' import showMetaImages from './shows/MetaImages.vue'
import modalAddShow from './shows/AddShowModal.vue' import showSelector from './ShowSelector.vue'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
// all modals to edit a show and its timeslots/notes, are importet as separate // all modals to edit a show and its timeslots/notes, are importet as separate
// components, to make it a tiny lickle bit less messy here // components, to make it a tiny lickle bit less messy here
components: { components: {
'addShowModal': modalAddShow,
'show-jumbotron': showJumbotron, 'show-jumbotron': showJumbotron,
'show-timeslots': showTimeslots, 'show-timeslots': showTimeslots,
'show-metaArrays': showMetaArrays, 'show-metaArrays': showMetaArrays,
'show-metaSimpleTypes': showMetaSimpleTypes, 'show-metaSimpleTypes': showMetaSimpleTypes,
'show-metaOwners': showMetaOwners, 'show-metaOwners': showMetaOwners,
'show-metaImages': showMetaImages, 'show-metaImages': showMetaImages,
'show-selector': showSelector,
}, },
data () { data () {
...@@ -124,6 +93,7 @@ export default { ...@@ -124,6 +93,7 @@ export default {
this.$store.dispatch('shows/fetchShows', { this.$store.dispatch('shows/fetchShows', {
callback: () => { callback: () => {
this.$store.dispatch('playlists/fetch', {slug: this.selectedShow.slug}) this.$store.dispatch('playlists/fetch', {slug: this.selectedShow.slug})
this.$refs.showSelector.updateInputSelector()
} }
}) })
this.$store.dispatch('shows/fetchMetaArray', {property: 'types', onlyActive: true}) this.$store.dispatch('shows/fetchMetaArray', {property: 'types', onlyActive: true})
...@@ -137,8 +107,7 @@ export default { ...@@ -137,8 +107,7 @@ export default {
}, },
methods: { methods: {
switchShow: function (index) { showHasSwitched () {
this.$store.commit('shows/switchShow', index)
this.$refs.timeslotsComponent.showHasSwitched() this.$refs.timeslotsComponent.showHasSwitched()
}, },
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment