mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-02 11:29:27 +00:00
code quality
This commit is contained in:
@@ -142,13 +142,13 @@ export default {
|
||||
}
|
||||
this.$api
|
||||
.call(endpoint)
|
||||
.then(result => {
|
||||
.then(() => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.$reloadList();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
addSpecialGroup(params) {
|
||||
addSpecialGroup() {
|
||||
const gruppe_kurzbz = this.$refs.newGroupModal.value.gruppe_kurzbz || this.$refs.newGroupModal.value;
|
||||
|
||||
if (Array.isArray(this.modelValue)) {
|
||||
@@ -183,7 +183,7 @@ export default {
|
||||
} else {
|
||||
this.$refs.newGroupModal.$refs.form
|
||||
.call(ApiStvGroups.add(this.modelValue.uid, gruppe_kurzbz, this.currentSemester))
|
||||
.then(result => {
|
||||
.then(() => {
|
||||
this.$refs.newGroupModal.hide();
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('gruppenmanagement/groups_added', { n: 1 }));
|
||||
this.$refs.list.reload();
|
||||
|
||||
@@ -162,7 +162,6 @@ export default {
|
||||
if (this.studiengang_kz === false)
|
||||
return;
|
||||
|
||||
let lvbList;
|
||||
this.$api
|
||||
.call(ApiStvLvb.getTree(this.studiengang_kz))
|
||||
.then(result => this.lvbList = result.data)
|
||||
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
this.hide();
|
||||
}
|
||||
},
|
||||
onEnter(evt) {
|
||||
onEnter() {
|
||||
/**
|
||||
* NOTE(chris): PrimeVue: AutoComplete: Enter does not submit form #5618
|
||||
* @see https://github.com/primefaces/primevue/issues/5618
|
||||
|
||||
@@ -59,8 +59,12 @@ export default {
|
||||
{title:"Vornamen", field:"vornamen", visible:false, headerFilter: true},
|
||||
{title:"TitelPost", field:"titelpost", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title:"Ersatzkennzeichen", field:"ersatzkennzeichen", headerFilter: true},
|
||||
{title:"Geburtsdatum", field:"gebdatum", formatter:dateFormatter,
|
||||
headerFilter: true, headerFilterFunc: function(headerValue, rowValue, rowData, filterParams) {
|
||||
{
|
||||
title: "Geburtsdatum",
|
||||
field: "gebdatum",
|
||||
formatter: dateFormatter,
|
||||
headerFilter: true,
|
||||
headerFilterFunc(headerValue, rowValue) {
|
||||
const matches = headerValue.match(/^(([0-9]{2})\.)?([0-9]{2})\.([0-9]{4})?$/);
|
||||
let comparestr = headerValue;
|
||||
if(matches !== null) {
|
||||
@@ -293,11 +297,13 @@ export default {
|
||||
onKeydown(e) { // TODO(chris): this should be in the filter component
|
||||
if (!this.focusObj)
|
||||
return;
|
||||
|
||||
var next;
|
||||
switch (e.code) {
|
||||
case 'Enter':
|
||||
case 'Space':
|
||||
e.preventDefault();
|
||||
const e2 = new Event('click', e);
|
||||
var e2 = new Event('click', e);
|
||||
e2.altKey = e.altKey;
|
||||
e2.ctrlKey = e.ctrlKey;
|
||||
e2.shiftKey = e.shiftKey;
|
||||
@@ -306,13 +312,13 @@ export default {
|
||||
break;
|
||||
case 'ArrowUp':
|
||||
e.preventDefault();
|
||||
var next = this.focusObj.previousElementSibling;
|
||||
next = this.focusObj.previousElementSibling;
|
||||
if (next)
|
||||
this.changeFocus(this.focusObj, next);
|
||||
break;
|
||||
case 'ArrowDown':
|
||||
e.preventDefault();
|
||||
var next = this.focusObj.nextElementSibling;
|
||||
next = this.focusObj.nextElementSibling;
|
||||
if (next)
|
||||
this.changeFocus(this.focusObj, next);
|
||||
break;
|
||||
|
||||
@@ -240,7 +240,7 @@ export default {
|
||||
res += ' (' + student.vorname + ' ' + student.nachname + ')';
|
||||
return res;
|
||||
},
|
||||
dropStudents(node, students, evt) {
|
||||
dropStudents(node, students) {
|
||||
const data = node.data;
|
||||
|
||||
let endpoint;
|
||||
@@ -335,7 +335,7 @@ export default {
|
||||
:data-tree-item-key="node.key"
|
||||
:title="node.data.studiengang_kz"
|
||||
v-drag-click="() => toggleTreeNode(node)"
|
||||
v-drop:link-strict.student-collection="(evt, students) => dropStudents(node, students, evt)"
|
||||
v-drop:link-strict.student-collection="(evt, students) => dropStudents(node, students)"
|
||||
>
|
||||
{{ node.data.name }}
|
||||
</span>
|
||||
|
||||
@@ -13,7 +13,7 @@ const EFFECTS = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mounted(el, binding, vnode) {
|
||||
mounted(el, binding) {
|
||||
updateValue(el, binding.value);
|
||||
updateEffectAllowed(el, binding.arg);
|
||||
|
||||
|
||||
@@ -7,10 +7,8 @@ const EFFECTS = [
|
||||
'none'
|
||||
];
|
||||
|
||||
let id = 0;
|
||||
|
||||
export default {
|
||||
mounted(el, binding, vnode) {
|
||||
mounted(el, binding) {
|
||||
const allowedTypes = Object.keys(binding.modifiers);
|
||||
allowedTypes.forEach(type => {
|
||||
if (type.substr(-11) == '-collection') {
|
||||
|
||||
@@ -50,20 +50,20 @@ function isValidDragObject(value) {
|
||||
return false;
|
||||
|
||||
if (value.type.substr(-11) == '-collection') {
|
||||
if (!value.hasOwnProperty('values'))
|
||||
if (!Object.prototype.hasOwnProperty.call(value, 'values'))
|
||||
return false;
|
||||
|
||||
if (!VALID_TYPES.includes(value.type.substr(0, value.type.length-11)))
|
||||
return false;
|
||||
} else {
|
||||
if (!value.hasOwnProperty('id'))
|
||||
if (!Object.prototype.hasOwnProperty.call(value, 'id'))
|
||||
return false;
|
||||
|
||||
if (!VALID_TYPES.includes(value.type))
|
||||
return false;
|
||||
|
||||
if (TYPE_DEFINITION[value.type].extras) {
|
||||
if (!TYPE_DEFINITION[value.type].extras.every(extra => value.hasOwnProperty(extra)))
|
||||
if (!TYPE_DEFINITION[value.type].extras.every(extra => Object.prototype.hasOwnProperty.call(value, extra)))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ function getValidTransferData(event, allowedTypes, strict) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} catch(error) {
|
||||
} catch(_error) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -175,15 +175,15 @@ function convertToValidDragObject(data, strict) {
|
||||
});
|
||||
}
|
||||
|
||||
if (data.hasOwnProperty('type') && isValidDragObject(data)) {
|
||||
if (Object.prototype.hasOwnProperty.call(data, 'type') && isValidDragObject(data)) {
|
||||
return data;
|
||||
}
|
||||
|
||||
const found = Object.entries(TYPE_DEFINITION).find(([type, typedef]) => {
|
||||
if (!data.hasOwnProperty(typedef.id))
|
||||
const found = Object.entries(TYPE_DEFINITION).find(([ , typedef ]) => {
|
||||
if (!Object.prototype.hasOwnProperty.call(data, typedef.id))
|
||||
return false;
|
||||
if (typedef.extras) {
|
||||
if (!typedef.extras.every(extra => data.hasOwnProperty("extra")))
|
||||
if (!typedef.extras.every(extra => Object.prototype.hasOwnProperty.call(data, extra)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -199,7 +199,7 @@ function convertToValidDragObject(data, strict) {
|
||||
newData.type = type;
|
||||
newData.id = data[typedef.id];
|
||||
if (typedef.extras)
|
||||
typedef.extras.forEach(extra => newData[extras] = data[extra]);
|
||||
typedef.extras.forEach(extra => newData[extra] = data[extra]);
|
||||
|
||||
return newData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user