Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurgolo committed Mar 23, 2024
2 parents f90ea50 + db35d4f commit e7e322d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 36 deletions.
19 changes: 3 additions & 16 deletions pages/matchinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,7 @@ db.version(17).stores({
// Version numbers must be changed whenever database objects (schema) are edited? See "Modify Schema" in https://dexie.org/docs/Tutorial/Understanding-the-basics
// db = database
// teams = table in database db

/* Steps to submitting data (theoretically)???????
1. Input information in match form, press the submit button
2. Collect the teamnumber (required? if so, must be required in teamdetails page)
3. Find the globalid associated with that teamnumber
4. Submit match data to the team with that globalid?
5. (TBD) Each team on the team list page should have a new button for "Matches"?
- opens unique (by globalid, like teamdetails) match summary page (see concept page)
- depicts list of matches by match number
- opening a match will show the data that you inputted originally in match form
*/

//const teamsDB = db.teams.toArray();


const urlParams = new URLSearchParams(window.location.search);
const globalid = parseInt(urlParams.get('globalid'), 10);
Expand Down Expand Up @@ -254,6 +242,7 @@ async function submitMatchData(rank, teamnumber, globalid, matchnumber, count1,
};

//Joy - you were on the right track here - but there can be multiple teams in the same match? Or do they each get their own match number?
// Yep, I had about the same realization earlier today (that there are duplicate match numbers granted that there are 6 teams per match) but wasn't sure how to implement it. Thank you so much for correcting it!!
const existingMatch = await db.matches.where('matchnumber').equals(matchnumber).and(match => match.globalid === parseInt(globalid, 10)).first();

//if the team already exists then add match information
Expand Down Expand Up @@ -293,9 +282,7 @@ async function submitMatchData(rank, teamnumber, globalid, matchnumber, count1,
}

document.getElementById("submitmatchinfo").addEventListener('click', function(event){
// Lesson Learned: I was having trouble with button communication and it resolved after I put it with a DOMContentLoaded (which waits until entire html is loaded)
// because w/o DOMContentLoaded, the script was initialized before the button, so it cannot "see" the button
// It works now because the js script was initialized AFTER the button (vs. in the head, when I used DOMContentLoaded)
// Make sure not to initialize the script before the button, or else there will be no communication

event.preventDefault();
// not sure if you can .value a span html element
Expand Down
12 changes: 0 additions & 12 deletions pages/matchsummary.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,6 @@ <h2> Team: <span class="teamnameeditable" id="teamnameeditable">NULL_TEAMNAME</s
<div id="matches">
</div>
</section>
<button class="matchnum" id="clickme"> Match 4 (Click Me) </button>
<script>
document.getElementById("clickme").onclick = () => {
alert("This could theoretically redirect to the match info page that already has the info loaded.");
}
</script>
<br>
<script src="matchsummary.js"></script> -->
</body>
Expand Down
9 changes: 1 addition & 8 deletions todolist.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
steps to create the world's best scouting app (in no particular order)

1. making sure the match info page can actually communicate with the database and submit info
a. should we make team number a required field to fill out in the team details page? if so:
b. the form element for team number should already be filled out on the match info page (but if not then no biggie, scouts can fill that in...???)

2. remove that weird submit button that is on the navigation bar on main page (team list)

3. connect a team from its unique team details page to its unique match summary page
Expand All @@ -25,9 +21,6 @@ steps to create the world's best scouting app (in no particular order)

7. hopefully done :D ?

8. i forgot. we need to teach the scouts how to use the app, even if this app is not used this year. that way, they have some familiarity when they look at it next year

9. should we consider exporting the data somehow to somewhere else? ie excel, sheets, etc. to archive data or to compile it all?
8. should we consider exporting the data somehow to somewhere else? ie excel, sheets, etc. to archive data or to compile it all?

10. pls fix delete button on team list page

0 comments on commit e7e322d

Please sign in to comment.