Skip to content

Commit

Permalink
Cleanup some logs
Browse files Browse the repository at this point in the history
  • Loading branch information
relf committed Aug 30, 2024
1 parent c08e133 commit eb2d422
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 26 deletions.
4 changes: 1 addition & 3 deletions app/javascript/application_views/analyses_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,11 @@ class AnalysesIndex {
});
}

console.log('ATTACH EVENT');
$('input[data-analyses-query]').on('click', setAnalysesListSettings);
$('input[data-analyses-order]').on('click', setAnalysesListSettings);
$('#analyses-filter').on(
'keypress',
(event) => {
console.log('Keypress');
if (event.key === 'Enter') {
setAnalysesListSettings();
// Cancel the default action, if needed
Expand Down Expand Up @@ -101,7 +99,7 @@ class AnalysesIndex {
},
success() {
$.getScript(this.href, () => {
if (timeout) { clearTimeout(timeout); console.log('CLEAR'); }
if (timeout) { clearTimeout(timeout); }
$('.spinner').hide();
});
},
Expand Down
1 change: 0 additions & 1 deletion app/javascript/application_views/optimizations_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class OptimizationsIndex {
const status = $('#status-select').val();

$('.checkbox_child').each(function toggle_status() {
console.log(this);
if ($(this).attr('class').indexOf(status) > 0) {
$(this).prop('checked', checked);
}
Expand Down
1 change: 0 additions & 1 deletion app/javascript/mda_viewer/components/DisciplinesEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ class Discipline extends React.Component {
}

handleSubAnalysisSelected(selected) {
console.log(`Select ${JSON.stringify(selected)}`);
// Extract name from analysis label #\d+ name
const [, discName] = selected[0].label.match(/#\d+\s(.*)/);
this.setState({ selected, discName });
Expand Down
34 changes: 15 additions & 19 deletions app/javascript/mda_viewer/components/DistributionModals.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,6 @@ class DistributionModal extends React.Component {
return this.visible;
}

getFormData() {
const { selected } = this.state;
const taken = selected < 0 ? 0 : selected;
const { dists: { [taken]: { kind, options_attributes } } } = this.state;
const formData = { kind };
if (options_attributes) {
formData[`${kind.toLowerCase()}_options`] = {};
}
for (let i = 0; i < options_attributes.length; i += 1) {
const opt = options_attributes[i];
formData[`${kind.toLowerCase()}_options`][opt.name] = opt.value;
}
return formData;
}

handleChange(data) {
const { selected } = this.state;

Expand All @@ -208,9 +193,6 @@ class DistributionModal extends React.Component {
const { formData } = data;
const { kind } = formData;

const { conn: { name } } = this.props;
console.log(`${name}[${selected}]`);

const newState = update(this.state, {
dists: {
[selected]: {
Expand All @@ -223,7 +205,6 @@ class DistributionModal extends React.Component {
if (k.startsWith(kind.toLowerCase())) {
for (const optname in formData[k]) {
if (formData[k][optname] !== undefined) { // Form bug: filter undefined data
// console.log('PUSH ', { name: optname, value: formData[k][optname] });
newState.dists[selected].options_attributes.push(
{ name: optname, value: formData[k][optname] },
);
Expand Down Expand Up @@ -258,6 +239,21 @@ class DistributionModal extends React.Component {
$(`#distributionModal-${name}`).modal('hide');
}

getFormData() {
const { selected } = this.state;
const taken = selected < 0 ? 0 : selected;
const { dists: { [taken]: { kind, options_attributes } } } = this.state;
const formData = { kind };
if (options_attributes) {
formData[`${kind.toLowerCase()}_options`] = {};
}
for (let i = 0; i < options_attributes.length; i += 1) {
const opt = options_attributes[i];
formData[`${kind.toLowerCase()}_options`][opt.name] = opt.value;
}
return formData;
}

/* eslint-disable jsx-a11y/control-has-associated-label */
/* eslint-disable react/no-array-index-key */
render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class VariableSearchPanel extends React.Component {
const { selected, vars, varinfo } = this.state;
const { api } = this.props;

console.log(selected);
let varDisplay = null;
if (selected.length !== 0) {
varDisplay = (<VariableDisplay api={api} varinfo={varinfo} />);
Expand Down
1 change: 0 additions & 1 deletion app/javascript/mda_viewer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ class MdaViewer extends React.Component {
},
});
if (selected.length) {
console.log(`Project: ${JSON.stringify(selected[0])}`);
newState = update(this.state, {
mda: { project: { $set: selected[0] } },
});
Expand Down

0 comments on commit eb2d422

Please sign in to comment.