Wall of People Groups: no debug logging in the shipped bundle
40 console.log calls (fetch progress, grid sizes, sample rows, API stats) ran on every load; public-hygiene flagged them. Warnings and errors are kept.
This commit is contained in:
parent
acf67c59be
commit
91fac156ee
3 changed files with 0 additions and 44 deletions
|
|
@ -79,11 +79,9 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
async fetchData() {
|
||||
console.log('📊 Wall component fetching data...');
|
||||
if (this.$store) {
|
||||
this.$store.profileConfig = this.profileConfig;
|
||||
await this.$store.fetchPeopleGroups();
|
||||
console.log('🎨 Data fetched, rendering cards...');
|
||||
this.renderCards();
|
||||
} else {
|
||||
console.error('❌ Store not available!');
|
||||
|
|
@ -149,8 +147,6 @@ export default {
|
|||
},
|
||||
|
||||
renderCards() {
|
||||
console.log('🎨 Rendering cards...');
|
||||
console.log('People groups available:', this.peopleGroups?.length || 0);
|
||||
|
||||
if (!this.peopleGroups || this.peopleGroups.length === 0) {
|
||||
console.warn('⚠️ No people groups to render');
|
||||
|
|
@ -177,8 +173,6 @@ export default {
|
|||
const cols = Math.ceil(Math.sqrt(totalGroups * canvasAspectRatio));
|
||||
const rows = Math.ceil(totalGroups / cols);
|
||||
|
||||
console.log(`📐 Grid Layout: ${cols} columns × ${rows} rows = ${cols * rows} slots for ${totalGroups} groups`);
|
||||
console.log(`📏 Canvas: ${this.canvasWidth}×${this.canvasHeight} (aspect: ${canvasAspectRatio.toFixed(2)})`);
|
||||
|
||||
// Calculate card size to fit the grid
|
||||
const availableWidth = this.canvasWidth - (this.cardSpacing * (cols + 1));
|
||||
|
|
@ -191,8 +185,6 @@ export default {
|
|||
this.cardWidth = Math.min(calculatedCardWidth, calculatedCardHeight * 0.7);
|
||||
this.cardHeight = this.cardWidth / 0.7; // Maintain card aspect ratio
|
||||
|
||||
console.log(`🎴 Card size: ${this.cardWidth.toFixed(1)}×${this.cardHeight.toFixed(1)}`);
|
||||
console.log('📦 Sample group data:', this.peopleGroups[0]);
|
||||
|
||||
const totalWidth = this.cardWidth + this.cardSpacing;
|
||||
const totalHeight = this.cardHeight + this.cardVerticalSpacing;
|
||||
|
|
@ -345,7 +337,6 @@ export default {
|
|||
.attr('preserveAspectRatio', 'xMidYMid slice')
|
||||
.style('pointer-events', 'none')
|
||||
.on('error', function() {
|
||||
console.log('Image failed to load:', d.imageUrl);
|
||||
});
|
||||
imgNodes[i] = group.select('image').node();
|
||||
} else {
|
||||
|
|
@ -446,7 +437,6 @@ export default {
|
|||
this.openComments(d);
|
||||
});
|
||||
|
||||
console.log(`✅ Rendered ${totalGroups} cards in ${cols}×${rows} grid`);
|
||||
},
|
||||
|
||||
handlePrayer(group) {
|
||||
|
|
@ -504,7 +494,6 @@ export default {
|
|||
this.renderCards();
|
||||
}
|
||||
|
||||
console.log(`📐 Switched to ${this.isLandscape ? 'LANDSCAPE (4ft×3ft)' : 'PORTRAIT (3ft×4ft)'}`);
|
||||
},
|
||||
|
||||
scheduleLod(t) {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
selectSource(sourceId) {
|
||||
console.log('🔄 Switching to source:', sourceId);
|
||||
if (this.$store) {
|
||||
this.$store.setDataSource(sourceId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ export const usePeopleGroupsStore = (pinia) => {
|
|||
this.loading = true;
|
||||
this.error = null;
|
||||
|
||||
console.log(`🔄 Fetching people groups from ${this.dataSource}...`);
|
||||
|
||||
try {
|
||||
if (this.dataSource === 'PRAY_API') {
|
||||
|
|
@ -57,8 +56,6 @@ export const usePeopleGroupsStore = (pinia) => {
|
|||
await this.fetchFromCSV();
|
||||
}
|
||||
|
||||
console.log(`✅ Successfully loaded ${this.peopleGroups.length} people groups from ${this.dataSource}!`);
|
||||
console.log('First 3 groups:', this.peopleGroups.slice(0, 3));
|
||||
|
||||
} catch (error) {
|
||||
// warn, not error: the wall now SAYS so on screen (PeopleGroupsWall's offline notice)
|
||||
|
|
@ -74,7 +71,6 @@ export const usePeopleGroupsStore = (pinia) => {
|
|||
async fetchFromPrayAPI() {
|
||||
const source = this.availableSources.find(s => s.id === 'PRAY_API');
|
||||
const apiUrl = source.url;
|
||||
console.log('🙏 Prayer.Tools API URL:', apiUrl);
|
||||
|
||||
const response = await fetch(apiUrl);
|
||||
|
||||
|
|
@ -156,12 +152,6 @@ export const usePeopleGroupsStore = (pinia) => {
|
|||
const withAdoption = this.peopleGroups.filter(g => g.adoptedByChurches > 0).length;
|
||||
const withImages = this.peopleGroups.filter(g => g.hasPhoto).length;
|
||||
|
||||
console.log(`📊 Prayer.Tools API stats:`);
|
||||
console.log(` Total groups: ${this.peopleGroups.length}`);
|
||||
console.log(` 🙏 With prayer: ${withPrayer}`);
|
||||
console.log(` 👥 With committed workers: ${withCommitted}`);
|
||||
console.log(` ⛪ Adopted by churches: ${withAdoption}`);
|
||||
console.log(` 📸 With photos: ${withImages}`);
|
||||
|
||||
// Start background image testing
|
||||
this.testImagesInBackground();
|
||||
|
|
@ -170,7 +160,6 @@ export const usePeopleGroupsStore = (pinia) => {
|
|||
async fetchFromAPI() {
|
||||
const source = this.availableSources.find(s => s.id === 'DOXA_API');
|
||||
const apiUrl = source.url;
|
||||
console.log('API URL:', apiUrl);
|
||||
|
||||
const response = await fetch(apiUrl);
|
||||
|
||||
|
|
@ -236,7 +225,6 @@ export const usePeopleGroupsStore = (pinia) => {
|
|||
// Log image statistics
|
||||
const withImages = this.peopleGroups.filter(g => g.hasPhoto && g.imb_picture_url).length;
|
||||
const withPlaceholder = this.peopleGroups.length - withImages;
|
||||
console.log(`📸 Image stats: ${withImages} with photos, ${withPlaceholder} using placeholder`);
|
||||
|
||||
// Start background image testing for groups that have URLs
|
||||
this.testImagesInBackground();
|
||||
|
|
@ -245,7 +233,6 @@ export const usePeopleGroupsStore = (pinia) => {
|
|||
async fetchFromCSV() {
|
||||
const source = this.availableSources.find(s => s.id === 'CSV');
|
||||
const csvUrl = source.url;
|
||||
console.log('CSV URL:', csvUrl);
|
||||
|
||||
const response = await fetch(csvUrl);
|
||||
|
||||
|
|
@ -314,21 +301,12 @@ export const usePeopleGroupsStore = (pinia) => {
|
|||
const withoutPeopleID3 = this.peopleGroups.length - withPeopleID3;
|
||||
const uniqueClusters = Object.keys(clusterStats).length;
|
||||
|
||||
console.log(`✅ Parsed ${parsedData.length} total rows`);
|
||||
console.log(` ${withPeopleID3} have PeopleID3, ${withoutPeopleID3} without`);
|
||||
console.log(` ${uniqueClusters} unique PeopleID3 clusters`);
|
||||
console.log('Top 5 largest clusters:',
|
||||
Object.entries(clusterStats)
|
||||
.sort((a, b) => b[1].total - a[1].total)
|
||||
.slice(0, 5)
|
||||
.map(([id, stats]) => `PeopleID3 ${id}: ${stats.total} groups`));
|
||||
|
||||
// Start background image testing (non-blocking)
|
||||
this.testImagesInBackground();
|
||||
},
|
||||
|
||||
async testImagesInBackground() {
|
||||
console.log('🔍 Starting background image verification...');
|
||||
|
||||
// Get groups that need image testing (have a real imageUrl, not placeholder)
|
||||
const groupsToTest = this.peopleGroups.filter(g =>
|
||||
|
|
@ -355,7 +333,6 @@ export const usePeopleGroupsStore = (pinia) => {
|
|||
let failed = 0;
|
||||
let errors = 0;
|
||||
|
||||
console.log(` Testing ${totalToTest} unique images...`);
|
||||
|
||||
// Test images SLOWLY - only 3 at a time with delays
|
||||
const batchSize = 3; // Small batch size to avoid rate limiting
|
||||
|
|
@ -408,7 +385,6 @@ export const usePeopleGroupsStore = (pinia) => {
|
|||
|
||||
// Log progress every 10 batches
|
||||
if ((i / batchSize) % 10 === 0) {
|
||||
console.log(` Progress: ${tested}/${totalToTest} tested (${loaded} ✅, ${failed} ❌, ${errors} ⚠️)`);
|
||||
}
|
||||
|
||||
// Delay between batches to avoid rate limiting
|
||||
|
|
@ -417,11 +393,6 @@ export const usePeopleGroupsStore = (pinia) => {
|
|||
}
|
||||
}
|
||||
|
||||
console.log(`🎉 Image testing complete!`);
|
||||
console.log(` ✅ ${loaded} images loaded successfully`);
|
||||
console.log(` ❌ ${failed} images not found (404) after retries`);
|
||||
console.log(` ⚠️ ${errors} network/timeout errors after retries`);
|
||||
console.log(` Note: Errors may be due to rate limiting or slow network`);
|
||||
},
|
||||
|
||||
async testImageWithRetry(url, peopleID3, maxRetries = 3) {
|
||||
|
|
@ -447,7 +418,6 @@ export const usePeopleGroupsStore = (pinia) => {
|
|||
|
||||
// Primary URL failed, try fallback URL format
|
||||
const fallbackUrl = `https://joshuaproject.net/assets/media/profiles/photos/p${peopleID3}.jpg`;
|
||||
console.log(` 🔄 Trying fallback URL for PeopleID3 ${peopleID3}...`);
|
||||
|
||||
const fallbackResult = await this.testImageLoadDetailed(fallbackUrl);
|
||||
|
||||
|
|
@ -519,8 +489,6 @@ export const usePeopleGroupsStore = (pinia) => {
|
|||
|
||||
// Get headers from first line - parse CSV properly
|
||||
const headers = this.parseCSVLine(lines[0]);
|
||||
console.log('CSV Headers found:', headers.length, 'columns');
|
||||
console.log('Key columns - PEID:', headers.indexOf('PEID'), 'Name:', headers.indexOf('Name'), 'PeopleID3:', headers.indexOf('PeopleID3'));
|
||||
|
||||
const data = [];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue