diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index e31d817f9..3b0b81d41 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -2,7 +2,12 @@ import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; import EditProfil from "./EditProfil.js"; import {Adresse, Kontakt, FetchProfilUpdates} from "./ProfilComponents.js"; - +import Mailverteiler from "./ProfilComponents/Mailverteiler.js"; +import AusweisStatus from "./ProfilComponents/FhAusweisStatus.js"; +import QuickLinks from "./ProfilComponents/QuickLinks.js"; +import ProfilEmails from "./ProfilComponents/ProfilEmails.js" +import RoleInformation from "./ProfilComponents/RoleInformation.js"; +import ProfilInformation from "./ProfilComponents/ProfilInformation.js"; export default { components: { @@ -11,6 +16,12 @@ export default { Adresse, Kontakt, FetchProfilUpdates, + AusweisStatus, + Mailverteiler, + QuickLinks, + ProfilEmails, + RoleInformation, + ProfilInformation, }, data() { return { @@ -160,64 +171,30 @@ export default { }, - sperre_foto_function() { - if (!this.data) { - return; - } - Vue.$fhcapi.UserData.sperre_foto_function(!this.data.foto_sperre).then((res) => { - this.data.foto_sperre = res.data.foto_sperre; - }); - }, + }, computed: { - - //? legacy mailto link to create an email with information that should be changed - refreshMailTo() { - return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]`; - }, - - get_image_base64_src() { - if (!this.data) { - return ""; - } - return "data:image/jpeg;base64," + this.data.foto; - }, - - get_mitarbeiter_standort_telefon(){ - if(this.data.standort_telefon){ - return "tel:"+ this.data.telefonklappe + this.data.standort_telefon; - }else{ - return null; - } - }, - //? this computed function returns all the informations for the first column in the profil - personData() { + profilInformation() { if (!this.data) { return {}; } return { + Vorname: this.data.vorname, + Nachname: this.data.nachname, Username: this.data.username, Anrede: this.data.anrede, Titel: this.data.titel, Postnomen: this.data.postnomen, + foto_sperre:this.data.foto_sperre, + foto:this.data.foto, + }; }, - personKontakt() { - if (!this.data) { - return {}; - } - - return { - emails: this.data.emails, - - }; - }, - - specialData() { + roleInformation() { if (!this.data) { return {}; } @@ -231,6 +208,10 @@ export default { }; }, + personEmails() { + return this.data?.emails ? this.data.emails : []; + }, + privateKontakte() { if (!this.data) { return {}; @@ -250,18 +231,6 @@ export default { }, - kontaktInfo() { - if (!this.data) { - return {}; - } - - return { - FhAusweisStatus: this.data.zutrittsdatum, - emails: this.data.emails, - Kontakte: this.data.kontakte, - Adressen: this.data.adressen, - }; - }, }, created() { @@ -352,41 +321,18 @@ export default {
-

-

- -

- + +
-
-
- Profil Informations Änderungen Anfragen
-
+ -
-
- +
@@ -432,96 +378,10 @@ export default {
-
-
- MitarbeiterIn -
-
- - + + - -
- - - - - - -
-
-
- - - - -
- -
- - -
-
- -
- - - - - -
-
-
- - -
-
Vorname
- {{data.vorname}} -
- - - -
-
- -
-
Nachname
- {{data.nachname}} -
- -
-
- - -
- - - - - - - - -
- - -
-
{{bez}}
- {{wert?wert:'-'}} -
- - - -
- - -
- - - -
-
@@ -529,57 +389,9 @@ export default {
-
- -
- Mitarbeiter Information -
-
-
-
- - - - - -
-
{{bez }}
+ + - - {{wert?wert:'-'}} - - - {{wert?wert:'-'}} -
- - - -
- - - -
- - - - - - - - -
-
- -
- -
@@ -606,64 +418,11 @@ export default {
- -
-
- Mails -
- -
- - + + + - -
- - - - - - - -
-
- -
- -
- - - -
- - -
- -
-
{{email.type}}
- {{email.email}} -
- - -
-
-
-
- - - - - - - - - -
- - -
-
@@ -759,26 +518,13 @@ export default {
- - - - - - - +
-
-
- Profil Updates -
-
- -
-
- - + + +
@@ -786,20 +532,8 @@ export default {
-
-
- Quick Links -
- -
- + + @@ -807,82 +541,21 @@ export default {
- -
- - - -
-
- Der FH Ausweis ist am {{data.zutrittsdatum}} ausgegeben worden. -
- -
- - -
- + + +
- -
-
- - - - -
-
- Mailverteilers -
-
- -
Sie sind Mitgglied in folgenden Verteilern:
-
-
-
-
- - - -
- -
- -
-
{{verteiler.beschreibung}}
-
- -
-
- - - - - + + +
- -
- - -
- - - - - - - - + - - `, diff --git a/public/js/components/Cis/Profil/ProfilComponents.js b/public/js/components/Cis/Profil/ProfilComponents.js index 3b666002c..fd9db1dd4 100644 --- a/public/js/components/Cis/Profil/ProfilComponents.js +++ b/public/js/components/Cis/Profil/ProfilComponents.js @@ -223,8 +223,7 @@ const EditKontakt = { }, template: ` -
{{JSON.stringify(data)}}
-
{{originalValue}}
+
@@ -386,7 +385,12 @@ const FetchProfilUpdates = { }, template:` -
{{JSON.stringify(data,null,2)}}
+ +
+
+ Profil Updates +
+
@@ -408,6 +412,9 @@ const FetchProfilUpdates = {
+
+
+ ` }; diff --git a/public/js/components/Cis/Profil/ProfilComponents/FhAusweisStatus.js b/public/js/components/Cis/Profil/ProfilComponents/FhAusweisStatus.js new file mode 100644 index 000000000..25bd41708 --- /dev/null +++ b/public/js/components/Cis/Profil/ProfilComponents/FhAusweisStatus.js @@ -0,0 +1,18 @@ +export default { + props:{ + data:{ + type:String, + } + }, + data(){ + return { + + } + }, + template: ` +
+
+ Der FH Ausweis ist am {{data}} ausgegeben worden. +
+
`, +} \ No newline at end of file diff --git a/public/js/components/Cis/Profil/ProfilComponents/Mailverteiler.js b/public/js/components/Cis/Profil/ProfilComponents/Mailverteiler.js new file mode 100644 index 000000000..15f4efcf8 --- /dev/null +++ b/public/js/components/Cis/Profil/ProfilComponents/Mailverteiler.js @@ -0,0 +1,37 @@ +export default { + props: { + data: Object, + title: { type: String, default: "Mailverteilers" }, + }, + data() { + return {}; + }, + template: ` +
+ +
+ {{title}} +
+
+ +
Sie sind Mitglied in folgenden Verteilern:
+
+
+
+
+ + + +
+ +
+ +
+
{{verteiler.beschreibung}}
+
+ +
+
`, +}; diff --git a/public/js/components/Cis/Profil/ProfilComponents/ProfilEmails.js b/public/js/components/Cis/Profil/ProfilComponents/ProfilEmails.js new file mode 100644 index 000000000..5de2be8ad --- /dev/null +++ b/public/js/components/Cis/Profil/ProfilComponents/ProfilEmails.js @@ -0,0 +1,74 @@ +export default { + data(){ + return { + + } + }, + props:{ + title:{ + type:String, + default:"Mails", + }, + data:{ + type:Array, + } + }, + template: ` +
+
+ {{title}} +
+ +
+ + + + + + + + + + + + + +
+
+ +
+ +
+ + + +
+ + +
+ +
+
{{email.type}}
+ {{email.email}} +
+ + +
+
+
+
+ + + + + + + + + + + + +
+
` +} \ No newline at end of file diff --git a/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js b/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js new file mode 100644 index 000000000..fe3b18380 --- /dev/null +++ b/public/js/components/Cis/Profil/ProfilComponents/ProfilInformation.js @@ -0,0 +1,145 @@ +export default { + + props:{ + title:{ + type:String, + + }, + data:{ + type:Object, + } + }, + data(){ + return { + FotoSperre:this.data.foto_sperre, + } + }, + + methods:{ + + sperre_foto_function() { + //TODO: make this better + if (!this.data) { + return; + } + Vue.$fhcapi.UserData.sperre_foto_function(!this.FotoSperre).then((res) => { + this.FotoSperre = res.data.foto_sperre; + + }); + }, + }, + computed:{ + get_image_base64_src: function() { + if (!this.data.foto) { + return ""; + } + return "data:image/jpeg;base64," + this.data.foto; + }, + name: function(){ + return {vorname:this.data.Vorname, nachname: this.data.Nachname}; + }, + profilInfo: function(){ + let res = {}; + let notIncludedProperties=["Vorname", "Nachname", "foto_sperre","foto"]; + Object.keys(this.data).forEach((key)=>{ + if(!notIncludedProperties.includes(key)){ + res[key] = this.data[key]; + } + }) + return res; + } + }, + template: ` + +
+
+ {{title}} +
+
+ + + + + +
+ + + + + + +
+
+
+ + + + +
+ +
+ + +
+
+ +
+ + + + + +
+
+
+ + +
+
Vorname
+{{name.vorname}} +
+ + + +
+
+ +
+
Nachname
+{{name.nachname}} +
+ +
+
+ + +
+ + + + + + + + +
+ + +
+
{{bez}}
+{{wert?wert:'-'}} +
+ + + +
+ + +
+ + + +
+
`, + +}; \ No newline at end of file diff --git a/public/js/components/Cis/Profil/ProfilComponents/QuickLinks.js b/public/js/components/Cis/Profil/ProfilComponents/QuickLinks.js new file mode 100644 index 000000000..7a78d2041 --- /dev/null +++ b/public/js/components/Cis/Profil/ProfilComponents/QuickLinks.js @@ -0,0 +1,74 @@ +export default{ + //TODO: To be implemented + props:{ + data:{ + type:String, + + }, + title:{ + type:String, + default: "Quick Links", + }, + mobile:{ + type:Boolean, + default:false, + } + }, + methods:{ + hideCollapse: function(){ + this.collapseOpen = false; + }, + showCollapse: function(){ + this.collapseOpen = true; + }, + }, + data(){ + return{ + collapseOpen: false, + + } + }, + template:` +
+ + +
`, +} \ No newline at end of file diff --git a/public/js/components/Cis/Profil/ProfilComponents/RoleInformation.js b/public/js/components/Cis/Profil/ProfilComponents/RoleInformation.js new file mode 100644 index 000000000..6303719de --- /dev/null +++ b/public/js/components/Cis/Profil/ProfilComponents/RoleInformation.js @@ -0,0 +1,72 @@ +export default { + data(){ + return { + + } + }, + props:{ + data:{ + type:Object, + }, + title:{ + type:String, + } + }, + computed:{ + + }, + created(){ + //TODO: check if data.Telefon is a valid telefon number to call before using it as a tel: link + }, + template:` +
+ +
+ {{title}} +
+
+
+
+ + + + + +
+
{{bez }}
+ + + {{wert?wert:'-'}} + + + {{wert?wert:'-'}} +
+ + + +
+ + + +
+ + + + + + + +
+
+ +
+ +
` +}; \ No newline at end of file