Fix nacitani spatnych dat do mapy u udalosti
This commit is contained in:
@@ -6,17 +6,6 @@ import {isNumber, isRequired, maxLength, minLength} from "src/composables/form/r
|
|||||||
import {commonProps} from "src/composables/inputs";
|
import {commonProps} from "src/composables/inputs";
|
||||||
import ComboboxInput from "components/inputs/ComboboxInput.vue";
|
import ComboboxInput from "components/inputs/ComboboxInput.vue";
|
||||||
|
|
||||||
const formData = reactive({
|
|
||||||
id: null,
|
|
||||||
callSign: "",
|
|
||||||
model: "",
|
|
||||||
seats: null,
|
|
||||||
manufacturer: "",
|
|
||||||
description: "",
|
|
||||||
organization: null,
|
|
||||||
isPublic: false
|
|
||||||
});
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -34,6 +23,17 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const formData = reactive({
|
||||||
|
id: null,
|
||||||
|
callSign: "",
|
||||||
|
model: "",
|
||||||
|
seats: null,
|
||||||
|
manufacturer: "",
|
||||||
|
description: "",
|
||||||
|
organization: null,
|
||||||
|
isPublic: false
|
||||||
|
});
|
||||||
|
|
||||||
const rules = {
|
const rules = {
|
||||||
callSign: [isRequired, minLength(4), maxLength(8)],
|
callSign: [isRequired, minLength(4), maxLength(8)],
|
||||||
seats: [isRequired, isNumber]
|
seats: [isRequired, isNumber]
|
||||||
@@ -54,48 +54,48 @@ onMounted(() => {
|
|||||||
<q-img :src="props.defaultValues.photoUrl" v-if="props.defaultValues.photoUrl"/>
|
<q-img :src="props.defaultValues.photoUrl" v-if="props.defaultValues.photoUrl"/>
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
type="text"
|
type="text"
|
||||||
:rules="rules.callSign"
|
:rules="rules.callSign"
|
||||||
v-model="formData.callSign"
|
v-model="formData.callSign"
|
||||||
label="Volací značka"
|
label="Volací značka"
|
||||||
v-bind="commonProps"
|
v-bind="commonProps"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
type="number"
|
type="number"
|
||||||
v-model.number="formData.seats"
|
v-model.number="formData.seats"
|
||||||
label="Počet míst (včetně pilota)"
|
label="Počet míst (včetně pilota)"
|
||||||
min="1"
|
min="1"
|
||||||
:rules="rules.seats"
|
:rules="rules.seats"
|
||||||
v-bind="commonProps"
|
v-bind="commonProps"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ComboboxInput
|
<ComboboxInput
|
||||||
:options="organizations"
|
:options="organizations"
|
||||||
label="Organizace"
|
label="Organizace"
|
||||||
v-model="formData.organization"
|
v-model="formData.organization"
|
||||||
v-bind="commonProps"
|
v-bind="commonProps"
|
||||||
hint="Vyber provozovatele letadla. Tím se stane dostupné i pro ostatní členy vybrané organizace."
|
hint="Vyber provozovatele letadla. Tím se stane dostupné i pro ostatní členy vybrané organizace."
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
type="text"
|
type="text"
|
||||||
v-model="formData.manufacturer"
|
v-model="formData.manufacturer"
|
||||||
label="Výrobce"
|
label="Výrobce"
|
||||||
v-bind="commonProps"
|
v-bind="commonProps"
|
||||||
/>
|
/>
|
||||||
<q-input
|
<q-input
|
||||||
type="text"
|
type="text"
|
||||||
v-model="formData.model"
|
v-model="formData.model"
|
||||||
label="Model"
|
label="Model"
|
||||||
v-bind="commonProps"
|
v-bind="commonProps"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
type="textarea"
|
type="textarea"
|
||||||
v-model="formData.description"
|
v-model="formData.description"
|
||||||
label="Popis"
|
label="Popis"
|
||||||
v-bind="commonProps"
|
v-bind="commonProps"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-checkbox v-model="formData.isPublic" label="Veřejné?" v-bind="commonProps"/>
|
<q-checkbox v-model="formData.isPublic" label="Veřejné?" v-bind="commonProps"/>
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
import MapWithMarkers from "components/map/MapWithMarkers.vue";
|
import MapWithMarkers from "components/map/MapWithMarkers.vue";
|
||||||
import {ref} from "vue";
|
import {ref} from "vue";
|
||||||
import {useEventsStore} from "stores/Events";
|
import {useEventsStore} from "stores/Events";
|
||||||
import {minutesToHumanReadable} from "../../composables/datetimeUtils";
|
import {minutesToHumanReadable} from "src/composables/datetimeUtils";
|
||||||
import {pluralize} from "../../composables/utils";
|
import {pluralize} from "src/composables/utils";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
event: {
|
eventId: {
|
||||||
type: Object,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
onlyPublic: {
|
onlyPublic: {
|
||||||
@@ -21,7 +21,7 @@ const totalTime = ref(0);
|
|||||||
const totalFlights = ref(0);
|
const totalFlights = ref(0);
|
||||||
|
|
||||||
useEventsStore().fetchFlightsTracks({
|
useEventsStore().fetchFlightsTracks({
|
||||||
eventId: props.event.id,
|
eventId: props.eventId,
|
||||||
onlyPublic: props.onlyPublic
|
onlyPublic: props.onlyPublic
|
||||||
}).then((data) => {
|
}).then((data) => {
|
||||||
if (!data.flights) return;
|
if (!data.flights) return;
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ import {useLoggedUserStore} from "stores/LoggedUser";
|
|||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
event: {
|
event: {
|
||||||
type: Object
|
type: Object,
|
||||||
|
required: false,
|
||||||
},
|
},
|
||||||
isRequestPending: {
|
isRequestPending: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -72,9 +73,6 @@ const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<RichTextEditor v-model="formData.description" v-bind="commonProps" label="Popis letu, poznámky, ..."/>
|
<RichTextEditor v-model="formData.description" v-bind="commonProps" label="Popis letu, poznámky, ..."/>
|
||||||
|
|
||||||
|
|
||||||
</FormWrapper>
|
</FormWrapper>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
|||||||
|
|
||||||
<article class="q-my-lg" v-html="event.description"/>
|
<article class="q-my-lg" v-html="event.description"/>
|
||||||
|
|
||||||
<EventFlightsMap :event="event" :only-public="false" />
|
<EventFlightsMap :event-id="eventId" :only-public="false" />
|
||||||
|
|
||||||
<h3>Lety</h3>
|
<h3>Lety</h3>
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,16 @@ import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
|||||||
import {useFlightsStore} from "stores/Flights";
|
import {useFlightsStore} from "stores/Flights";
|
||||||
import {storeToRefs} from "pinia";
|
import {storeToRefs} from "pinia";
|
||||||
import {loadPage, paginationLimit} from "src/composables/pagination";
|
import {loadPage, paginationLimit} from "src/composables/pagination";
|
||||||
|
import {onMounted} from "vue";
|
||||||
|
|
||||||
useAppStore().setPageTitle("Moje lety");
|
useAppStore().setPageTitle("Moje lety");
|
||||||
|
|
||||||
const loadNextPage = (appendItems) => loadPage({
|
const loadNextPage = (appendItems) => loadPage({
|
||||||
fetchFunc: useFlightsStore().fetch, appendItems
|
fetchFunc: useFlightsStore().fetch, appendItems
|
||||||
});
|
});
|
||||||
loadNextPage(false);
|
onMounted(() => {
|
||||||
|
loadNextPage(false);
|
||||||
|
});
|
||||||
const {flights, totalItemsCount, isQueryRunning} = storeToRefs(useFlightsStore());
|
const {flights, totalItemsCount, isQueryRunning} = storeToRefs(useFlightsStore());
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -36,7 +39,6 @@ const {flights, totalItemsCount, isQueryRunning} = storeToRefs(useFlightsStore()
|
|||||||
:items-per-page="paginationLimit"
|
:items-per-page="paginationLimit"
|
||||||
:total-items-count="totalItemsCount"
|
:total-items-count="totalItemsCount"
|
||||||
@load-more="loadNextPage(true)"
|
@load-more="loadNextPage(true)"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FAB mode="add" :router-link="{name: 'addFlight'}"/>
|
<FAB mode="add" :router-link="{name: 'addFlight'}"/>
|
||||||
|
|||||||
@@ -60,7 +60,9 @@ const {flights, totalItemsCount, isQueryRunning: areFlightsLoading} = storeToRef
|
|||||||
|
|
||||||
<article class="q-my-lg" v-html="event.description"/>
|
<article class="q-my-lg" v-html="event.description"/>
|
||||||
|
|
||||||
<EventFlightsMap :event="event" :only-public="true"/>
|
<q-no-ssr>
|
||||||
|
<EventFlightsMap :event-id="event.id" :only-public="true"/>
|
||||||
|
</q-no-ssr>
|
||||||
|
|
||||||
<h3>Lety</h3>
|
<h3>Lety</h3>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ export default route(function ({ store }) {
|
|||||||
|
|
||||||
Router.beforeEach(async (to, from) => {
|
Router.beforeEach(async (to, from) => {
|
||||||
if (from.name !== to.name) {
|
if (from.name !== to.name) {
|
||||||
useAppStore(store).resetAfterRouteChange();
|
useAppStore(store).resetBeforeRouteChange();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -1,13 +1,13 @@
|
|||||||
import {defineStore} from 'pinia'
|
import {defineStore} from 'pinia'
|
||||||
import {ref} from "vue";
|
import {ref} from "vue";
|
||||||
import {paginationLimit, paginationOffset} from "src/composables/pagination";
|
import {filters, paginationLimit, paginationOffset} from "src/composables/pagination";
|
||||||
|
|
||||||
export const useAppStore = defineStore('App', () => {
|
export const useAppStore = defineStore('App', () => {
|
||||||
const pageTitle = ref(null);
|
const pageTitle = ref(null);
|
||||||
const breadcrumbs = ref(null);
|
const breadcrumbs = ref(null);
|
||||||
const appStatus = ref(200);
|
const appStatus = ref(200);
|
||||||
|
|
||||||
const resetAfterRouteChange = () => {
|
const resetBeforeRouteChange = () => {
|
||||||
pageTitle.value = null;
|
pageTitle.value = null;
|
||||||
// appStatus.value = 200; // tohle dela problem pri renderu 404 na serveru
|
// appStatus.value = 200; // tohle dela problem pri renderu 404 na serveru
|
||||||
breadcrumbs.value = null;
|
breadcrumbs.value = null;
|
||||||
@@ -15,6 +15,7 @@ export const useAppStore = defineStore('App', () => {
|
|||||||
// reset strankovani po prechodu na strankach
|
// reset strankovani po prechodu na strankach
|
||||||
paginationLimit.value = 10;
|
paginationLimit.value = 10;
|
||||||
paginationOffset.value = 0;
|
paginationOffset.value = 0;
|
||||||
|
filters.value = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
const setPageTitle = (value) => {
|
const setPageTitle = (value) => {
|
||||||
@@ -28,6 +29,6 @@ export const useAppStore = defineStore('App', () => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
pageTitle, breadcrumbs, appStatus,
|
pageTitle, breadcrumbs, appStatus,
|
||||||
resetAfterRouteChange, setPageTitle, setBreadcrumbs
|
resetBeforeRouteChange, setPageTitle, setBreadcrumbs
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user