Add removal of console logs in ClassSchedule components

This commit is contained in:
Ivymaster
2026-05-07 14:06:34 +02:00
parent 8d5588de02
commit a7c4571d25
9 changed files with 259 additions and 138 deletions
@@ -118,7 +118,7 @@ export default {
classTimeSlotTypes() {
this.overlays = this.overlays.map((overlay) => {
let type = this.classTimeSlotTypes.find(
(type) => type.unterrichtszeitentyp_kurzbz === overlay.type
(type) => type.unterrichtszeitentyp_kurzbz === overlay.type,
);
if (type) {
overlay.hexColor = type.hintergrundfarbe;
@@ -215,7 +215,7 @@ export default {
},
userLanguage() {
return Vue.ref(FHC_JS_DATA_STORAGE_OBJECT.user_language);
}
},
},
methods: {
createOverlay() {
@@ -252,7 +252,7 @@ export default {
firstSelectedElementNumber === null ||
lastSelectedElementNumber === null
) {
console.error("Selected elements do not have data-number attribute");
//console.error("Selected elements do not have data-number attribute");
return;
}
@@ -725,10 +725,10 @@ export default {
(overlay) => overlay.id === dropzoneItem.id,
);
if (!dropzoneOverlay) {
console.error(
"Could not find overlay for dropzone item with id " +
dropzoneItem.id,
);
// console.error(
// "Could not find overlay for dropzone item with id " +
// dropzoneItem.id,
// );
return;
}
@@ -759,7 +759,6 @@ export default {
"div[data-weekday='" + dropzoneOverlay.weekday + "']",
);
let closestPartBody = null;
partBodies.forEach((partBody) => {
const rect = partBody.getBoundingClientRect();
@@ -1381,9 +1380,9 @@ export default {
(type) => type.unterrichtszeitentyp_kurzbz === newType,
);
if (!classTimeSlotType) {
console.error(
"Could not find class time slot type for newType: " + newType,
);
// console.error(
// "Could not find class time slot type for newType: " + newType,
// );
return;
}
@@ -1431,10 +1430,10 @@ export default {
),
);
if (!selectedType) {
console.error(
"Could not find class time slot type for selected description: " +
selectedTypeDescription,
);
// console.error(
// "Could not find class time slot type for selected description: " +
// selectedTypeDescription,
// );
return;
}
@@ -1463,9 +1462,10 @@ export default {
},
getClassTimeSlotTypeLabel(classTimeSlotType) {
if (!classTimeSlotType) return "";
return this.userLanguage?.value === 'English' ?
classTimeSlotType.bezeichnung_mehrsprachig[1].value : classTimeSlotType.bezeichnung_mehrsprachig[0].value;
}
return this.userLanguage?.value === "English"
? classTimeSlotType.bezeichnung_mehrsprachig[1].value
: classTimeSlotType.bezeichnung_mehrsprachig[0].value;
},
},
unmounted() {
this.hideOverlayClassTimeTypePopover();
@@ -18,7 +18,8 @@ export default {
computed: {},
methods: {},
async created() {
this.organizationalUnitShortCode = this.$route.params.organizationalUnitShortCode;
this.organizationalUnitShortCode =
this.$route.params.organizationalUnitShortCode;
this.studyPlanId = parseInt(this.$route.params.studyPlanId);
let getAllClassTimeValidityPeriodsPerOrganizationalUnitResponse =
@@ -37,18 +38,19 @@ export default {
if (!this.studyPlanId) return true;
return period.studienplan_id === this.studyPlanId;
}
},
);
} else {
console.error(
"Error fetching class time slot validity periods:",
getAllClassTimeValidityPeriodsPerOrganizationalUnitResponse.meta
.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingClassScheduleValidityPeriods"),
);
}
for (let validityPeriod of this.classScheduleValidityPeriods) {
if (this.studyPlanId && validityPeriod.studienplan_id !== this.studyPlanId) {
if (
this.studyPlanId &&
validityPeriod.studienplan_id !== this.studyPlanId
) {
continue;
}
@@ -65,9 +67,11 @@ export default {
...getClassTimeSlotsForValidityPeriodResponse.data,
];
} else {
console.error(
`Error fetching class time slots for validity period ${validityPeriod.unterrichtszeitengueltigkeit_id}:`,
getClassTimeSlotsForValidityPeriodResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t(
"ui",
"errorFetchingClassScheduleTimeSlotForValidityPeriod",
),
);
}
}
@@ -90,9 +94,8 @@ export default {
},
);
} else {
console.error(
"Error fetching class time slot types:",
getAllClassTimeSlotTypesResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingClassScheduleTimeSlotTypes"),
);
}
},
@@ -54,7 +54,7 @@ export default {
isClassTimeSlotValidityPeriodModalVisible: false,
organizationalUnits: [],
filteredOrganizationalUnits: [],
allSemesters: [],
allSemesters: [],
filteredSemesters: [],
filterData: {
selectedOrganizationalUnit: null,
@@ -296,7 +296,7 @@ export default {
ende: semester.ende,
};
});
}
},
},
methods: {
async getParsedClassTimeSlotValidityPeriodData() {
@@ -334,9 +334,8 @@ export default {
},
);
} else {
console.error(
"Error fetching class time slot validity periods:",
getAllClassTimeValidityPeriodsResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingClassScheduleValidityPeriods"),
);
}
},
@@ -360,10 +359,6 @@ export default {
this.$refs.classTimeSlotValidityPeriodsTable.tabulator.replaceData();
})
.catch((error) => {
console.error(
"Error deleting class time slot validity period:",
error,
);
this.$fhcAlert.handleSystemError(error);
});
},
@@ -378,34 +373,44 @@ export default {
},
filterOrganizationalUnits(event) {
let defaultItem = {
label: '----------',
label: "----------",
value: null,
};
const query = event.query.toLowerCase();
if (!query) {
return this.filteredOrganizationalUnits = [defaultItem, ...this.dropdownParsedOrganizationalUnits];
return (this.filteredOrganizationalUnits = [
defaultItem,
...this.dropdownParsedOrganizationalUnits,
]);
}
return this.filteredOrganizationalUnits = [defaultItem].concat(this.dropdownParsedOrganizationalUnits).filter((unit) => {
return unit.label.toLowerCase().includes(query);
});
return (this.filteredOrganizationalUnits = [defaultItem]
.concat(this.dropdownParsedOrganizationalUnits)
.filter((unit) => {
return unit.label.toLowerCase().includes(query);
}));
},
filterSemesters(event) {
let defaultItem = {
label: '----------',
label: "----------",
value: null,
};
const query = event.query.toLowerCase();
if (!query) {
return this.filteredSemesters = [defaultItem, ...this.dropdownParsedSemesters];
return (this.filteredSemesters = [
defaultItem,
...this.dropdownParsedSemesters,
]);
}
return this.filteredSemesters = [defaultItem].concat(this.dropdownParsedSemesters).filter((semester) => {
return semester.label.toLowerCase().includes(query);
});
}
return (this.filteredSemesters = [defaultItem]
.concat(this.dropdownParsedSemesters)
.filter((semester) => {
return semester.label.toLowerCase().includes(query);
}));
},
},
async created() {
let getAllClassTimeValidityPeriodsResponse = await this.$api.call(
@@ -415,9 +420,8 @@ export default {
this.classTimeSlotValidityPeriods =
getAllClassTimeValidityPeriodsResponse.data;
} else {
console.error(
"Error fetching class time slot validity periods:",
getAllClassTimeValidityPeriodsResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingClassScheduleValidityPeriods"),
);
}
@@ -429,23 +433,19 @@ export default {
(a, b) => a.bezeichnung.localeCompare(b.bezeichnung),
);
} else {
console.error(
"Error fetching organizational units:",
getAllOrganizationalUnitsResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingOrganizationalUnits"),
);
}
let getAllSemestersResponse = await this.$api.call(
ApiStudienSemester.getAll('DESC'),
ApiStudienSemester.getAll("DESC"),
);
if (getAllSemestersResponse.meta.status === "success") {
this.allSemesters = getAllSemestersResponse.data;
} else {
console.error(
"Error fetching semesters:",
getAllSemestersResponse.meta.message,
);
}
this.$fhcAlert.alertError(this.$p.t("ui", "errorFetchingSemesters"));
}
},
mounted() {
this.$p
@@ -21,7 +21,11 @@ export default {
required: true,
},
},
emits: ["hideBsModal", "classTimeSlotTypeCreated", "classTimeSlotTypeUpdated"],
emits: [
"hideBsModal",
"classTimeSlotTypeCreated",
"classTimeSlotTypeUpdated",
],
watch: {
isVisible(newValue) {
if (newValue) {
@@ -68,9 +72,8 @@ export default {
},
);
} else {
console.error(
"Error fetching class schedule types:",
getAllClassScheduleTypeResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingClassScheduleTimeSlotTypes"),
);
}
},
@@ -147,7 +150,6 @@ export default {
this.getAllClassScheduleTypes();
})
.catch((error) => {
console.error("Error deleting class time slot type:", error);
this.$fhcAlert.handleSystemError(error);
});
},
@@ -174,7 +176,7 @@ export default {
async created() {
await this.getAllClassScheduleTypes();
},
template: /* html */`
template: /* html */ `
<bs-modal ref="classScheduleTypeModal" size="md" @hideBsModal="() => { $emit('hideBsModal'); resetClassTimeSlotTypeForm(); }">
<template #title>
<p v-if="hasLehreUnterrichtszeitenTypWPermission" class="fw-bold mt-3">{{$p.t('ui', 'editClassTimeSlotTypeModalTitle')}}</p>
@@ -87,7 +87,6 @@ export default {
this.classTimeSlots = [];
this.$emit("classTimeSlotsCreated");
} else {
console.error("Error creating class time slot validity period:", error);
this.$fhcAlert.handleSystemError(error);
}
},
@@ -107,10 +106,6 @@ export default {
this.classTimeSlots = [];
this.$emit("classTimeSlotsEdited");
} else {
console.error(
"Error editing class time slot validity period:",
response.meta.message,
);
this.$fhcAlert.handleSystemError(response.meta.message);
}
},
@@ -158,9 +153,8 @@ export default {
},
);
} else {
console.error(
"Error fetching class time slot types:",
getAllClassTimeSlotTypesResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingClassScheduleTimeSlotTypes"),
);
}
},
@@ -51,10 +51,6 @@ export default {
(unit) => unit.oe_kurzbz === validityPeriodData.oe_kurzbz,
);
if (!organizationalUnit) {
console.error(
"Organizational unit not found for validity period:",
validityPeriodData,
);
this.$fhcAlert.alertError(this.$p.t("ui", "errorLoadingData"));
return;
}
@@ -75,10 +71,6 @@ export default {
this.$refs.classTimeSlotValidityPeriodModal.show();
})
.catch((error) => {
console.error(
"Error fetching class time slot validity period details:",
error,
);
this.$fhcAlert.handleSystemError(error);
});
},
@@ -180,10 +172,10 @@ export default {
if (editedStudyPlan) {
this.studyPlans.push(editedStudyPlan);
} else {
console.error(
"Edited study plan not found:",
this.editedClassTimeSlotValidityPeriod.studienplan_id,
);
// console.error(
// "Edited study plan not found:",
// this.editedClassTimeSlotValidityPeriod.studienplan_id,
// );
}
}
}
@@ -248,10 +240,7 @@ export default {
),
);
if (getAllStudyPlansResponse.meta.status !== "success") {
console.error(
"Error fetching study plans:",
getAllStudyPlansResponse.meta.message,
);
this.$fhcAlert.alertError(this.$p.t("ui", "errorFetchingStudyPlans"));
}
return getAllStudyPlansResponse.data?.length
@@ -267,10 +256,7 @@ export default {
ApiStudienPlan.getStudyPlan(studienplan_id),
);
if (getStudyPlanResponse.meta.status !== "success") {
console.error(
"Error fetching study plan details:",
getStudyPlanResponse.meta.message,
);
this.$fhcAlert.alertError(this.$p.t("ui", "errorFetchingStudyPlan"));
return null;
}
@@ -297,9 +283,8 @@ export default {
),
);
if (getStudySemestersResponse.meta.status !== "success") {
console.error(
"Error fetching study semesters by organizational unit and dates:",
getStudySemestersResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingSemesters"),
);
}
@@ -324,9 +309,8 @@ export default {
),
);
if (getStudySemestersResponse.meta.status !== "success") {
console.error(
"Error fetching study semesters:",
getStudySemestersResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingSemesters"),
);
}
@@ -352,10 +336,6 @@ export default {
this.$emit("classTimeSlotValidityPeriodCreated");
})
.catch((error) => {
console.error(
"Error creating class time slot validity period:",
error,
);
this.$fhcAlert.handleSystemError(error);
});
},
@@ -384,10 +364,6 @@ export default {
this.$emit("classTimeSlotValidityPeriodUpdated");
})
.catch((error) => {
console.error(
"Error updating class time slot validity period:",
error,
);
this.$fhcAlert.handleSystemError(error);
});
},
@@ -434,9 +410,8 @@ export default {
(a, b) => a.bezeichnung.localeCompare(b.bezeichnung),
);
} else {
console.error(
"Error fetching organizational units:",
getAllOrganizationalUnitsResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingOrganizationalUnits"),
);
}
@@ -446,10 +421,7 @@ export default {
if (getAllStudyPlansResponse.meta.status === "success") {
this.studyPlans = getAllStudyPlansResponse.data;
} else {
console.error(
"Error fetching study plans:",
getAllStudyPlansResponse.meta.message,
);
this.$fhcAlert.alertError(this.$p.t("ui", "errorFetchingStudyPlans"));
}
let getAllClassTimeSlotTypesResponse = await this.$api.call(
@@ -470,9 +442,8 @@ export default {
},
);
} else {
console.error(
"Error fetching class time slot types:",
getAllClassTimeSlotTypesResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingClassScheduleTimeSlotTypes"),
);
}
},
@@ -60,9 +60,8 @@ export default {
this.$router.push({ name: "overview" });
}
} else {
console.error(
"Error fetching class time slot validity period:",
getClassTimeValidityPeriodResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingClassScheduleValidityPeriod"),
);
}
},
@@ -92,9 +91,8 @@ export default {
});
this.classTimeSlots = classTimeSlotsGroupedByWeek;
} else {
console.error(
"Error fetching class time slots for validity period:",
this.classTimeSlots,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingClassScheduleTimeSlotForValidityPeriod"),
);
}
},
@@ -119,7 +117,7 @@ export default {
};
}) || [];
this.showClassTimeSlotForm();
this.showClassTimeSlotForm();
},
deleteClassTimeSlotsForValidityPeriodPerGroup(groupIdentifikator) {
let isDeletionConfirmed = confirm(
@@ -143,7 +141,6 @@ export default {
this.fetchClassTimeSlots();
})
.catch((error) => {
console.error("Error deleting class time slots per group:", error);
this.$fhcAlert.handleSystemError(error);
});
},
@@ -186,10 +183,6 @@ export default {
this.$router.push({ name: "overview" });
})
.catch((error) => {
console.error(
"Error deleting class time slot validity period:",
error,
);
this.$fhcAlert.handleSystemError(error);
});
},
@@ -221,15 +214,14 @@ export default {
},
);
} else {
console.error(
"Error fetching class time slot types:",
getAllClassTimeSlotTypesResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorFetchingClassScheduleTimeSlotTypes"),
);
}
this.fetchClassTimeSlots();
},
template: /* html */`
template: /* html */ `
<div class="container mt-4">
<div class='mb-5'>
<div class="d-flex align-items-center justify-content-between mb-2">
@@ -64,7 +64,6 @@ export default {
},
methods: {
showClassScheduleValidityPeriod(classScheduleValidityPeriodId) {
this.$router.push({
name: "validityPeriodOverview",
params: {
+160
View File
@@ -58476,6 +58476,166 @@ I have been informed that I am under no obligation to consent to the transmissio
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'errorFetchingClassScheduleValidityPeriods',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Abrufen der Unterrichtszeit Gültigkeitszeiträume',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error fetching class schedule validity periods',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'errorFetchingClassScheduleValidityPeriod',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Abrufen des Unterrichtszeit Gültigkeitszeitraums',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error fetching class schedule validity period',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'errorFetchingClassScheduleTimeSlotForValidityPeriod',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Abrufen der Unterrichtszeiten für diesen Gültigkeitszeitraum',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error fetching class time slots for this validity period',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'errorFetchingClassScheduleTimeSlotTypes',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Abrufen der Unterrichtszeittypen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error fetching class time slot types',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'errorFetchingOrganizationalUnits',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Abrufen der Organisationseinheiten',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error fetching organizational units',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'errorFetchingSemesters',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Abrufen der Semester',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error fetching semesters',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'errorFetchingStudyPlans',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Abrufen der Studienpläne',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error fetching study plans',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'errorFetchingStudyPlan',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Abrufen des Studienplans',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error fetching study plan',
'description' => '',
'insertvon' => 'system'
)
)
),
);