mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 17:02:19 +00:00
doesn't show the footer if the view inside the EditProfil Modal is set to Status
This commit is contained in:
@@ -60,10 +60,10 @@ const profilApp = Vue.createApp({
|
||||
provide() {
|
||||
return {
|
||||
profilUpdateStates: Vue.computed(() =>
|
||||
this.profilUpdateStates ? this.profilUpdateStates : null
|
||||
this.profilUpdateStates ? this.profilUpdateStates : false
|
||||
),
|
||||
profilUpdateTopic: Vue.computed(() =>
|
||||
this.profilUpdateTopic ? this.profilUpdateTopic : null
|
||||
this.profilUpdateTopic ? this.profilUpdateTopic : false
|
||||
),
|
||||
setLoading: (newValue) => {
|
||||
this.loading = newValue;
|
||||
@@ -364,7 +364,6 @@ const profilApp = Vue.createApp({
|
||||
|
||||
Vue.$fhcapi.ProfilUpdate.getTopic()
|
||||
.then((response) => {
|
||||
console.log("t", response.data);
|
||||
this.profilUpdateTopic = response.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
|
||||
@@ -220,10 +220,8 @@ export default {
|
||||
//? sorts the profil Updates: pending -> accepted -> rejected
|
||||
this.data.profilUpdates?.sort(this.sortProfilUpdates);
|
||||
},
|
||||
|
||||
|
||||
mounted() {
|
||||
console.log("this mitarbeter",this)
|
||||
console.log("this p",this.$p)
|
||||
this.$refs.betriebsmittelTable.tabulator.on("tableBuilt", () => {
|
||||
this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel);
|
||||
});
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import BsModal from "../../../Bootstrap/Modal.js";
|
||||
import Alert from "../../../Bootstrap/Alert.js";
|
||||
import EditProfilSelect from "./EditProfilSelect.js";
|
||||
import Loader from "../../../Loader.js"
|
||||
import Loader from "../../../Loader.js";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BsModal,
|
||||
Alert,
|
||||
EditProfilSelect,
|
||||
Loader
|
||||
Loader,
|
||||
},
|
||||
mixins: [BsModal],
|
||||
props: {
|
||||
@@ -28,42 +28,40 @@ export default {
|
||||
onShowBsModal: Function,
|
||||
onShownBsModal: Function,
|
||||
},
|
||||
|
||||
|
||||
data() {
|
||||
return {
|
||||
topic: null,
|
||||
profilUpdate: null,
|
||||
editData: this.value,
|
||||
fileID:null,
|
||||
fileID: null,
|
||||
breadcrumb: null,
|
||||
loading:false,
|
||||
loading: false,
|
||||
|
||||
result: false,
|
||||
info: null,
|
||||
};
|
||||
},
|
||||
inject:["setLoading"],
|
||||
provide(){
|
||||
inject: ["setLoading"],
|
||||
provide() {
|
||||
return {
|
||||
updateFileID: this.updateFileIDFunction,
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
updateFileIDFunction: function(newFileID){
|
||||
updateFileIDFunction: function (newFileID) {
|
||||
this.fileID = newFileID;
|
||||
},
|
||||
|
||||
async submitProfilChange() {
|
||||
//? check if data is valid before making a request
|
||||
if (this.topic && this.profilUpdate) {
|
||||
|
||||
//? if profil update contains any attachment
|
||||
if (this.fileID) {
|
||||
const fileData = await this.uploadFiles(this.fileID);
|
||||
|
||||
this.fileID = fileData? fileData : null;
|
||||
|
||||
this.fileID = fileData ? fileData : null;
|
||||
}
|
||||
|
||||
//? inserts new row in public.tbl_cis_profil_update
|
||||
@@ -90,66 +88,66 @@ export default {
|
||||
|
||||
//* v-show on EditProfil modal binded to this.loading
|
||||
//? hides the EditProfil modal and shows the loading modal by calling a callback that was passed as prop from the parent component
|
||||
this.loading=true;
|
||||
this.loading = true;
|
||||
this.setLoading(true);
|
||||
|
||||
|
||||
this.editData.updateID
|
||||
? Vue.$fhcapi.ProfilUpdate.updateProfilRequest(
|
||||
? Vue.$fhcapi.ProfilUpdate.updateProfilRequest(
|
||||
this.topic,
|
||||
this.profilUpdate,
|
||||
this.editData.updateID,
|
||||
this.fileID? this.fileID[0]: null
|
||||
).then((res) => {
|
||||
handleApiResponse(res);
|
||||
}).catch((err) => {
|
||||
console.error(err);
|
||||
})
|
||||
: Vue.$fhcapi.ProfilUpdate.insertProfilRequest(
|
||||
this.fileID ? this.fileID[0] : null
|
||||
)
|
||||
.then((res) => {
|
||||
handleApiResponse(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
})
|
||||
: Vue.$fhcapi.ProfilUpdate.insertProfilRequest(
|
||||
this.topic,
|
||||
this.profilUpdate,
|
||||
this.fileID? this.fileID[0]: null
|
||||
|
||||
).then((res) => {
|
||||
handleApiResponse(res);
|
||||
}).catch((err) => {
|
||||
console.error(err);
|
||||
})
|
||||
this.fileID ? this.fileID[0] : null
|
||||
)
|
||||
.then((res) => {
|
||||
handleApiResponse(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
uploadFiles: async function (files) {
|
||||
|
||||
if (files[0].type !== "application/x.fhc-dms+json"){
|
||||
uploadFiles: async function (files) {
|
||||
if (files[0].type !== "application/x.fhc-dms+json") {
|
||||
let formData = new FormData();
|
||||
formData.append("files[]", files[0]);
|
||||
const result = this.editData.updateID ?
|
||||
//? updating old attachment by replacing
|
||||
//* second parameter of api request insertFile checks if the file has to be replaced or not
|
||||
await Vue.$fhcapi.ProfilUpdate.insertFile(formData,this.editData.updateID).then(res => {
|
||||
return res.data?.map((file) => file.dms_id);
|
||||
})
|
||||
|
||||
:
|
||||
//? fresh insert of new attachment
|
||||
await Vue.$fhcapi.ProfilUpdate.insertFile(formData).then(res => {
|
||||
return res.data?.map((file) => file.dms_id);
|
||||
})
|
||||
const result = this.editData.updateID
|
||||
? //? updating old attachment by replacing
|
||||
//* second parameter of api request insertFile checks if the file has to be replaced or not
|
||||
await Vue.$fhcapi.ProfilUpdate.insertFile(
|
||||
formData,
|
||||
this.editData.updateID
|
||||
).then((res) => {
|
||||
return res.data?.map((file) => file.dms_id);
|
||||
})
|
||||
: //? fresh insert of new attachment
|
||||
await Vue.$fhcapi.ProfilUpdate.insertFile(formData).then((res) => {
|
||||
return res.data?.map((file) => file.dms_id);
|
||||
});
|
||||
return result;
|
||||
}else{
|
||||
} else {
|
||||
//? attachment hasn't been replaced
|
||||
return false;
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
computed: {},
|
||||
created() {
|
||||
|
||||
if (this.editData.topic) {
|
||||
//? if the topic was passed through the prop add it to the component
|
||||
this.topic = this.editData.topic;
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.modal = this.$refs.modalContainer.modal;
|
||||
@@ -157,7 +155,7 @@ export default {
|
||||
popup(options) {
|
||||
return BsModal.popup.bind(this)(null, options);
|
||||
},
|
||||
template: /*html*/`
|
||||
template: /*html*/ `
|
||||
<bs-modal v-show="!loading" ref="modalContainer" v-bind="$props" body-class="" dialog-class="modal-lg" class="bootstrap-alert" backdrop="false" >
|
||||
|
||||
<template v-if="title" v-slot:title>
|
||||
@@ -165,6 +163,7 @@ export default {
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div >
|
||||
|
||||
<nav aria-label="breadcrumb" class="ps-2 ">
|
||||
<ol class="breadcrumb ">
|
||||
<li class="breadcrumb-item" v-for="element in breadcrumb">{{element}}</li>
|
||||
@@ -176,7 +175,7 @@ export default {
|
||||
|
||||
</template>
|
||||
<!-- optional footer -->
|
||||
<template v-slot:footer>
|
||||
<template v-slot:footer v-if="value.view? value.view != 'Status' : true">
|
||||
<loader ref="loaderRef" :timeout="0"></loader>
|
||||
|
||||
<button class="btn btn-outline-danger " @click="hide">{{$p.t('ui','cancel')}}</button>
|
||||
|
||||
Reference in New Issue
Block a user