Skip to content

Commit 72672a8

Browse files
remove console logs
1 parent 27b0827 commit 72672a8

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

lib/DataHarmonizer.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ class DataHarmonizer {
273273
section_title = field.is_a;
274274
} else {
275275
section_title = 'Generic';
276-
console.log("Template field doesn't have section: ", name);
276+
console.warn("Template field doesn't have section: ", name);
277277
}
278278
}
279279

@@ -325,7 +325,7 @@ class DataHarmonizer {
325325
// Parse slot's range(s)
326326
for (let range of range_array) {
327327
if (range === undefined) {
328-
console.log('field has no range', new_field.title);
328+
console.warn('field has no range', new_field.title);
329329
}
330330

331331
// Range is a datatype?
@@ -461,10 +461,10 @@ class DataHarmonizer {
461461
try {
462462
new_field.pattern = new RegExp(field.pattern);
463463
} catch (err) {
464-
console.log(
464+
console.warn(
465465
`TEMPLATE ERROR: Check the regular expression syntax for "${new_field.title}".`
466466
);
467-
console.log(err);
467+
console.error(err);
468468
// Allow anything until regex fixed.
469469
new_field.pattern = new RegExp(/.*/);
470470
}
@@ -520,7 +520,7 @@ class DataHarmonizer {
520520
this.hot.loadData(list_data);
521521
}
522522
} catch (err) {
523-
console.log(err);
523+
console.error(err);
524524
}
525525
}
526526

@@ -674,7 +674,7 @@ class DataHarmonizer {
674674
this.enableMultiSelection();
675675

676676
} else {
677-
console.log(
677+
console.warn(
678678
'This template had no sections and fields: ' + this.template_name
679679
);
680680
}
@@ -1215,7 +1215,6 @@ class DataHarmonizer {
12151215
// Now add 2nd row child titles
12161216
rows[1].push(...parent.children.map((child) => child.title));
12171217
}
1218-
console.log('get flat headers rows', rows)
12191218
return rows;
12201219
}
12211220

@@ -1885,7 +1884,7 @@ class DataHarmonizer {
18851884
}
18861885
let sources = exportHeaders.get(target.field);
18871886
if (!sources) {
1888-
console.log(
1887+
console.warn(
18891888
'Malformed export.js exportHeader field:',
18901889
target.field
18911890
);

lib/editors/KeyValueEditor.js

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export default class KeyValueListEditor extends Handsontable.editors
4141
if (instance) {
4242
const _id = instance.getDataAtRowProp(row, '_id');
4343
const label = instance.getDataAtRowProp(row, 'label');
44-
console.log(`${_id}, ${label}`);
4544
const translated_value =
4645
i18next.t(_id) !== _id ? i18next.t(_id) : label;
4746
return translated_value;

lib/utils/i18n.js

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ const withNamespace = (namespace) => (obj) =>
3232
{}
3333
);
3434

35-
console.log(withNamespace('translation')(labels));
36-
3735
const rerender = () => {
3836
// start localizing, details:
3937
// https://github.com/i18next/jquery-i18next#usage-of-selector-function

web/index.js

-8
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ let dhs = [];
4141
let data_harmonizers = {};
4242

4343
const rootUrl = window.location.host;
44-
console.log('Root URL:', rootUrl);
4544

4645
async function getTemplatePath() {
4746
let templatePath;
@@ -90,7 +89,6 @@ class AppContext {
9089
}
9190

9291
setCurrentDataHarmonizer(data_harmonizer_name) {
93-
console.log('set current data harmonizer', data_harmonizer_name)
9492
this.current_data_harmonizer_name = data_harmonizer_name;
9593
}
9694

@@ -722,8 +720,6 @@ function makeDataHarmonizersFromSchemaTree(context, schema, schema_tree, schema_
722720
})
723721
dhTabNav.appendChild(dhTab); // Appending to the tab navigation
724722

725-
console.log('findSlotNamesForClass', findSlotNamesForClass(schema, cls_key));
726-
727723
data_harmonizers[spec.name] = new DataHarmonizer(dhSubroot, {
728724
context: context,
729725
loadingScreenRoot: document.body,
@@ -750,8 +746,6 @@ function makeDataHarmonizersFromSchemaTree(context, schema, schema_tree, schema_
750746
function transformMultivaluedColumn(data_harmonizer, shared_field, changes, source, old_value, new_value) {
751747
const hot = data_harmonizer.hot;
752748

753-
console.log('transform multivalued column execute', shared_field, changes, source, old_value, new_value);
754-
console.log(hot.propToCol(shared_field.name))
755749
// Verify if column_name is a valid property
756750
if (hot.propToCol(shared_field.name) === -1) {
757751
console.error(`Invalid column name: ${column_name}`);
@@ -770,7 +764,6 @@ function transformMultivaluedColumn(data_harmonizer, shared_field, changes, sour
770764
// });
771765
hot.batch(() => {
772766
hot.getData().forEach((row, rowIndex) => {
773-
console.log(row, rowIndex)
774767
if (row[changes[0][1]] === old_value) {
775768
// Set new value for the cell that matches the condition
776769
// hot.setDataAtCell(rowIndex, columnIndex, new_value);
@@ -873,7 +866,6 @@ function setupSharedColumn(data_harmonizer, shared_key_name, callback) {
873866
} else {
874867
// Listen for changes using the afterChange hook of Handsontable
875868
hot.addHook('afterChange', (changes, source) => {
876-
console.log('setupSharedColumn: afterchange hook execute', changes, source)
877869
// changes is a 2D array containing information about each change
878870
// Each change is of the form [row, prop, oldVal, newVal]
879871
if (changes && source !== 'loadData') { // Ignore initial load changes

0 commit comments

Comments
 (0)