remove console.logs

This commit is contained in:
William Buezas 2024-03-21 13:15:11 -03:00
parent 65da9a3e69
commit d20828ac7c
2 changed files with 6 additions and 41 deletions

View File

@ -116,7 +116,6 @@ const setDate = async (date) => {
startOfWeek.value = newStartOfWeek; startOfWeek.value = newStartOfWeek;
endOfWeek.value = newEndOfWeek; endOfWeek.value = newEndOfWeek;
selectedWeekNumber.value = getWeekNumber(newStartOfWeek); // Asignar el número de la semana selectedWeekNumber.value = getWeekNumber(newStartOfWeek); // Asignar el número de la semana
console.log('selectedWeekNumber:: ', selectedWeekNumber.value);
getWeekDates(newStartOfWeek, newEndOfWeek); getWeekDates(newStartOfWeek, newEndOfWeek);
@ -230,7 +229,6 @@ const getAbsences = async () => {
}; };
const { data } = await axios.get('Calendars/absences', { params }); const { data } = await axios.get('Calendars/absences', { params });
console.log('absenses:: ', data);
if (data) addEvents(data); if (data) addEvents(data);
}; };
@ -239,7 +237,6 @@ const hasEvents = (day) => {
}; };
const addEvents = (data) => { const addEvents = (data) => {
console.log('ADD EVENTS:: ');
const events = {}; const events = {};
const addEvent = (day, event) => { const addEvent = (day, event) => {
@ -272,7 +269,6 @@ const addEvents = (data) => {
const timestamp = day.dated.getTime(); const timestamp = day.dated.getTime();
if (events[timestamp]) day.event = events[timestamp]; if (events[timestamp]) day.event = events[timestamp];
}); });
console.log('weekdays after events:: ', weekDays.value);
}; };
const fetchHours = async () => { const fetchHours = async () => {
@ -396,12 +392,9 @@ const getMailStates = async (date) => {
{ params } { params }
); );
workerTimeControlMails.value = data; workerTimeControlMails.value = data;
console.log('workerTimeControlMails: ', workerTimeControlMails.value);
// await repaint();
}; };
const showWorkerTimeForm = (propValue, formType) => { const showWorkerTimeForm = (propValue, formType) => {
console.log('workerTimeFormDialogRef:: ', workerTimeFormDialogRef.value);
if (formType === 'edit') { if (formType === 'edit') {
workerTimeFormProps.entryId = propValue; workerTimeFormProps.entryId = propValue;
} else { } else {
@ -439,8 +432,10 @@ const isSatisfied = async () => {
}; };
const isUnsatisfied = async (reason) => { const isUnsatisfied = async (reason) => {
console.log('unsatiesfied reason:: ', reason); if (!reason) {
if (!reason) return; // TODO: Mostrar notify de 'debe haber una razon' notify(t('You must indicate a reason', 'negative'));
return;
}
updateWorkerTimeControlMail('REVISE', reason); updateWorkerTimeControlMail('REVISE', reason);
}; };
@ -463,14 +458,11 @@ const resendEmail = async () => {
onBeforeMount(() => { onBeforeMount(() => {
weekdayStore.initStore(); weekdayStore.initStore();
console.log('asdasdasd:: ', weekdayStore);
}); });
onMounted(async () => { onMounted(async () => {
setDate(Date.vnNew()); setDate(Date.vnNew());
stateStore.rightDrawer = true; stateStore.rightDrawer = true;
const test = useArrayData('workerData').store.data;
console.log('test:: ', test);
}); });
</script> </script>

View File

@ -1,4 +1,4 @@
import { computed, ref, reactive } from 'vue'; import { reactive } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
@ -13,19 +13,11 @@ export const useWeekdayStore = defineStore('weekdayStore', () => {
{ code: 'sat', name: 'Saturday' }, { code: 'sat', name: 'Saturday' },
]; ];
const localeOrder = { const { t } = useI18n();
es: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'],
en: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'],
};
const { t, locale } = useI18n();
const localeWeekdays = ref([]);
const weekdaysMap = reactive({}); const weekdaysMap = reactive({});
const initStore = () => { const initStore = () => {
getWeekdaysMap(); getWeekdaysMap();
getLocales();
console.log('weekdaysMap:: ', weekdaysMap);
}; };
const getWeekdaysMap = () => { 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 { return {
initStore, initStore,
getLocales,
localeWeekdays,
weekdaysMap, weekdaysMap,
}; };
}); });