From 0c3349e13686936a5f42c98a57fcb563680d1902 Mon Sep 17 00:00:00 2001 From: Malini Date: Fri, 12 Dec 2025 15:20:14 +0530 Subject: [PATCH] removed console --- .../components/survey/ProductData/ProductData.jsx | 15 --------------- .../src/pages/Admin/configuration/IsicHsCodes.jsx | 11 ----------- .../src/pages/Admin/configuration/UnitMaster.jsx | 2 +- ipi-survey-platform/src/pages/History/History.jsx | 6 ------ ipi-survey-platform/src/pages/Login/Login.jsx | 2 -- ipi-survey-platform/src/pages/Survey/Survey.jsx | 10 ---------- 6 files changed, 1 insertion(+), 45 deletions(-) diff --git a/ipi-survey-platform/src/components/survey/ProductData/ProductData.jsx b/ipi-survey-platform/src/components/survey/ProductData/ProductData.jsx index 916950c..b2eb5d1 100644 --- a/ipi-survey-platform/src/components/survey/ProductData/ProductData.jsx +++ b/ipi-survey-platform/src/components/survey/ProductData/ProductData.jsx @@ -352,7 +352,6 @@ const ProductData = ({ // Debug: Log products data when it changes useEffect(() => { - console.log('Products data updated:', products); }, [products]); const [activeTab, setActiveTab] = React.useState('current'); @@ -732,12 +731,6 @@ const location = useLocation(); }; const fetchPreviousForecastData = async (productId, establishmentId) => { - console.log('fetchPreviousForecastData called with:', { - productId, - establishmentId, - quarter, - year - }); if (!productId || !establishmentId || !quarter || !year) { console.warn('Missing required parameters for fetchPreviousForecastData:', { @@ -918,14 +911,6 @@ const location = useLocation(); // Use the product_id directly as the value const productId = selectedProduct.value; - console.log('Fetching forecast data for:', { - productId, - establishmentId, - quarter, - year, - storageSource: localStorage.getItem('establishment_id') ? 'sessionStorage' : 'localStorage' - }); - // Call handleProductSelect with the product ID handleProductSelect(productId, establishmentId, id); } else { diff --git a/ipi-survey-platform/src/pages/Admin/configuration/IsicHsCodes.jsx b/ipi-survey-platform/src/pages/Admin/configuration/IsicHsCodes.jsx index ee32f9a..2d620e7 100644 --- a/ipi-survey-platform/src/pages/Admin/configuration/IsicHsCodes.jsx +++ b/ipi-survey-platform/src/pages/Admin/configuration/IsicHsCodes.jsx @@ -77,11 +77,9 @@ const ImportModal = ({ isOpen, onClose, onImport, showToast: showToastProp }) => const fileInputRef = React.useRef(null); const showToast = (message, type = 'success', position = 'modal') => { - console.log('showToast called with:', { message, type, position }); // Always use local toast state for the modal setToast(prev => { - console.log('Updating toast state'); return { ...prev, show: true, @@ -93,13 +91,11 @@ const ImportModal = ({ isOpen, onClose, onImport, showToast: showToastProp }) => // Auto-hide after delay const timer = setTimeout(() => { - console.log('Hiding toast after timeout'); setToast(prev => ({ ...prev, show: false })); }, 3000); // Cleanup return () => { - console.log('Cleaning up toast timeout'); clearTimeout(timer); }; }; @@ -152,7 +148,6 @@ const ImportModal = ({ isOpen, onClose, onImport, showToast: showToastProp }) => }; const handleImport = async () => { - console.log('handleImport called'); if (!file) { setError('Please select a file to import'); return; @@ -162,13 +157,9 @@ const ImportModal = ({ isOpen, onClose, onImport, showToast: showToastProp }) => setLoading(true); setError(''); - console.log('Calling productService.uploadCSV'); const response = await productService.uploadCSV(file); - console.log('Upload response:', response); - // Check the response status if (response.status === 'failed') { - console.log('Import failed with response:', response); let errorMsg = response.message || 'Import failed'; if (response.summary?.errors?.length > 0) { @@ -187,7 +178,6 @@ const ImportModal = ({ isOpen, onClose, onImport, showToast: showToastProp }) => onClose(); // Then call onImport which will trigger the parent's success handling - console.log('Calling onImport'); await onImport(response); } catch (err) { console.error('Error uploading CSV:', err); @@ -275,7 +265,6 @@ const ImportModal = ({ isOpen, onClose, onImport, showToast: showToastProp }) => type={toast.type} position="modal" onClose={() => { - console.log('Toast onClose called'); setToast(prev => ({ ...prev, show: false })); }} /> diff --git a/ipi-survey-platform/src/pages/Admin/configuration/UnitMaster.jsx b/ipi-survey-platform/src/pages/Admin/configuration/UnitMaster.jsx index 95dc03b..0925c2c 100644 --- a/ipi-survey-platform/src/pages/Admin/configuration/UnitMaster.jsx +++ b/ipi-survey-platform/src/pages/Admin/configuration/UnitMaster.jsx @@ -722,7 +722,7 @@ const downloadSampleCSV = async () => { const response = await downloadSampleFile(); // Create a blob from the response - const blob = new Blob([response.data], { type: 'text/csv' }); + const blob = new Blob([response.data], { type: 'text/csv;charset=utf-8;' }); const url = window.URL.createObjectURL(blob); const link = document.createElement('a'); link.href = url; diff --git a/ipi-survey-platform/src/pages/History/History.jsx b/ipi-survey-platform/src/pages/History/History.jsx index a048792..e8060f8 100644 --- a/ipi-survey-platform/src/pages/History/History.jsx +++ b/ipi-survey-platform/src/pages/History/History.jsx @@ -140,12 +140,6 @@ useEffect(() => { ? hscodeFilter.split(" - ")[1].trim() : hscodeFilter.trim(); - console.log("Loading audit history with:", { - yearFilter, - quarterFilter, - productName, - establishmentId - }); const params = { year: yearFilter || undefined, diff --git a/ipi-survey-platform/src/pages/Login/Login.jsx b/ipi-survey-platform/src/pages/Login/Login.jsx index 3d13c87..958ebca 100644 --- a/ipi-survey-platform/src/pages/Login/Login.jsx +++ b/ipi-survey-platform/src/pages/Login/Login.jsx @@ -168,12 +168,10 @@ const submit = async (e) => { try { const response = await login({ email, password }); - console.log("Login response:", response); // Check if login was successful if (response?.status === 'success' && response?.data) { const userData = response.data; - console.log("User data:", userData); // Clear any existing failed attempts const storedAttempts = JSON.parse(localStorage.getItem("login_attempts") || "{}"); diff --git a/ipi-survey-platform/src/pages/Survey/Survey.jsx b/ipi-survey-platform/src/pages/Survey/Survey.jsx index bd15f83..6b13344 100644 --- a/ipi-survey-platform/src/pages/Survey/Survey.jsx +++ b/ipi-survey-platform/src/pages/Survey/Survey.jsx @@ -389,16 +389,6 @@ const Survey = () => { const unitName = ensureString(product?.unit?.uom) || ensureString(product?.unit?.name) || ensureString(unitId) || ''; - - console.log('Product mapping:', { - id: productId, - productName, - hsCode, - displayName, - unitId, - unitName, - originalProduct: product - }); return { id: product?.id ?? index + 1,