diff --git a/ems-core/public/main/Matchmaker.ts b/ems-core/public/main/Matchmaker.ts index d531084..df9d353 100644 --- a/ems-core/public/main/Matchmaker.ts +++ b/ems-core/public/main/Matchmaker.ts @@ -22,7 +22,7 @@ interface IMatchMakerOptions { let matchMakerPath = ""; if (os.type() === "Windows_NT") { if (isProd) { - matchMakerPath = path.join(__dirname, "../match-maker/macOS/MatchMaker"); + matchMakerPath = path.join(__dirname, "../match-maker/windows/MatchMaker"); } else { matchMakerPath = path.join(__dirname, "../../match-maker/windows/MatchMaker.exe"); } diff --git a/ems-core/src/managers/MatchManager.ts b/ems-core/src/managers/MatchManager.ts index 986091a..1bb993d 100644 --- a/ems-core/src/managers/MatchManager.ts +++ b/ems-core/src/managers/MatchManager.ts @@ -415,7 +415,11 @@ class MatchManager { match.matchDetails.matchKey = match.matchKey; match.matchDetails.matchDetailKey = match.matchDetailKey; for (const participant of match.participants) { - if (typeof participant.cardStatus === "undefined" || (participant.cardStatus as any) === "null") { + if (typeof participant.cardStatus === "undefined" + || (participant.cardStatus as any) === "null" + || (participant.cardStatus) > 2 + || (isNaN(participant.cardStatus)) + || (participant.cardStatus) < 0) { participant.cardStatus = 0; } } diff --git a/ems-core/src/views/event-manager/views/EventAdvancement.tsx b/ems-core/src/views/event-manager/views/EventAdvancement.tsx index 9c10ab7..99f264b 100644 --- a/ems-core/src/views/event-manager/views/EventAdvancement.tsx +++ b/ems-core/src/views/event-manager/views/EventAdvancement.tsx @@ -10,7 +10,7 @@ import {Dispatch} from "redux"; import {connect} from "react-redux"; import {Card, Tab, TabProps} from "semantic-ui-react"; import {SyntheticEvent} from "react"; -import TournamentRound from "@the-orange-alliance/lib-ems/dist/models/ems/TournamentRound"; +import {Team, TournamentRound} from "@the-orange-alliance/lib-ems"; import TournamentRoundCard from "../../../components/TournamentRoundCard"; import {CONFIG_STORE} from "../../../AppStore"; import DialogManager from "../../../managers/DialogManager"; @@ -30,6 +30,7 @@ interface IProps { playoffsMatches: Match[], eventConfig?: EventConfiguration, event?: Event, + teams?: Team[], toaConfig?: TOAConfig, navigationDisabled?: boolean, setNavigationDisabled?: (disabled: boolean) => IDisableNavigation, @@ -162,22 +163,28 @@ class EventAdvancementView extends React.Component { } private onPublishSchedule() { + const {eventConfig, teams, playoffsSchedule} = this.props; this.props.setNavigationDisabled(true); const matches: Match[] = this.props.playoffsMatches.filter((m: Match) => m.matchKey.split("-")[3].substring(1, 2) === (this.props.eventConfig.activeTournamentID + "")); - if (this.props.toaConfig.enabled) { - UploadManager.postMatchSchedule(this.props.event.eventKey, matches).then(() => { - console.log(`${matches.length} matches have been posted to TOA.`); + EventCreationManager.createRanks(teams.filter((t: Team) => playoffsSchedule[eventConfig.activeTournamentID].teams.indexOf(t.teamKey) > 0), this.props.event.eventKey).then(() => { + if (this.props.toaConfig.enabled) { + UploadManager.postMatchSchedule(this.props.event.eventKey, matches).then(() => { + console.log(`${matches.length} matches have been posted to TOA.`); + }).catch((error: HttpError) => { + DialogManager.showErrorBox(error); + }); + } + EventCreationManager.createPlayoffsSchedule(matches).then(() => { + this.props.setNavigationDisabled(false); + this.props.onComplete(); }).catch((error: HttpError) => { + console.log(error); + this.props.setNavigationDisabled(false); DialogManager.showErrorBox(error); }); - } - EventCreationManager.createPlayoffsSchedule(matches).then(() => { + }).catch((rankError: HttpError) => { this.props.setNavigationDisabled(false); - this.props.onComplete(); - }).catch((error: HttpError) => { - console.log(error); - this.props.setNavigationDisabled(false); - DialogManager.showErrorBox(error); + DialogManager.showErrorBox(rankError); }); } @@ -227,6 +234,7 @@ function mapStateToProps({configState, internalState}: IApplicationState) { return { event: configState.event, eventConfig: configState.eventConfiguration, + team: internalState.teamList, toaConfig: configState.toaConfig, playoffsSchedule: configState.playoffsSchedule, playoffsMatches: internalState.playoffsMatches diff --git a/ems-core/src/views/match-play/containers/MatchPlay.tsx b/ems-core/src/views/match-play/containers/MatchPlay.tsx index 07174d0..42b7c96 100644 --- a/ems-core/src/views/match-play/containers/MatchPlay.tsx +++ b/ems-core/src/views/match-play/containers/MatchPlay.tsx @@ -317,6 +317,11 @@ class MatchPlay extends React.Component { this.setState({committingScores: true}); activeMatch.matchDetails = this.props.activeDetails; activeMatch.participants = this.props.activeParticipants; + for (const participant of activeMatch.participants) { + if ([0, 1 , 2].indexOf(participant.cardStatus) < 0) { + participant.cardStatus = 0; + } + } MatchManager.commitScores(activeMatch, eventConfig).then(() => { if (this.props.toaConfig.enabled) { UploadManager.postMatchResults(event.eventKey, activeMatch).then(() => { diff --git a/ems-home/src/pages/DownloadsPage.tsx b/ems-home/src/pages/DownloadsPage.tsx index 9ce6658..867a7ec 100644 --- a/ems-home/src/pages/DownloadsPage.tsx +++ b/ems-home/src/pages/DownloadsPage.tsx @@ -32,7 +32,7 @@ class DownloadsPage extends React.Component { - +