Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/farmtech/client/js/apps/farmtech-dashboard-publisher.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ const updateWidgetVisibility = () => {

if (shouldShow) {
container.style.display = 'block';
console.log('✅ Dashboard Publisher widget visible');
} else {
container.style.display = 'none';
console.log('🔒 Dashboard Publisher widget hidden');
}
};

Expand All @@ -53,8 +51,6 @@ const initializeApp = (containerId) => {
const container = document.getElementById(containerId);
if (!container || !hasUploaderPermission() ) return false;

console.log(`📦 Initializing Dashboard Publisher in ${containerId}...`);

const root = createRoot(container);
root.render(
<Provider store={store}>
Expand All @@ -64,7 +60,6 @@ const initializeApp = (containerId) => {
</Provider>
);

console.log(`✅ Dashboard Publisher initialized in ${containerId}`);
return true;
};

Expand All @@ -82,14 +77,12 @@ const mountInTopbar = () => {
initializeApp('farmtech-dashboard-publisher-topbar');
} else if (attempts >= maxAttempts) {
clearInterval(tryMount);
console.log('⚠️ Dashboard Publisher topbar placeholder not found after 5s');
}
}, 100);
};

document.addEventListener('DOMContentLoaded', function() {
if (!hasUploaderPermission()) {
console.log('🔒 User does not have uploader permission, Dashboard Publisher not initialized');
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const DashboardPublisherApp = () => {

const onMapstoreReady = (e) => {
const msAPI = e.details
console.log({msAPI})
}

const publish = async (pk) => {
Expand Down Expand Up @@ -68,7 +67,6 @@ export const DashboardPublisherApp = () => {
setError(null);

// Chiama POST /api/published/dashboard con il pk della dashboard selezionata
console.log(`Publishing dashboard ${newPublishedId}`);

await publish(newPublishedId);

Expand All @@ -78,7 +76,6 @@ export const DashboardPublisherApp = () => {
(d) => d.pk === newPublishedId
)?.title;

console.log("Published dashboard changed to:", dashboardName);
} catch (err) {
console.error("Error publishing dashboard:", err);
setError("Errore durante la pubblicazione");
Expand Down
37 changes: 24 additions & 13 deletions src/farmtech/client/js/components/index/IndexApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,30 +100,41 @@ export const IndexApp = ({ staticUrl = '' }) => {
<div className="mb-5 overflow-hidden">
<div className="funding-logos-track">
{/* Primo set di loghi */}
<a href="/" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/FARM-TECH.svg`} alt="Logo Tech4You" className="img-fluid" style={{maxHeight: '80px'}} />
<a href="https://ecs-tech4you.it/" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/logo-t4y-1.png`} alt="Logo Tech4You" className="img-fluid" style={{maxHeight: '80px'}} />
</a>
<a href="/" className="d-inline-block flex-shrink-0">
<a href="https://www.smartshaped.com/" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/SS_logo_orizzontale.svg`} alt="Logo Partner 1" className="img-fluid" style={{maxHeight: '80px'}} />
</a>
<a href="/" className="d-inline-block flex-shrink-0">
<a href="https://www.tracetech.it/" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/TRC_logo_orizzontale.svg`} alt="Logo Partner 2" className="img-fluid" style={{maxHeight: '80px'}} />
</a>
<a href="/" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/SS_logo_orizzontale.svg`} alt="Logo Partner 3" className="img-fluid" style={{maxHeight: '80px'}} />
<a href="https://next-generation-eu.europa.eu/index_it" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/nextgeneu_en.jpg`} alt="Logo Partner 1" className="img-fluid" style={{maxHeight: '80px'}} />
</a>
{/* Duplica i loghi per loop continuo */}
<a href="/" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/FARM-TECH.svg`} alt="Logo Tech4You" className="img-fluid" style={{maxHeight: '80px'}} />
<a href="https://www.mur.gov.it/it" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/MUR-logo.png`} alt="Logo Partner 2" className="img-fluid" style={{maxHeight: '80px'}} />
</a>
<a href="/" className="d-inline-block flex-shrink-0">
<a href="https://www.italiadomani.gov.it/it/home.html" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/Logo_Italiadomani.svg.png`} alt="Logo Partner 3" className="img-fluid" style={{maxHeight: '80px'}} />
</a>
<a href="https://ecs-tech4you.it/" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/logo-t4y-1.png`} alt="Logo Tech4You" className="img-fluid" style={{maxHeight: '80px'}} />
</a>
<a href="https://www.smartshaped.com/" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/SS_logo_orizzontale.svg`} alt="Logo Partner 1" className="img-fluid" style={{maxHeight: '80px'}} />
</a>
<a href="/" className="d-inline-block flex-shrink-0">
<a href="https://www.tracetech.it/" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/TRC_logo_orizzontale.svg`} alt="Logo Partner 2" className="img-fluid" style={{maxHeight: '80px'}} />
</a>
<a href="/" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/SS_logo_orizzontale.svg`} alt="Logo Partner 3" className="img-fluid" style={{maxHeight: '80px'}} />
<a href="https://next-generation-eu.europa.eu/index_it" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/nextgeneu_en.jpg`} alt="Logo Partner 1" className="img-fluid" style={{maxHeight: '80px'}} />
</a>
<a href="https://www.mur.gov.it/it" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/MUR-logo.png`} alt="Logo Partner 2" className="img-fluid" style={{maxHeight: '80px'}} />
</a>
<a href="https://www.italiadomani.gov.it/it/home.html" className="d-inline-block flex-shrink-0">
<img src={`${staticUrl}img/Logo_Italiadomani.svg.png`} alt="Logo Partner 3" className="img-fluid" style={{maxHeight: '80px'}} />
</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/farmtech/client/js/components/inference/MapView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const MapView = ({ tiffFile, isDrawing, onPolygonDrawn, userPolygon, resu
map.getView().setZoom(12);
},
(error) => {
console.log('Geolocation error:', error.message, '- Using default location (Rome)');
console.error('Geolocation error:', error.message, '- Using default location (Rome)');
},
{
enableHighAccuracy: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export const PermissionRequestDialog = ({ onClose }) => {
};

const getSelectedLineData = () => {
console.log({selectedLine, researchLines})
return researchLines.find((line) => String(line.id) === selectedLine);
};

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/farmtech/static/img/MUR-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/farmtech/static/img/logo-t4y-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/farmtech/static/img/nextgeneu_en.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Inject Django user data into window scope (from context processor)
window.__FARMTECH_USER__ = {{ farmtech_user_json | safe }};

console.log({ user: window.__FARMTECH_USER__ })
// Inject menu items with translations already resolved server-side
window.__FARMTECH_MENU__ = {{ FARMTECH_MENU_JSON | safe }};

Expand All @@ -21,13 +20,6 @@
(user.perms && user.perms.includes('download_resourcebase')) //TODO: verificare se il permesso è corretto
);

console.log('FARMTECH: User download permission check', {
username: user?.username,
canDownload,
is_superuser: user?.is_superuser,
perms: user?.perms
});

//TODO: possiamo anche quì permettere comunque il download all'admin ma non so quato ci serva..
// Disable download functionality for users without permission
if (!canDownload) {
Expand All @@ -36,7 +28,6 @@
localConfig.plugins.catalogue = localConfig.plugins.catalogue.filter(
plugin => plugin.name !== 'DownloadResource'
);
console.log('FARMTECH: DownloadResource plugin removed from catalogue');
}

// Remove DownloadResource plugin from viewers
Expand All @@ -47,9 +38,6 @@
localConfig.plugins[viewerName] = localConfig.plugins[viewerName].filter(
plugin => plugin.name !== 'DownloadResource'
);
if (localConfig.plugins[viewerName].length < originalLength) {
console.log(`FARMTECH: DownloadResource plugin removed from ${viewerName}`);
}
}
});

Expand All @@ -65,14 +53,11 @@
...plugin.cfg[pageName].cardOptions,
hideDownload: true
};
console.log(`FARMTECH: Download hidden in ${pageName} cards`);
}
});
}
});
}

console.log('FARMTECH: All download options disabled for user', user?.username);
}

const customMenu = window.__FARMTECH_MENU__ || [];
Expand Down Expand Up @@ -104,7 +89,6 @@

// Aggiungi i menu custom con traduzioni già risolte all'inizio
plugin.cfg.leftMenuItems = [...customMenu, ...plugin.cfg.leftMenuItems];
console.log(`FARMTECH: Custom menu applied to ${viewerName}`, customMenu);
}
});
});
Expand Down Expand Up @@ -134,7 +118,6 @@
const groupMemberSet = (user.group_members || []).map(gm => {
return gm.auth_group_id
})
console.log(groupMemberSet)

// Se l'utente ha gruppi e NON è admin, filtra per GroupProfile ID
//TODO: riabilitare l'admin
Expand All @@ -157,7 +140,6 @@
...plugin.cfg[pageName].defaultQuery,
...groupFilter
};
console.log(`FARMTECH: Filter applied to ${pageName}:`, plugin.cfg[pageName].defaultQuery);
}
});
}
Expand Down Expand Up @@ -203,8 +185,6 @@
// Fallback: aggiungi al navbar
navbar.appendChild(placeholder);
}

console.log('FARMTECH: Dashboard Publisher placeholder injected in MapStore navbar');
}
}
}, 100);
Expand Down
2 changes: 1 addition & 1 deletion src/farmtech/views/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ def get(self, request):
requests.get(keycloak_logout_url, params=params, timeout=10)

logout(request)
return redirect(logout_url)
return redirect("/account/logout/complete/")

logger.debug("Keycloak non configurato - logout solo Django")
logger.debug("=" * 80)
Expand Down