CSR-803: rename tweaking, again
This commit is contained in:
parent
9d38856241
commit
d907080bf6
7 changed files with 47 additions and 47 deletions
|
|
@ -155,7 +155,7 @@ export default {
|
|||
return {
|
||||
answerResult: questionAnswer,
|
||||
answeredQuestions: answeredQuestions,
|
||||
glassPieceIndex: this.glassPieceIndex,
|
||||
index: this.glassPieceIndex,
|
||||
};
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@
|
|||
:manualHeadline="alertFewMoreQuestionsHeader"
|
||||
:manualCopy="alertFewMoreQuestionsCopy"
|
||||
v-bind:isDismissible="false" />
|
||||
<div v-for="(questionDatum, i) in questionsData" :key="questionDatum.key">
|
||||
<div v-for="(questionsDatum, i) in questionsData" :key="questionsDatum.key">
|
||||
<questionChain
|
||||
ref="questionChain"
|
||||
v-model="selectedAnswers[questionDatum.answerKey]"
|
||||
:questionData="questionDatum.questions"
|
||||
v-model="selectedAnswers[questionsDatum.answerKey]"
|
||||
:questionData="questionsDatum.questions"
|
||||
:glassPieceIndex="i"
|
||||
v-if="showThisQuestionChain(questionDatum, i)"
|
||||
:answerKey="questionDatum.answerKey"
|
||||
v-if="showThisQuestionChain(questionsDatum, i)"
|
||||
:answerKey="questionsDatum.answerKey"
|
||||
:validationRules="validationRules" />
|
||||
</div>
|
||||
<funnel-footer
|
||||
|
|
|
|||
|
|
@ -77,27 +77,27 @@ export default {
|
|||
|
||||
this.questionsData = this.pageData.partsOrQuestions
|
||||
.filter((x) => x.capabilityQuestions)
|
||||
.map((glass, i) => {
|
||||
.map((glassPiece, i) => {
|
||||
// NOTE: questions for property "questions" can differ between layouts
|
||||
glass.questions = glass.capabilityQuestions;
|
||||
glass.answerKey = glass.glassLocation + "-" + glass.glassName;
|
||||
// reset selectedAnswers for this glass
|
||||
this.selectedAnswers[glass.answerKey] = [];
|
||||
glassPiece.questions = glassPiece.capabilityQuestions;
|
||||
glassPiece.answerKey = glassPiece.glassLocation + "-" + glassPiece.glassName;
|
||||
// reset selectedAnswers for this glassPiece
|
||||
this.selectedAnswers[glassPiece.answerKey] = [];
|
||||
|
||||
const updatedGlass = this.setupInitialData(glass, i, alreadyAnsweredQuestions);
|
||||
const updatedGlassPiece = this.setupInitialData(glass, i, alreadyAnsweredQuestions);
|
||||
|
||||
// Set up watch for each set of glass questions
|
||||
this.$watch(
|
||||
"selectedAnswers." + glass.answerKey,
|
||||
"selectedAnswers." + glassPiece.answerKey,
|
||||
(newValue) => {
|
||||
if (newValue && Object.keys(newValue).length > 0) {
|
||||
this.handleAnswerUpdates(newValue, glass.answerKey);
|
||||
this.handleAnswerUpdates(newValue, glassPiece.answerKey);
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
return updatedGlass;
|
||||
return updatedGlassPiece;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -77,26 +77,26 @@ export default {
|
|||
|
||||
this.questionsData = this.pageData.partsOrQuestions
|
||||
.filter((x) => x.parts[0].childPartQuestions.length)
|
||||
.map((glass, i) => {
|
||||
.map((glassPiece, i) => {
|
||||
// NOTE: questions for property "questions" can differ between layouts
|
||||
glass.questions = glass.parts[0].childPartQuestions;
|
||||
glass.answerKey = glass.glassLocation + "-" + glass.glassName;
|
||||
// reset selectedAnswers for this glass
|
||||
this.selectedAnswers[glass.answerKey] = [];
|
||||
glassPiece.questions = glassPiece.parts[0].childPartQuestions;
|
||||
glassPiece.answerKey = glassPiece.glassLocation + "-" + glassPiece.glassName;
|
||||
// reset selectedAnswers for this glassPiece
|
||||
this.selectedAnswers[glassPiece.answerKey] = [];
|
||||
|
||||
const updatedGlass = this.setupInitialData(glass, i, alreadyAnsweredQuestions);
|
||||
const updatedGlassPiece = this.setupInitialData(glass, i, alreadyAnsweredQuestions);
|
||||
|
||||
this.$watch(
|
||||
"selectedAnswers." + glass.answerKey,
|
||||
"selectedAnswers." + glassPiece.answerKey,
|
||||
(newValue) => {
|
||||
if (newValue && Object.keys(newValue).length > 0) {
|
||||
this.handleAnswerUpdates(newValue, glass.answerKey);
|
||||
this.handleAnswerUpdates(newValue, glassPiece.answerKey);
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
return updatedGlass;
|
||||
return updatedGlassPiece;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -77,27 +77,27 @@ export default {
|
|||
|
||||
this.questionsData = this.pageData.partsOrQuestions
|
||||
.filter((x) => x.partQuestions)
|
||||
.map((glass, i) => {
|
||||
.map((glassPiece, i) => {
|
||||
// NOTE: questions for property "questions" can differ between layouts
|
||||
glass.questions = glass.partQuestions;
|
||||
glass.answerKey = glass.glassLocation + "-" + glass.glassName;
|
||||
// reset selectedAnswers for this glass
|
||||
this.selectedAnswers[glass.answerKey] = [];
|
||||
glassPiece.questions = glassPiece.partQuestions;
|
||||
glassPiece.answerKey = glassPiece.glassLocation + "-" + glassPiece.glassName;
|
||||
// reset selectedAnswers for this glassPiece
|
||||
this.selectedAnswers[glassPiece.answerKey] = [];
|
||||
|
||||
const updatedGlass = this.setupInitialData(glass, i, alreadyAnsweredQuestions);
|
||||
const updatedGlassPiece = this.setupInitialData(glass, i, alreadyAnsweredQuestions);
|
||||
|
||||
// Set up watch for each set of glass questions
|
||||
this.$watch(
|
||||
"selectedAnswers." + glass.answerKey,
|
||||
"selectedAnswers." + glassPiece.answerKey,
|
||||
(newValue) => {
|
||||
if (newValue && Object.keys(newValue).length > 0) {
|
||||
this.handleAnswerUpdates(newValue, glass.answerKey);
|
||||
this.handleAnswerUpdates(newValue, glassPiece.answerKey);
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
return updatedGlass;
|
||||
return updatedGlassPiece;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ export default {
|
|||
"questionNum": 1,
|
||||
}
|
||||
],
|
||||
"glassPieceIndex": 0
|
||||
"index": 0
|
||||
}
|
||||
*/
|
||||
|
||||
|
|
@ -213,7 +213,7 @@ export default {
|
|||
*/
|
||||
|
||||
// limit duplicate search to glass pieces that follow after the currently being answered glass piece
|
||||
if (pieceIndex > answer.glassPieceIndex) {
|
||||
if (pieceIndex > answer.index) {
|
||||
let indexToSuppressTo;
|
||||
// reset this glass piece, in case user is changing their previous answers
|
||||
glassPiece.answerData = null;
|
||||
|
|
@ -341,13 +341,13 @@ export default {
|
|||
});
|
||||
|
||||
// set final answer data for the current answered glass part
|
||||
self.questionsData[answer.glassPieceIndex].answerData = {
|
||||
self.questionsData[answer.index].answerData = {
|
||||
answerResult: answer.answerResult,
|
||||
answeredQuestions: answer.answeredQuestions,
|
||||
};
|
||||
|
||||
// this part has been fully answered, so advance to next part's question chain
|
||||
for (let i = answer.glassPieceIndex + 1; i < this.questionsData.length; i++) {
|
||||
for (let i = answer.index + 1; i < this.questionsData.length; i++) {
|
||||
// if this part has not yet been fully answered, then make it the current part
|
||||
if (!this.questionsData[i].answerData?.answerResult) {
|
||||
this.currentGlassPieceIndex = i;
|
||||
|
|
|
|||
|
|
@ -425,7 +425,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
questionNum: 1,
|
||||
},
|
||||
],
|
||||
glassPieceIndex: 0,
|
||||
index: 0,
|
||||
};
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -459,7 +459,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
questionNum: 1,
|
||||
},
|
||||
],
|
||||
glassPieceIndex: 0,
|
||||
index: 0,
|
||||
};
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -495,7 +495,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
questionNum: 1,
|
||||
},
|
||||
],
|
||||
glassPieceIndex: 0,
|
||||
index: 0,
|
||||
};
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -532,7 +532,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
questionNum: 1,
|
||||
},
|
||||
],
|
||||
glassPieceIndex: 0,
|
||||
index: 0,
|
||||
};
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -609,7 +609,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
questionNum: 1,
|
||||
},
|
||||
],
|
||||
glassPieceIndex: 0,
|
||||
index: 0,
|
||||
};
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -681,7 +681,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
questionNum: 1,
|
||||
},
|
||||
],
|
||||
glassPieceIndex: 0,
|
||||
index: 0,
|
||||
};
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -752,7 +752,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
questionNum: 1,
|
||||
},
|
||||
],
|
||||
glassPieceIndex: 0,
|
||||
index: 0,
|
||||
};
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -855,7 +855,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
questionNum: 1,
|
||||
},
|
||||
],
|
||||
glassPieceIndex: 0,
|
||||
index: 0,
|
||||
};
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -1003,7 +1003,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
questionNum: 1,
|
||||
},
|
||||
],
|
||||
glassPieceIndex: 0,
|
||||
index: 0,
|
||||
};
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -1115,7 +1115,7 @@ describe("vehicle-questions-mixin", () => {
|
|||
questionNum: 1,
|
||||
},
|
||||
],
|
||||
glassPieceIndex: 0,
|
||||
index: 0,
|
||||
};
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue