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
|
||||
|
||||
Reference in New Issue
Block a user