Skip to content

Commit

Permalink
quick UI fixups in addition to scouting page update for endgame
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan-Bauroth committed Jan 12, 2025
1 parent a008ce0 commit a8fb65b
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 54 deletions.
2 changes: 1 addition & 1 deletion pages/dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ async function updateTeamData() {
<p class="">{{ currentRankings[0][1] }}</p>
<p class="!text-primary">Team 6502 Stats</p>
</div>
<div class="flex justify-center my-1">
<div class="flex justify-center my-1" v-if="currentTeamRanking">
<UButton
class="rounded-2xl mx-0.5"
color="gray"
Expand Down
4 changes: 2 additions & 2 deletions pages/matches.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const headers = [
];
//sets up the data for the table
let items;
let items: Array<ScoutingData & IdMeta> = [];
async function setup() {
//gets all documents from the database asynchronously
Expand Down Expand Up @@ -124,7 +124,7 @@ async function setup() {
>
<br />
<div class="whitespace-normal break-all">
Notes: {{ row.value.notes }}
<strong>Notes:</strong><br/>{{ row.value.notes }}
</div>
</UContainer>
</template>
Expand Down
62 changes: 38 additions & 24 deletions pages/notes.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import databases from '~/utils/databases';
import databases, { ScoutingData } from '~/utils/databases';
import { eventOptions } from '~/utils/eventOptions';
import Navbar from '~/components/website-utils/Navbar.vue';
Expand All @@ -10,39 +10,54 @@ let selectedEvent = eventOptions[0];
if (typeof window !== 'undefined')
selectedEvent = localStorage.getItem('currentEvent') || eventOptions[0];
let data: Ref<
UnwrapRef<{
auto: { speakerNA: number; amp: number; missed: number; mobility: boolean };
notes: { efficiency: number; notes: string; reliability: number };
endgame: { endgame: string[]; trap: number };
teamNumber: null;
event: string;
matchNumber: null;
teleop: { speakerNA: number; amp: number; missed: number };
}>
> = ref({
let data = ref<ScoutingData>({
event: '',
teamNumber: null,
teamNumber: '',
matchNumber: -1,
author: '',
auto: {
speakerNA: 0,
amp: 0,
missed: 0,
coralL1: 0,
coralL2: 0,
coralL3: 0,
coralL4: 0,
processorMiss: 0,
processor: 0,
netMiss: 0,
net: 0,
mobility: false,
},
teleop: {
amp: 0,
speakerNA: 0,
missed: 0,
coralL1: 0,
coralL2: 0,
coralL3: 0,
coralL4: 0,
processorMiss: 0,
processor: 0,
netMiss: 0,
net: 0,
},
endgame: {
trap: 0,
endgame: '',
endgame: [""],
},
notes: {
playedDefense: false,
defense: 3,
notes: '',
promptedNotes: [
{
selected: false,
rating: 1,
notes: [],
},
{
selected: false,
rating: 1,
notes: [],
},
{
selected: false,
rating: 1,
notes: [],
},
],
},
});
Expand Down Expand Up @@ -91,7 +106,6 @@ async function submit() {
<UDivider label="🍪" class="mt-2 mb-2"/>
<UTextarea
v-model="data.notes.notes"
color="yellow"
placeholder="Other notes..."
:rows="10"
/>
Expand Down
31 changes: 4 additions & 27 deletions pages/scout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,8 @@ Configuration variables done
* updateEndgameOptions updates the scoutData variable to match the currently selected option in the endgame multiselect
* @param value the currently selected option
*/
function updateEndgameOptions(value: Array<number>) {
let arr = [];
for (let i = 0; i < value.length; i++) {
if (value[i] == 1) {
arr.push(endgameOptions[i]);
}
}
scoutData.value.endgame.endgame = arr;
if (scoutData.value.endgame.endgame.length < 1) {
scoutData.value.endgame.endgame = [endgameOptions[0]];
}
function updateEndgameOptions(value: number) {
scoutData.value.endgame.endgame = [endgameOptions[value]]
}
// all the data collected on the scout page in the form of a ScoutingData object,
Expand Down Expand Up @@ -439,31 +430,17 @@ async function submit() {
</div>
<!-- In this section put all the elements you want for the endgame tab -->
<div v-if="gameTime == GameTime.Endgame">
<!-- <div class="flex text-center flex-wrap mb-3">-->
<!-- <div class="max-w-24 w-24">-->
<!-- <h1 class="text-gray-700 dark:text-gray-200 font-sans font-medium">-->
<!-- Trap-->
<!-- </h1>-->
<!-- &lt;!&ndash; a new scoring method, but same idea as above incremental buttons &ndash;&gt;-->
<!-- <IncrementalButton-->
<!-- class="mt-1"-->
<!-- v-model="scoutData.endgame.trap"-->
<!-- :max-value="3"-->
<!-- ></IncrementalButton>-->
<!-- </div>-->
<!-- </div>-->
<!-- a multi select custom component. this acts like the single select but allows you to select multiple buttons at a time.
the connection options optional param allows you to configure which options are allowed to be selected with each other
notice the @update: which runs the updateEndgameOptions() function upon each update of the custom component-->
<MultiSelect
:model-value="[1, 0, 0, 0, 0, 0]"
<SingleSelect
:model-value="0"
:options="endgameOptions"
@update:model-value="
value => {
updateEndgameOptions(value);
}
"
:connected-options="[1, 2, 3, 4, 5, 6]"

/>
</div>
Expand Down

0 comments on commit a8fb65b

Please sign in to comment.