Uprava publikovani objektu, bugfixing
This commit is contained in:
@@ -49,8 +49,8 @@ const deleteAircraft = (id) => {
|
||||
});
|
||||
};
|
||||
|
||||
const togglePublicVisibility = () => toggleVisibility({
|
||||
$q, store: useAircraftsStore(), object: aircraft.value
|
||||
const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
$q, store: useAircraftsStore(), object: aircraft.value, variables
|
||||
});
|
||||
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
|
||||
@@ -39,8 +39,8 @@ const {isQueryRunning, copilot} = storeToRefs(useCopilotsStore());
|
||||
const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
|
||||
const $q = useQuasar();
|
||||
const togglePublicVisibility = (data) => toggleVisibility({
|
||||
$q, store: useCopilotsStore(), object: copilot.value, urlSlug: data.urlSlug
|
||||
const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
$q, store: useCopilotsStore(), object: copilot.value, variables
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -10,6 +10,12 @@ import {useEventsStore} from "stores/Events";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {loadPage, paginationLimit} from "src/composables/pagination";
|
||||
import {useFlightsStore} from "stores/Flights";
|
||||
import PublishButton from "components/inputs/PublishButton.vue";
|
||||
import {useLoggedUserStore} from "stores/LoggedUser";
|
||||
import {toggleVisibility} from "src/composables/form/formHandling";
|
||||
import {TOGGLE_FLIGHT_PUBLISH} from "src/graphql/mutations/flight";
|
||||
import {useQuasar} from "quasar";
|
||||
import CopyLinkButton from "components/inputs/CopyLinkButton.vue";
|
||||
|
||||
const eventId = parseInt(useRoute().params.id);
|
||||
onMounted(() => {
|
||||
@@ -32,6 +38,13 @@ const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
});
|
||||
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
|
||||
|
||||
const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
|
||||
const $q = useQuasar();
|
||||
const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
$q, store: useEventsStore(), object: event.value, variables
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -52,6 +65,16 @@ const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRef
|
||||
</q-item>
|
||||
</q-list>
|
||||
|
||||
<PublishButton
|
||||
:url-prefix="`${loggedUser.publicUsername}/udalosti/`"
|
||||
:is-public="event.isPublic"
|
||||
:require-url-slug="event.urlSlug === ''"
|
||||
@change-visibility="togglePublicVisibility"
|
||||
/>
|
||||
<CopyLinkButton
|
||||
:route="{name: 'publicEventDetail', params: {username: loggedUser.publicUsername, eventSlug: event.urlSlug}}"
|
||||
/>
|
||||
|
||||
<article v-html="event.description"/>
|
||||
|
||||
<h3>Lety</h3>
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
<script>
|
||||
import {useFlightsStore} from "stores/Flights";
|
||||
|
||||
export default {
|
||||
preFetch({currentRoute}) {
|
||||
useFlightsStore().fetchDetail(currentRoute.params.id);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script setup>
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {watch} from "vue";
|
||||
@@ -7,7 +17,6 @@ import {useAppStore} from "stores/App";
|
||||
import FlightBasicInfo from "components/flights/FlightBasicInfo.vue";
|
||||
import {useQuasar} from "quasar";
|
||||
import {confirmObject, successObject} from "src/composables/dialog";
|
||||
import {useFlightsStore} from "stores/Flights";
|
||||
import FlightTrackMap from "components/flights/FlightTrackMap.vue";
|
||||
import {useLoggedUserStore} from "stores/LoggedUser";
|
||||
import {storeToRefs} from "pinia";
|
||||
@@ -18,11 +27,11 @@ import ContentCardEditButton from "components/ContentCardEditButton.vue";
|
||||
import {toggleVisibility} from "src/composables/form/formHandling";
|
||||
import PublishButton from "components/inputs/PublishButton.vue";
|
||||
import CopyLinkButton from "components/inputs/CopyLinkButton.vue";
|
||||
import {TOGGLE_FLIGHT_PUBLISH} from "src/graphql/mutations/flight";
|
||||
|
||||
const flightId = parseInt(useRoute().params.id);
|
||||
const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
|
||||
useFlightsStore().fetchDetail(flightId);
|
||||
const {isQueryRunning, flight} = storeToRefs(useFlightsStore());
|
||||
watch(() => flight.value, (f) => {
|
||||
if (!f) return;
|
||||
@@ -46,11 +55,8 @@ const handleDeleteAndRedirect = () => {
|
||||
});
|
||||
}
|
||||
|
||||
const togglePublicVisibility = (data) => toggleVisibility({
|
||||
$q,
|
||||
store: useFlightsStore(),
|
||||
object: flight.value,
|
||||
urlSlug: data.isPublic ? data.urlSlug : undefined
|
||||
const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
$q, store: useFlightsStore(), object: flight.value, mutation: TOGGLE_FLIGHT_PUBLISH, variables
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRef
|
||||
const {isQueryRunning, pointOfInterest} = storeToRefs(usePointsOfInterestStore());
|
||||
|
||||
const $q = useQuasar();
|
||||
const togglePublicVisibility = (data) => toggleVisibility({
|
||||
$q, store: usePointsOfInterestStore(), object: pointOfInterest.value, urlSlug: data.urlSlug
|
||||
const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
$q, store: usePointsOfInterestStore(), object: pointOfInterest.value, variables
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import {loadPage, paginationLimit} from "src/composables/pagination";
|
||||
|
||||
useAppStore().setPageTitle("Zajímavá místa");
|
||||
|
||||
paginationLimit.value = 15;
|
||||
const loadNextPage = (appendItems) => loadPage({
|
||||
fetchFunc: usePointsOfInterestStore().fetch,
|
||||
appendItems
|
||||
|
||||
@@ -21,6 +21,7 @@ import {useMeta} from "quasar";
|
||||
import {metaData} from "src/composables/meta";
|
||||
import PhotoGallerySkeleton from "components/photos/skeletons/PhotoGallerySkeleton.vue";
|
||||
import {loadPage, paginationLimit} from "src/composables/pagination";
|
||||
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
||||
|
||||
const props = defineProps({
|
||||
pilot: {
|
||||
@@ -70,6 +71,9 @@ onMounted(() => {
|
||||
|
||||
<h3>Společné lety</h3>
|
||||
<FlightsListSkeleton v-if="areFlightsLoading && flights.length === 0"/>
|
||||
<BasicInfoBanner v-else-if="!areFlightsLoading && flights.length === 0">
|
||||
Zatím tu není žádný zveřejněný let.
|
||||
</BasicInfoBanner>
|
||||
<FlightsList
|
||||
v-else
|
||||
:items="flights"
|
||||
|
||||
@@ -19,7 +19,7 @@ import PhotoGallery from "components/photos/PhotoGallery.vue";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {flightName} from "src/composables/flight";
|
||||
import {useMeta} from "quasar";
|
||||
import {metaData} from "src/composables/meta";
|
||||
import {aircraftKeywords, metaData} from "src/composables/meta";
|
||||
import ContentCard from "components/ContentCard.vue";
|
||||
import {usePhotosStore} from "stores/Photos";
|
||||
|
||||
@@ -45,7 +45,7 @@ useAppStore().setBreadcrumbs([
|
||||
|
||||
useMeta(() => metaData({
|
||||
title: `${flightNameFormatted} - ${props.pilot.name}`,
|
||||
keywords: ["let", "výlet", "letadlo", props.pilot.name, flight.value.aircraft.callSign],
|
||||
keywords: ["let", "výlet", "letadlo", props.pilot.name, aircraftKeywords(flight.value.aircraft)],
|
||||
description: flight.value.description,
|
||||
image: flight.value.titlePhoto?.url
|
||||
}
|
||||
@@ -62,7 +62,7 @@ useMeta(() => metaData({
|
||||
<FlightBasicInfo
|
||||
:flight="flight"
|
||||
:poi-detail-route="{name: 'publicPOIDetail'}"
|
||||
:aircraft-detail-route="flight.aircraft.isPublic ? {name: 'publicAircraftDetail'} : null"
|
||||
:aircraft-detail-route="{name: 'publicAircraftDetail'}"
|
||||
:copilot-detail-route="{name: 'publicCopilotDetail', params: {username: pilot.publicUsername}}"
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user