survery-lib 2.1.52 → 2.1.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -167,7 +167,7 @@ const questionAnswers = createSelector(selectSurveyData, (state) => selectAll$1(
167
167
  AnswerText: answerText,
168
168
  AnswerIdArr: x.answerIdArr,
169
169
  AnswerLevelId: x.answerLevelId,
170
- AnswerFile: x.answerFile.map(x => ({ byteArr: x.byteArr, name: x.name, id: x.id })),
170
+ AnswerFile: x.answerFile?.map(x => ({ byteArr: x.byteArr, name: x.name, id: x.id })),
171
171
  PassedRuleQuestionId: x.passedRuleQuestionId
172
172
  };
173
173
  }
@@ -282,42 +282,42 @@ class SurveyLibService {
282
282
  }
283
283
  setsurveyAnswers(model) {
284
284
  model.defaultAnswers.forEach(answer => {
285
- if (answer.QuestionType == QuestionTypeEnum.TextInput ||
286
- answer.QuestionType == QuestionTypeEnum.FeedBack) {
285
+ if (answer.questionType == QuestionTypeEnum.TextInput ||
286
+ answer.questionType == QuestionTypeEnum.FeedBack) {
287
287
  this._Store.dispatch(surveyActions.updateQuestionAnswer({
288
- questionId: answer.QuestionId,
289
- answer: answer.AnswerText,
288
+ questionId: answer.questionId,
289
+ answer: answer.answerText,
290
290
  isValid: true
291
291
  }));
292
292
  }
293
- else if (answer.QuestionType == QuestionTypeEnum.File) {
293
+ else if (answer.questionType == QuestionTypeEnum.File) {
294
294
  this._Store.dispatch(surveyActions.updateQuestionFileAnswer({
295
- questionId: answer.QuestionId,
296
- fileArr: answer.FileArr.map(x => ({ byteArr: null, name: x.name, id: x.id })),
295
+ questionId: answer.questionId,
296
+ fileArr: answer.fileArr.map(x => ({ byteArr: null, name: x.name, id: x.id })),
297
297
  isValid: true
298
298
  }));
299
299
  }
300
- else if (answer.QuestionType == QuestionTypeEnum.CheckBox
301
- || answer.QuestionType == QuestionTypeEnum.DropDownMulti) {
300
+ else if (answer.questionType == QuestionTypeEnum.CheckBox
301
+ || answer.questionType == QuestionTypeEnum.DropDownMulti) {
302
302
  this._Store.dispatch(surveyActions.updateQuestionAnswer({
303
- questionId: answer.QuestionId,
304
- answer: answer.AnswerIdArr,
303
+ questionId: answer.questionId,
304
+ answer: answer.answerIdArr,
305
305
  isValid: true
306
306
  }));
307
307
  }
308
- else if (answer.QuestionType == QuestionTypeEnum.Institutions) {
308
+ else if (answer.questionType == QuestionTypeEnum.Institutions) {
309
309
  this._Store.dispatch(surveyActions.updateInstitutionQuestionAnswer({
310
- questionId: answer.QuestionId,
311
- answer: answer.AnswerText,
312
- answerId: answer.AnswerId,
313
- answerLevelId: answer.AnswerLevelId,
310
+ questionId: answer.questionId,
311
+ answer: answer.answerText,
312
+ answerId: answer.answerId,
313
+ answerLevelId: answer.answerLevelId,
314
314
  isValid: true
315
315
  }));
316
316
  }
317
317
  else {
318
318
  this._Store.dispatch(surveyActions.updateQuestionAnswer({
319
- questionId: answer.QuestionId,
320
- answer: answer.AnswerId,
319
+ questionId: answer.questionId,
320
+ answer: answer.answerId,
321
321
  isValid: true
322
322
  }));
323
323
  }
@@ -2323,7 +2323,7 @@ class QuestionFileTemplateComponent {
2323
2323
  this.fCtrls.fileArr.updateValueAndValidity();
2324
2324
  }
2325
2325
  var question = this.questionArr().find(x => x.questionId == value.questionId);
2326
- if (question?.answerText) {
2326
+ if (question?.answerFile) {
2327
2327
  this.rForm.patchValue({
2328
2328
  fileArr: question.answerFile.map(x => ({ fileBase64: null, name: x.name, byteArr: null, id: x.id })),
2329
2329
  isDisabled: question.isDisabled,
@@ -2625,7 +2625,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImpor
2625
2625
  class DefaultQuestionAnswerPipe {
2626
2626
  transform(value, questionId, reloadId) {
2627
2627
  if (value != null) {
2628
- return value.find(x => x.QuestionId == questionId);
2628
+ return value.find(x => x.questionId == questionId);
2629
2629
  }
2630
2630
  return null;
2631
2631
  }
@@ -2642,7 +2642,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImpor
2642
2642
  class DefaultQuestionAnswersPipe {
2643
2643
  transform(value, questionId, reloadId) {
2644
2644
  if (value != null) {
2645
- return value.filter(x => x.ParentQuestionId == questionId);
2645
+ return value.filter(x => x.parentQuestionId == questionId);
2646
2646
  }
2647
2647
  return [];
2648
2648
  }
@@ -2721,14 +2721,13 @@ const _surveyReducer = createReducer(initialSurveyState, on(surveyActions.loadSu
2721
2721
  }), on(surveyActions.updateQuestionFileAnswer, (state, props) => {
2722
2722
  const question = selectAll(state.questionArr).find(x => x.questionId == props.questionId);
2723
2723
  if (question) {
2724
- var updateModel;
2725
2724
  if (question.questionType == QuestionTypeEnum.File) {
2726
- updateModel = {
2725
+ var updateModel = {
2727
2726
  id: props.questionId,
2728
2727
  changes: {
2729
2728
  answerId: question.questionAllInfo.surveyAnswers[0].answerId,
2730
2729
  answerText: null,
2731
- answerFile: props.fileArr.map(x => ({ byteArr: x.byteArr, name: x.name, id: x.id })),
2730
+ answerFile: props.fileArr?.map(x => ({ byteArr: x.byteArr, name: x.name, id: x.id })),
2732
2731
  isValid: props.isValid
2733
2732
  }
2734
2733
  };