Merge branch 'feature-69710/FHC4_Studierendenverwaltung/Filterverhalten_bei_Aenderungen' into studvw_2026-02_rc4

This commit is contained in:
Harald Bamberger
2026-02-03 10:46:57 +01:00
4 changed files with 85 additions and 8 deletions
@@ -146,7 +146,8 @@ export default {
sprachen: [],
geschlechter: []
},
verbandEndpoint: ApiStvVerband
verbandEndpoint: ApiStvVerband,
filter: []
}
},
computed: {
@@ -392,6 +393,7 @@ export default {
}
},
onSearch(e) {
this.deleteCustomFilter();
const searchsettings = { ...this.$refs.searchbar.searchsettings };
if (searchsettings.searchstr.length >= 2) {
this.blurSearchbar();
@@ -420,6 +422,12 @@ export default {
this.$refs.searchbar.$refs.input.blur();
this.$refs.searchbar.abort();
this.$refs.searchbar.hideresult();
},
handleCustomFilter(filter){
this.filter = filter;
},
deleteCustomFilter(){
this.$refs.stvList.resetFilter();
}
},
created() {
@@ -625,7 +633,7 @@ export default {
<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"></stv-list>
<stv-list ref="stvList" v-model:selected="selected" :studiengang-kz="studiengangKz" :studiensemester-kurzbz="studiensemesterKurzbz" @filterActive="handleCustomFilter"></stv-list>
</template>
<template #bottom>
<stv-details ref="details" :students="selected"></stv-details>
@@ -43,7 +43,8 @@ export default {
studiensemesterKurzbz: String
},
emits: [
'update:selected'
'update:selected',
'filterActive'
],
data() {
function dateFormatter(cell)
@@ -274,7 +275,7 @@ export default {
let today = new Date().toLocaleDateString('en-GB')
.replace(/\//g, '_');
return "StudentList_" + today + ".csv";
}
},
},
watch: {
'$p.user_language.value'(n, o) {
@@ -398,13 +399,14 @@ export default {
},
updateFilter(filter) {
this.filter = filter;
this.$emit('filterActive', filter);
this.updateUrl();
},
updateUrl(endpoint, first) {
this.lastSelected = first ? undefined : this.selected;
console.log('function param endpoint: ' + JSON.stringify(endpoint));
console.log('current endpoint: ' + JSON.stringify(this.currentEndpoint));
/* console.log('function param endpoint: ' + JSON.stringify(endpoint));
console.log('current endpoint: ' + JSON.stringify(this.currentEndpoint));*/
if( endpoint === undefined && this.currentEndpoint === null)
{
@@ -435,6 +437,7 @@ export default {
this.tabulatorOptions.ajaxURL = endpoint.url;
this.tabulatorOptions.ajaxParams = { ...params };
this.tabulatorOptions.ajaxConfig = {method};
if (!this.$refs.table.tableBuilt) {
if (this.$refs.table.tabulator) {
this.$refs.table.tabulator.on("tableBuilt", () => {
@@ -529,7 +532,9 @@ export default {
getAllRows() {
this.allRows = this.$refs.table.tabulator.getRows();
},
resetFilter(){
this.$refs.listfilter.resetFilter();
}
},
// TODO(chris): focusin, focusout, keydown and tabindex should be in the filter component
// TODO(chris): filter component column chooser has no accessibilty features
@@ -544,6 +549,7 @@ export default {
v-draggable:copyLink.capture="selectedDragObject"
@dragend="dragCleanup"
>
<core-filter-cmpt
ref="table"
:description="countsToHTML"
@@ -557,6 +563,7 @@ export default {
:new-btn-label="$p.t('stv/action_new')"
@click:new="actionNewPrestudent"
@table-built="translateTabulator"
:useSelectionSpan="false"
>
<template #actions>
@@ -570,10 +577,26 @@ export default {
></core-tag>
</template>
<template #actions v-if="filter.length">
<div class="d-flex align-items-center gap-2 ps-4">
<p class="text-danger mb-0">
<strong>{{$p.t('filter','filterActive')}}</strong>
</p>
<button
class="btn btn-outline-danger sm"
:title="$p.t('filter/filterDelete')"
@click="resetFilter"
>
<span class="fa-solid fa-filter-circle-xmark"></span>
</button>
</div>
</template>
<template #filter>
<div class="card">
<div class="card-body">
<list-filter @change="updateFilter" />
<list-filter ref="listfilter" @change="updateFilter" :filterActive="filter.length" />
</div>
</div>
</template>
@@ -7,6 +7,9 @@ export default {
components: {
FilterItem
},
props: {
filterActive: Boolean,
},
emits: [
'change'
],
@@ -74,6 +77,9 @@ export default {
},
remove(index) {
this.filters.splice(index, 1);
},
resetFilter(){
this.filters = [];
}
},
created() {
+40
View File
@@ -2240,6 +2240,46 @@ $phrases = array(
)
)
),
array(
'app' => 'core',
'category' => 'filter',
'phrase' => 'filterDelete',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Filter zurücksetzen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'delete filter',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'filter',
'phrase' => 'filterActive',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Filter aktiv',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'filter active',
'description' => '',
'insertvon' => 'system'
)
)
),
//**************************** CORE/person
array(