From 9526730f555d5089b1baaf052ddfe1de0831b1f5 Mon Sep 17 00:00:00 2001 From: Anro Date: Wed, 6 Nov 2024 12:24:34 +0200 Subject: [PATCH] fix: remove console logs --- .../contacts/contacts-edit.component.ts | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/webapp/src/ts/modules/contacts/contacts-edit.component.ts b/webapp/src/ts/modules/contacts/contacts-edit.component.ts index d60c79ca7b..fca0688249 100644 --- a/webapp/src/ts/modules/contacts/contacts-edit.component.ts +++ b/webapp/src/ts/modules/contacts/contacts-edit.component.ts @@ -205,7 +205,6 @@ export class ContactsEditComponent implements OnInit, OnDestroy, AfterViewInit { // When using the link to go to another form, we need to clean up the duplicate section if (this.needsCleanup){ - console.log('Cleaning up duplicate section'); this.cleanUpDuplicateSection(); this.needsCleanup = false; } @@ -380,8 +379,6 @@ export class ContactsEditComponent implements OnInit, OnDestroy, AfterViewInit { private parseXmlForm(form): Document | undefined { // Below line is taken from enketo-core form-model line 114 const xmlDoc = this.parser.parseFromString(form.getDataStr({ irrelevant: false }), 'text/xml'); - console.log('Doc'); - console.log(xmlDoc); if (xmlDoc.getElementsByTagName('parsererror').length > 0) { console.error('Error parsing XML:', xmlDoc.getElementsByTagName('parsererror')[0].textContent); this.globalActions.setEnketoError('Error parsing xml document'); @@ -401,8 +398,6 @@ export class ContactsEditComponent implements OnInit, OnDestroy, AfterViewInit { XPathResult.STRING_TYPE, null ).stringValue; - - console.log(`Value of ${path}: `, value); values.push(value); } catch (error) { console.error(`Path ${path} value could not be resolved!`); @@ -413,11 +408,7 @@ export class ContactsEditComponent implements OnInit, OnDestroy, AfterViewInit { private queryPropInfo(xmlDoc: Document, info: Exclude){ const propPaths = info.valuePaths; - console.log('Query prop paths: ', propPaths); - const values = this.getFormValues(xmlDoc, propPaths); - - console.log('Function: ', info.query); const result = info.query(...values); return result; } @@ -429,7 +420,6 @@ export class ContactsEditComponent implements OnInit, OnDestroy, AfterViewInit { for (const field of props) { if (Object.prototype.hasOwnProperty.call(sibling, field.compareToDocProp)) { const test = this.strategy(field.value.toLowerCase(), sibling[field.compareToDocProp].toLowerCase()); - console.log(`${field.value.toLowerCase()} vs: ${sibling[field.compareToDocProp].toLowerCase()} Score: ${test}`); totalScore += test; count++; } @@ -441,11 +431,8 @@ export class ContactsEditComponent implements OnInit, OnDestroy, AfterViewInit { private getLikelyDuplicates(siblings: Sibling[], props: {value: string; compareToDocProp: string}[]){ const duplicates: Array = []; for (const sibling of siblings){ - console.log('Props to check: ', props); const score = this.calculateSiblingLikenessScore(sibling, props); - console.log('Calculated avg score: ', score); if (score !== null && score < this.duplicateThreshold){ - console.log('Adding to duplicate list'); duplicates.push({_id: sibling._id, name: sibling.name, reported_date: sibling.reported_date, score}); } } @@ -471,7 +458,6 @@ export class ContactsEditComponent implements OnInit, OnDestroy, AfterViewInit { private cleanUpDuplicateSection() { const $duplicateInfoElement = $('#contact-form').find('#duplicate_info'); - console.log($duplicateInfoElement); $duplicateInfoElement.empty(); // Remove all child nodes $duplicateInfoElement.hide(); } @@ -501,7 +487,6 @@ export class ContactsEditComponent implements OnInit, OnDestroy, AfterViewInit { private outputDuplicates(duplicates: Duplicate[]){ const $duplicateInfoElement = $('#contact-form').find('#duplicate_info'); - console.log($duplicateInfoElement); $duplicateInfoElement.empty(); // Remove all child nodes $duplicateInfoElement.show(); // TODO: create a template component where these values are fed into. @@ -514,7 +499,6 @@ export class ContactsEditComponent implements OnInit, OnDestroy, AfterViewInit { } $duplicateInfoElement.append(content); $duplicateInfoElement.on('click', '.duplicate-navigate-link', () => { - console.log('Flagging for cleanup'); this.needsCleanup = true; }); } @@ -560,20 +544,15 @@ export class ContactsEditComponent implements OnInit, OnDestroy, AfterViewInit { } const shouldCircumventDuplicateCheck = this.queryParams ? this.queryPropInfo(xmlDoc, this.queryParams) : false; - console.log('Should circumvent duplicate check: ', shouldCircumventDuplicateCheck); return this.allSettledFallback([form.validate(), this.dbLookupRef]) .then((results) => { - console.log('Intercepting and doing my cool thing here.'); - console.log(results); - let valid = results[0].status === 'fulfilled'? results[0].value : false; if (valid && !shouldCircumventDuplicateCheck) { if (results[1].status === 'fulfilled'){ const additionalCheckResult = results[1].value; const map = additionalCheckResult.rows.map((row: { doc: Sibling }) => row.doc); - console.log(map); valid = this.ensureUniqueItem(xmlDoc, docId, map); } else { valid = false;