-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate the two break display editors into a single tabbed modal
- Loading branch information
Showing
5 changed files
with
159 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 0 additions & 102 deletions
102
website/src/components/website/dashboard/BreakDisplayModal.vue
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
website/src/components/website/dashboard/BreakDisplayMultiModal.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<template> | ||
<div class="break-display-modal"> | ||
<div v-b-modal.break-display> | ||
<b-button size="sm" :class="{ active: broadcast && broadcast.break_display }" :variant="broadcast && broadcast.break_display ? 'primary' : ''"> | ||
<DashboardModalIcon/> {{ autoText }} | ||
</b-button> | ||
</div> | ||
<b-modal ref="modal" id="break-display" title="Break display settings" @show="selectedTab = 'Display'" :hide-footer="selectedTab !== 'Display'"> | ||
<b-form-radio-group class="w-100 mb-3" v-model="selectedTab" :options="tabs" buttons button-variant="outline-primary" /> | ||
<BreakDisplayTab :broadcast="broadcast" v-if="selectedTab === 'Display'"/> | ||
<BreakAutomationTab :broadcast="broadcast" v-if="selectedTab === 'Automation'" /> | ||
|
||
<template v-slot:modal-footer> | ||
<div v-if="selectedTab === 'Display'" class="w-100 flex-center text-center"> | ||
These settings will change the break scene's display instantly.<br> | ||
Make sure that your show is ready for these graphics to appear. | ||
</div> | ||
</template> | ||
</b-modal> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import DashboardModalIcon from "@/components/website/dashboard/DashboardModalIcon.vue"; | ||
import { BButton, BFormRadioGroup, BModal, VBModal } from "bootstrap-vue"; | ||
import BreakDisplayTab from "@/components/website/dashboard/BreakDisplayTab.vue"; | ||
import BreakAutomationTab from "@/components/website/dashboard/BreakAutomationTab.vue"; | ||
export default { | ||
name: "BreakDisplayMultiModal", | ||
components: { BreakAutomationTab, BreakDisplayTab, BFormRadioGroup, BModal, BButton, DashboardModalIcon }, | ||
directives: { BModal: VBModal }, | ||
props: { | ||
broadcast: Object | ||
}, | ||
data: () => ({ | ||
selectedTab: "Display", | ||
tabs: [ | ||
"Display", | ||
"Automation" | ||
] | ||
}), | ||
computed: { | ||
autoText() { | ||
return this.broadcast?.break_display ? `Display: ${this.broadcast.break_display}` : "Display"; | ||
} | ||
} | ||
}; | ||
</script> | ||
<style scoped> | ||
</style> |
81 changes: 81 additions & 0 deletions
81
website/src/components/website/dashboard/BreakDisplayTab.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<template> | ||
<div class="break-display-tab"> | ||
<div class="flex-center"> | ||
<div class="buttons d-inline-flex flex-column"> | ||
<b-button class="mb-1" v-for="option in options" :key="option.value" | ||
@click="setOption(option.value)" | ||
:disabled="processing && (selected === option.value)" | ||
:class="{ 'active': selected === option.value }" | ||
:variant="selected === option.value && !processing ? 'primary' : 'secondary'"> | ||
{{ option.text }} | ||
</b-button> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { BButton } from "bootstrap-vue"; | ||
import { updateBreakDisplay } from "@/utils/dashboard"; | ||
export default { | ||
name: "BreakDisplayTab", | ||
components: { BButton }, | ||
props: { broadcast: Object }, | ||
data: () => ({ | ||
options: [ | ||
{ value: "Automated", text: "Automated break display" }, | ||
{ value: "Schedule", text: "Schedule" }, | ||
{ value: "Standings", text: "Standings" }, | ||
{ value: "Image", text: "Image" }, | ||
{ value: "Bracket", text: "Bracket" }, | ||
{ value: "Staff", text: "Event staff" }, | ||
{ value: "Matchup", text: "Matchup" }, | ||
{ value: "Title", text: "Title" }, | ||
{ value: "Other Streams", text: "Other Streams" }, | ||
{ value: "Other Info", text: "Other Info" } | ||
], | ||
selected: null, | ||
processing: false | ||
}), | ||
computed: { | ||
activeOption() { | ||
return this.broadcast?.break_display; | ||
} | ||
}, | ||
watch: { | ||
activeOption: { | ||
immediate: true, | ||
handler(newOption) { | ||
this.resetOption(newOption); | ||
} | ||
}, | ||
selectedEndingOptions(options) { | ||
if (options.length > 1) { | ||
this.selectedEndingOptions = [options.pop()]; | ||
} | ||
} | ||
}, | ||
methods: { | ||
async setOption(option) { | ||
this.selected = option; | ||
this.processing = true; | ||
try { | ||
const response = await updateBreakDisplay(this.$root.auth, this.selected); | ||
if (!response.error) { | ||
this.$notyf.success(`Break display set to ${this.selected}`); | ||
} | ||
} finally { | ||
this.processing = false; | ||
} | ||
}, | ||
resetOption(option) { | ||
this.selected = option; | ||
} | ||
} | ||
}; | ||
</script> | ||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters