Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Season Elements (plus a lot of other changes because this ended up acting like a dev branch) #39

Merged
merged 23 commits into from
Jan 19, 2024
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
db61f6c
added BooleanButton.vue and implemented a test case in scout.vue
Ryan-Bauroth Jan 9, 2024
496107f
not working fully but implemented. need some advice from a1cd before …
Ryan-Bauroth Jan 10, 2024
44d70f1
far more function now. needs work graphically and matches/teams are n…
Ryan-Bauroth Jan 10, 2024
f44fc1c
added MultiSelect.vue and worked a lot on UI
Ryan-Bauroth Jan 10, 2024
fb7625c
added connectedOptions to MultiSelect.vue to stop misinputs
Ryan-Bauroth Jan 11, 2024
40df6c9
Remove import lines
alexru26 Jan 11, 2024
e02a6ab
Delete import lines
alexru26 Jan 11, 2024
f2a78dd
fixed optional props on IncrementalButton.vue and MultiSelect.vue (ad…
Ryan-Bauroth Jan 11, 2024
06d474b
fixed bug with IncrementalButton.vue optional maxValue
Ryan-Bauroth Jan 11, 2024
9258ae0
made mobility a boolean button once again and made sure something is …
Ryan-Bauroth Jan 11, 2024
208144d
Delete import statements
alexru26 Jan 11, 2024
2771175
Merge pull request #25 from DurhamAcademy/fix-import-error
alexru26 Jan 11, 2024
dae1393
Removed notes button and moved it to take up more space.
PrestonSwigart Jan 11, 2024
5028e42
Merge pull request #27 from DurhamAcademy/7-have-notes-under-scout-pa…
Ryan-Bauroth Jan 12, 2024
c01d733
just making sure I don't lose progress. working on basic teams page
Ryan-Bauroth Jan 12, 2024
f4e1fe8
added average amp cycles
Ryan-Bauroth Jan 12, 2024
1a4fd3e
worked on endgames for teams page. not complete
Ryan-Bauroth Jan 12, 2024
3f170d4
added pie chart for auto and worked more on general teams.vue stuff :)
Ryan-Bauroth Jan 13, 2024
44a2b56
idek what is in this i just need to switch branches
Ryan-Bauroth Jan 16, 2024
8dc245d
fixed peer dependancy issues
Ryan-Bauroth Jan 16, 2024
d0ab3e9
Tyler and Nathaniel worked to change the button type from an arrow th…
NathanielW07 Jan 17, 2024
2d98dfb
Merge pull request #36 from DurhamAcademy/redsign-scout-page-2
Ryan-Bauroth Jan 17, 2024
de70a6a
now technically complete. we may want to work further but in a good s…
Ryan-Bauroth Jan 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added bun.lockb
Binary file not shown.
45 changes: 45 additions & 0 deletions components/BooleanButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<script setup lang="ts">
import { computed } from 'vue'
const emit = defineEmits(['update:modelValue'])
const props = defineProps<{
modelValue: boolean,
defaultValue: string,
otherValue: string
}>()

const value = computed({
get() {
return props.modelValue
},
set(value) {
emit('update:modelValue', value)
}
})

function selected(){
value.value = !value.value
variantReference.value = bool ? "outline" : "solid"
labelReference.value = bool ? props.defaultValue : props.otherValue
bool = !bool
}

/**
* Probably unnecessary
*/
let bool = props.modelValue

let variantReference = ref(
props.modelValue ? "solid" : "outline"
)
let labelReference = ref(
props.modelValue ? props.otherValue : props.defaultValue
)
</script>

<template>
<UButton @click="selected()" :label="labelReference" :variant="variantReference"></UButton>
</template>

<style scoped>

</style>
10 changes: 8 additions & 2 deletions components/IncrementalButton.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<script setup lang="ts">
import { computed } from 'vue'
const props = defineProps(['modelValue'])
const props = defineProps<{
modelValue: number,
maxValue?: number,
}>()
const emit = defineEmits(['update:modelValue'])

const value = computed({
@@ -17,7 +20,10 @@ const value = computed({
* adds one to the value of the component
*/
function addToValue(){
value.value++
if(props.maxValue == undefined)
value.value++
else if(value.value < props.maxValue)
value.value++
}

/**
53 changes: 53 additions & 0 deletions components/MultiSelect.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<script setup lang="ts">
import { computed } from 'vue'
const emit = defineEmits(['update:modelValue'])
const props = defineProps<{
modelValue: Array<number>,
options: Array<String>,
connectedOptions?: Array<number>
}>()

const value = computed({
get() {
return props.modelValue
},
set(value) {
emit('update:modelValue', value)
}
})

function selected(index:number){
let currentVariant = variantArray.value[index]
variantArray.value.forEach(
(element, listIndex) => {
if(props.connectedOptions != undefined && props.connectedOptions[index] != props.connectedOptions[listIndex]){
variantArray.value[listIndex] = "outline"
let uv = value.value
uv[listIndex] = 0
value.value = uv
}
}
)
variantArray.value[index] = currentVariant == "solid" ? "outline" : "solid"
let updatedValue = value.value
updatedValue[index] = value.value[index] == 0 ? 1 : 0
value.value = updatedValue
}

let variantArray = ref(
Array(props.options.length)
.fill("")
.map(
(_, index) => props.modelValue[index] == 1 ? "solid" : "outline"
)
)

</script>

<template>
<UButton v-for="(item, index) in options" class="m-1" :label=item :variant="variantArray[index]" @click="selected(index)"></UButton>
</template>

<style scoped>

</style>
6 changes: 3 additions & 3 deletions components/Navbar.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script setup lang="ts">
import LoginState from "~/utils/authorization/LoginState";
import {VerticalNavigationLink} from "@nuxt/ui/dist/runtime/types";
import {loginStateKey} from "~/utils/keys";
import SessionResponse = PouchDB.Authentication.SessionResponse;
import {UnwrapRef} from "vue";
import {Ref} from "@vue/reactivity";

const {usernameState, sessionState, logout}: {
logout: () => Promise<void>;
// noinspection TypeScriptUnresolvedReference
loginState: Ref<UnwrapRef<LoginState>>;
// noinspection TypeScriptUnresolvedReference
sessionState: Ref<UnwrapRef<PouchDB.Authentication.SessionResponse>>;
// noinspection TypeScriptUnresolvedReference
usernameState: Ref<UnwrapRef<string>>;
updateUsernameState: () => Promise<boolean>
} = inject(loginStateKey)!
3 changes: 0 additions & 3 deletions components/OuterComponents.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<script setup lang="ts">
import {useWindowSize} from "@vueuse/core";
import {VerticalNavigationLink} from "@nuxt/ui/dist/runtime/types";
import LoginState from "~/utils/authorization/LoginState";
import {loginStateKey} from "~/utils/keys";
import AddButton from "~/components/AddButton.vue";
import SessionResponse = PouchDB.Authentication.SessionResponse;
import {Ref} from "@vue/reactivity";
import {UnwrapRef} from "vue";

const {loginState,usernameState, sessionState, logout}: {
logout: () => Promise<void>;
32 changes: 32 additions & 0 deletions components/PieChart.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<template>
<DoughnutChart :chartData="testData" />
</template>

<script lang="ts" setup>
import { defineComponent } from 'vue';
import { DoughnutChart } from 'vue-chart-3';
import { Chart, registerables } from "chart.js";

const props = defineProps<{
labels: Array<string>,
data: Array<number>,
backgroundColors?: Array<string>
}>()

Chart.register(...registerables);

let pieChartColors = ['#77CEFF', '#0079AF', '#123E6B', '#97B0C4', '#A5C8ED']
if(props.backgroundColors)
pieChartColors = props.backgroundColors


const testData = {
labels: props.labels,
datasets: [
{
data: props.data,
backgroundColor: pieChartColors,
},
],
};
</script>
12 changes: 6 additions & 6 deletions components/SingleSelect.vue
Original file line number Diff line number Diff line change
@@ -10,12 +10,12 @@ const props = defineProps<{
* Changes the solid button to the selected index
* @param selectedIndex the index of the button the user selects
*/
function currentlySelected(selectedIndex:number){
variantCheckList.value.forEach(
(element, listIndex) => variantCheckList.value[listIndex] = "outline"
function selected(selectedIndex:number){
variantArray.value.forEach(
(element, listIndex) => variantArray.value[listIndex] = "outline"
)
value.value = selectedIndex
variantCheckList.value[selectedIndex] = "solid"
variantArray.value[selectedIndex] = "solid"
}

const value = computed({
@@ -27,7 +27,7 @@ const value = computed({
}
})

let variantCheckList = ref(
let variantArray = ref(
Array(props.options.length)
.fill("")
.map(
@@ -39,7 +39,7 @@ let variantCheckList = ref(
</script>

<template>
<UButton v-for="(item, index) in options" class="m-1" :label=item :variant="variantCheckList[index]" @click="currentlySelected(index)"></UButton>
<UButton v-for="(item, index) in options" class="m-1" :label=item :variant="variantArray[index]" @click="selected(index)"></UButton>
</template>

<style scoped>
2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
@@ -76,4 +76,4 @@ services:
networks:
intercom_network:
name: intercom
external: true
external: false
14,410 changes: 14,410 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -15,15 +15,17 @@
"vite-plugin-node-polyfills": "^0.19.0"
},
"dependencies": {
"@nuxt/ui": "2.10.0",
"@nuxt/ui": "^2.10.0",
"@nuxtjs/pwa": "3.3.5",
"@userfront/vue": "0.1.20",
"@vueuse/core": "10.4.1",
"chart.js": "^3.9.1",
"compressorjs": "1.2.1",
"nuxt": "latest",
"nuxt": "^3.9.1",
"pouchdb": "8.0.1",
"pouchdb-authentication": "1.1.3",
"pouchdb-browser": "8.0.1",
"pouchdb-security-helper": "2.1.2"
"pouchdb-security-helper": "2.1.2",
"vue-chart-3": "^3.1.8"
}
}
166 changes: 104 additions & 62 deletions pages/scout.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script lang="ts" setup>
import databases from "~/utils/databases"
//import {integer} from "vscode-languageserver-types";
import IncrementalButton from '~/components/IncrementalButton.vue'
import {UnwrapRef} from "vue";
const { scoutingData } = databases.locals
let db = scoutingData
@@ -15,8 +13,10 @@ enum GameTime {
}
let gameTime = ref(GameTime.Autonomous)
const endgames = ["None", "Parked", "Docked", "Docked & Engaged"];
let selectedIndex = 0
const endgameOptions = ["None", "Parked", "Attempted Onstage" , "Onstage", "Harmony"]
let endgameIndex = [1, 0, 0, 0, 0]
/*
async function dataPull(team: integer): Promise<any>{
let refNum: integer = team;
@@ -60,7 +60,6 @@ function editGameTime(direction: String) {
}
}
const notesOpen = ref(false)
/*const ph: any = dataPull(info.teamNum)();
@@ -71,21 +70,41 @@ let impData = {
let data = ref({
TeamNumber: null,
MatchNumber: null,
points: 0,
ConeHigh: 0,
ConeMid: 0,
ConeLow: 0,
CubeHigh: 0,
CubeMid: 0,
CubeLow: 0,
endgame: endgames[0],
teamNumber: null,
matchNumber: null,
auto: {
speakerNA: 0,
amp: 0,
leave: false,
},
teleop: {
amp: 0,
speakerNA: 0,
speakerA: 0,
},
endgame: {
trap: 0,
endgame: [endgameOptions[0]]
},
notes: "",
})
function updateEndgameOptions(value: Array<number>){
let arr = []
for(let i = 0; i < value.length; i++){
if(value[i] == 1){
arr.push(endgameOptions[i])
}
}
data.value.endgame.endgame = arr
if(data.value.endgame.endgame.length < 1){
data.value.endgame.endgame = [endgameOptions[0]]
}
}
function isValidNum() {
return (data.value.TeamNumber != null) && (data.value.MatchNumber != null) && (data.value.TeamNumber > 0) && (data.value.MatchNumber > 0) && (data.value.TeamNumber < 10000)
return (data.value.teamNumber != null) && (data.value.matchNumber != null) && (data.value.teamNumber > 0) && (data.value.matchNumber > 0) && (data.value.teamNumber < 10000)
}
async function submit() {
@@ -107,63 +126,86 @@ async function submit() {
<div class="flex justify-center">
<UCard class="max-w-xl flex-grow m-5 ">
<template #header>
<UButtonGroup class="flex">
<UButton :disabled="gameTime==GameTime.Autonomous" icon="i-heroicons-chevron-left"
@click="editGameTime('-')"/>
<UButton :label="gameTime.valueOf()" block class="w-auto" disabled style="flex-grow: 1;"/>
<UButton :disabled="gameTime==GameTime.Endgame" icon="i-heroicons-chevron-right" @click="editGameTime('+')"/>
</UButtonGroup>
</template>

<UInput v-model="data.TeamNumber" placeholder="Team #"></UInput>
<UInput v-model="data.MatchNumber" placeholder="Match #"></UInput>
<div v-if="isValidNum()">
<p>Ready</p>
</div>
<div v-else-if="(data.TeamNumber==null)||(data.MatchNumber==null)">
</div>
<div v-else>
<p>Invalid Team/Match Number</p>
</div>
<div v-if="gameTime == GameTime.Autonomous">

</div>
<div v-if="gameTime == GameTime.Teleoperated">
<div class="w-1/2" id="cone-div" style="text-align:center; display:inline-block">
<h1 class="mb-2.5">Cone</h1>
<IncrementalButton v-model="data.ConeHigh"/>
<br/>
<IncrementalButton v-model="data.ConeMid"/>
<br/>
<IncrementalButton v-model="data.ConeLow"/>

<div style="display:flex">
<div style="flex:1">
<UInput v-model="data.teamNumber" placeholder="Team #"></UInput>
</div>
<div style="flex:1">
<UInput v-model="data.matchNumber" placeholder="Match #"></UInput>
</div>
</div>
<div v-if="gameTime == GameTime.Endgame">
<SingleSelect :model-value="selectedIndex" @update:model-value="index => {data.endgame = endgames[index]; selectedIndex = index}" :options="endgames"></SingleSelect>
</div>
<br>
<UButtonGroup class="flex">
<UButton :label=GameTime.Autonomous block class="w-auto" enabled style="flex-grow: 1;" @click="gameTime= GameTime.Autonomous"/>
<UButton :label=GameTime.Teleoperated block class="w-auto" enabled style="flex-grow: 1;" @click="gameTime= GameTime.Teleoperated"/>
<UButton :label=GameTime.Endgame block class="w-auto" enabled style="flex-grow: 1;" @click="gameTime= GameTime.Endgame"/>
</UButtonGroup>
</template>
<div v-if="gameTime == GameTime.Autonomous">
<div class="flex" style="text-align:center">
<div>
<h1 class="text-green-600 font-sans">Amp</h1>
<IncrementalButton v-model="data.auto.amp" style="margin:5px"></IncrementalButton>
</div>
<div>
<h1 class="text-green-600 font-sans">Speaker</h1>
<IncrementalButton v-model="data.auto.speakerNA" style="margin:5px"></IncrementalButton>
</div>
<div>
<br>
<BooleanButton v-model="data.auto.leave" :default-value="'Mobility'" :other-value="'Mobility'" style="margin:5px"></BooleanButton>
</div>
</div>
</div>
<div v-if="gameTime == GameTime.Teleoperated">
<div class="flex" style="text-align:center">
<div>
<h1 class="text-green-600 font-sans">Amp</h1>
<IncrementalButton v-model="data.teleop.amp" style="margin:5px"></IncrementalButton>
</div>
<div>
<h1 class="text-green-600 font-sans">SpeakerNA</h1>
<IncrementalButton v-model="data.teleop.speakerNA" style="margin:5px"></IncrementalButton>
</div>
<div>
<h1 class="text-green-600 font-sans">SpeakerA</h1>
<IncrementalButton v-model="data.teleop.speakerA" style="margin:5px"></IncrementalButton>
</div>
</div>
</div>
<div v-if="gameTime == GameTime.Endgame">
<div class="flex" style="text-align:center">
<div>
<h1 class="text-green-600 font-sans">Amp</h1>
<IncrementalButton v-model="data.teleop.amp" style="margin:5px"></IncrementalButton>
</div>
<div>
<h1 class="text-green-600 font-sans">SpeakerNA</h1>
<IncrementalButton v-model="data.teleop.speakerNA" style="margin:5px"></IncrementalButton>
</div>
<div>
<h1 class="text-green-600 font-sans">SpeakerA</h1>
<IncrementalButton v-model="data.teleop.speakerA" style="margin:5px"></IncrementalButton>
</div>
<div>
<h1 class="text-green-600 font-sans">Trap</h1>
<IncrementalButton v-model="data.endgame.trap" style="margin:5px"></IncrementalButton>
</div>
</div>
<br>
<MultiSelect :model-value="endgameIndex" :options="endgameOptions" @update:model-value="value => {updateEndgameOptions(value)}" :connected-options="[1, 2, 2, 3, 3]"></MultiSelect>
</div>
<template #footer>
<UTextarea v-model="data.notes" color="yellow" placeholder="Notes..."/>
<br/>
<div class="flex justify-between">
<div>
<UButton class="m-1" color="rose" label="Cancel" to="/dashboard" type="reset" variant="outline"/>
<UButton class="m-1" color="green" label="Submit" type="submit" variant="solid" :disabled="!isValidNum()" @click="submit"/>
</div>
<UButton class="m-1" color="yellow" label="Notes" variant="soft" @click="notesOpen = !notesOpen"/>
</div>
</template>
</UCard>
<USlideover v-model="notesOpen" side="right">
<UCard class="flex flex-col h-screen">
<template #header>
<div class="flex justify-end">
<UButton icon="i-heroicons-x-mark-solid" size="xl" @click="notesOpen=false" color="yellow" variant="ghost"/>
</div>
</template>
<div class="overflow-y-scroll">
<UTextarea v-model="data.notes" color="yellow" size="xl" autoresize/>
</div>
</UCard>
</USlideover>
</div>
</template>

148 changes: 134 additions & 14 deletions pages/teams.vue
Original file line number Diff line number Diff line change
@@ -14,35 +14,155 @@ let teamOrgMatches = new Map<number, Array<any>>()
for(let i = 0; i < match.length; i++){
let currentMatch = (await match[i])
if(!teamOrgMatches.has(currentMatch.team))
teamOrgMatches.set(currentMatch.team, [currentMatch])
if(!teamOrgMatches.has(currentMatch.teamNumber))
teamOrgMatches.set(currentMatch.teamNumber, [currentMatch])
else
teamOrgMatches.get(currentMatch.team)!.push(currentMatch)
teamOrgMatches.get(currentMatch.teamNumber)!.push(currentMatch)
}
function getConeAverage(teamNum: number){
let total = 0.0
for(let i = 0; i < teamOrgMatches.get(teamNum)!.length; i++){
total += teamOrgMatches.get(teamNum)![i].ConeHigh + teamOrgMatches.get(teamNum)![i].ConeMid + teamOrgMatches.get(teamNum)![i].ConeLow
let teamsData : Array<any> = []
for(let [key, value] of teamOrgMatches){
let arr = {team: key, amp:getAverageAmpCycles(value).toFixed(2), speaker:getAverageSpeakerCycles(value).toFixed(2), mobility:averageAuto(value).toFixed(2), endgame:compileEndgames(value)}
teamsData.push(arr)
}
function getAverageSpeakerCycles(teamArrays: Array<any>){
let nonAveragedValue = 0
for(let i = 0; i < teamArrays.length; i++){
nonAveragedValue += teamArrays[i].auto.speakerNA + teamArrays[i].teleop.speakerNA + teamArrays[i].teleop.speakerA
}
return nonAveragedValue/teamArrays.length
}
function getAverageAmpCycles(teamArrays: Array<any>){
let nonAveragedValue = 0
for(let i = 0; i < teamArrays.length; i++){
nonAveragedValue += teamArrays[i].auto.amp + teamArrays[i].teleop.amp
}
return nonAveragedValue/teamArrays.length
}
function averageAuto(teamArrays: Array<any>){
let successfulMobilityCount = 0
for(let match of teamArrays){
successfulMobilityCount += match.auto.leave ? 1 : 0
}
return total/teamOrgMatches.get(teamNum)!.length
return successfulMobilityCount/teamArrays.length
}
let x = [[teamOrgMatches.get(6502)![0].team, getConeAverage(6502)]]
function compileEndgames(teamArrays: Array<any>){
let endgameMap = new Map<string, number>();
for(let i = 0; i < teamArrays.length; i++) {
teamArrays[i].endgame.endgame.forEach(function (value: string) {
if (endgameMap.has(value)) {
endgameMap.set(value, endgameMap.get(value)! + 1)
} else
endgameMap.set(value, 1)
})
}
let endgameOptionsArr : Array<string> = []
let endgameDataArr : Array<number> = []
endgameMap.forEach(function(value, key){
endgameOptionsArr.push(key)
endgameDataArr.push(value)
})
return [endgameOptionsArr, endgameDataArr]
}
const columns = [{
key: "0",
label: 'TEAM #'
key: 'team',
label: 'Team #'
}, {
key: 'amp',
label: 'Average Amp Cycles'
}, {
key: 'speaker',
label: 'Average Speaker Cycles'
}, {
key: "1",
label: 'AVERAGE CONE CYCLES'
key: 'mobility',
label: 'Mobility Success Rate'
}, {
key: 'actions',
label: 'Endgame'
}, {
key: 'dropdown'
}]
</script>

<template>
<Navbar></Navbar>
<UTable :rows="x" :columns="columns"></UTable>
<UTable :rows="teamsData" :columns="columns">

<template #amp-data="{ row }">
<UPopover>
<UButton class="m-1" color="white" variant="soft" >{{row.amp}}</UButton>
<template #panel>
<UCard>
<div class="max-w-xs min-w-[15rem] overflow-y-auto" style="max-height: 20rem; min-height: 10rem">

</div>
</UCard>
</template>
</UPopover>
</template>

<template #mobility-data="{ row }">
<UPopover>
<UButton class="m-1" color="white" variant="soft" >{{row.mobility}}</UButton>
<template #panel>
<UCard>
<div class="max-w-xs min-w-[15rem] overflow-y-auto" style="max-height: 20rem; min-height: 10rem">

</div>
</UCard>
</template>
</UPopover>
</template>

<template #speaker-data="{ row }">
<UPopover>
<UButton class="m-1" color="white" variant="soft" >{{row.speaker}}</UButton>
<template #panel>
<UCard>
<div class="max-w-xs min-w-[15rem] overflow-y-auto" style="max-height: 20rem; min-height: 10rem">

</div>
</UCard>
</template>
</UPopover>
</template>

<template #actions-data="{ row }">
<UPopover>
<UButton class="m-1" color="blue" label="Chart" variant="soft" />
<template #panel>
<UCard>
<div class="max-w-xs min-w-[15rem] overflow-y-auto" style="max-height: 20rem; min-height: 10rem">
<PieChart :labels="row.endgame[0]" :data="row.endgame[1]"/>
</div>
</UCard>
</template>
</UPopover>
</template>

<template #dropdown-data="{ row }">
<UPopover>
<UButton color="gray" variant="ghost" icon="i-heroicons-ellipsis-horizontal-20-solid" />
<template #panel>
<UCard>
<div class="max-w-full min-w-max overflow-y-auto" style="max-height: 20rem; min-height: 10rem">

</div>
</UCard>
</template>
</UPopover>
</template>

</UTable>
</template>

<style scoped>
8 changes: 4 additions & 4 deletions utils/databases.ts
Original file line number Diff line number Diff line change
@@ -17,17 +17,17 @@ class LocalRemoteDatabaseSyncHolder<Content extends {} = {}> {
PouchDB.sync(this.local, this.remote, {live: true, retry: true,})
}

static databases: { attachments: LocalRemoteDatabaseSyncHolder<{ name: string; team: number | undefined; author: string }>; scoutingData: LocalRemoteDatabaseSyncHolder<{ TeamNumber: any; MatchNumber: any}>; basic: LocalRemoteDatabaseSyncHolder<{}> } = {
static databases: { attachments: LocalRemoteDatabaseSyncHolder<{ name: string; team: number | undefined; author: string }>; scoutingData: LocalRemoteDatabaseSyncHolder<{ teamNumber: any; matchNumber: any}>; basic: LocalRemoteDatabaseSyncHolder<{}> } = {
"attachments": new LocalRemoteDatabaseSyncHolder<{name: string, team: number|undefined, author: string}>("attachment-db"),
"scoutingData": new LocalRemoteDatabaseSyncHolder<{ TeamNumber: number; MatchNumber: number }>("scouting-data"),
"scoutingData": new LocalRemoteDatabaseSyncHolder<{ teamNumber: number; matchNumber: number }>("scouting-data"),
"basic": new LocalRemoteDatabaseSyncHolder<{}>("basic")
};
static locals: { attachments: PouchDB.Database<{ name: string; team: number | undefined; author: string }>; scoutingData: PouchDB.Database<{ TeamNumber: any; MatchNumber: any}>; basic: PouchDB.Database<{}> } = {
static locals: { attachments: PouchDB.Database<{ name: string; team: number | undefined; author: string }>; scoutingData: PouchDB.Database<{ teamNumber: any; matchNumber: any}>; basic: PouchDB.Database<{}> } = {
"attachments": this.databases.attachments.local,
"scoutingData": this.databases.scoutingData.local,
"basic": this.databases.basic.local,
};
static remotes: { attachments: PouchDB.Database<{ name: string; team: number | undefined; author: string }>; scoutingData: PouchDB.Database<{ TeamNumber: any; MatchNumber: any}>; basic: PouchDB.Database<{}> } = {
static remotes: { attachments: PouchDB.Database<{ name: string; team: number | undefined; author: string }>; scoutingData: PouchDB.Database<{ teamNumber: any; matchNumber: any}>; basic: PouchDB.Database<{}> } = {
"attachments": this.databases.attachments.remote,
"scoutingData": this.databases.scoutingData.remote,
"basic": this.databases.basic.remote,