diff --git a/Dockerfile b/Dockerfile index 31de7a2..a1b7027 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,8 @@ COPY . . # build stage FROM develop-stage as build-stage +ENV NODE_ENV production + RUN quasar build -m ssr FROM node:20-alpine as production-stage diff --git a/src/boot/apollo.js b/src/boot/apollo.js index 00cce77..9a75832 100644 --- a/src/boot/apollo.js +++ b/src/boot/apollo.js @@ -12,7 +12,7 @@ const handleRefreshToken = (store, forward, operation) => { return fromPromise(useUserStore(store).refreshAccessToken() .catch((error) => { Notify.create(warningObject("Tvoje přihlášení vypřešlo. Přihlaš se prosím znovu.")); - window.location = "/login"; + if (window) window.location = "/login"; })) .filter((value) => Boolean(value)) .flatMap((accessToken) => { diff --git a/src/components/ContentCard.vue b/src/components/ContentCard.vue index d277fdd..e06bb1e 100644 --- a/src/components/ContentCard.vue +++ b/src/components/ContentCard.vue @@ -17,16 +17,18 @@ const props = defineProps({ diff --git a/src/components/ContentCardEditButton.vue b/src/components/ContentCardEditButton.vue new file mode 100644 index 0000000..d7da0a5 --- /dev/null +++ b/src/components/ContentCardEditButton.vue @@ -0,0 +1,22 @@ + + + diff --git a/src/components/aircrafts/AircraftsList.vue b/src/components/aircrafts/AircraftsList.vue index cf55784..de1c0af 100644 --- a/src/components/aircrafts/AircraftsList.vue +++ b/src/components/aircrafts/AircraftsList.vue @@ -22,7 +22,7 @@ useAppStore().setPageTitle("Letadla"); > - + diff --git a/src/components/poi/POIList.vue b/src/components/poi/POIList.vue index 0b7dce8..226c9b4 100644 --- a/src/components/poi/POIList.vue +++ b/src/components/poi/POIList.vue @@ -10,7 +10,10 @@ const props = defineProps({ - + + + + {{ poi.name }} diff --git a/src/composables/form/formHandling.js b/src/composables/form/formHandling.js index d674963..f932bf0 100644 --- a/src/composables/form/formHandling.js +++ b/src/composables/form/formHandling.js @@ -1,3 +1,5 @@ +import {successObject} from "src/composables/dialog"; + export const setDefaultData = (formData, defaultData) => { const ignoredFields = ['__typename']; @@ -10,3 +12,12 @@ export const setDefaultData = (formData, defaultData) => { formData[key] = defaultData[key]; } } + +export const toggleVisibility = ({store, $q, object}) => { + console.log(object); + const newVisibility = !object.isPublic; + store.update(object.id, {isPublic: newVisibility}) + .then(() => { + $q.notify(successObject(newVisibility ? "Úspěšně publikováno" : "Úspěšně skryto")); + }); +} diff --git a/src/graphql/fragments/aircraft.js b/src/graphql/fragments/aircraft.js index 1c362f7..8b5d2da 100644 --- a/src/graphql/fragments/aircraft.js +++ b/src/graphql/fragments/aircraft.js @@ -2,6 +2,24 @@ 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_LIST_INFO = gql` +fragment aircraftListInfo on Aircraft { + id + callSign + model + manufacturer + isPublic + + titlePhoto { + thumbnailUrl + } + + organization { + name + } +} +`; + export const FRAGMENT_AIRCRAFT_FULL_INFO = gql` fragment aircraftFullInfo on Aircraft { id @@ -10,7 +28,6 @@ fragment aircraftFullInfo on Aircraft { description manufacturer seats - createdById isPublic @@ -29,6 +46,7 @@ fragment aircraftFullInfo on Aircraft { export const FRAGMENT_AIRCRAFT_FULL_PRIVATE_INFO = gql` fragment aircraftFullPrivateInfo on Aircraft { ...aircraftFullInfo + photos { ...photoFullInfo diff --git a/src/graphql/fragments/poi.js b/src/graphql/fragments/poi.js index ef7421d..fc92c83 100644 --- a/src/graphql/fragments/poi.js +++ b/src/graphql/fragments/poi.js @@ -8,6 +8,9 @@ fragment pointOfInterestListInfo on PointOfInterest { id name isPublic + titlePhoto { + thumbnailUrl + } type { id name diff --git a/src/graphql/queries/aircrafts.js b/src/graphql/queries/aircrafts.js index 9416347..d6e369c 100644 --- a/src/graphql/queries/aircrafts.js +++ b/src/graphql/queries/aircrafts.js @@ -1,14 +1,14 @@ import gql from "graphql-tag"; -import {FRAGMENT_AIRCRAFT_FULL_INFO, FRAGMENT_AIRCRAFT_FULL_PRIVATE_INFO} from "src/graphql/fragments/aircraft"; +import {FRAGMENT_AIRCRAFT_FULL_INFO, FRAGMENT_AIRCRAFT_FULL_PRIVATE_INFO, FRAGMENT_AIRCRAFT_LIST_INFO} from "src/graphql/fragments/aircraft"; export const AIRCRAFTS_LIST = gql` query AircraftsList { aircrafts { - ...aircraftFullInfo + ...aircraftListInfo } } -${FRAGMENT_AIRCRAFT_FULL_INFO} +${FRAGMENT_AIRCRAFT_LIST_INFO} `; diff --git a/src/graphql/queries/poi.js b/src/graphql/queries/poi.js index d0ebfd0..9c811ca 100644 --- a/src/graphql/queries/poi.js +++ b/src/graphql/queries/poi.js @@ -32,7 +32,7 @@ ${FRAGMENT_POI_FULL_PRIVATE_INFO} `; export const POI_PUBLIC_DETAIL = gql` -query poiDetail($id: Int!) { +query publicPOIDetail($id: Int!) { pointOfInterest(id: $id, public: true) { ...pointOfInterestFullInfo } diff --git a/src/pages/profile/aircraft/AircraftDetailPage.vue b/src/pages/profile/aircraft/AircraftDetailPage.vue index 3e7536c..6b474db 100644 --- a/src/pages/profile/aircraft/AircraftDetailPage.vue +++ b/src/pages/profile/aircraft/AircraftDetailPage.vue @@ -1,6 +1,6 @@ @@ -53,19 +72,34 @@ const deleteAircraft = (id) => { - - - diff --git a/src/pages/profile/aircraft/EditAircraftPage.vue b/src/pages/profile/aircraft/EditAircraftPage.vue index 7dfbebb..df69aff 100644 --- a/src/pages/profile/aircraft/EditAircraftPage.vue +++ b/src/pages/profile/aircraft/EditAircraftPage.vue @@ -76,15 +76,15 @@ const formStep = computed(() => useRoute().params.step || "basic");