Compare commits

..

5 Commits

Author SHA1 Message Date
ma0068 e23cadf39d use new api for getUri 2026-03-25 15:04:02 +01:00
ma0068 9b1774fabe refactor deprecated functions of LvUebersicht 2026-03-25 13:23:53 +01:00
ma0068 2112506832 refactor function deleteFile and delete comment 2026-03-25 10:37:24 +01:00
ma0068 bea4e2cf34 update comments 2026-03-24 14:05:26 +01:00
ma0068 b0da4e7dc5 update comments for notiz factory 2026-03-24 13:57:39 +01:00
13 changed files with 79 additions and 74 deletions
+38
View File
@@ -0,0 +1,38 @@
/**
* Copyright (C) 2026 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export default {
getAllStudienSemester(studiensemester, studiengang, semester, studienplan) {
return {
method: 'get',
url: 'api/frontend/v1/Studium/getStudienAllSemester/',
params: {studiensemester, studiengang, semester, studienplan}
};
},
getLvPlanForStudiensemester(studiensemester, lvid) {
return {
method: 'get',
url: '/api/frontend/v1/LvPlan/getLvPlanForStudiensemester/'+ studiensemester + '/' + lvid
};
},
getLvEvaluierungInfo(studiensemester_kurzbz, lvid) {
return {
method: 'get',
url: 'api/frontend/v1/Studium/getLvEvaluierungInfo/' + studiensemester_kurzbz + '/' + lvid
};
},
}
-1
View File
@@ -60,7 +60,6 @@ export default {
};
},
deleteFile(akte_id){
console.log("in deleteFile " + akte_id);
return {
method: 'post',
url: 'api/frontend/v1/stv/dokumente/deleteAkte/' + akte_id,
@@ -2,6 +2,7 @@ import BsModal from "../../Bootstrap/Modal.js";
import LvMenu from "./LvMenu.js";
import ApiAddons from '../../../api/factory/addons.js';
import ApiCisStudium from '../../../api/factory/cis/studium.js';
export default {
@@ -63,7 +64,8 @@ export default {
// check lv evaluierung info
if (this.studium_studiensemester) {
this.$fhcApi.factory.studium.getLvEvaluierungInfo(this.studium_studiensemester, this.event.lehreinheit_id ?? this.event.lehrveranstaltung_id)
this.$api
.call(ApiCisStudium.getLvEvaluierungInfo(this.studium_studiensemester, this.event.lehreinheit_id ?? this.event.lehrveranstaltung_id))
.then(data => data.data)
.then(res => {
this.lvEvaluierungMessage = res.message;
@@ -72,7 +74,8 @@ export default {
// check if the lv has lvplan entries for this studiensemester
if (this.studiensemester && this.event) {
return this.$fhcApi.factory.studium.getLvPlanForStudiensemester(this.studiensemester, this.event.lehreinheit_id ?? this.event.lehrveranstaltung_id)
return this.$api
.call(ApiCisStudium.getLvPlanForStudiensemester(this.studiensemester, this.event.lehreinheit_id ?? this.event.lehrveranstaltung_id))
.then(data => data.data)
.then(res => {
if (Array.isArray(res) && res.length > 0) {
+16 -11
View File
@@ -1,4 +1,5 @@
import LvUebersicht from "../Mylv/LvUebersicht.js";
import ApiCisStudium from '../../../api/factory/cis/studium.js';
export default {
@@ -97,28 +98,32 @@ export default {
return value;
},
changeSelectedStudienSemester(studiensemester_kurzbz) {
this.$fhcApi.factory.studium.getAllStudienSemester(studiensemester_kurzbz, this.selectedStudiengang, this.selectedSemester, this.selectedStudienordnung)
return this.$api
.call(ApiCisStudium.getAllStudienSemester(studiensemester_kurzbz, this.selectedStudiengang, this.selectedSemester, this.selectedStudienordnung))
.then(data => data.data)
.then(res => {
this.extractPropertyValues(res);
})
},
changeSelectedStudienGang(studiengang_kz) {
this.$fhcApi.factory.studium.getAllStudienSemester(this.selectedStudiensemester, studiengang_kz, this.selectedSemester, this.selectedStudienordnung)
return this.$api
.call(ApiCisStudium.getAllStudienSemester(this.selectedStudiensemester, studiengang_kz, this.selectedSemester, this.selectedStudienordnung))
.then(data => data.data)
.then(res => {
this.extractPropertyValues(res);
})
},
changeSelectedSemester(semester) {
this.$fhcApi.factory.studium.getAllStudienSemester(this.selectedStudiensemester, this.selectedStudiengang, semester, this.selectedStudienordnung)
return this.$api
.call(ApiCisStudium.getAllStudienSemester(this.selectedStudiensemester, this.selectedStudiengang, semester, this.selectedStudienordnung))
.then(data => data.data)
.then(res => {
this.extractPropertyValues(res);
})
},
changeSelectedStudienPlan(studienplan_id) {
this.$fhcApi.factory.studium.getAllStudienSemester(this.selectedStudiensemester, this.selectedStudiengang, this.selectedSemester, studienplan_id)
return this.$api
.call(ApiCisStudium.getAllStudienSemester(this.selectedStudiensemester, this.selectedStudiengang, this.selectedSemester, studienplan_id))
.then(data => data.data)
.then(res => {
this.extractPropertyValues(res);
@@ -209,7 +214,7 @@ export default {
default:
return `${studiensemester}`;
}
}
},
},
computed:{
@@ -256,12 +261,12 @@ export default {
const studienordnung = JSON.parse(this.getDataFromLocalStorage("studienordnung")) ?? undefined;
// only fetch default data if no data is stored in the local storage
this.$fhcApi.factory.studium.getAllStudienSemester(studiensemester, studiengang, semester, studienordnung)
.then(data => data.data)
.then(res => {
this.extractPropertyValues(res);
})
this.$api
.call(ApiCisStudium.getAllStudienSemester(studiensemester, studiengang, semester, studienordnung))
.then(data => data.data)
.then(res => {
this.extractPropertyValues(res);
})
},
template: `
@@ -508,7 +508,7 @@ export default {
this.handlePersonUrl();
},
template: /* html */`
<div class="stv" :class="{ 'sidebar-collapsed': sidebarCollapsed }" data-cy="studentenverwaltung">
<div class="stv" :class="{ 'sidebar-collapsed': sidebarCollapsed }">
<header class="navbar navbar-expand-lg navbar-dark bg-dark flex-md-nowrap p-0 shadow">
<div class="col-md-4 col-lg-3 col-xl-2 d-flex align-items-center">
<button
@@ -632,14 +632,14 @@ export default {
</app-menu>
</div>
</aside>
<nav id="sidebarMenu" class="bg-light offcanvas offcanvas-start col-md p-md-0 h-100" data-cy="stv-sidebar">
<nav id="sidebarMenu" class="bg-light offcanvas offcanvas-start col-md p-md-0 h-100">
<div class="offcanvas-header justify-content-end px-1 d-md-none">
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" :aria-label="$p.t('ui/schliessen')"></button>
</div>
<stv-verband :preselectedKey="studiengangKz ? '' + studiengangKz : null" :endpoint="verbandEndpoint" @select-verband="onSelectVerband" class="col" style="height:0%"></stv-verband>
<stv-studiensemester v-model:studiensemester-kurzbz="studiensemesterKurzbz" @update:studiensemester-kurzbz="studiensemesterChanged"></stv-studiensemester>
</nav>
<main class="col-md-8 ms-sm-auto col-lg-9 col-xl-10" data-cy="stv-main">
<main class="col-md-8 ms-sm-auto col-lg-9 col-xl-10">
<vertical-split>
<template #top>
<stv-list ref="stvList" v-model:selected="selected" :studiengang-kz="studiengangKz" :studiensemester-kurzbz="studiensemesterKurzbz" @filterActive="handleCustomFilter"></stv-list>
@@ -86,7 +86,7 @@ export default {
this.loadConfig();
},
template: `
<div class="stv-details h-100 d-flex flex-column" data-cy="stv-details">
<div class="stv-details h-100 d-flex flex-column">
<div v-if="!students?.length" class="justify-content-center d-flex h-100 align-items-center">
{{$p.t('ui', 'chooseStudent')}}
</div>
@@ -108,7 +108,6 @@ export default {
<fhc-tabs
v-if="students.length == 1"
ref="tabs"
data-cy="stv-details-tabs"
:useprimevue="true"
:modelValue="students[0]"
:config="config"
@@ -117,17 +116,7 @@ export default {
@changed="reload"
>
</fhc-tabs>
<fhc-tabs
v-else
ref="tabs"
data-cy="stv-details-tabs"
:useprimevue="true"
:modelValue="students"
:config="config"
:default="$route.params.tab"
style="flex: 1 1 0%; height: 0%"
@changed="reload">
</fhc-tabs>
<fhc-tabs v-else ref="tabs" :useprimevue="true" :modelValue="students" :config="config" :default="$route.params.tab" style="flex: 1 1 0%; height: 0%" @changed="reload"></fhc-tabs>
</div>
<div v-else>
Loading...
@@ -306,7 +306,8 @@ export default {
});
},
deleteFile(akte_id){
return this.$fhcApi.factory.stv.documents.deleteFile(akte_id)
return this.$api
.call(ApiStvDocuments.deleteFile(akte_id))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
})
@@ -13,7 +13,7 @@ export default {
}
},
template: `
<div class="stv-details-multistatus h-100" data-cy="stv-tab-multistatus">
<div class="stv-details-multistatus h-100">
<tbl-multi-status :model-value="modelValue" :config="config"></tbl-multi-status>
</div>
`
@@ -18,7 +18,7 @@ export default {
template: `
<div class="stv-details-notizen h-100 pb-3">
<!-- Test Version classicFas for enter with one click vs popupModal-->
<!-- Test Version popupModal-->
<core-notiz
class="overflow-hidden"
:endpoint="endpoint"
@@ -32,15 +32,15 @@ export default {
@reload="$emit('update:suffix')"
tabulator-persistence-id="stv-notiz-20260217"
>
</core-notiz>
</core-notiz>
<!--
---------------------------------------------------------------------------------------------
-------------------- DESCRIPTION FOR PARAMETER PROPS ----------------------------------------
---------------------------------------------------------------------------------------------
endpoint: for corecontroller: eg: :endpoint="$fhcApi.factory.notiz.person"
(...prestudent, ...mitarbeiter, ...bestellung, ...lehreinheit, ...projekt, ...projektphase, ...projekttask, ...anrechnung)
endpoints for coreControllers: prestudent, mitarbeiter, bestellung, lehreinheit, projekt, projektphase, projekttask, anrechnung
import ApiNotiz[...] from '../../../../api/factory/notiz/[...].js';
for extensions: write own controller extending core NotizController
@@ -58,7 +58,7 @@ showDocument: if true: section with documentHandling will be displayed
showTinyMCE: if true: section with WYSIWYG Editor for Text will be displayed
visibleColumns: list, which fields shoult be showed as default in filter component
visibleColumns: list, which fields should be shown as default in filter component
fullVersion: :visibleColumns="['titel','text','bearbeiter','verfasser','von','bis','dokumente','erledigt','notiz_id','notizzuordnung_id','id','lastupdate']"
@@ -76,7 +76,7 @@ visibleColumns: list, which fields shoult be showed as default in filter compone
---------------------------------------------------------------------------------------------
<core-notiz
:endpoint="$fhcApi.factory.notiz.mitarbeiter"
:endpoint="endpoint"
ref="formc"
type-id="uid"
:id= "'ma0068'"
@@ -89,7 +89,7 @@ visibleColumns: list, which fields shoult be showed as default in filter compone
</core-notiz>
<core-notiz
:endpoint="$fhcApi.factory.notiz.prestudent"
:endpoint="endpoint"
ref="formc"
type-id="prestudent_id"
:id="modelValue.prestudent_id"
@@ -102,7 +102,7 @@ visibleColumns: list, which fields shoult be showed as default in filter compone
</core-notiz>
<core-notiz
:endpoint="$fhcApi.factory.notiz.projekt"
:endpoint="endpoint"
ref="formc"
type-id="projekt_kurzbz"
:id="'EA74'"
@@ -152,7 +152,6 @@ export default{
button.className = 'btn btn-outline-secondary btn-action';
button.innerHTML = '<i class="fa fa-forward"></i>';
button.title = this.$p.t('ui', 'btn_statusVorruecken');
button.setAttribute('data-cy', 'status-btn-advance');
button.addEventListener('click', () =>
this.actionAdvanceStatus(data.status_kurzbz, data.studiensemester_kurzbz, data.ausbildungssemester)
);
@@ -165,7 +164,6 @@ export default{
button.className = 'btn btn-outline-secondary btn-action';
button.innerHTML = '<i class="fa fa-check"></i>';
button.title = this.$p.t('ui', 'btn_confirmStatus');
button.setAttribute('data-cy', 'status-btn-confirm');
button.addEventListener('click', () =>
this.actionConfirmStatus(data.status_kurzbz, data.studiensemester_kurzbz, data.ausbildungssemester)
);
@@ -177,7 +175,6 @@ export default{
button.className = 'btn btn-outline-secondary btn-action';
button.innerHTML = '<i class="fa fa-edit"></i>';
button.title = this.$p.t('ui', 'btn_editStatus');
button.setAttribute('data-cy', 'status-btn-edit');
button.addEventListener('click', () =>
this.actionEditStatus(data.status_kurzbz, data.studiensemester_kurzbz, data.ausbildungssemester)
);
@@ -189,7 +186,6 @@ export default{
button.className = 'btn btn-outline-secondary btn-action';
button.innerHTML = '<i class="fa fa-xmark"></i>';
button.title = this.$p.t('ui', 'btn_deleteStatus');
button.setAttribute('data-cy', 'status-btn-delete');
button.addEventListener('click', () =>
this.actionDeleteStatus(data.status_kurzbz, data.studiensemester_kurzbz, data.ausbildungssemester)
);
@@ -208,11 +204,6 @@ export default{
{
row.getElement().classList.add('text-black','text-opacity-50','fst-italic');
}
// data-cy: unique per status entry for Cypress assertions
const stdsem = rowData.studiensemester_kurzbz ?? 'unknown';
const status = rowData.status_kurzbz ?? 'unknown';
const sem = rowData.ausbildungssemester ?? '0';
row.getElement().setAttribute('data-cy', `status-row-${stdsem}-${status}-${sem}`);
},
layout: 'fitDataStretchFrozen',
layoutColumnsOnNewData: false,
@@ -402,7 +393,7 @@ export default{
.catch(this.$fhcAlert.handleSystemError);
},
template: `
<div class="stv-multistatus h-100 pt-3" data-cy="stv-multistatus">
<div class="stv-multistatus h-100 pt-3">
<status-modal
ref="test"
:meldestichtag="new Date(dataMeldestichtag)"
@@ -414,7 +405,6 @@ export default{
<core-filter-cmpt
v-if="!this.modelValue.length"
ref="table"
data-cy="stv-multistatus-table"
:tabulator-options="tabulatorOptions"
:tabulator-events="tabulatorEvents"
table-only
@@ -142,10 +142,6 @@ export default {
row.getElement().classList.add('text-black','text-opacity-50','fst-italic');
}
row.getElement().draggable = true
// data-cy for Cypress e2e: prefer prestudent_id, fall back to uid or person_id
const d = row.getData();
const id = d.prestudent_id ?? d.uid ?? d.person_id ?? 'unknown';
row.getElement().setAttribute('data-cy', 'student-row-' + id);
},
ajaxRequestFunc: (url, config, params) => {
@@ -604,12 +600,11 @@ export default {
// TODO(chris): focusin, focusout, keydown and tabindex should be in the filter component
// TODO(chris): filter component column chooser has no accessibilty features
template: `
<div class="stv-list h-100 pt-3" data-cy="stv-list">
<div class="stv-list h-100 pt-3">
<div
class="tabulator-container d-flex flex-column h-100"
:class="{'has-filter': filter.length}"
tabindex="0"
data-cy="stv-list-table-container"
@focusin="onFocus"
@keydown="onKeydown"
v-draggable:copyLink.capture="selectedDragObject"
@@ -61,15 +61,6 @@ export default {
},
noSemReloadNodes() {
return this.nodes.reduce(this.mapNodesToNoSemReloadNodes, []);
},
colPt() {
return {
rowToggler: ( options ) => {
return {
'data-cy': `tree-toggle-${options?.parent?.props?.node?.key ?? 'unknown'}`
}
}
}
}
},
watch: {
@@ -328,7 +319,7 @@ export default {
.catch(this.$fhcAlert.handleSystemError);
},
template: /* html */`
<div class="overflow-auto" tabindex="-1" data-cy="stv-verband-tree">
<div class="overflow-auto" tabindex="-1">
<pv-treetable
ref="tree"
class="stv-verband p-treetable-sm"
@@ -348,7 +339,6 @@ export default {
field="name"
expander
class="text-break"
:pt="colPt"
>
<template #header>
<div class="text-right">
@@ -359,7 +349,6 @@ export default {
v-model="filters['global']"
class="form-control ps-5"
placeholder="Search"
data-cy="verband-search"
>
</div>
</div>
@@ -369,7 +358,6 @@ export default {
v-if="['semester', 'verband', 'gruppe', 'gruppe_kurzbz'].some(key => node.data.hasOwnProperty(key))"
:data-tree-item-key="node.key"
:title="node.data.studiengang_kz"
:data-cy="'student-collection-'+node.key"
v-drag-click="() => toggleTreeNode(node)"
v-drop:link-strict.student-collection="(evt, students) => dropStudents(node, students)"
>
@@ -379,7 +367,6 @@ export default {
v-else
:data-tree-item-key="node.key"
:title="node.data.studiengang_kz"
:data-cy="'stg-node-label-'+node.key"
v-drag-click="() => toggleTreeNode(node)"
>
{{ node.data.name }}
@@ -396,7 +383,6 @@ export default {
v-if="favorites.on || favorites.list.length"
href="#"
@click.prevent="filterFav"
data-cy="favorite-icon-header"
>
<i
:class="favorites.on ? 'fa-solid' : 'fa-regular'"
@@ -412,7 +398,6 @@ export default {
data-link-fav-add
@click.prevent="markFav(node)"
@keydown.enter.stop.prevent="markFav(node)"
:data-cy="'favorite-icon-'+node.data.studiengang_kz"
>
<i
:class="favorites.list.includes(node.data.link + '') ? 'fa-solid' : 'fa-regular'"
+1 -1
View File
@@ -52,7 +52,7 @@ export default {
let url = this.res.content_url;
if (url.substr(0, 16) == '../index.ci.php/')
url = this.$fhcApi.getUri(url.substr(16));
url = this.$api.getUri(url.substr(16));
else if (url.substr(0, 3) == '../')
url = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/\/+$/, '') + url.substr(2);
return '<a href="' + url + '">' + url + '</a>';