From 13fd7fdfc00d24869bd9a1f831d6ce1c2f685f7d Mon Sep 17 00:00:00 2001 From: HumanoidSandvichDispenser Date: Wed, 11 Dec 2024 17:20:04 -0800 Subject: [PATCH] Move matches tab to team settings --- availabili.tf/src/client/index.ts | 1 + .../src/client/models/GetMatchQuery.ts | 8 +++ .../src/client/models/MatchSchema.ts | 2 +- .../src/client/models/SubmitMatchJson.ts | 1 + .../src/client/models/TeamMatchSchema.ts | 1 + .../src/client/services/DefaultService.ts | 33 ++++++---- .../src/components/AddMatchDialog.vue | 8 ++- .../src/components/LogsTfIntegrationForm.vue | 2 +- availabili.tf/src/components/MatchCard.vue | 66 +++++++++++++++++-- availabili.tf/src/router/index.ts | 12 ++-- availabili.tf/src/stores/matches.ts | 41 ++++++++++-- availabili.tf/src/views/TeamDetailsView.vue | 19 ++++-- .../views/{ => TeamSettings}/MatchesView.vue | 29 +++++--- availabili.tf/src/views/TeamSettingsView.vue | 3 + backend-flask/match.py | 23 ++++--- backend-flask/models/team_match.py | 2 + docker-compose.yml | 4 +- nginx/default.conf | 24 ------- nginx/development.conf | 30 +++++++++ 19 files changed, 229 insertions(+), 80 deletions(-) create mode 100644 availabili.tf/src/client/models/GetMatchQuery.ts rename availabili.tf/src/views/{ => TeamSettings}/MatchesView.vue (52%) delete mode 100644 nginx/default.conf create mode 100644 nginx/development.conf diff --git a/availabili.tf/src/client/index.ts b/availabili.tf/src/client/index.ts index d1cd3b4..fece2fc 100644 --- a/availabili.tf/src/client/index.ts +++ b/availabili.tf/src/client/index.ts @@ -21,6 +21,7 @@ export type { EventSchema } from './models/EventSchema'; export type { EventWithPlayerSchema } from './models/EventWithPlayerSchema'; export type { EventWithPlayerSchemaList } from './models/EventWithPlayerSchemaList'; export type { GetEventPlayersResponse } from './models/GetEventPlayersResponse'; +export type { GetMatchQuery } from './models/GetMatchQuery'; export type { MatchSchema } from './models/MatchSchema'; export type { PlayerEventRolesSchema } from './models/PlayerEventRolesSchema'; export type { PlayerRoleSchema } from './models/PlayerRoleSchema'; diff --git a/availabili.tf/src/client/models/GetMatchQuery.ts b/availabili.tf/src/client/models/GetMatchQuery.ts new file mode 100644 index 0000000..9adc97a --- /dev/null +++ b/availabili.tf/src/client/models/GetMatchQuery.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type GetMatchQuery = { + limit: (number | null); +}; + diff --git a/availabili.tf/src/client/models/MatchSchema.ts b/availabili.tf/src/client/models/MatchSchema.ts index bb1b131..0f526cd 100644 --- a/availabili.tf/src/client/models/MatchSchema.ts +++ b/availabili.tf/src/client/models/MatchSchema.ts @@ -5,7 +5,7 @@ export type MatchSchema = { blueScore: number; createdAt: string; - duration: string; + duration: number; logsTfId: number; logsTfTitle: string; matchTime: string; diff --git a/availabili.tf/src/client/models/SubmitMatchJson.ts b/availabili.tf/src/client/models/SubmitMatchJson.ts index 3316a65..33d9adf 100644 --- a/availabili.tf/src/client/models/SubmitMatchJson.ts +++ b/availabili.tf/src/client/models/SubmitMatchJson.ts @@ -4,5 +4,6 @@ /* eslint-disable */ export type SubmitMatchJson = { matchIds: Array; + teamId: number; }; diff --git a/availabili.tf/src/client/models/TeamMatchSchema.ts b/availabili.tf/src/client/models/TeamMatchSchema.ts index 740e2d9..eebec98 100644 --- a/availabili.tf/src/client/models/TeamMatchSchema.ts +++ b/availabili.tf/src/client/models/TeamMatchSchema.ts @@ -6,6 +6,7 @@ import type { MatchSchema } from './MatchSchema'; export type TeamMatchSchema = { match: MatchSchema; ourScore: number; + teamColor: string; theirScore: number; }; diff --git a/availabili.tf/src/client/services/DefaultService.ts b/availabili.tf/src/client/services/DefaultService.ts index dec8f07..bf3b07f 100644 --- a/availabili.tf/src/client/services/DefaultService.ts +++ b/availabili.tf/src/client/services/DefaultService.ts @@ -348,11 +348,13 @@ export class DefaultService { /** * get_matches_for_team * @param teamId + * @param limit * @returns TeamMatchSchemaList OK * @throws ApiError */ public getMatchesForTeam( teamId: number, + limit: (number | null), ): CancelablePromise { return this.httpRequest.request({ method: 'GET', @@ -360,6 +362,9 @@ export class DefaultService { path: { 'team_id': teamId, }, + query: { + 'limit': limit, + }, errors: { 422: `Unprocessable Content`, }, @@ -520,7 +525,7 @@ export class DefaultService { * @throws ApiError */ public deleteTeam( - teamId: string, + teamId: number, ): CancelablePromise { return this.httpRequest.request({ method: 'DELETE', @@ -542,7 +547,7 @@ export class DefaultService { * @throws ApiError */ public getTeam( - teamId: string, + teamId: number, ): CancelablePromise { return this.httpRequest.request({ method: 'GET', @@ -590,8 +595,8 @@ export class DefaultService { * @throws ApiError */ public editMemberRoles( - teamId: string, - targetPlayerId: string, + teamId: number, + targetPlayerId: number, requestBody?: EditMemberRolesJson, ): CancelablePromise { return this.httpRequest.request({ @@ -617,7 +622,7 @@ export class DefaultService { * @throws ApiError */ public getIntegrations( - teamId: string, + teamId: number, ): CancelablePromise { return this.httpRequest.request({ method: 'GET', @@ -638,7 +643,7 @@ export class DefaultService { * @throws ApiError */ public updateIntegrations( - teamId: string, + teamId: number, requestBody?: TeamIntegrationSchema, ): CancelablePromise { return this.httpRequest.request({ @@ -661,7 +666,7 @@ export class DefaultService { * @throws ApiError */ public getInvites( - teamId: string, + teamId: number, ): CancelablePromise { return this.httpRequest.request({ method: 'GET', @@ -682,7 +687,7 @@ export class DefaultService { * @throws ApiError */ public createInvite( - teamId: string, + teamId: number, ): CancelablePromise { return this.httpRequest.request({ method: 'POST', @@ -704,7 +709,7 @@ export class DefaultService { * @throws ApiError */ public revokeInvite( - teamId: string, + teamId: number, key: string, ): CancelablePromise { return this.httpRequest.request({ @@ -729,8 +734,8 @@ export class DefaultService { * @throws ApiError */ public createOrUpdatePlayer( - teamId: string, - playerId: string, + teamId: number, + playerId: number, requestBody?: AddPlayerJson, ): CancelablePromise { return this.httpRequest.request({ @@ -757,8 +762,8 @@ export class DefaultService { * @throws ApiError */ public removePlayerFromTeam( - teamId: string, - targetPlayerId: string, + teamId: number, + targetPlayerId: number, ): CancelablePromise { return this.httpRequest.request({ method: 'DELETE', @@ -781,7 +786,7 @@ export class DefaultService { * @throws ApiError */ public getTeamMembers( - teamId: string, + teamId: number, ): CancelablePromise { return this.httpRequest.request({ method: 'GET', diff --git a/availabili.tf/src/components/AddMatchDialog.vue b/availabili.tf/src/components/AddMatchDialog.vue index 24a3717..cc92ad7 100644 --- a/availabili.tf/src/components/AddMatchDialog.vue +++ b/availabili.tf/src/components/AddMatchDialog.vue @@ -1,10 +1,13 @@ diff --git a/availabili.tf/src/components/LogsTfIntegrationForm.vue b/availabili.tf/src/components/LogsTfIntegrationForm.vue index cdba23d..832894c 100644 --- a/availabili.tf/src/components/LogsTfIntegrationForm.vue +++ b/availabili.tf/src/components/LogsTfIntegrationForm.vue @@ -28,7 +28,7 @@ function disableIntegration() {