Skip to content

Commit 8f64221

Browse files
committed
fix(import): fix literal questions not updating. closes #192
1 parent 2e1ece2 commit 8f64221

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

src/app/new.state/xml/xml.reducer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ export const xmlReducer = createReducer(
136136
variablesMatched,
137137
);
138138
}
139-
// console.log(createNewVariables(variablesMatched, variables, variableTemplate));
140139
duplicateState.info
141140
? (duplicateState.info.importedSuccess = true)
142141
: {

src/app/new.state/xml/xml.util.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ export function updateGroups(
413413
groups: VariableGroup[],
414414
matchedVariableIDs: MatchVariables,
415415
): VariableGroup[] {
416-
console.log(groups);
417416
const duplicateVariableGroups: VariableGroup[] = [];
418417
groups.forEach((group) => {
419418
const flipMatched: { [oldVariableID: string]: string } = {};
@@ -464,13 +463,11 @@ export function createNewVariables(
464463
variablesMatched[variable['@_ID']],
465464
reverseLookup,
466465
);
467-
// console.log(updatedVariable);
468466
newVariables.push(updatedVariable);
469467
} else {
470468
newVariables.push(variable);
471469
}
472470
});
473-
// console.log(newVariables);
474471
return newVariables;
475472
}
476473

@@ -537,21 +534,18 @@ function editSingleVariable(
537534
};
538535
}
539536
if (variableTemplate.literalQuestion) {
540-
console.log('current: ', currentVariable.qstn);
541-
console.log('imported: ', importedVariablesMatched.importedVariable.qstn);
542537
const literalQuestion =
543538
importedVariablesMatched.importedVariable.qstn?.qstnLit ||
544539
currentVariable.qstn?.qstnLit ||
545540
'';
546-
console.log('literalQuestion: ', literalQuestion);
547541
currentVariableCloned.qstn = {
548542
...currentVariable.qstn,
549543
qstnLit: literalQuestion,
550544
};
551545
}
552546
if (variableTemplate.interviewQuestion) {
553547
currentVariableCloned.qstn = {
554-
...currentVariable.qstn,
548+
...currentVariableCloned.qstn,
555549
ivuInstr:
556550
importedVariablesMatched.importedVariable.qstn?.ivuInstr ||
557551
currentVariable.qstn?.ivuInstr ||
@@ -560,7 +554,7 @@ function editSingleVariable(
560554
}
561555
if (variableTemplate.postQuestion) {
562556
currentVariableCloned.qstn = {
563-
...currentVariable.qstn,
557+
...currentVariableCloned.qstn,
564558
postQTxt:
565559
importedVariablesMatched.importedVariable.qstn?.postQTxt ||
566560
currentVariable.qstn?.postQTxt ||
@@ -571,7 +565,6 @@ function editSingleVariable(
571565
currentVariableCloned.universe =
572566
importedVariablesMatched.importedVariable.universe;
573567
}
574-
console.log('clones: ', currentVariableCloned);
575568
return currentVariableCloned;
576569
}
577570

0 commit comments

Comments
 (0)