diff --git a/app/components/Loading.js b/app/components/Loading.js
new file mode 100644
index 0000000..17fa887
--- /dev/null
+++ b/app/components/Loading.js
@@ -0,0 +1,30 @@
+import styles from '@/app/styles/Loading.module.css'
+
+export default function Loading({ prompt }) {
+ return (
+
+
+
+ )
+}
diff --git a/app/matches/[slug]/page.js b/app/matches/[slug]/page.js
index deb8421..d50751a 100644
--- a/app/matches/[slug]/page.js
+++ b/app/matches/[slug]/page.js
@@ -215,7 +215,7 @@ const MatchPage = () => {
player2TieScores={matchData.pointsJson.map(
(point) => point.player2TiebreakScore
)}
- isUnfinished={matchData.matchDetails.status === 'unfinished'}
+ isUnfinished={matchData.matchDetails.unfinished}
displaySections={{ score: true, info: true, matchup: true }}
/>
@@ -399,7 +399,7 @@ const MatchPage = () => {
player2TieScores={matchData.pointsJson.map(
(point) => point.player2TiebreakScore
)}
- isUnfinished={matchData.matchDetails.status === 'unfinished'}
+ isUnfinished={matchData.matchDetails.unfinished}
displaySections={{ score: true, info: true, matchup: true }}
/>
@@ -429,7 +429,7 @@ const MatchPage = () => {
{showPDF ? (
diff --git a/app/services/matchSchemas.js b/app/services/matchSchemas.js
index bfb0e68..2d7802b 100644
--- a/app/services/matchSchemas.js
+++ b/app/services/matchSchemas.js
@@ -39,6 +39,14 @@ const initialSchema = {
title: 'Date',
format: 'date'
},
+ unfinished: {
+ type: 'boolean',
+ title: 'Unfinished'
+ },
+ duel: {
+ type: 'boolean',
+ title: 'Duel'
+ },
matchScore: {
type: 'object',
title: 'Match Score',
@@ -149,8 +157,8 @@ const initialSchema = {
},
pdfFile: {
type: 'string',
- title: 'PDF File',
- format: 'data-url'
+ title: 'PDF File'
+ // format: 'data-url'
}
},
required: [
@@ -175,26 +183,44 @@ const uiSchema = {
matchScore: {
set1: {
clientTiebreak: {
- 'ui:widget': 'updown'
+ 'ui:widget': 'text',
+ 'ui:options': {
+ inputType: 'number'
+ }
},
opponentTiebreak: {
- 'ui:widget': 'updown'
+ 'ui:widget': 'text',
+ 'ui:options': {
+ inputType: 'number'
+ }
}
},
set2: {
clientTiebreak: {
- 'ui:widget': 'updown'
+ 'ui:widget': 'text',
+ 'ui:options': {
+ inputType: 'number'
+ }
},
opponentTiebreak: {
- 'ui:widget': 'updown'
+ 'ui:widget': 'text',
+ 'ui:options': {
+ inputType: 'number'
+ }
}
},
set3: {
clientTiebreak: {
- 'ui:widget': 'updown'
+ 'ui:widget': 'text',
+ 'ui:options': {
+ inputType: 'number'
+ }
},
opponentTiebreak: {
- 'ui:widget': 'updown'
+ 'ui:widget': 'text',
+ 'ui:options': {
+ inputType: 'number'
+ }
}
}
}
diff --git a/app/services/taggerButtonData.js b/app/services/taggerButtonData.js
index 6bc1b4b..fe5cbc3 100644
--- a/app/services/taggerButtonData.js
+++ b/app/services/taggerButtonData.js
@@ -34,8 +34,6 @@ Additional Properties of 'data':
let serverScore = 0
let returnerScore = 0
-// const player1SetScore = 0
-// const player2SetScore = 0
let player1GameScore = 0
let player2GameScore = 0
let isAce = false
@@ -222,7 +220,7 @@ export const getTaggerButtonData = (
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Deuce')
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -230,19 +228,24 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '0-15')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Ad')
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -250,19 +253,24 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '15-0')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Ad')
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -270,19 +278,24 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '15-15')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Deuce')
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -290,19 +303,24 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '30-0')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Deuce')
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -310,19 +328,24 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '0-30')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Deuce')
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -330,19 +353,24 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '30-15')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Ad')
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -350,19 +378,24 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '0-40')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Ad')
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -370,19 +403,24 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '40-0')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Ad')
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -390,19 +428,24 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '15-30')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Ad')
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -410,19 +453,24 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '30-30')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Deuce')
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -430,19 +478,24 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '40-15')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Deuce')
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -450,20 +503,25 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '15-40')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Deuce')
updateActiveRow('isBreakPoint', 1)
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -471,20 +529,25 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '30-40')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Ad')
updateActiveRow('isBreakPoint', 1)
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -492,19 +555,24 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '40-30')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Ad')
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -512,20 +580,25 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '40-40')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Ad')
updateActiveRow('isBreakPoint', 1)
updateActiveRow('pointStartTime', data.videoTimestamp)
- setCurrentPage('FirstServe')
+ setCurrentPage('ServerLocation')
}
},
{
@@ -533,19 +606,44 @@ export const getTaggerButtonData = (
action: (data) => {
addNewRow()
updateActiveRow('pointScore', '40-40')
- updateActiveRow(
- 'gameScore',
- data.table[data.activeRowIndex - 1].gameScore
- )
- updateActiveRow(
- 'setScore',
- data.table[data.activeRowIndex - 1].setScore
- )
+ if (data.activeRowIndex > 1) {
+ updateActiveRow(
+ 'gameScore',
+ data.table[data.activeRowIndex - 1].gameScore
+ )
+ updateActiveRow(
+ 'setScore',
+ data.table[data.activeRowIndex - 1].setScore
+ )
+ } else {
+ updateActiveRow('gameScore', '0-0')
+ updateActiveRow('setScore', '0-0')
+ }
updateActiveRow('isPointStart', 1)
updateActiveRow('shotInRally', 1)
updateActiveRow('side', 'Deuce')
updateActiveRow('isBreakPoint', 1)
updateActiveRow('pointStartTime', data.videoTimestamp)
+ setCurrentPage('ServerLocation')
+ }
+ }
+ ],
+ ServerLocation: [
+ {
+ courtImage: true,
+ label: 'Select Server Location',
+ action: (data) => {
+ updateActiveRow('serverStartLocation', data.x)
+ setCurrentPage('ReturnerLocation')
+ }
+ }
+ ],
+ ReturnerLocation: [
+ {
+ courtImage: true,
+ label: 'Select Returner Location',
+ action: (data) => {
+ updateActiveRow('returnerStartLocation', data.x)
setCurrentPage('FirstServe')
}
}
@@ -1222,6 +1320,12 @@ export const getTaggerButtonData = (
updateActiveRow('isExcitingPoint', '1')
}
},
+ {
+ label: 'Unforced Error',
+ action: () => {
+ updateActiveRow('isUnforcedError', '1')
+ }
+ },
{
courtImage: true,
label: 'Select Shot Result Location',
@@ -1391,6 +1495,8 @@ export const columnNames = [
'side',
'serverName',
'serverFarNear',
+ 'serverStartLocation',
+ 'returnerStartLocation',
'firstServeIn',
'firstServeZone',
'firstServeXCoord',
@@ -1420,6 +1526,7 @@ export const columnNames = [
'isErrorWideL',
'isErrorNet',
'isErrorLong',
+ 'isUnforcedError',
'clientTeam',
'Date',
'Division',
diff --git a/app/styles/Loading.module.css b/app/styles/Loading.module.css
new file mode 100644
index 0000000..019b4b2
--- /dev/null
+++ b/app/styles/Loading.module.css
@@ -0,0 +1,34 @@
+.loadingContainer {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ height: 100%;
+ font-family: 'DM Sans', sans-serif;
+}
+
+.customText {
+ fill: #2774ae;
+ font-family: 'DM Sans', sans-serif;
+ font-size: 1.2rem;
+ text-anchor: middle;
+}
+
+.animatedCircle {
+ animation: animateCircle 1s linear infinite;
+}
+
+@keyframes animateCircle {
+ 0% {
+ stroke-dashoffset: 628.32; /* Start hidden */
+ }
+ 30% {
+ stroke-dashoffset: 314.16; /* Halfway drawn (half of the circle) */
+ }
+ 75% {
+ stroke-dashoffset: -471.24;
+ }
+ 100% {
+ stroke-dashoffset: -628.32; /* Fully drawn (circle completed) */
+ }
+}
diff --git a/app/upload-match/page.js b/app/upload-match/page.js
index 9614b77..c6e9345 100644
--- a/app/upload-match/page.js
+++ b/app/upload-match/page.js
@@ -3,13 +3,14 @@
import React, { useState, useEffect, useCallback } from 'react'
import Form from '@rjsf/core'
import validator from '@rjsf/validator-ajv8'
+import { dataURItoBlob } from '@rjsf/utils'
import getTeams from '@/app/services/getTeams.js'
import { initialSchema, uiSchema } from '@/app/services/matchSchemas.js'
import { searchableProperties } from '@/app/services/searchableProperties.js'
-import { useData } from '@/app/components/DataProvider.js'
-import { useAuth } from '@/app/components/AuthWrapper.js'
+import { useData } from '@/app/DataProvider.js'
+import { useAuth } from '@/app/AuthWrapper.js'
import styles from '@/app/styles/Upload.module.css'
@@ -101,6 +102,7 @@ export default function UploadMatchForm() {
const handleSubmit = async ({ formData }) => {
try {
+ let published = true
const pointsJson = formData.jsonFile
? JSON.parse(atob(formData.jsonFile.split(',')[1]))
: []
@@ -109,6 +111,7 @@ export default function UploadMatchForm() {
"You're currently uploading an UNTAGGED match. Proceed?"
)
if (!result) throw new Error('Upload cancelled by user.')
+ published = false
}
const teams = {
clientTeam: formData.clientTeam,
@@ -139,7 +142,9 @@ export default function UploadMatchForm() {
matchVenue: formData.matchVenue || null,
round: formData.round || null,
indoor: formData.court ? formData.court === 'Indoor' : null,
- surface: formData.surface || null
+ surface: formData.surface || null,
+ unfinished: formData.unfinished || false,
+ duel: formData.duel || false
}
// const sets = parseMatchScore(formData.matchScore);
const sets = [
@@ -153,7 +158,7 @@ export default function UploadMatchForm() {
sets,
videoId: formData.videoID,
pointsJson,
- pdfFile: formData.pdfFile || null,
+ pdfFile: formData.pdfFile ? dataURItoBlob(formData.pdfFile) : null,
teams,
players,
matchDate: formData.date,
@@ -161,7 +166,7 @@ export default function UploadMatchForm() {
matchDetails,
searchableProperties,
version: 'v1', // Current version for new matches added
- published: false
+ published
})
alert('Match uploaded successfully!')
diff --git a/package-lock.json b/package-lock.json
index 50692f3..e48a292 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,6 +9,7 @@
"version": "0.1.0",
"dependencies": {
"@rjsf/core": "^5.19.3",
+ "@rjsf/utils": "^5.23.1",
"@rjsf/validator-ajv8": "^5.19.3",
"firebase": "^10.7.1",
"fuse.js": "^7.0.0",
@@ -2776,10 +2777,9 @@
}
},
"node_modules/@rjsf/utils": {
- "version": "5.22.4",
- "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.22.4.tgz",
- "integrity": "sha512-yQTdz5ryiYy258xCVthVPQ3DeaMzrRNrFcO8xvGHorp0/bLUxdTZ0iidXop49m3y8SaxxTZd398ZKWg2cqxiIA==",
- "peer": true,
+ "version": "5.23.1",
+ "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.23.1.tgz",
+ "integrity": "sha512-cXnWgUdfeWWCsTIKamMdaP8q8lfFTvJfNQ8UyQlAumU/+hQQMOzVcyd/cVOlqWyV/JyTKrQMZOuQc9yXkka9FA==",
"dependencies": {
"json-schema-merge-allof": "^0.8.1",
"jsonpointer": "^5.0.1",
@@ -3852,7 +3852,6 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/compute-gcd/-/compute-gcd-1.2.1.tgz",
"integrity": "sha512-TwMbxBNz0l71+8Sc4czv13h4kEqnchV9igQZBi6QUaz09dnz13juGnnaWWJTRsP3brxOoxeB4SA2WELLw1hCtg==",
- "peer": true,
"dependencies": {
"validate.io-array": "^1.0.3",
"validate.io-function": "^1.0.2",
@@ -3863,7 +3862,6 @@
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/compute-lcm/-/compute-lcm-1.1.2.tgz",
"integrity": "sha512-OFNPdQAXnQhDSKioX8/XYT6sdUlXwpeMjfd6ApxMJfyZ4GxmLR1xvMERctlYhlHwIiz6CSpBc2+qYKjHGZw4TQ==",
- "peer": true,
"dependencies": {
"compute-gcd": "^1.2.1",
"validate.io-array": "^1.0.3",
@@ -6232,7 +6230,6 @@
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/json-schema-compare/-/json-schema-compare-0.2.2.tgz",
"integrity": "sha512-c4WYmDKyJXhs7WWvAWm3uIYnfyWFoIp+JEoX34rctVvEkMYCPGhXtvmFFXiffBbxfZsvQ0RNnV5H7GvDF5HCqQ==",
- "peer": true,
"dependencies": {
"lodash": "^4.17.4"
}
@@ -6241,7 +6238,6 @@
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/json-schema-merge-allof/-/json-schema-merge-allof-0.8.1.tgz",
"integrity": "sha512-CTUKmIlPJbsWfzRRnOXz+0MjIqvnleIXwFTzz+t9T86HnYX/Rozria6ZVGLktAU9e+NygNljveP+yxqtQp/Q4w==",
- "peer": true,
"dependencies": {
"compute-lcm": "^1.1.2",
"json-schema-compare": "^0.2.2",
@@ -6279,7 +6275,6 @@
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz",
"integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==",
- "peer": true,
"engines": {
"node": ">=0.10.0"
}
@@ -7395,8 +7390,7 @@
"node_modules/react-is": {
"version": "18.3.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz",
- "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==",
- "peer": true
+ "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg=="
},
"node_modules/react-select": {
"version": "5.8.3",
@@ -8525,20 +8519,17 @@
"node_modules/validate.io-array": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/validate.io-array/-/validate.io-array-1.0.6.tgz",
- "integrity": "sha512-DeOy7CnPEziggrOO5CZhVKJw6S3Yi7e9e65R1Nl/RTN1vTQKnzjfvks0/8kQ40FP/dsjRAOd4hxmJ7uLa6vxkg==",
- "peer": true
+ "integrity": "sha512-DeOy7CnPEziggrOO5CZhVKJw6S3Yi7e9e65R1Nl/RTN1vTQKnzjfvks0/8kQ40FP/dsjRAOd4hxmJ7uLa6vxkg=="
},
"node_modules/validate.io-function": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/validate.io-function/-/validate.io-function-1.0.2.tgz",
- "integrity": "sha512-LlFybRJEriSuBnUhQyG5bwglhh50EpTL2ul23MPIuR1odjO7XaMLFV8vHGwp7AZciFxtYOeiSCT5st+XSPONiQ==",
- "peer": true
+ "integrity": "sha512-LlFybRJEriSuBnUhQyG5bwglhh50EpTL2ul23MPIuR1odjO7XaMLFV8vHGwp7AZciFxtYOeiSCT5st+XSPONiQ=="
},
"node_modules/validate.io-integer": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/validate.io-integer/-/validate.io-integer-1.0.5.tgz",
"integrity": "sha512-22izsYSLojN/P6bppBqhgUDjCkr5RY2jd+N2a3DCAUey8ydvrZ/OkGvFPR7qfOpwR2LC5p4Ngzxz36g5Vgr/hQ==",
- "peer": true,
"dependencies": {
"validate.io-number": "^1.0.3"
}
@@ -8547,7 +8538,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/validate.io-integer-array/-/validate.io-integer-array-1.0.0.tgz",
"integrity": "sha512-mTrMk/1ytQHtCY0oNO3dztafHYyGU88KL+jRxWuzfOmQb+4qqnWmI+gykvGp8usKZOM0H7keJHEbRaFiYA0VrA==",
- "peer": true,
"dependencies": {
"validate.io-array": "^1.0.3",
"validate.io-integer": "^1.0.4"
@@ -8556,8 +8546,7 @@
"node_modules/validate.io-number": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/validate.io-number/-/validate.io-number-1.0.3.tgz",
- "integrity": "sha512-kRAyotcbNaSYoDnXvb4MHg/0a1egJdLwS6oJ38TJY7aw9n93Fl/3blIXdyYvPOp55CNxywooG/3BcrwNrBpcSg==",
- "peer": true
+ "integrity": "sha512-kRAyotcbNaSYoDnXvb4MHg/0a1egJdLwS6oJ38TJY7aw9n93Fl/3blIXdyYvPOp55CNxywooG/3BcrwNrBpcSg=="
},
"node_modules/websocket-driver": {
"version": "0.7.4",
diff --git a/package.json b/package.json
index 9b2f64b..f4883c1 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,7 @@
},
"dependencies": {
"@rjsf/core": "^5.19.3",
+ "@rjsf/utils": "^5.23.1",
"@rjsf/validator-ajv8": "^5.19.3",
"firebase": "^10.7.1",
"fuse.js": "^7.0.0",