diff --git a/public/js/components/Cis/Profil/ProfilComponents/FetchProfilUpdates.js b/public/js/components/Cis/Profil/ProfilComponents/FetchProfilUpdates.js index 491a81274..0159f772b 100755 --- a/public/js/components/Cis/Profil/ProfilComponents/FetchProfilUpdates.js +++ b/public/js/components/Cis/Profil/ProfilComponents/FetchProfilUpdates.js @@ -86,7 +86,7 @@ export default { } //? adds the status information if the profil update request was rejected or accepted - if (updateRequest.status !== this.profilUpdateStates.Pending) { + if (updateRequest.status !== this.profilUpdateStates["Pending"]) { content["status"] = updateRequest.status; content["status_message"] = updateRequest.status_message; content["status_timestamp"] = updateRequest.status_timestamp; @@ -119,7 +119,7 @@ export default { ); }, getView: function (topic, status) { - if (!(status === this.profilUpdateStates.Pending)) { + if (!(status === this.profilUpdateStates["Pending"])) { return "Status"; } diff --git a/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/Status.js b/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/Status.js index 30795af1d..307a0cc62 100755 --- a/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/Status.js +++ b/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/Status.js @@ -6,30 +6,53 @@ export default { Adresse, Kontakt, }, + inject: ["profilUpdateTopic"], data() { return { - files:null, + files: null, }; }, - methods:{ - getDocumentLink: function(dms_id){ - return FHC_JS_DATA_STORAGE_OBJECT.app_root + - FHC_JS_DATA_STORAGE_OBJECT.ci_router + - `/Cis/ProfilUpdate/show/${dms_id}`; - } + methods: { + getDocumentLink: function (dms_id) { + return ( + FHC_JS_DATA_STORAGE_OBJECT.app_root + + FHC_JS_DATA_STORAGE_OBJECT.ci_router + + `/Cis/ProfilUpdate/show/${dms_id}` + ); + }, }, computed: { getComponentView: function () { - let title = this.topic.toLowerCase(); - if (title.includes("adressen")) return "Adresse"; - else if (title.includes("kontakte")) return "Kontakt"; - else return "text_input"; + if ( + this.topic == this.profilUpdateTopic["Private Adressen"] || + this.topic == this.profilUpdateTopic["Add Adresse"] || + this.topic == this.profilUpdateTopic["Delete Adresse"] + ) { + return "Adresse"; + } else if ( + this.topic == this.profilUpdateTopic["Private Kontakte"] || + this.topic == this.profilUpdateTopic["Add Kontakt"] || + this.topic == this.profilUpdateTopic["Delete Kontakt"] + ) { + return "Kontakt"; + } else { + return "text_input"; + } }, cardHeader: function () { - let title = this.topic.toLowerCase(); - if (title.includes("delete")) return "Delete"; - else if (title.includes("add")) return "Add"; - else return "Update"; + if ( + this.topic == this.profilUpdateTopic["Delete Addresse"] || + this.topic == this.profilUpdateTopic["Delete Kontakt"] + ) { + return "Delete"; + } else if ( + this.topic == this.profilUpdateTopic["Add Adresse"] || + this.topic == this.profilUpdateTopic["Add Kontakt"] + ) { + return "Add"; + } else { + return "Update"; + } }, }, props: { @@ -42,11 +65,13 @@ export default { topic: { type: String }, }, created() { - Vue.$fhcapi.ProfilUpdate.getProfilRequestFiles(this.updateID).then((res) =>{ - this.files = res.data; - }) + Vue.$fhcapi.ProfilUpdate.getProfilRequestFiles(this.updateID).then( + (res) => { + this.files = res.data; + } + ); }, - template: /*html*/` + template: /*html*/ `