From a7c4571d258c5e2b60370742ade31ef875c9e8a2 Mon Sep 17 00:00:00 2001 From: Ivymaster Date: Thu, 7 May 2026 14:06:34 +0200 Subject: [PATCH] Add removal of console logs in ClassSchedule components --- .../ClassScheduleCalendarSelector.js | 36 ++-- ...leOrgUnitGroupedValidityPeriodsOverview.js | 29 ++-- .../ClassSchedule/ClassScheduleOverview.js | 64 +++---- .../ClassSchedule/ClassScheduleTypeModal.js | 14 +- .../ClassScheduleValidityPeriodForm.js | 10 +- .../ClassScheduleValidityPeriodModal.js | 59 ++----- .../ClassScheduleValidityPeriodOverview.js | 24 +-- .../ClassScheduleValidityPeriodPreview.js | 1 - system/phrasesupdate.php | 160 ++++++++++++++++++ 9 files changed, 259 insertions(+), 138 deletions(-) diff --git a/public/js/components/ClassSchedule/ClassScheduleCalendarSelector.js b/public/js/components/ClassSchedule/ClassScheduleCalendarSelector.js index f9cdb8e72..1fc620eda 100644 --- a/public/js/components/ClassSchedule/ClassScheduleCalendarSelector.js +++ b/public/js/components/ClassSchedule/ClassScheduleCalendarSelector.js @@ -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(); diff --git a/public/js/components/ClassSchedule/ClassScheduleOrgUnitGroupedValidityPeriodsOverview.js b/public/js/components/ClassSchedule/ClassScheduleOrgUnitGroupedValidityPeriodsOverview.js index 8601dc6dd..5a76416bd 100644 --- a/public/js/components/ClassSchedule/ClassScheduleOrgUnitGroupedValidityPeriodsOverview.js +++ b/public/js/components/ClassSchedule/ClassScheduleOrgUnitGroupedValidityPeriodsOverview.js @@ -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"), ); } }, diff --git a/public/js/components/ClassSchedule/ClassScheduleOverview.js b/public/js/components/ClassSchedule/ClassScheduleOverview.js index 9cd1249be..05db598ad 100644 --- a/public/js/components/ClassSchedule/ClassScheduleOverview.js +++ b/public/js/components/ClassSchedule/ClassScheduleOverview.js @@ -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 diff --git a/public/js/components/ClassSchedule/ClassScheduleTypeModal.js b/public/js/components/ClassSchedule/ClassScheduleTypeModal.js index 6e867abcb..7a59dbf47 100644 --- a/public/js/components/ClassSchedule/ClassScheduleTypeModal.js +++ b/public/js/components/ClassSchedule/ClassScheduleTypeModal.js @@ -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 */ `