Skip to content

Commit

Permalink
Merge pull request #270 from DurhamAcademy/245-edit-matches-page-for-…
Browse files Browse the repository at this point in the history
…this-year

245 edit matches page for this year
  • Loading branch information
kmholladay authored Jan 16, 2025
2 parents 02bdf3a + 6a9b65b commit d001ea6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
6 changes: 6 additions & 0 deletions components/scouting-components/PromptedNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ const props = defineProps<{
const value = computed({
get() {
for (let i in props.modelValue.notes){
if (props.modelValue.notes[i] == undefined) {
console.log("ran update")
props.modelValue.notes[i] = ""
}
}
return props.modelValue;
},
set(value) {
Expand Down
18 changes: 15 additions & 3 deletions pages/matches.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ async function setup() {
console.log(matches);
items = matches;
}
let promptedNoteTitles = ["Coral", "Algae", "Driver"]
</script>
<template>
<OuterComponents>
Expand All @@ -116,16 +118,26 @@ async function setup() {
color="yellow"
label="Notes"
variant="soft"
@click="console.dir(row.value.promptedNotes[0])"
/>
<template #panel>
<UContainer
class="m-auto max-w-lg min-w-[15rem] overflow-y-auto"
style="max-height: 20rem; min-height: 10rem"
>
<br />
<div class="whitespace-normal break-all">
Notes: {{ row.value.notes }}
<br/>
<div v-for="(promptedNote, index) in row.value.promptedNotes">
<p v-if="promptedNote.notes.length > 0"> <b>{{promptedNoteTitles[index]}}</b> </p>
<p v-else><del> </del></p>
<p v-for="note in promptedNote.notes">{{note}}</p> <br>
</div>
<div>
<p v-if="row.value.notes.length > 0"> <b>Other</b><br>{{row.value.notes}}</p>
<p v-else><del> </del></p>
<br>
</div>


</UContainer>
</template>
</UPopover>
Expand Down
14 changes: 7 additions & 7 deletions pages/scout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -551,20 +551,20 @@ async function submit() {
open-icon="i-heroicons-plus"
close-icon="i-heroicons-minus"
:items="[
{ label: 'Defense', slot: 'defense', defaultOpen: true },
{ label: 'Offense', slot: 'offense' },
{ label: 'Coral', slot: 'coral', defaultOpen: true },
{ label: 'Algae', slot: 'algae' },
{ label: 'Driver', slot: 'driver' },
]"
>
<!-- templates fill the UAccordion's sections -->
<template #defense>
<template #coral>
<!-- the PromptedNote custom component takes in an array of questions and how many lines should be expected as output for that question
for example: 'Where did this team play defense?' is the question while '1' is the number of lines expected for that response
it then returns an array of answers to the questions which is updated to the scoutData variable -->
<PromptedNote
v-model="scoutData.notes.promptedNotes[0]"
:questions="[
['Where did this team play defense?', 1],
['How efficient and accurate was this team while scoring coral?', 1],
[
'Is this team at risk of causing fouls? If so, elaborate why.',
2,
Expand All @@ -573,16 +573,16 @@ async function submit() {
]"
/>
</template>
<template #offense>
<template #algae>
<PromptedNote
v-model="scoutData.notes.promptedNotes[1]"
:questions="[
['Where can this team shoot from?', 1],
['How efficient and accurate was this team while scoring algae?', 1],
[
'If applicable, how did the driver make efforts to avoid opposing defense?',
2,
],
['What slowed down their cycles?', 2],
['What slowed down this teams scoring process with algae and/or coral?', 2],
['What other factors contributed to your rating?', 1],
]"
/>
Expand Down

0 comments on commit d001ea6

Please sign in to comment.