Lepsi verejna cast, ssr, lepsi prace s fotkamaa

This commit is contained in:
Michal Kváček
2023-12-04 22:46:23 +01:00
parent 11cc6ad107
commit 3bd4d7ba52
62 changed files with 1331 additions and 619 deletions
+27 -10
View File
@@ -1,4 +1,6 @@
import gql from "graphql-tag";
import {FRAGMENT_PHOTO_FULL_INFO} from "src/graphql/fragments/photo";
import {FRAGMENT_FLIGHT_LIST_INFO} from "src/graphql/fragments/flight_list";
export const FRAGMENT_AIRCRAFT_FULL_INFO = gql`
fragment aircraftFullInfo on Aircraft {
@@ -7,9 +9,15 @@ fragment aircraftFullInfo on Aircraft {
model
description
manufacturer
photoUrl
seats
createdById
isPublic
titlePhoto {
id
url
}
organization {
id
@@ -18,15 +26,24 @@ fragment aircraftFullInfo on Aircraft {
}
`;
export const FRAGMENT_AIRCRAFT_BASIC_INFO = gql`
fragment aircraftBasicInfo on Aircraft {
id
callSign
manufacturer
export const FRAGMENT_AIRCRAFT_FULL_PRIVATE_INFO = gql`
fragment aircraftFullPrivateInfo on Aircraft {
...aircraftFullInfo
photos {
...photoFullInfo
organization {
id
name
}
copilots {
id
name
}
}
flights {
...flightListInfo
}
}
${FRAGMENT_AIRCRAFT_FULL_INFO}
${FRAGMENT_PHOTO_FULL_INFO}
${FRAGMENT_FLIGHT_LIST_INFO}
`;
+14
View File
@@ -0,0 +1,14 @@
import gql from "graphql-tag";
export const FRAGMENT_AIRCRAFT_BASIC_INFO = gql`
fragment aircraftBasicInfo on Aircraft {
id
callSign
manufacturer
organization {
id
name
}
}
`;
+5
View File
@@ -11,5 +11,10 @@ export const FRAGMENT_COPILOT_FULL_INFO = gql`
fragment copilotFullInfo on Copilot {
id
name
titlePhoto {
id
url
}
}
`;
+32 -19
View File
@@ -28,15 +28,28 @@ fragment flightFullInfo on Flight {
durationMinCalculated
isPublic
coverPhoto {
titlePhoto {
thumbnailUrl
url
id
}
takeoffAirport {
...airportInfo
}
landingAirport {
...airportInfo
}
landingWeatherInfo {
...weatherFullInfo
}
takeoffWeatherInfo {
...weatherFullInfo
}
copilots {
id
name
@@ -73,30 +86,30 @@ fragment flightFullInfo on Flight {
landingDuration
}
landingAirport {
...airportInfo
}
landingWeatherInfo {
...weatherFullInfo
}
takeoffWeatherInfo {
...weatherFullInfo
}
aircraft {
...aircraftFullInfo
}
photos {
...photoFullInfo
}
}
${FRAGMENT_PHOTO_FULL_INFO}
${FRAGMENT_AIRCRAFT_FULL_INFO}
${FRAGMENT_AIRPORT_INFO}
${FRAGMENT_POI_FULL_INFO}
${FRAGMENT_WEATHER_FULL_INFO}
`;
export const FRAGMENT_FLIGHT_FULL_PRIVATE_INFO = gql`
fragment flightFullPrivateInfo on Flight {
...flightFullInfo
photos {
...photoFullInfo
copilots {
id
name
}
}
}
${FRAGMENT_FLIGHT_FULL_INFO}
${FRAGMENT_PHOTO_FULL_INFO}
`;
+4 -2
View File
@@ -1,6 +1,6 @@
import gql from "graphql-tag";
import {FRAGMENT_AIRPORT_INFO} from "src/graphql/fragments/airport";
import {FRAGMENT_AIRCRAFT_BASIC_INFO} from "src/graphql/fragments/aircraft";
import {FRAGMENT_AIRCRAFT_BASIC_INFO} from "src/graphql/fragments/aircraft_basic";
export const FRAGMENT_FLIGHT_LIST_INFO = gql`
fragment flightListInfo on Flight {
@@ -11,13 +11,15 @@ fragment flightListInfo on Flight {
durationMinCalculated
isPublic
coverPhoto {
titlePhoto {
thumbnailUrl
}
track {
pointOfInterest {
id
name
isPublic
}
airport {
icaoCode
+1 -1
View File
@@ -1,5 +1,5 @@
import gql from "graphql-tag";
import {FRAGMENT_AIRCRAFT_BASIC_INFO} from "src/graphql/fragments/aircraft";
import {FRAGMENT_AIRCRAFT_BASIC_INFO} from "src/graphql/fragments/aircraft_basic";
export const FRAGMENT_ORGANIZATION_LIST_INFO = gql`
fragment organizationListInfo on Organization {
+5 -4
View File
@@ -9,10 +9,7 @@ export const FRAGMENT_PHOTO_FULL_INFO = gql`
name
description
flightId
pointOfInterest {
id
name
}
isAircraft
width
height
isFlightCover
@@ -21,4 +18,8 @@ export const FRAGMENT_PHOTO_FULL_INFO = gql`
gpsAltitude
terrainElevation
exposedAt
copilots {
id
name
}
}`;
+28 -9
View File
@@ -1,6 +1,8 @@
import gql from "graphql-tag";
import {FRAGMENT_PHOTO_FULL_INFO} from "src/graphql/fragments/photo";
import {FRAGMENT_FLIGHT_LIST_INFO} from "src/graphql/fragments/flight_list";
export const FRAGMENT_POI_LIST_INFO = gql`
fragment pointOfInterestListInfo on PointOfInterest {
id
@@ -22,20 +24,37 @@ fragment pointOfInterestFullInfo on PointOfInterest {
gpsLatitude
gpsLongitude
createdById
titlePhoto {
id
url
}
type {
id
name
}
flights {
...flightListInfo
}
photos {
thumbnailUrl
url
name
description
}
}
`;
export const FRAGMENT_POI_FULL_PRIVATE_INFO = gql`
fragment pointOfInterestFullPrivateInfo on PointOfInterest {
...pointOfInterestFullInfo
flights {
...flightListInfo
}
photos {
...photoFullInfo
copilots {
id
name
}
}
}
${FRAGMENT_POI_FULL_INFO}
${FRAGMENT_PHOTO_FULL_INFO}
${FRAGMENT_FLIGHT_LIST_INFO}
`;
+5 -5
View File
@@ -1,24 +1,24 @@
import gql from "graphql-tag";
import {FRAGMENT_AIRCRAFT_FULL_INFO} from "src/graphql/fragments/aircraft";
import {FRAGMENT_AIRCRAFT_FULL_PRIVATE_INFO} from "src/graphql/fragments/aircraft";
export const CREATE_AIRCRAFT = gql`
mutation createAircraft($input: CreateAircraftInput!) {
createAircraft(input: $input) {
...aircraftFullInfo
...aircraftFullPrivateInfo
}
}
${FRAGMENT_AIRCRAFT_FULL_INFO}
${FRAGMENT_AIRCRAFT_FULL_PRIVATE_INFO}
`;
export const EDIT_AIRCRAFT = gql`
mutation editAircraft($id: Int!, $input: EditAircraftInput!) {
editAircraft(id: $id, input: $input) {
...aircraftFullInfo
...aircraftFullPrivateInfo
}
}
${FRAGMENT_AIRCRAFT_FULL_INFO}
${FRAGMENT_AIRCRAFT_FULL_PRIVATE_INFO}
`;
export const DELETE_AIRCRAFT = gql`
mutation deleteAircraft($id: Int!) {
+5 -5
View File
@@ -1,23 +1,23 @@
import gql from "graphql-tag";
import {FRAGMENT_FLIGHT_FULL_INFO} from "src/graphql/fragments/flight";
import {FRAGMENT_FLIGHT_FULL_PRIVATE_INFO} from "src/graphql/fragments/flight";
export const CREATE_FLIGHT = gql`
mutation createFlight($input: CreateFlightInput!) {
createFlight(input: $input) {
...flightFullInfo
...flightFullPrivateInfo
}
}
${FRAGMENT_FLIGHT_FULL_INFO}
${FRAGMENT_FLIGHT_FULL_PRIVATE_INFO}
`;
export const EDIT_FLIGHT = gql`
mutation editFlight($id: Int!, $input: EditFlightInput!) {
editFlight(id: $id, input: $input) {
...flightFullInfo
...flightFullPrivateInfo
}
}
${FRAGMENT_FLIGHT_FULL_INFO}
${FRAGMENT_FLIGHT_FULL_PRIVATE_INFO}
`;
+5 -5
View File
@@ -1,22 +1,22 @@
import gql from "graphql-tag";
import {FRAGMENT_POI_FULL_INFO, FRAGMENT_POI_LIST_INFO} from "src/graphql/fragments/poi";
import {FRAGMENT_POI_FULL_PRIVATE_INFO} from "src/graphql/fragments/poi";
export const CREATE_POI = gql`
mutation createPointOfInterest($input: CreatePointOfInterestInput!) {
createPointOfInterest(input: $input) {
...pointOfInterestFullInfo
...pointOfInterestFullPrivateInfo
}
}
${FRAGMENT_POI_FULL_INFO}
${FRAGMENT_POI_FULL_PRIVATE_INFO}
`;
export const EDIT_POI = gql`
mutation editPointOfInterest($id: Int!, $input: EditPointOfInterestInput!) {
editPointOfInterest(id: $id, input: $input) {
...pointOfInterestFullInfo
...pointOfInterestFullPrivateInfo
}
}
${FRAGMENT_POI_FULL_INFO}
${FRAGMENT_POI_FULL_PRIVATE_INFO}
`;
+10 -8
View File
@@ -1,6 +1,5 @@
import gql from "graphql-tag";
import {FRAGMENT_AIRCRAFT_FULL_INFO} from "src/graphql/fragments/aircraft";
import {FRAGMENT_FLIGHT_LIST_INFO} from "src/graphql/fragments/flight_list";
import {FRAGMENT_AIRCRAFT_FULL_INFO, FRAGMENT_AIRCRAFT_FULL_PRIVATE_INFO} from "src/graphql/fragments/aircraft";
export const AIRCRAFTS_LIST = gql`
query AircraftsList {
@@ -16,14 +15,17 @@ ${FRAGMENT_AIRCRAFT_FULL_INFO}
export const AIRCRAFT_DETAIL = gql`
query AircraftDetail($id: Int!) {
aircraft(id: $id) {
...aircraftFullPrivateInfo
}
}
${FRAGMENT_AIRCRAFT_FULL_PRIVATE_INFO}
`;
export const AIRCRAFT_PUBLIC_DETAIL = gql`
query AircraftDetail($id: Int!) {
aircraft(id: $id, public: true) {
...aircraftFullInfo
flights {
...flightListInfo
}
}
}
${FRAGMENT_AIRCRAFT_FULL_INFO}
${FRAGMENT_FLIGHT_LIST_INFO}
`;
+16
View File
@@ -1,6 +1,7 @@
import gql from "graphql-tag";
import {FRAGMENT_FLIGHT_LIST_INFO} from "src/graphql/fragments/flight_list";
import {FRAGMENT_COPILOT_FULL_INFO, FRAGMENT_COPILOT_LIST_INFO} from "src/graphql/fragments/copilot";
import {FRAGMENT_PHOTO_FULL_INFO} from "src/graphql/fragments/photo";
export const COPILOTS_LIST = gql`
query copilotsList {
@@ -17,12 +18,27 @@ query copilot($id: Int!, $pilotUsername: String) {
copilot(id: $id, pilotUsername: $pilotUsername) {
...copilotFullInfo
photos {
...photoFullInfo
}
flights {
...flightListInfo
}
}
}
${FRAGMENT_PHOTO_FULL_INFO}
${FRAGMENT_COPILOT_FULL_INFO}
${FRAGMENT_FLIGHT_LIST_INFO}
`;
export const COPILOT_PUBLIC_DETAIL = gql`
query copilot($id: Int!, $pilotUsername: String) {
copilot(id: $id, pilotUsername: $pilotUsername) {
...copilotFullInfo
}
}
${FRAGMENT_COPILOT_FULL_INFO}
`;
+1 -1
View File
@@ -8,7 +8,7 @@ query eventsList($username: String) {
...eventListInfo
flights {
coverPhoto {
titlePhoto {
thumbnailUrl
}
}
+28 -3
View File
@@ -1,19 +1,44 @@
import gql from "graphql-tag";
import {FRAGMENT_FLIGHT_FULL_INFO} from "src/graphql/fragments/flight";
import {FRAGMENT_FLIGHT_FULL_INFO, FRAGMENT_FLIGHT_FULL_PRIVATE_INFO} from "src/graphql/fragments/flight";
import {FRAGMENT_FLIGHT_LIST_INFO} from "src/graphql/fragments/flight_list";
import {FRAGMENT_PHOTO_FULL_INFO} from "src/graphql/fragments/photo";
export const FLIGHTS_LIST = gql`
query FlightsList($username: String) {
flights(username: $username) {
query FlightsList {
flights {
...flightListInfo
}
}
${FRAGMENT_FLIGHT_LIST_INFO}
`;
export const FLIGHTS_PUBLIC_LIST = gql`
query FlightsPublicList($username: String, $aircraftId: Int, $copilotId: Int, $pointOfInterestId: Int) {
flights(username: $username, aircraftId: $aircraftId, copilotId: $copilotId, pointOfInterestId: $pointOfInterestId, public: true) {
...flightListInfo
pilot {
id
publicUsername
}
}
}
${FRAGMENT_FLIGHT_LIST_INFO}
`;
export const FLIGHT_DETAIL = gql`
query FlightDetail($id: Int!, $username: String) {
flight(id: $id, username: $username) {
...flightFullPrivateInfo
}
}
${FRAGMENT_FLIGHT_FULL_PRIVATE_INFO}
`;
export const FLIGHT_PUBLIC_DETAIL = gql`
query FlightPublicDetail($id: Int!, $username: String) {
flight(id: $id, username: $username, public: true) {
...flightFullInfo
}
}
+20
View File
@@ -7,6 +7,15 @@ query photo($id: Int!) {
photo(id: $id) {
...photoFullInfo
pointOfInterest {
id
name
}
copilots {
id
name
}
adjustment {
contrast
saturation
@@ -28,3 +37,14 @@ query photo($id: Int!) {
${FRAGMENT_PHOTO_FULL_INFO}
${FRAGMENT_FLIGHT_LIST_INFO}
`;
export const PHOTOS_PUBLIC_LIST = gql`
query photos($flightId: Int, $pointOfInterestId: Int, $aircraftId: Int, $copilotId: Int) {
photos(public: true, flightId: $flightId, pointOfInterestId: $pointOfInterestId, aircraftId: $aircraftId, copilotId: $copilotId) {
...photoFullInfo
}
}
${FRAGMENT_PHOTO_FULL_INFO}
`;
+21 -1
View File
@@ -1,5 +1,5 @@
import gql from "graphql-tag";
import {FRAGMENT_POI_FULL_INFO, FRAGMENT_POI_LIST_INFO} from "src/graphql/fragments/poi";
import {FRAGMENT_POI_FULL_INFO, FRAGMENT_POI_FULL_PRIVATE_INFO, FRAGMENT_POI_LIST_INFO} from "src/graphql/fragments/poi";
export const POI_LIST = gql`
query poiList {
@@ -11,9 +11,29 @@ query poiList {
${FRAGMENT_POI_LIST_INFO}
`;
export const POI_PUBLIC_LIST = gql`
query poiList {
pointsOfInterest(public: true) {
...pointOfInterestListInfo
}
}
${FRAGMENT_POI_LIST_INFO}
`;
export const POI_DETAIL = gql`
query poiDetail($id: Int!) {
pointOfInterest(id: $id) {
...pointOfInterestFullPrivateInfo
}
}
${FRAGMENT_POI_FULL_PRIVATE_INFO}
`;
export const POI_PUBLIC_DETAIL = gql`
query poiDetail($id: Int!) {
pointOfInterest(id: $id, public: true) {
...pointOfInterestFullInfo
}
}