mirror of
https://github.com/Freika/dawarich.git
synced 2025-12-21 04:49:46 -06:00
Remove some debug logging statements.
This commit is contained in:
@@ -127,7 +127,6 @@ export default class extends Controller {
|
||||
}
|
||||
|
||||
exitAddVisitMode(button) {
|
||||
console.log('exitAddVisitMode called');
|
||||
this.isAddingVisit = false;
|
||||
|
||||
// Reset button style to inactive state
|
||||
@@ -141,14 +140,12 @@ export default class extends Controller {
|
||||
|
||||
// Remove any existing marker
|
||||
if (this.addVisitMarker) {
|
||||
console.log('Removing add visit marker');
|
||||
this.map.removeLayer(this.addVisitMarker);
|
||||
this.addVisitMarker = null;
|
||||
}
|
||||
|
||||
// Close any open popup
|
||||
if (this.currentPopup) {
|
||||
console.log('Closing current popup');
|
||||
this.map.closePopup(this.currentPopup);
|
||||
this.currentPopup = null;
|
||||
} else {
|
||||
@@ -273,7 +270,7 @@ export default class extends Controller {
|
||||
cancelButton.addEventListener('click', (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
console.log('Cancel button clicked - exiting add visit mode');
|
||||
|
||||
this.exitAddVisitMode(this.addVisitButton);
|
||||
});
|
||||
}
|
||||
@@ -356,8 +353,6 @@ export default class extends Controller {
|
||||
}
|
||||
|
||||
addCreatedVisitToMap(visitData, latitude, longitude) {
|
||||
console.log('Adding newly created visit to map immediately', { latitude, longitude, visitData });
|
||||
|
||||
const mapsController = document.querySelector('[data-controller*="maps"]');
|
||||
if (!mapsController) {
|
||||
console.log('Could not find maps controller element');
|
||||
@@ -367,6 +362,7 @@ export default class extends Controller {
|
||||
const stimulusController = this.application.getControllerForElementAndIdentifier(mapsController, 'maps');
|
||||
if (!stimulusController || !stimulusController.visitsManager) {
|
||||
console.log('Could not find maps controller or visits manager');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -386,16 +382,10 @@ export default class extends Controller {
|
||||
|
||||
// Add the circle to the confirmed visits layer
|
||||
visitsManager.confirmedVisitCircles.addLayer(circle);
|
||||
console.log('✅ Added newly created confirmed visit circle to layer');
|
||||
console.log('Confirmed visits layer info:', {
|
||||
layerCount: visitsManager.confirmedVisitCircles.getLayers().length,
|
||||
isOnMap: this.map.hasLayer(visitsManager.confirmedVisitCircles)
|
||||
});
|
||||
|
||||
// Make sure the layer is visible on the map
|
||||
if (!this.map.hasLayer(visitsManager.confirmedVisitCircles)) {
|
||||
this.map.addLayer(visitsManager.confirmedVisitCircles);
|
||||
console.log('✅ Added confirmed visits layer to map');
|
||||
}
|
||||
|
||||
// Check if the layer control has the confirmed visits layer enabled
|
||||
@@ -421,9 +411,7 @@ export default class extends Controller {
|
||||
inputs.forEach(input => {
|
||||
const label = input.nextElementSibling;
|
||||
if (label && label.textContent.trim().includes('Confirmed Visits')) {
|
||||
console.log('Found Confirmed Visits checkbox, current state:', input.checked);
|
||||
if (!input.checked) {
|
||||
console.log('Enabling Confirmed Visits layer via checkbox');
|
||||
input.checked = true;
|
||||
input.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export default class extends Controller {
|
||||
if (this.isUploading) {
|
||||
// If still uploading, prevent submission
|
||||
event.preventDefault()
|
||||
console.log("Form submission prevented during upload")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export default class extends Controller {
|
||||
const signedIds = this.element.querySelectorAll('input[name="import[files][]"][type="hidden"]')
|
||||
if (signedIds.length === 0) {
|
||||
event.preventDefault()
|
||||
console.log("No files uploaded yet")
|
||||
|
||||
alert("Please select and upload files first")
|
||||
} else {
|
||||
console.log(`Submitting form with ${signedIds.length} uploaded files`)
|
||||
@@ -78,7 +78,6 @@ export default class extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Uploading ${files.length} files`)
|
||||
this.isUploading = true
|
||||
|
||||
// Disable submit button during upload
|
||||
@@ -124,8 +123,6 @@ export default class extends Controller {
|
||||
// Add the progress wrapper AFTER the file input field but BEFORE the submit button
|
||||
this.submitTarget.parentNode.insertBefore(progressWrapper, this.submitTarget)
|
||||
|
||||
console.log("Progress bar created and inserted before submit button")
|
||||
|
||||
let uploadCount = 0
|
||||
const totalFiles = files.length
|
||||
|
||||
@@ -137,17 +134,13 @@ export default class extends Controller {
|
||||
});
|
||||
|
||||
Array.from(files).forEach(file => {
|
||||
console.log(`Starting upload for ${file.name}`)
|
||||
const upload = new DirectUpload(file, this.urlValue, this)
|
||||
upload.create((error, blob) => {
|
||||
uploadCount++
|
||||
|
||||
if (error) {
|
||||
console.error("Error uploading file:", error)
|
||||
// Show error to user using flash
|
||||
showFlashMessage('error', `Error uploading ${file.name}: ${error.message || 'Unknown error'}`)
|
||||
} else {
|
||||
console.log(`Successfully uploaded ${file.name} with ID: ${blob.signed_id}`)
|
||||
|
||||
// Create a hidden field with the correct name
|
||||
const hiddenField = document.createElement("input")
|
||||
@@ -155,8 +148,6 @@ export default class extends Controller {
|
||||
hiddenField.setAttribute("name", "import[files][]")
|
||||
hiddenField.setAttribute("value", blob.signed_id)
|
||||
this.element.appendChild(hiddenField)
|
||||
|
||||
console.log("Added hidden field with signed ID:", blob.signed_id)
|
||||
}
|
||||
|
||||
// Enable submit button when all uploads are complete
|
||||
@@ -186,8 +177,6 @@ export default class extends Controller {
|
||||
}
|
||||
}
|
||||
this.isUploading = false
|
||||
console.log("All uploads completed")
|
||||
console.log(`Ready to submit with ${successfulUploads} files`)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user