Napoveda, fix filtru pro nacitani letu u objektu

This commit is contained in:
Michal Kváček
2024-02-13 23:00:37 +01:00
parent 9c9bbc9baa
commit 1a5c8f09bf
17 changed files with 189 additions and 104 deletions
@@ -16,7 +16,7 @@ import {useLoggedUserStore} from "stores/LoggedUser";
import {useFlightsStore} from "stores/Flights";
import {toggleVisibility} from "src/composables/form/formHandling";
import ContentCardEditButton from "components/ContentCardEditButton.vue";
import {loadPage, paginationLimit} from "src/composables/pagination";
import {filters, loadPage, paginationLimit} from "src/composables/pagination";
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
import FlightsListSkeleton from "components/flights/skeletons/FlightsListSkeleton.vue";
import CopyLinkButton from "components/inputs/CopyLinkButton.vue";
@@ -53,9 +53,9 @@ const togglePublicVisibility = (variables) => toggleVisibility({
$q, store: useAircraftsStore(), object: aircraft.value, variables
});
filters.value = {aircraftId: aircraftId};
const loadNextFlightsPage = (appendItems) => loadPage({
fetchFunc: useFlightsStore().fetch,
filters: {aircraftId: aircraftId},
appendItems
});
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
@@ -88,12 +88,14 @@ const loggedUser = storeToRefs(useLoggedUserStore()).user;
<q-card-section>
<ContentCardEditButton
v-if="aircraft.createdById === loggedUser?.id"
:to='{name: "aircraftEdit", params: {id: aircraft.id, step: "info"}}'
label="Upravit informace"
/>
<AircraftInfo :aircraft="aircraft"/>
<ContentCardEditButton
v-if="aircraft.createdById === loggedUser?.id"
:to='{name: "aircraftEdit", params: {id: aircraft.id, step: "photo"}}'
label="Titulní fotografie"
/>
+1 -2
View File
@@ -14,8 +14,7 @@ import {loadPage, paginationLimit} from "src/composables/pagination";
useAppStore().setPageTitle("Letadla");
const loadNextAircraftsPage = (appendItems) => loadPage({
fetchFunc: useAircraftsStore().fetch,
appendItems
fetchFunc: useAircraftsStore().fetch, appendItems
});
loadNextAircraftsPage(false);
+11 -12
View File
@@ -8,7 +8,7 @@ import {useCopilotsStore} from "stores/Copilots";
import {storeToRefs} from "pinia";
import PhotoGallery from "components/photos/PhotoGallery.vue";
import ContentCard from "components/ContentCard.vue";
import {loadPage, paginationLimit} from "src/composables/pagination";
import {filters, loadPage, paginationLimit} from "src/composables/pagination";
import {useFlightsStore} from "stores/Flights";
import FlightsListSkeleton from "components/flights/skeletons/FlightsListSkeleton.vue";
import {useMeta, useQuasar} from "quasar";
@@ -27,21 +27,20 @@ useCopilotsStore().fetchDetail(copilotId).then(() => {
])
});
const loadNextFlightsPage = (appendItems) => loadPage({
fetchFunc: useFlightsStore().fetch,
filters: {copilotId: copilotId},
appendItems
});
loadNextFlightsPage(false);
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
const {isQueryRunning, copilot} = storeToRefs(useCopilotsStore());
const loggedUser = storeToRefs(useLoggedUserStore()).user;
const $q = useQuasar();
const togglePublicVisibility = (variables) => toggleVisibility({
$q, store: useCopilotsStore(), object: copilot.value, variables
});
filters.value = {copilotId: copilotId};
const loadNextFlightsPage = (appendItems) => loadPage({
fetchFunc: useFlightsStore().fetch, appendItems
});
loadNextFlightsPage(false);
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
const {isQueryRunning, copilot} = storeToRefs(useCopilotsStore());
const loggedUser = storeToRefs(useLoggedUserStore()).user;
</script>
<template>
+11 -11
View File
@@ -8,7 +8,7 @@ import FlightsList from "components/flights/FlightsList.vue";
import {FORMAT_DATE, formatDatetime} from "src/composables/datetimeUtils";
import {useEventsStore} from "stores/Events";
import {storeToRefs} from "pinia";
import {loadPage, paginationLimit} from "src/composables/pagination";
import {filters, loadPage, paginationLimit} from "src/composables/pagination";
import {useFlightsStore} from "stores/Flights";
import PublishButton from "components/inputs/PublishButton.vue";
import {useLoggedUserStore} from "stores/LoggedUser";
@@ -29,22 +29,22 @@ onMounted(() => {
loadNextFlightsPage(false);
})
const {isQueryRunning, event} = storeToRefs(useEventsStore());
const loadNextFlightsPage = (appendItems) => loadPage({
fetchFunc: useFlightsStore().fetch,
filters: {eventId: eventId},
appendItems
});
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
});
const {isQueryRunning, event} = storeToRefs(useEventsStore());
filters.value = {eventId: eventId}
const loadNextFlightsPage = (appendItems) => loadPage({
fetchFunc: useFlightsStore().fetch, appendItems
});
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
const loggedUser = storeToRefs(useLoggedUserStore()).user;
</script>
<template>
@@ -16,7 +16,7 @@ import {successObject} from "src/composables/dialog";
import ContentCardEditButton from "components/ContentCardEditButton.vue";
import {useFlightsStore} from "stores/Flights";
import FlightsListSkeleton from "components/flights/skeletons/FlightsListSkeleton.vue";
import {loadPage, paginationLimit} from "src/composables/pagination";
import {filters, loadPage, paginationLimit} from "src/composables/pagination";
import PublishButton from "components/inputs/PublishButton.vue";
import CopyLinkButton from "components/inputs/CopyLinkButton.vue";
@@ -33,19 +33,20 @@ usePointsOfInterestStore().fetchDetail(poiId).then((p) => {
])
});
const loadNextFlightsPage = (appendItems) => loadPage({
fetchFunc: useFlightsStore().fetch,
filters: {pointOfInterestId: poiId},
appendItems
});
loadNextFlightsPage(false);
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
const {isQueryRunning, pointOfInterest} = storeToRefs(usePointsOfInterestStore());
const $q = useQuasar();
const togglePublicVisibility = (variables) => toggleVisibility({
$q, store: usePointsOfInterestStore(), object: pointOfInterest.value, variables
});
filters.value = {pointOfInterestId: poiId};
const loadNextFlightsPage = (appendItems) => loadPage({
fetchFunc: useFlightsStore().fetch,
appendItems
});
loadNextFlightsPage(false);
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
const {isQueryRunning, pointOfInterest} = storeToRefs(usePointsOfInterestStore());
</script>
<template>
@@ -73,6 +74,7 @@ const togglePublicVisibility = (variables) => toggleVisibility({
<q-card-section>
<ContentCardEditButton
v-if="pointOfInterest.createdById === loggedUser?.id"
:to="{name: 'poiEdit', params:{id: pointOfInterest.id, step: 'info'}}"
label="Upravit informace"
/>
@@ -89,6 +91,7 @@ const togglePublicVisibility = (variables) => toggleVisibility({
</BasicInfoBanner>
<ContentCardEditButton
v-if="pointOfInterest.createdById === loggedUser?.id"
:to="{name: 'poiEdit', params:{id: pointOfInterest.id, step: 'photo'}}"
label="Úvodní fotografie"
/>