Merge branch 'feature-25999/C4' into feature-40309/Cis_News_widget

This commit is contained in:
SimonGschnell
2024-07-24 14:40:15 +02:00
26 changed files with 1833 additions and 458 deletions
+9 -9
View File
@@ -2,11 +2,10 @@ import StudentProfil from "../../components/Cis/Profil/StudentProfil.js";
import MitarbeiterProfil from "../../components/Cis/Profil/MitarbeiterProfil.js";
import ViewStudentProfil from "../../components/Cis/Profil/StudentViewProfil.js";
import ViewMitarbeiterProfil from "../../components/Cis/Profil/MitarbeiterViewProfil.js";
import fhcapifactory from "../api/fhcapifactory.js";
import Loading from "../../components/Loader.js";
import Phrasen from "../../plugin/Phrasen.js";
Vue.$fhcapi = fhcapifactory;
Vue.$collapseFormatter = function (data) {
//data - an array of objects containing the column title and value for each cell
var container = document.createElement("div");
@@ -317,16 +316,16 @@ const profilApp = Vue.createApp({
?.filter((item) => {
return !this.data.profilUpdates?.some((update) => {
return (
update.status === "pending" &&
update.status === this.profilUpdateStates["Pending"] &&
update.requested_change?.adresse_id == item.adresse_id
);
});
})
.map((kontakt) => {
.map((adresse) => {
return {
listview: "Adresse",
view: "EditAdresse",
data: kontakt,
data: adresse,
};
}),
},
@@ -352,9 +351,10 @@ const profilApp = Vue.createApp({
},
},
created() {
async created() {
// fetch profilUpdateStates to provide them to children components
Vue.$fhcapi.ProfilUpdate.getStatus()
await this.$fhcApi.factory.profilUpdate.getStatus()
.then((response) => {
this.profilUpdateStates = response.data;
})
@@ -362,7 +362,7 @@ const profilApp = Vue.createApp({
console.error(error);
});
Vue.$fhcapi.ProfilUpdate.getTopic()
this.$fhcApi.factory.profilUpdate.getTopic()
.then((response) => {
this.profilUpdateTopic = response.data;
})
@@ -373,7 +373,7 @@ const profilApp = Vue.createApp({
//? uid contains the last part of the uri
let uid = location.pathname.split("/").pop();
Vue.$fhcapi.UserData.getView(uid).then((res) => {
this.$fhcApi.factory.profil.getView(uid).then((res) => {
if (!res.data) {
this.notFoundUID = uid;
} else {
+1 -3
View File
@@ -1,7 +1,5 @@
import fhcapifactory from "../api/fhcapifactory.js";
import ProfilUpdateView from "../../components/Cis/ProfilUpdate/ProfilUpdateView.js";
import Phrasen from "../../plugin/Phrasen.js";
Vue.$fhcapi = fhcapifactory;
const app = Vue.createApp({
components: {
@@ -22,7 +20,7 @@ const app = Vue.createApp({
},
methods: {},
created() {
Vue.$fhcapi.ProfilUpdate.getStatus()
this.$fhcApi.factory.profilUpdate.getStatus()
.then((response) => {
this.profilUpdateStates = response.data;
})
-4
View File
@@ -1,11 +1,7 @@
import Search from "./search.js";
import Cms from "./cms.js";
import UserData from "./userdata.js";
import ProfilUpdate from "./profilUpdate.js"
export default {
"Search": Search,
"UserData": UserData,
"ProfilUpdate": ProfilUpdate,
"Cms": Cms,
};
-120
View File
@@ -1,120 +0,0 @@
export default {
//! API calls for profil update requests
getStatus: function () {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
"/Cis/ProfilUpdate/getStatus";
return axios.get(url);
},
getTopic: function () {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
"/Cis/ProfilUpdate/getTopic";
return axios.get(url);
},
getProfilUpdateRequest: function () {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
"/Cis/ProfilUpdate/getAllRequests";
return axios.get(url);
},
acceptProfilRequest: function (payload) {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
"/Cis/ProfilUpdate/acceptProfilRequest";
return axios.post(url, payload);
},
denyProfilRequest: function (payload) {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
"/Cis/ProfilUpdate/denyProfilRequest";
return axios.post(url, payload);
},
replaceProfilUpdateAttachment: function (dms) {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
`/Cis/ProfilUpdate/replaceProfilUpdateAttachment`;
return axios.post(url, dms, {
headers: { "Content-Type": "multipart/form-data" },
});
},
//? new reuquests
insertFile: function (dms, replace = null) {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
`/Cis/ProfilUpdate/insertFile/${replace}`;
return axios.post(url, dms, {
headers: { "Content-Type": "multipart/form-data" },
});
},
getProfilRequestFiles: function (requestID) {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
`/Cis/ProfilUpdate/getProfilRequestFiles`;
return axios.post(url, requestID);
},
selectProfilRequest: function (uid = null, id = null) {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
`/Cis/ProfilUpdate/selectProfilRequest`;
return axios.get(url, { uid: uid, id: id });
},
insertProfilRequest: function (topic, payload, fileID = null) {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
`/Cis/ProfilUpdate/insertProfilRequest`;
return axios.post(url, {
topic,
payload,
...(fileID ? { fileID: fileID } : {}),
});
},
updateProfilRequest: function (topic, payload, ID, fileID = null) {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
`/Cis/ProfilUpdate/updateProfilRequest`;
return axios.post(url, {
topic,
payload,
ID,
...(fileID ? { fileID: fileID } : {}),
});
},
deleteProfilRequest: function (requestID) {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
`/Cis/ProfilUpdate/deleteProfilRequest`;
return axios.post(url, requestID);
},
};
-58
View File
@@ -1,58 +0,0 @@
export default {
//! API Calls for Profil Views
getGemeinden: function(nation,zip=null){
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
`cis.php/Cis/Profil/getGemeinden`;
return axios.get(url,{params:{nation:nation,zip:zip}});
},
getAllNationen:function(){
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
`cis.php/Cis/Profil/getAllNationen`;
return axios.get(url);
},
getView: function (uid) {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root + `cis.php/Cis/Profil/getView/${uid}`;
return axios.get(url);
},
sperre_foto_function: function (value) {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
`cis.php/Cis/Profil/foto_sperre_function/${value}`;
return axios.get(url);
},
isStudent: function (uid) {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
`cis.php/Cis/Profil/isStudent/${uid}`;
return axios.get(url);
},
isMitarbeiter: function (uid) {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
`cis.php/Cis/Profil/isMitarbeiter/${uid}`;
return axios.get(url);
},
getZustellAdresse: function () {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
`cis.php/Cis/Profil/getZustellAdresse`;
return axios.get(url);
},
getZustellKontakt: function () {
const url =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
`cis.php/Cis/Profil/getZustellKontakt`;
return axios.get(url);
},
};