Skip to content

Commit

Permalink
Add clients #34
Browse files Browse the repository at this point in the history
  • Loading branch information
slmnio committed Jun 28, 2021
1 parent d7938a1 commit 786395c
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 31 deletions.
3 changes: 2 additions & 1 deletion server/src/airtable-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const logUpdates = false;
// Starting with syncing Matches

// const tables = ["Matches", "Teams", "Themes", "Events", "Players", "Player Relationships"];
const tables = ["Event Series", "News", "Matches", "Teams", "Themes", "Events", "Players", "Socials", "Accolades", "Player Relationships", "Broadcasts", "Brackets", "Live Guests", "Headlines"];
const tables = ["Event Series", "News", "Matches", "Teams", "Themes", "Events", "Players", "Socials", "Accolades", "Player Relationships", "Broadcasts", "Brackets", "Live Guests", "Headlines", "Clients"];

function deAirtable(obj) {
const data = {};
Expand Down Expand Up @@ -43,6 +43,7 @@ async function getAllTableData(tableName, options = {}) {

function customUpdater(tableName, item) {
if (tableName === "Broadcasts" && item.key && item.active) Cache.set(`broadcast-${item.key}`, item);
if (tableName === "Clients" && item.key) Cache.set(`client-${item.key}`, item);
if (tableName === "Events" && item.subdomain) Cache.set(`event-${item.subdomain}`, item);
}

Expand Down
4 changes: 2 additions & 2 deletions website/src/apps/BroadcastApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { ReactiveArray, ReactiveRoot, ReactiveThing } from "@/utils/reactive";
export default {
name: "BroadcastApp",
props: ["id", "title", "top"],
props: ["id", "title", "top", "code"],
computed: {
broadcast() {
return ReactiveRoot(`broadcast-${this.id}`, {
return ReactiveRoot(this.id || `broadcast-${this.code}`, {
event: ReactiveThing("event", {
theme: ReactiveThing("theme")
}),
Expand Down
27 changes: 27 additions & 0 deletions website/src/apps/ClientApp.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<BroadcastApp v-if="broadcastID" :id="broadcastID" />
</template>

<script>
import BroadcastApp from "@/apps/BroadcastApp";
import { ReactiveRoot, ReactiveThing } from "@/utils/reactive";
export default {
name: "ClientApp",
components: { BroadcastApp },
props: ["client"],
computed: {
_client() {
return ReactiveRoot(`client-${this.client}`, {
broadcast: ReactiveThing("broadcast")
});
},
broadcastID() {
return this._client?.broadcast?.id;
}
}
};
</script>
<style scoped>
</style>
26 changes: 26 additions & 0 deletions website/src/router/broadcast.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import IngameOverlay from "@/components/broadcast/IngameOverlay";
import BreakOverlay from "@/components/broadcast/BreakOverlay";
import BracketOverlay from "@/components/broadcast/BracketOverlay";
import ScheduleOverlay from "@/components/broadcast/ScheduleOverlay";
import StandingsOverlay from "@/components/broadcast/StandingsOverlay";
import RosterOverlay from "@/components/broadcast/RosterOverlay";
import EventThumbnailCreator from "@/components/broadcast/EventThumbnailCreator";
import DraftOverlay from "@/components/broadcast/DraftOverlay";
import DeskOverlay from "@/components/broadcast/DeskOverlay";
import CustomOverlay from "@/components/broadcast/CustomOverlay";
import InfoOverlay from "@/components/broadcast/InfoOverlay";

export default [
{ path: "ingame", component: IngameOverlay },
{ path: "break", component: BreakOverlay },
{ path: "bracket", component: BracketOverlay, props: route => ({ bracketKey: route.query.key, extended: !!route.query.extended, scale: route.query.scale }) },
{ path: "schedule", component: ScheduleOverlay },
{ path: "standings", component: StandingsOverlay },
{ path: "roster", redirect: "rosters" },
{ path: "rosters", component: RosterOverlay },
{ path: "thumbnail", component: EventThumbnailCreator },
{ path: "draft", component: DraftOverlay },
{ path: "casters", component: DeskOverlay, props: route => ({ group: "casters" }) },
{ path: "custom", component: CustomOverlay },
{ path: "info", component: InfoOverlay }
];
39 changes: 11 additions & 28 deletions website/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,16 @@ import TeamMain from "@/views/sub-views/TeamMain";
import TeamMatches from "@/views/sub-views/TeamMatches";
import PlayerPlayedMatches from "@/views/sub-views/PlayerPlayedMatches";
import Match from "@/views/Match";
import IngameOverlay from "@/components/broadcast/IngameOverlay";
import BreakOverlay from "@/components/broadcast/BreakOverlay";
import ScheduleOverlay from "@/components/broadcast/ScheduleOverlay";
import StandingsOverlay from "@/components/broadcast/StandingsOverlay";
import CustomOverlay from "@/components/broadcast/CustomOverlay";
import RosterOverlay from "@/components/broadcast/RosterOverlay";
import EventThumbnailCreator from "@/components/broadcast/EventThumbnailCreator";
import EventMain from "@/views/sub-views/EventMain";
import EventRosters from "@/views/sub-views/EventRosters";
import EventBrackets from "@/views/sub-views/EventBrackets";
import TeamTheme from "@/views/sub-views/TeamTheme";
import EventSchedule from "@/views/sub-views/EventSchedule";
import EventScenarios from "@/components/website/EventScenarios";
import BracketOverlay from "@/components/broadcast/BracketOverlay";
import DraftOverlay from "@/components/broadcast/DraftOverlay";
import EventDraft from "@/views/sub-views/EventDraft";
import TeamDetails from "@/views/sub-views/TeamDetails";
import DeskOverlay from "@/components/broadcast/DeskOverlay";
import InfoOverlay from "@/components/broadcast/InfoOverlay";
// import EventScenarios2 from "@/components/website/EventScenarios2";
import BroadcastRoutes from "@/router/broadcast";
import ClientApp from "@/apps/ClientApp";

Vue.use(VueRouter);

Expand Down Expand Up @@ -106,23 +96,16 @@ const routes = [
]
},
{
path: "/broadcast/:broadcastID",
path: "/broadcast/:broadcastCode",
component: OverlayApp,
props: route => ({ id: route.params.broadcastID, title: route.query.title, top: route.query.top }),
children: [
{ path: "ingame", component: IngameOverlay },
{ path: "break", component: BreakOverlay },
{ path: "bracket", component: BracketOverlay, props: route => ({ bracketKey: route.query.key, extended: !!route.query.extended, scale: route.query.scale }) },
{ path: "schedule", component: ScheduleOverlay },
{ path: "standings", component: StandingsOverlay },
{ path: "roster", redirect: "rosters" },
{ path: "rosters", component: RosterOverlay },
{ path: "thumbnail", component: EventThumbnailCreator },
{ path: "draft", component: DraftOverlay },
{ path: "casters", component: DeskOverlay, props: route => ({ group: "casters" }) },
{ path: "custom", component: CustomOverlay },
{ path: "info", component: InfoOverlay }
]
props: route => ({ code: route.params.broadcastCode, title: route.query.title, top: route.query.top }),
children: BroadcastRoutes
},
{
path: "/client/:clientID",
component: ClientApp,
props: route => ({ client: route.params.clientID }),
children: BroadcastRoutes
}
];

Expand Down

0 comments on commit 786395c

Please sign in to comment.