Aktualizace balicku, strnakovani, uprava hlavni stranky
This commit is contained in:
@@ -42,11 +42,11 @@ watch(() => $route.params.step, (val) => formStep.value = val);
|
||||
onMounted(() => {
|
||||
formStep.value = $route.params.step || "basic";
|
||||
|
||||
useAircraftsStore().fetch();
|
||||
usePointsOfInterestStore().fetch();
|
||||
useAircraftsStore().fetch({});
|
||||
usePointsOfInterestStore().fetch({});
|
||||
useAirportsStore().fetch();
|
||||
useCopilotsStore().fetch();
|
||||
useEventsStore().fetch();
|
||||
useEventsStore().fetch({});
|
||||
|
||||
useFlightsStore().fetchDetail(flightId).then((f) => {
|
||||
const flightNameFormatted = flightName(f);
|
||||
@@ -133,7 +133,7 @@ const updateSinglePhoto = (id, formData) => {
|
||||
return usePhotosStore().update(id, formData).then((data) => {
|
||||
const idx = _findPhotoIndex(data.id);
|
||||
flight.value.photos[idx] = data;
|
||||
usePointsOfInterestStore().fetch();
|
||||
usePointsOfInterestStore().fetch({});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {copyToClipboard, useQuasar} from "quasar";
|
||||
import {confirmObject, successObject} from "src/composables/dialog";
|
||||
import {useFlightsStore} from "stores/Flights";
|
||||
import FlightTrackMap from "components/flights/FlightTrackMap.vue";
|
||||
import {useUserStore} from "stores/User";
|
||||
import {useLoggedUserStore} from "stores/LoggedUser";
|
||||
import {storeToRefs} from "pinia";
|
||||
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
||||
import PhotoGallery from "components/photos/PhotoGallery.vue";
|
||||
@@ -21,7 +21,7 @@ import {toggleVisibility} from "src/composables/form/formHandling";
|
||||
const $q = useQuasar();
|
||||
const $router = useRouter();
|
||||
const flightId = parseInt(useRoute().params.id);
|
||||
const loggedUser = storeToRefs(useUserStore()).user;
|
||||
const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
|
||||
useFlightsStore().fetchDetail(flightId);
|
||||
const {isQueryRunning, flight} = storeToRefs(useFlightsStore());
|
||||
@@ -52,7 +52,7 @@ const togglePublicVisibility = () => toggleVisibility({
|
||||
});
|
||||
|
||||
const copyLinkToClipboard = () => {
|
||||
const loggedUser = useUserStore().user;
|
||||
const loggedUser = useLoggedUserStore().user;
|
||||
const url = $router.resolve({
|
||||
name: "publicFlightDetail",
|
||||
params: {id: flightId, username: loggedUser.publicUsername}
|
||||
|
||||
@@ -6,24 +6,48 @@ import {useAppStore} from "stores/App";
|
||||
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
||||
import {useFlightsStore} from "stores/Flights";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {ref} from "vue";
|
||||
|
||||
useAppStore().setPageTitle("Moje lety");
|
||||
useFlightsStore().fetch({});
|
||||
const {flights, isQueryRunning} = storeToRefs(useFlightsStore());
|
||||
|
||||
const paginationLimit = ref(10);
|
||||
const paginationOffset = ref(0);
|
||||
|
||||
const loadNextPage = (appendItems) => {
|
||||
return useFlightsStore().fetch({
|
||||
limit: paginationLimit.value,
|
||||
offset: paginationOffset.value,
|
||||
appendItems
|
||||
}).then(() => {
|
||||
paginationOffset.value += paginationLimit.value;
|
||||
})
|
||||
}
|
||||
|
||||
loadNextPage(false);
|
||||
const {flights, totalItemsCount, isQueryRunning} = storeToRefs(useFlightsStore());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FlightsListSkeleton v-if="isQueryRunning"/>
|
||||
|
||||
<BasicInfoBanner
|
||||
v-else-if="!isQueryRunning && flights.length === 0"
|
||||
v-else-if="!isQueryRunning && totalItemsCount === 0"
|
||||
:route-add="{name: 'addFlight'}"
|
||||
label-add="Přidat let"
|
||||
>
|
||||
Nemáš zaznamenaný žádný let.
|
||||
</BasicInfoBanner>
|
||||
|
||||
<FlightsList v-else :items="flights" :public="false" />
|
||||
<FlightsList
|
||||
v-else
|
||||
:items="flights"
|
||||
:public="false"
|
||||
:is-query-running="isQueryRunning"
|
||||
:items-per-page="paginationLimit"
|
||||
:total-items-count="totalItemsCount"
|
||||
@load-more="loadNextPage(true)"
|
||||
|
||||
/>
|
||||
|
||||
<FAB mode="add" :router-link="{name: 'addFlight'}"/>
|
||||
</template>
|
||||
|
||||
@@ -12,9 +12,9 @@ import FlightFormBasic from "components/flights/form/FlightFormBasic.vue";
|
||||
import FlightEditSkeleton from "components/flights/skeletons/FlightEditSkeleton.vue";
|
||||
|
||||
onMounted(() => {
|
||||
useAircraftsStore().fetch()
|
||||
usePointsOfInterestStore().fetch()
|
||||
useFlightsStore().fetch()
|
||||
useAircraftsStore().fetch({})
|
||||
usePointsOfInterestStore().fetch({})
|
||||
useFlightsStore().fetch({})
|
||||
useAirportsStore().fetch()
|
||||
|
||||
useAppStore().setPageTitle("Nový let");
|
||||
|
||||
Reference in New Issue
Block a user