Breadcrumbs resit pres funkce
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
<script>
|
||||
import {useAircraftsStore} from "stores/Aircrafts";
|
||||
|
||||
export default {
|
||||
serverPrefetch({currentRoute}) {
|
||||
return useAircraftsStore().fetchDetail(currentRoute.params.id);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script setup>
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {useMeta, useQuasar} from "quasar";
|
||||
@@ -6,7 +16,6 @@ import {confirmObject, successObject} from "src/composables/dialog";
|
||||
import {useAppStore} from "stores/App";
|
||||
import FlightsList from "components/flights/FlightsList.vue";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {useAircraftsStore} from "stores/Aircrafts";
|
||||
import {watch} from "vue";
|
||||
import {metaData} from "src/composables/meta";
|
||||
import PhotoGallery from "components/photos/PhotoGallery.vue";
|
||||
@@ -24,7 +33,6 @@ import PublishButton from "components/inputs/PublishButton.vue";
|
||||
|
||||
const aircraftId = parseInt(useRoute().params.id);
|
||||
|
||||
useAircraftsStore().fetchDetail(aircraftId);
|
||||
const {aircraft, isQueryRunning} = storeToRefs(useAircraftsStore());
|
||||
watch(() => aircraft.value, (newVal) => {
|
||||
if (!newVal) return;
|
||||
@@ -53,14 +61,11 @@ const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
$q, store: useAircraftsStore(), object: aircraft.value, variables
|
||||
});
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetch});
|
||||
filters.value = {aircraftId: aircraftId};
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetch,
|
||||
appendItems
|
||||
});
|
||||
loadPage(false);
|
||||
|
||||
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
|
||||
loadNextFlightsPage(false);
|
||||
|
||||
const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
</script>
|
||||
@@ -114,7 +119,7 @@ const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
:total-items-count="totalItemsCount"
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
</q-card-section>
|
||||
</template>
|
||||
|
||||
@@ -10,11 +10,8 @@ import {usePagination} from "src/composables/pagination";
|
||||
|
||||
useAppStore().setPageTitle("Letadla");
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const loadNextAircraftsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useAircraftsStore().fetch, appendItems
|
||||
});
|
||||
loadNextAircraftsPage(false);
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useAircraftsStore().fetch});
|
||||
loadPage(false);
|
||||
|
||||
const {aircrafts, totalItemsCount, isQueryRunning} = storeToRefs(useAircraftsStore());
|
||||
</script>
|
||||
@@ -40,7 +37,7 @@ const {aircrafts, totalItemsCount, isQueryRunning} = storeToRefs(useAircraftsSto
|
||||
:items-per-page="paginationLimit"
|
||||
:public="true"
|
||||
class="q-mb-xl"
|
||||
@load-more="loadNextAircraftsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
|
||||
<FAB mode="add" :router-link="{name: 'addAircraft'}"/>
|
||||
|
||||
@@ -30,12 +30,9 @@ const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
$q, store: useCopilotsStore(), object: copilot.value, variables
|
||||
});
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetch});
|
||||
filters.value = {copilotId: copilotId};
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetch, appendItems
|
||||
});
|
||||
loadNextFlightsPage(false);
|
||||
loadPage(false);
|
||||
|
||||
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
|
||||
const {isQueryRunning, copilot} = storeToRefs(useCopilotsStore());
|
||||
@@ -90,7 +87,7 @@ const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
:total-items-count="totalItemsCount"
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
<q-banner v-if="flights.length === 0" class="bg-light-blue text-white">
|
||||
Zatím tu nemáš uložené žádné společné lety.
|
||||
|
||||
@@ -26,7 +26,7 @@ onMounted(() => {
|
||||
{label: event.value.name}
|
||||
])
|
||||
});
|
||||
loadNextFlightsPage(false);
|
||||
loadPage(false);
|
||||
})
|
||||
|
||||
|
||||
@@ -37,11 +37,8 @@ const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
|
||||
const {isQueryRunning, event} = storeToRefs(useEventsStore());
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetch});
|
||||
filters.value = {eventId: eventId}
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetch, appendItems
|
||||
});
|
||||
|
||||
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
|
||||
const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
@@ -65,7 +62,7 @@ const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
|
||||
<article class="q-my-lg" v-html="event.description"/>
|
||||
|
||||
<EventFlightsMap :event-id="eventId" :only-public="false" />
|
||||
<EventFlightsMap :event-id="eventId" :only-public="false"/>
|
||||
|
||||
<h3>Lety</h3>
|
||||
|
||||
@@ -80,7 +77,7 @@ const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
:total-items-count="totalItemsCount"
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
<FAB mode="edit" :router-link="{name: 'eventEdit', params: {id: eventId}}"/>
|
||||
</template>
|
||||
|
||||
@@ -11,13 +11,9 @@ import {onMounted} from "vue";
|
||||
|
||||
useAppStore().setPageTitle("Moje lety");
|
||||
|
||||
const {loadPage, paginationLimit} = usePagination();
|
||||
|
||||
const loadNextPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetch, appendItems
|
||||
});
|
||||
const {loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetch});
|
||||
onMounted(() => {
|
||||
loadNextPage(false);
|
||||
loadPage(false);
|
||||
});
|
||||
const {flights, totalItemsCount, isQueryRunning} = storeToRefs(useFlightsStore());
|
||||
</script>
|
||||
@@ -40,7 +36,7 @@ const {flights, totalItemsCount, isQueryRunning} = storeToRefs(useFlightsStore()
|
||||
:is-query-running="isQueryRunning"
|
||||
:items-per-page="paginationLimit"
|
||||
:total-items-count="totalItemsCount"
|
||||
@load-more="loadNextPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
|
||||
<FAB mode="add" :router-link="{name: 'addFlight'}"/>
|
||||
|
||||
@@ -14,7 +14,6 @@ import {useOrganizationsStore} from "stores/Organizations";
|
||||
|
||||
const organizationId = parseInt(useRoute().params.id);
|
||||
const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
const $q = useQuasar();
|
||||
|
||||
onMounted(() => {
|
||||
useOrganizationsStore().fetchDetail(organizationId).then((o) => {
|
||||
|
||||
@@ -38,13 +38,9 @@ const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
$q, store: usePointsOfInterestStore(), object: pointOfInterest.value, variables
|
||||
});
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetch});
|
||||
filters.value = {pointOfInterestId: poiId};
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetch,
|
||||
appendItems
|
||||
});
|
||||
loadNextFlightsPage(false);
|
||||
loadPage(false);
|
||||
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
|
||||
const {isQueryRunning, pointOfInterest} = storeToRefs(usePointsOfInterestStore());
|
||||
</script>
|
||||
@@ -114,7 +110,7 @@ const {isQueryRunning, pointOfInterest} = storeToRefs(usePointsOfInterestStore()
|
||||
:total-items-count="totalItemsCount"
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
<BasicInfoBanner v-else>
|
||||
Na tomto místě jsi zatím nebyl/a.
|
||||
|
||||
@@ -12,16 +12,15 @@ import ListFilters from "components/ListFilters.vue";
|
||||
useAppStore().setPageTitle("Zajímavá místa");
|
||||
|
||||
|
||||
const {filters, loadPage, paginationLimit, paginationOffset} = usePagination();
|
||||
paginationLimit.value = 15;
|
||||
const loadNextPage = (appendItems) => loadPage({
|
||||
fetchFunc: usePointsOfInterestStore().fetch, appendItems
|
||||
const {filters, loadPage, paginationLimit, paginationOffset} = usePagination({
|
||||
fetchFunction: usePointsOfInterestStore().fetch,
|
||||
itemsPerPage: 1 // nefunguje
|
||||
});
|
||||
loadNextPage(false);
|
||||
loadPage(false);
|
||||
const handleFiltersChanged = (newFilters) => {
|
||||
paginationOffset.value = 0;
|
||||
filters.value = newFilters;
|
||||
loadNextPage(false);
|
||||
loadPage(false);
|
||||
}
|
||||
|
||||
const {isQueryRunning, totalItemsCount, pointsOfInterest} = storeToRefs(usePointsOfInterestStore());
|
||||
@@ -47,7 +46,7 @@ const {isQueryRunning, totalItemsCount, pointsOfInterest} = storeToRefs(usePoint
|
||||
:total-items-count="totalItemsCount"
|
||||
:is-query-running="isQueryRunning"
|
||||
:items-per-page="paginationLimit"
|
||||
@load-more="loadNextPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
<FAB :router-link="{name: 'addPOI'}" mode="add"/>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user