Bugfixy
This commit is contained in:
@@ -13,11 +13,11 @@ useAppStore().setPageTitle("Profil");
|
||||
const loggedUser = storeToRefs(useUserStore()).user;
|
||||
|
||||
const $q = useQuasar();
|
||||
const handleSave = (formData) => {
|
||||
useUserStore().update(loggedUser.id, formData).then((user) => {
|
||||
$q.notify(successObject("Uspesne upraveno"));
|
||||
});
|
||||
const handleSave = async (formData) => {
|
||||
await useUserStore().update(formData);
|
||||
$q.notify(successObject("Úspěšně uloženo"));
|
||||
};
|
||||
const isRequestPending = storeToRefs(useUserStore()).isMutationRunning;
|
||||
const openedTab = ref("profile");
|
||||
</script>
|
||||
|
||||
@@ -30,15 +30,15 @@ const openedTab = ref("profile");
|
||||
|
||||
<q-tab-panels v-model="openedTab">
|
||||
<q-tab-panel name="profile">
|
||||
<ProfileImagesForm :user="loggedUser" @save="handleSave"/>
|
||||
<ProfileImagesForm :user="loggedUser" :isRequestPending="isRequestPending" @save="handleSave"/>
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel name="changePassword">
|
||||
<ChangePasswordForm @save="handleSave" />
|
||||
<ChangePasswordForm @save="handleSave" :isRequestPending="isRequestPending" />
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel name="publicProfile">
|
||||
<PublicProfileInfo @save="handleSave" :user="loggedUser" />
|
||||
<PublicProfileInfo @save="handleSave" :isRequestPending="isRequestPending" :user="loggedUser" />
|
||||
</q-tab-panel>
|
||||
|
||||
</q-tab-panels>
|
||||
|
||||
@@ -10,6 +10,7 @@ import FAB from "components/FAB.vue";
|
||||
import {useAppStore} from "stores/App";
|
||||
import FlightsList from "components/flights/FlightsList.vue";
|
||||
import {copilot} from "src/composables/objects/copilot";
|
||||
import {flight} from "src/composables/objects/flight";
|
||||
|
||||
const aircraftId = parseInt(useRoute().params.id);
|
||||
onMounted(() => {
|
||||
@@ -44,6 +45,21 @@ watch(aircraft, (newVal) => {
|
||||
<q-card class="q-mx-md q-my-md flight-detail-card">
|
||||
<q-img :src="aircraft.photoUrl" v-if="aircraft.photoUrl" />
|
||||
|
||||
<q-card-actions class="q-my-md">
|
||||
<div class="col-grow">
|
||||
<q-btn
|
||||
flat
|
||||
:to='{name: "aircraftEdit", params: {id: aircraft.id}}'
|
||||
icon="edit"
|
||||
text-color="primary"
|
||||
label="Upravit"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
<q-btn @click="confirmDelete(aircraft.id)" icon="delete" flat text-color="red" label="Smazat"/>
|
||||
</q-card-actions>
|
||||
|
||||
<q-card-section>
|
||||
<q-list>
|
||||
<q-item v-if="aircraft.manufacturer">
|
||||
@@ -55,9 +71,10 @@ watch(aircraft, (newVal) => {
|
||||
</q-list>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right">
|
||||
<q-btn @click="confirmDelete(aircraft.id)" icon="delete" text-color="red" rounded flat/>
|
||||
</q-card-actions>
|
||||
<!-- <q-card-actions align="right">-->
|
||||
<!-- <q-btn :to='{name: "aircraftEdit", params: {id: aircraft.id}}' icon="edit" text-color="primary" rounded flat/>-->
|
||||
<!-- <q-btn @click="confirmDelete(aircraft.id)" icon="delete" text-color="red" rounded flat/>-->
|
||||
<!-- </q-card-actions>-->
|
||||
</q-card>
|
||||
|
||||
<q-card class="flight-detail-card" flat>
|
||||
@@ -68,7 +85,7 @@ watch(aircraft, (newVal) => {
|
||||
<FlightsList :items="aircraft.flights" v-else/>
|
||||
</q-card>
|
||||
|
||||
<FAB :router-link='{name: "aircraftEdit", params: {id: aircraft.id}}' mode="edit"/>
|
||||
<!-- <FAB :router-link='{name: "aircraftEdit", params: {id: aircraft.id}}' mode="edit"/>-->
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@ const handleFlightEdit = (data) => {
|
||||
})
|
||||
}
|
||||
|
||||
const isRequestPending = storeToRefs(useFlightsStore()).isMutationRunning;
|
||||
|
||||
const handlePhotosUpload = (data) => {
|
||||
const promises = [];
|
||||
for (const photo of data.photos) {
|
||||
@@ -134,6 +136,7 @@ const openPhotoEdit = (photo) => {
|
||||
<q-tab-panel name="photos">
|
||||
<FlightFormPhotos
|
||||
:flight="flight"
|
||||
:is-request-pending="isRequestPending"
|
||||
@save="handlePhotosUpload"
|
||||
/>
|
||||
|
||||
@@ -144,6 +147,8 @@ const openPhotoEdit = (photo) => {
|
||||
@save="handlePhotoUpdate"
|
||||
/>
|
||||
|
||||
Tu nejsou videt fotky po nahrani
|
||||
|
||||
<PhotosList
|
||||
:photos="flight.photos"
|
||||
@edit="openPhotoEdit"
|
||||
|
||||
@@ -10,6 +10,8 @@ import {successObject} from "src/composables/dialog";
|
||||
import {usePointsOfInterestTypeStore} from "stores/PointOfInterestType";
|
||||
import {storeToRefs} from "pinia";
|
||||
import POIForm from "components/poi/POIForm.vue";
|
||||
import {useUserStore} from "stores/User";
|
||||
import AccessDeniedBanner from "components/AccessDeniedBanner.vue";
|
||||
|
||||
const poiId = parseInt(useRoute().params.id);
|
||||
|
||||
@@ -27,6 +29,7 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
const poiTypes = storeToRefs(usePointsOfInterestTypeStore()).items;
|
||||
const loggedUser = storeToRefs(useUserStore()).user;
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
@@ -40,6 +43,6 @@ const handleSave = (data) => {
|
||||
|
||||
<template>
|
||||
<POIEditSkeleton v-if="loading"/>
|
||||
|
||||
<AccessDeniedBanner v-else-if="poi.createdbyId !== loggedUser.id" :route-back="{name: 'poiDetail', params: {id: poiId}}"/>
|
||||
<POIForm :poi="poi" :types="poiTypes" v-else @save="handleSave"/>
|
||||
</template>
|
||||
|
||||
@@ -29,7 +29,7 @@ onMounted(() => {
|
||||
<POIDetailSkeleton v-if="loading || !poi"/>
|
||||
|
||||
<template v-else>
|
||||
<article v-html="poi.description" />
|
||||
<article v-html="poi.description" class="q-my-lg" />
|
||||
|
||||
<EmbeddedMap
|
||||
v-if="poi.gpsLatitude && poi.gpsLongitude"
|
||||
@@ -51,7 +51,7 @@ onMounted(() => {
|
||||
Pokud přidáš toto místo k nějaké fotce, zobrazí se tu.
|
||||
</BasicInfoBanner>
|
||||
|
||||
<FlightsList :items="poi.flights" />
|
||||
<FlightsList :items="poi.flights" v-if="poi.flights.length > 0 && loggedUser.id === poi.createdById"/>
|
||||
|
||||
<FAB v-if="poi.createdById === loggedUser.id" :router-link="{name: 'poiEdit', params:{id: poi.id}}" mode="edit"/>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user