From d20828ac7ca21b539e0b5525b726fa8696413e35 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 21 Mar 2024 13:15:11 -0300 Subject: [PATCH] remove console.logs --- src/pages/Worker/Card/WorkerTimeControl.vue | 16 +++-------- src/stores/useWeekdayStore.js | 31 ++------------------- 2 files changed, 6 insertions(+), 41 deletions(-) diff --git a/src/pages/Worker/Card/WorkerTimeControl.vue b/src/pages/Worker/Card/WorkerTimeControl.vue index 894f6ccc6..4b2e432d3 100644 --- a/src/pages/Worker/Card/WorkerTimeControl.vue +++ b/src/pages/Worker/Card/WorkerTimeControl.vue @@ -116,7 +116,6 @@ const setDate = async (date) => { startOfWeek.value = newStartOfWeek; endOfWeek.value = newEndOfWeek; selectedWeekNumber.value = getWeekNumber(newStartOfWeek); // Asignar el nĂºmero de la semana - console.log('selectedWeekNumber:: ', selectedWeekNumber.value); getWeekDates(newStartOfWeek, newEndOfWeek); @@ -230,7 +229,6 @@ const getAbsences = async () => { }; const { data } = await axios.get('Calendars/absences', { params }); - console.log('absenses:: ', data); if (data) addEvents(data); }; @@ -239,7 +237,6 @@ const hasEvents = (day) => { }; const addEvents = (data) => { - console.log('ADD EVENTS:: '); const events = {}; const addEvent = (day, event) => { @@ -272,7 +269,6 @@ const addEvents = (data) => { const timestamp = day.dated.getTime(); if (events[timestamp]) day.event = events[timestamp]; }); - console.log('weekdays after events:: ', weekDays.value); }; const fetchHours = async () => { @@ -396,12 +392,9 @@ const getMailStates = async (date) => { { params } ); workerTimeControlMails.value = data; - console.log('workerTimeControlMails: ', workerTimeControlMails.value); - // await repaint(); }; const showWorkerTimeForm = (propValue, formType) => { - console.log('workerTimeFormDialogRef:: ', workerTimeFormDialogRef.value); if (formType === 'edit') { workerTimeFormProps.entryId = propValue; } else { @@ -439,8 +432,10 @@ const isSatisfied = async () => { }; const isUnsatisfied = async (reason) => { - console.log('unsatiesfied reason:: ', reason); - if (!reason) return; // TODO: Mostrar notify de 'debe haber una razon' + if (!reason) { + notify(t('You must indicate a reason', 'negative')); + return; + } updateWorkerTimeControlMail('REVISE', reason); }; @@ -463,14 +458,11 @@ const resendEmail = async () => { onBeforeMount(() => { weekdayStore.initStore(); - console.log('asdasdasd:: ', weekdayStore); }); onMounted(async () => { setDate(Date.vnNew()); stateStore.rightDrawer = true; - const test = useArrayData('workerData').store.data; - console.log('test:: ', test); }); diff --git a/src/stores/useWeekdayStore.js b/src/stores/useWeekdayStore.js index 2d0078c1e..cc339a549 100644 --- a/src/stores/useWeekdayStore.js +++ b/src/stores/useWeekdayStore.js @@ -1,4 +1,4 @@ -import { computed, ref, reactive } from 'vue'; +import { reactive } from 'vue'; import { useI18n } from 'vue-i18n'; import { defineStore } from 'pinia'; @@ -13,19 +13,11 @@ export const useWeekdayStore = defineStore('weekdayStore', () => { { code: 'sat', name: 'Saturday' }, ]; - const localeOrder = { - es: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'], - en: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'], - }; - - const { t, locale } = useI18n(); - const localeWeekdays = ref([]); + const { t } = useI18n(); const weekdaysMap = reactive({}); const initStore = () => { getWeekdaysMap(); - getLocales(); - console.log('weekdaysMap:: ', weekdaysMap); }; const getWeekdaysMap = () => { @@ -45,27 +37,8 @@ export const useWeekdayStore = defineStore('weekdayStore', () => { }); }; - const getLocales = () => { - if (localeWeekdays.value.length > 0) return localeWeekdays.value; - for (let code of localeOrder.es) { - console.log('code:: ', code); - localeWeekdays.value.push(weekdaysMap[code]); - } - console.log('localeWeekdays:: ', localeWeekdays.value); - return localeWeekdays.value; - }; - - // const orderLocales = (weekDaysArray) => { - // const order = localeOrder[locale.value] || localeOrder.en; - // const orderedLocales = []; - // for (let code of order) orderedLocales.push(weekDaysArray[code]); - // // return order.map((code) => localeWeekdays.value.find((day) => day.code === code)); - // }; - return { initStore, - getLocales, - localeWeekdays, weekdaysMap, }; });