`,
- };
-
\ No newline at end of file
+};
diff --git a/public/js/components/Cis/Profil/ProfilComponents/FetchProfilUpdates.js b/public/js/components/Cis/Profil/ProfilComponents/FetchProfilUpdates.js
index e32b96897..70f81ec42 100755
--- a/public/js/components/Cis/Profil/ProfilComponents/FetchProfilUpdates.js
+++ b/public/js/components/Cis/Profil/ProfilComponents/FetchProfilUpdates.js
@@ -1,123 +1,117 @@
-
import EditProfil from "../EditProfil.js";
//? EditProfil is the modal used to edit the profil updates
export default {
- props:{
- data:{
- type:Object,
- },
+ props: {
+ data: {
+ type: Object,
},
+ },
- emits:["fetchUpdates"],
-
- data(){
- return {
-
+ emits: ["fetchUpdates"],
+
+ data() {
+ return {};
+ },
+ methods: {
+ deleteRequest: function (item) {
+ Vue.$fhcapi.UserData.deleteProfilRequest(item.profil_update_id).then(
+ (res) => {
+ if (res.data.error) {
+ //? open alert
+ console.log(res.data);
+ } else {
+ this.$emit("fetchUpdates");
+ }
}
+ );
},
- methods:{
-
- deleteRequest: function(item){
-
- Vue.$fhcapi.UserData.deleteProfilRequest(item.profil_update_id).then((res)=>{
- if(res.data.error){
- //? open alert
- console.log(res.data);
- }else{
- this.$emit('fetchUpdates');
- }
- });
- },
- getView: function(topic,status){
- switch(topic){
- case "Private Kontakte" : return status ==='pending'? "EditKontakt": "Status"; break;
- case "Private Adressen" : return status ==='pending'? "EditAdresse": "Status"; break;
- case "Add Adressen" : return status ==='pending'? "EditAdresse": "Status"; break;
- case "Add Kontakte" : return status ==='pending'? "EditKontakt": "Status"; break;
- case "Delete Adressen" : return status ==='pending'? "Adresse": "Status" ; break;
- case "Delete Kontakte" : return status ==='pending'? "Kontakt": "Status"; break;
- default: return status ==='pending'? "TextInputDokument": "Status"; break;
- }
- },
- openModal(updateRequest) {
-
- let view = this.getView(updateRequest.topic,updateRequest.status);
- let data = null;
- let content =null;
- let files =null;
- let withFiles = false;
-
-
- if(view === "TextInputDokument"){
-
- data = {
- titel:updateRequest.topic,
- value: updateRequest.requested_change.value,
-
- };
- if(updateRequest.requested_change.files.length){
- const FILE = updateRequest.requested_change.files?.map(file=>{return new File(["files[]"], file.name);})
- const FILELIST = new DataTransfer();
- FILE.forEach(file => {
- FILELIST.items.add(file);
- })
- files=updateRequest.requested_change.files;
- }
- withFiles = true;
- }
- else{
- data = updateRequest.requested_change;
- }
-
-
-
-
- content={
- updateID:updateRequest.profil_update_id,
- view:view,
- data:data,
- withFiles:withFiles,
- topic:updateRequest.topic,
- files: files,
-
- }
-
-
- //? adds the status information if the profil update request was rejected or accepted
- if(updateRequest.status !== 'pending'){
- content['status']= updateRequest.status;
- content['status_message']= updateRequest.status_message;
- content['status_timestamp']=updateRequest.status_timestamp;
- }
-
- //? only show the popup if also the right content is available
- if(content){
- EditProfil.popup({
-
- value:content,
-
- }).then((res) => {
- if(res === true){
- this.$emit('fetchUpdates');
- }
-
- }).catch(e => {
- // Wenn der User das Modal abbricht ohne Änderungen
-
- });
-
- }
-
-
- },
+ getView: function (topic, status) {
+ switch (topic) {
+ case "Private Kontakte":
+ return status === "pending" ? "EditKontakt" : "Status";
+ break;
+ case "Private Adressen":
+ return status === "pending" ? "EditAdresse" : "Status";
+ break;
+ case "Add Adressen":
+ return status === "pending" ? "EditAdresse" : "Status";
+ break;
+ case "Add Kontakte":
+ return status === "pending" ? "EditKontakt" : "Status";
+ break;
+ case "Delete Adressen":
+ return status === "pending" ? "Adresse" : "Status";
+ break;
+ case "Delete Kontakte":
+ return status === "pending" ? "Kontakt" : "Status";
+ break;
+ default:
+ return status === "pending" ? "TextInputDokument" : "Status";
+ break;
+ }
},
- created(){
-
+ openModal(updateRequest) {
+ let view = this.getView(updateRequest.topic, updateRequest.status);
+ let data = null;
+ let content = null;
+ let files = null;
+ let withFiles = false;
+
+ if (view === "TextInputDokument") {
+ data = {
+ titel: updateRequest.topic,
+ value: updateRequest.requested_change.value,
+ };
+ if (updateRequest.requested_change.files.length) {
+ const FILE = updateRequest.requested_change.files?.map((file) => {
+ return new File(["files[]"], file.name);
+ });
+ const FILELIST = new DataTransfer();
+ FILE.forEach((file) => {
+ FILELIST.items.add(file);
+ });
+ files = updateRequest.requested_change.files;
+ }
+ withFiles = true;
+ } else {
+ data = updateRequest.requested_change;
+ }
+
+ content = {
+ updateID: updateRequest.profil_update_id,
+ view: view,
+ data: data,
+ withFiles: withFiles,
+ topic: updateRequest.topic,
+ files: files,
+ };
+
+ //? adds the status information if the profil update request was rejected or accepted
+ if (updateRequest.status !== "pending") {
+ content["status"] = updateRequest.status;
+ content["status_message"] = updateRequest.status_message;
+ content["status_timestamp"] = updateRequest.status_timestamp;
+ }
+
+ //? only show the popup if also the right content is available
+ if (content) {
+ EditProfil.popup({
+ value: content,
+ })
+ .then((res) => {
+ if (res === true) {
+ this.$emit("fetchUpdates");
+ }
+ })
+ .catch((e) => {
+ // Wenn der User das Modal abbricht ohne Änderungen
+ });
+ }
},
- computed:{
-
- },
- template:`
+ },
+ created() {},
+ computed: {},
+ template: `
- `
-};
\ No newline at end of file
+ `,
+};
diff --git a/public/js/components/Cis/Profil/ProfilComponents/Status.js b/public/js/components/Cis/Profil/ProfilComponents/Status.js
index 535252ec2..2eebbf8fa 100755
--- a/public/js/components/Cis/Profil/ProfilComponents/Status.js
+++ b/public/js/components/Cis/Profil/ProfilComponents/Status.js
@@ -2,42 +2,38 @@ import Adresse from "./Adresse.js";
import Kontakt from "./Kontakt.js";
export default {
- components:{
- Adresse,
- Kontakt,
+ components: {
+ Adresse,
+ Kontakt,
+ },
+ data() {
+ return {};
+ },
+ 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";
},
- data(){
- return {
-
- }
+ cardHeader: function () {
+ let title = this.topic.toLowerCase();
+ if (title.includes("delete")) return "Delete";
+ else if (title.includes("add")) return "Add";
+ else return "Update";
},
- 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";
-
- },
- cardHeader: function(){
- let title = this.topic.toLowerCase();
- if(title.includes("delete")) return "Delete";
- else if(title.includes("add")) return "Add";
- else return "Update";
- }
- },
- props:{
- data:{type:Object},
- view:{type:String},
- status:{type:String},
- status_message:{type:String},
- status_timestamp:{type:String},
- updateID:{type:Number},
- topic:{type:String},
- },
- created(){
-
- },template:`
+ },
+ props: {
+ data: { type: Object },
+ view: { type: String },
+ status: { type: String },
+ status_message: { type: String },
+ status_timestamp: { type: String },
+ updateID: { type: Number },
+ topic: { type: String },
+ },
+ created() {},
+ template: `
@@ -86,5 +82,4 @@ export default {
`,
-
-}
\ No newline at end of file
+};
diff --git a/public/js/components/Cis/Profil/ProfilComponents/TextInputDokument.js b/public/js/components/Cis/Profil/ProfilComponents/TextInputDokument.js
index 257c4c39f..5f5ca9375 100644
--- a/public/js/components/Cis/Profil/ProfilComponents/TextInputDokument.js
+++ b/public/js/components/Cis/Profil/ProfilComponents/TextInputDokument.js
@@ -1,89 +1,86 @@
import Dms from "../../../Form/Upload/Dms.js";
-
export default {
- data(){
- return {
- dmsData:[],
- originalValue:null,
- originalFiles:null,
- }
+ data() {
+ return {
+ dmsData: [],
+ originalValue: null,
+ originalFiles: null,
+ };
+ },
+ components: {
+ Dms,
+ },
+ props: {
+ data: {
+ type: Object,
},
- components:{
- Dms,
+ withFiles: {
+ type: Boolean,
+ default: false,
},
- props:{
-
- data:{
- type:Object,
- },
- withFiles:{
- type:Boolean,
- default:false,
- },
- files:{
- type:FileList,
- },
- updateID:{
- type:Boolean,
- }
+ files: {
+ type: FileList,
},
- computed: {
- isChanged: function(){
- //? controls whether the user is allowed to send the profil update or not
- if(this.withFiles && !this.dmsData.length) {return false;}
- return JSON.stringify(this.data) !== Vue.toRaw(this.originalValue);
-
- }
+ updateID: {
+ type: Boolean,
+ },
+ },
+ computed: {
+ isChanged: function () {
+ //? controls whether the user is allowed to send the profil update or not
+ if (this.withFiles && !this.dmsData.length) {
+ return false;
+ }
+ return JSON.stringify(this.data) !== Vue.toRaw(this.originalValue);
+ },
+ },
+ emits: ["profilUpdate"],
+ watch: {
+ //? watcher to trigger the event emit when a file was uploaded or removed
+ dmsData(value) {
+ this.emitChanges();
+ },
+ },
+ methods: {
+ emitChanges: function () {
+ if (this.updateID || this.isChanged) {
+ this.$emit(
+ "profilUpdate",
+ this.withFiles
+ ? { value: this.data.value, files: this.dmsData }
+ : { value: this.data.value }
+ );
+ } else {
+ this.$emit("profilUpdate", null);
+ }
+ },
+ },
+ mounted() {
+ this.originalValue = JSON.stringify(this.data);
- },
- emits:["profilUpdate"],
- watch: {
- //? watcher to trigger the event emit when a file was uploaded or removed
- dmsData(value) {
- this.emitChanges();
-
- }
- },
- methods:{
-
- emitChanges: function(){
- if(this.updateID || this.isChanged){
-
- this.$emit('profilUpdate', this.withFiles?{value:this.data.value, files:this.dmsData}:{value:this.data.value});
- }else{
-
- this.$emit('profilUpdate',null);
- }
- },
-
- },
- mounted(){
-
- this.originalValue = JSON.stringify(this.data);
-
+ if (this.files) {
+ this.dmsData = this.files;
- if(this.files){
- this.dmsData = this.files;
+ for (let i = 0; i < this.dmsData.length; i++) {
+ console.log("here", this.dmsData[i]);
+ }
- for(let i=0; i < this.dmsData.length; i++){
- console.log("here",this.dmsData[i]);
- }
-
- this.originalFiles=null;
- }
-
- },
- template:`
+ this.originalFiles = null;
+ }
+ },
+ template: `
+
Please update your {{data.titel}} and upload the corresponding Document for proof
+
`,
-}
\ No newline at end of file
+};
diff --git a/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js b/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js
index e5e5e59bb..3c808b913 100755
--- a/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js
+++ b/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js
@@ -3,23 +3,21 @@ import Alert from "../../Bootstrap/Alert.js";
import Kontakt from "../Profil/ProfilComponents/Kontakt.js";
import Adresse from "../Profil/ProfilComponents/Adresse.js";
-
export default {
components: {
BsModal,
Alert,
Kontakt,
Adresse,
-
},
mixins: [BsModal],
props: {
- title:{
- type:String,
- default:"Profil Update Request"
+ title: {
+ type: String,
+ default: "Profil Update Request",
},
value: {
- type:Object,
+ type: Object,
},
/*
* NOTE(chris):
@@ -34,73 +32,71 @@ export default {
onShownBsModal: Function,
},
data() {
- return {
+ return {
data: this.value,
//? result is returned from the Promise when the modal is closed
result: false,
info: null,
- }
+ };
},
methods: {
- acceptRequest: function(){
-
- Vue.$fhcapi.ProfilUpdate.acceptProfilRequest(this.data).then(res =>{
- console.log("res",res);
- console.log("res.data",res.data);
+ acceptRequest: function () {
+ Vue.$fhcapi.ProfilUpdate.acceptProfilRequest(this.data).then((res) => {
+ console.log("res", res);
+ console.log("res.data", res.data);
this.result = true;
- })
+ });
this.hide();
},
- denyRequest: function(){
+ denyRequest: function () {
console.log(this.data.profil_update_id);
- Vue.$fhcapi.ProfilUpdate.denyProfilRequest(this.data).then(res =>{
- console.log("res",res);
- console.log("res.data",res.data);
+ Vue.$fhcapi.ProfilUpdate.denyProfilRequest(this.data).then((res) => {
+ console.log("res", res);
+ console.log("res.data", res.data);
this.result = true;
- })
+ });
this.hide();
},
-
- submitProfilChange(){
- //TODO: check if the updated value is different from the original value before submitting the request
- if(false){
- //? inserts new row in public.tbl_cis_profil_update
+ submitProfilChange() {
+ //TODO: check if the updated value is different from the original value before submitting the request
+ if (false) {
+ //? inserts new row in public.tbl_cis_profil_update
//* calls the update api call if an update field is present in the data that was passed to the module
- Vue.$fhcapi.UserData[this.editData.update?'updateProfilRequest':'insertProfilRequest'](this.topic,this.profilUpdate).then((res)=>{
-
- if(res.data.error == 0){
- this.result= true;
+ Vue.$fhcapi.UserData[
+ this.editData.update ? "updateProfilRequest" : "insertProfilRequest"
+ ](this.topic, this.profilUpdate).then((res) => {
+ if (res.data.error == 0) {
+ this.result = true;
this.hide();
- Alert.popup("Ihre Anfrage wurde erfolgreich gesendet. Bitte warten Sie, während sich das Team um Ihre Anfrage kümmert.");
- }else{
- this.result= false;
+ Alert.popup(
+ "Ihre Anfrage wurde erfolgreich gesendet. Bitte warten Sie, während sich das Team um Ihre Anfrage kümmert."
+ );
+ } else {
+ this.result = false;
this.hide();
- Alert.popup("Ein Fehler ist aufgetreten: "+ JSON.stringify(res.data.retval));
- }
-
+ Alert.popup(
+ "Ein Fehler ist aufgetreten: " + JSON.stringify(res.data.retval)
+ );
+ }
});
- }
+ }
},
},
computed: {
- getComponentView: function(){
-
- if(this.data.topic.toLowerCase().includes("kontakt")){
- return "kontakt";
- }else if (this.data.topic.toLowerCase().includes("adresse")){
- return "adresse";
- }else{
- return "text_input";
- }
+ getComponentView: function () {
+ if (this.data.topic.toLowerCase().includes("kontakt")) {
+ return "kontakt";
+ } else if (this.data.topic.toLowerCase().includes("adresse")) {
+ return "adresse";
+ } else {
+ return "text_input";
+ }
},
},
- created() {
-
-
- },
+ created() {},
mounted() {
this.modal = this.$refs.modalContainer.modal;
},
diff --git a/public/js/components/Form/Upload/Dms.js b/public/js/components/Form/Upload/Dms.js
index 0416436db..3184a7e0b 100755
--- a/public/js/components/Form/Upload/Dms.js
+++ b/public/js/components/Form/Upload/Dms.js
@@ -73,7 +73,6 @@ export default {
},
template: `