From 29e7d13674f4edd5ea19a828d24ef33d58f57933 Mon Sep 17 00:00:00 2001 From: Yuze Fu Date: Sun, 15 Sep 2024 14:53:07 +0900 Subject: [PATCH] feat: callsign and aircraft type --- Net.Vatprc.Uniapi.UI.Event/package.json | 2 +- Net.Vatprc.Uniapi.UI.Event/src/api.d.ts | 6 + .../src/components/datetime.tsx | 7 +- .../src/components/slot-button-book.tsx | 9 +- .../src/components/slot-button-release.tsx | 9 +- .../src/components/slot-detail.tsx | 18 + .../src/components/slot-import.tsx | 24 +- .../src/routes/events/$event_id.tsx | 21 +- .../Controllers/EventSlotController.cs | 12 + ...SlotAddCallsignAndAircraftType.Designer.cs | 546 ++++++++++++++++++ ...017_EventSlotAddCallsignAndAircraftType.cs | 38 ++ .../Migrations/VATPRCContextModelSnapshot.cs | 8 + Net.Vatprc.Uniapi/Models/EventSlot.cs | 3 + 13 files changed, 690 insertions(+), 13 deletions(-) create mode 100644 Net.Vatprc.Uniapi/Migrations/20240915052017_EventSlotAddCallsignAndAircraftType.Designer.cs create mode 100644 Net.Vatprc.Uniapi/Migrations/20240915052017_EventSlotAddCallsignAndAircraftType.cs diff --git a/Net.Vatprc.Uniapi.UI.Event/package.json b/Net.Vatprc.Uniapi.UI.Event/package.json index d9c29e8..f95f1c6 100644 --- a/Net.Vatprc.Uniapi.UI.Event/package.json +++ b/Net.Vatprc.Uniapi.UI.Event/package.json @@ -5,7 +5,7 @@ "private": true, "type": "module", "scripts": { - "dev": "vite --port 3000", + "dev": "vite --port 3000 --open", "build": "vite build", "serve": "vite preview", "lint:eslint": "eslint 'src/**/*.{ts,tsx}'", diff --git a/Net.Vatprc.Uniapi.UI.Event/src/api.d.ts b/Net.Vatprc.Uniapi.UI.Event/src/api.d.ts index 5be3b8e..4392f36 100644 --- a/Net.Vatprc.Uniapi.UI.Event/src/api.d.ts +++ b/Net.Vatprc.Uniapi.UI.Event/src/api.d.ts @@ -313,6 +313,8 @@ export interface components { enter_at: string; /** Format: date-time */ leave_at?: string | null; + callsign?: string | null; + aircraft_type_icao?: string | null; }; ErrorProdResponse: { error_code: string; @@ -370,6 +372,8 @@ export interface components { /** Format: date-time */ updated_at: string; booking?: components["schemas"]["EventBookingDto"]; + callsign?: string | null; + aircraft_type_icao?: string | null; }; LoginResDto: { access_token: string; @@ -423,6 +427,8 @@ export interface components { enter_at: string; /** Format: date-time */ leave_at?: string | null; + callsign?: string | null; + aircraft_type_icao?: string | null; }; UserDto: { id: string; diff --git a/Net.Vatprc.Uniapi.UI.Event/src/components/datetime.tsx b/Net.Vatprc.Uniapi.UI.Event/src/components/datetime.tsx index 9ecd826..4fc0f47 100644 --- a/Net.Vatprc.Uniapi.UI.Event/src/components/datetime.tsx +++ b/Net.Vatprc.Uniapi.UI.Event/src/components/datetime.tsx @@ -19,7 +19,12 @@ export const DateTime = ({ return ( <> - {formatInTimeZone(time, "UTC", noDate ? "HH:mm" : "yyyy-MM-dd HH:mm")}Z + + {formatInTimeZone(time, "UTC", noDate ? "HHmm" : "yyyy-MM-dd HH:mm")} + + Z + + {!noDistance && ( diff --git a/Net.Vatprc.Uniapi.UI.Event/src/components/slot-button-book.tsx b/Net.Vatprc.Uniapi.UI.Event/src/components/slot-button-book.tsx index 71fb1ce..75a779c 100644 --- a/Net.Vatprc.Uniapi.UI.Event/src/components/slot-button-book.tsx +++ b/Net.Vatprc.Uniapi.UI.Event/src/components/slot-button-book.tsx @@ -1,3 +1,4 @@ +import { DateTime } from "./datetime"; import { paths } from "@/api"; import { invalidatePath, useApi, useApiPut } from "@/client"; import { useUser } from "@/services/auth"; @@ -54,7 +55,13 @@ export const SlotBookButton = ({ - Do you want to book this slot? + + Do you want to book the slot for {slot?.airspace?.name} at{" "} + + {slot.enter_at} + + ? +