From 930282629421cade4e6094f73a5d087a332a67fa Mon Sep 17 00:00:00 2001 From: Andrea Generosi Date: Tue, 26 Nov 2024 20:22:35 +0100 Subject: [PATCH 1/3] fix orari timbrature non modificabile se l'utente non ha il permesso --- .../stampings/modal/absence/absenceModalTab.tsx | 10 +++++++--- components/stampings/stampingsTable.tsx | 14 ++++++++------ utils/secureCheck.ts | 5 ++--- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/components/stampings/modal/absence/absenceModalTab.tsx b/components/stampings/modal/absence/absenceModalTab.tsx index 6f52779..afdc411 100644 --- a/components/stampings/modal/absence/absenceModalTab.tsx +++ b/components/stampings/modal/absence/absenceModalTab.tsx @@ -31,7 +31,8 @@ const AbsenceModalTab: React.FC = ({ showFindCodeTab, showForceInsert }) => { - const [selectedTab, setSelectedTab] = useState(tabName); + const [selectedTab, setSelectedTab] = useState(null); + const [activeTab,setActiveTab] = useState(null); const [visibleTabs, setVisibleTabs] = useState(Object.values(tabsVisible)); const [dataTab, setDataTab] = useState(data); const [simDataTab, setSimDataTab] = useState(simData); @@ -48,7 +49,9 @@ const AbsenceModalTab: React.FC = ({ newParams['id'] = parameters.id; newParams['from'] = parameters.from; - newParams['category'] = selectedTab; + if (selectedTab){ + newParams['category'] = selectedTab; + } newParams['switchGroup'] = false; if (!('groupAbsenceTypeName' in element) && dataTab.groupSelected) { @@ -88,6 +91,7 @@ const AbsenceModalTab: React.FC = ({ params['category'] = selectedTab; var dataAbs = await fetchDataAbsence(params, false); setDataTab(dataAbs.data); + setActiveTab(dataAbs.data.categoryTabSelected.name); } getData(); } @@ -118,7 +122,7 @@ const AbsenceModalTab: React.FC = ({ return ( <> handleTabChange(k)} diff --git a/components/stampings/stampingsTable.tsx b/components/stampings/stampingsTable.tsx index 793e402..51b7469 100644 --- a/components/stampings/stampingsTable.tsx +++ b/components/stampings/stampingsTable.tsx @@ -48,8 +48,10 @@ const StampingsTable: React.FC = ({ }; const personId = monthRecap.personId; - console.log("personId ", personId); - console.log("monthRecap ", monthRecap); + + useEffect(() => { + setMonthRecapData(monthRecap); + }, [monthRecap]); useEffect(() => { let isMounted = true; // Flag per sapere se il componente รจ ancora montato @@ -130,13 +132,11 @@ const StampingsTable: React.FC = ({ const url = `/api/rest/v4?endpoint=monthrecaps&${parameters}`; async function getData() { var res = await fetchData(url, "", null); - console.log('Dati recuperati:', res); setMonthRecapData(res.data); } getData(); } - }, [refreshStampingModal, personId,year,month]); - console.log('monthRecapData.canEditStampings---+', monthRecapData.canEditStampings); + }, [refreshStampingModal, personId, year, month]); return (<> = ({ )} - + { showInsertStamping && !pdr.personDay.future ? diff --git a/utils/secureCheck.ts b/utils/secureCheck.ts index 46ceb8a..00e546b 100644 --- a/utils/secureCheck.ts +++ b/utils/secureCheck.ts @@ -31,10 +31,9 @@ export const secureCheck = async (params: any) => { } const data = await response.json(); - console.log("data securecheck ", data); return data; // Restituisci i dati } catch (error) { - console.error("unable to achieve this", error); - return false; // In caso di errore restituisci false + console.error("unable to achieve this", error); + return false; // In caso di errore restituisci false } }; From 2e1012478c62009756d3376c64f0e4f3c8acb407 Mon Sep 17 00:00:00 2001 From: Andrea Generosi Date: Wed, 27 Nov 2024 21:29:43 +0100 Subject: [PATCH 2/3] rimossa colonna vuota per aggiunta timbrature se non si hanno i permessi --- components/stampings/stampingsTable.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/stampings/stampingsTable.tsx b/components/stampings/stampingsTable.tsx index 51b7469..b6e2696 100644 --- a/components/stampings/stampingsTable.tsx +++ b/components/stampings/stampingsTable.tsx @@ -164,7 +164,8 @@ const StampingsTable: React.FC = ({ )) } - {showInsertStamping ? Inserisci
timbratura: } + {showInsertStamping && !pdr.personDay.future ? + (Inserisci
timbratura): ''} Tempo
lavoro Diffe-
renza @@ -206,15 +207,14 @@ const StampingsTable: React.FC = ({ - { showInsertStamping && !pdr.personDay.future ? ( + setModalParam('Stamping',pdr)}> +++ - ):'' - } - + + ):''} {pdr.wttd?.workingTimeType?.description} From 0c9ece5e19b191cfb37bcb1e5d9b0ba009b3806e Mon Sep 17 00:00:00 2001 From: Andrea Generosi Date: Wed, 27 Nov 2024 21:38:11 +0100 Subject: [PATCH 3/3] sistemata posizione logo --- styles/globals.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/globals.css b/styles/globals.css index 3901523..8a03e35 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -38,7 +38,7 @@ nav { .navbar-brand { font-family: 'Shadows Into Light', cursive !important; font-size: 200% !important; - padding: 1px 15px !important; + /*padding: 1px 15px !important;*/ } .nav-item {