survery-lib 2.1.10 → 2.1.13
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.
- package/esm2022/lib/components/question-institutions-template/question-institutions-template.component.mjs +6 -6
- package/esm2022/lib/core/states/entites/question.entity.mjs +1 -1
- package/esm2022/lib/core/states/survey-store/question.selector.mjs +26 -10
- package/esm2022/lib/core/states/survey-store/survey.action.mjs +1 -1
- package/esm2022/lib/core/states/survey-store/survey.reducer.mjs +2 -2
- package/esm2022/lib/services/api.service.mjs +2 -2
- package/esm2022/lib/services/survey-lib.service.mjs +10 -1
- package/esm2022/shared/dtos/default-question-answers.dto.mjs +1 -1
- package/esm2022/shared/enums/survey-language.enum.mjs +3 -3
- package/esm2022/shared/models/survery-question-result.model.mjs +1 -1
- package/fesm2022/survery-lib.mjs +42 -18
- package/fesm2022/survery-lib.mjs.map +1 -1
- package/lib/core/states/entites/question.entity.d.ts +1 -1
- package/lib/core/states/survey-store/survey.action.d.ts +2 -2
- package/package.json +1 -1
- package/shared/dtos/default-question-answers.dto.d.ts +1 -0
- package/shared/enums/survey-language.enum.d.ts +2 -2
- package/shared/models/survery-question-result.model.d.ts +1 -0
package/fesm2022/survery-lib.mjs
CHANGED
|
@@ -113,15 +113,30 @@ const { selectAll: selectAll$1, selectIds: selectIds$1 } = questionAdapter.getSe
|
|
|
113
113
|
const selectSurveyData = createFeatureSelector('survey-lib');
|
|
114
114
|
const allQuestions = createSelector(selectSurveyData, (state) => selectAll$1(state.questionArr));
|
|
115
115
|
const pageQuestions = createSelector(selectSurveyData, (state) => selectAll$1(state.questionArr).filter(x => x.surveyPageId == state.selectedPageId));
|
|
116
|
-
const questionAnswers = createSelector(selectSurveyData, (state) => selectAll$1(state.questionArr)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
116
|
+
const questionAnswers = createSelector(selectSurveyData, (state) => selectAll$1(state.questionArr)
|
|
117
|
+
.filter(x => x.isQuestionGroup != true).map(x => {
|
|
118
|
+
if (x.questionType == QuestionTypeEnum.Institutions) {
|
|
119
|
+
return {
|
|
120
|
+
SurveyPageIndex: x.surveyPageId,
|
|
121
|
+
QuestionId: x.questionId,
|
|
122
|
+
QuestionType: x.questionType,
|
|
123
|
+
AnswerId: x.answerLevelId,
|
|
124
|
+
AnswerText: x.answerText,
|
|
125
|
+
AnswerIdArr: x.answerIdArr,
|
|
126
|
+
AnswerLevelId: x.answerId
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
return {
|
|
131
|
+
SurveyPageIndex: x.surveyPageId,
|
|
132
|
+
QuestionId: x.questionId,
|
|
133
|
+
QuestionType: x.questionType,
|
|
134
|
+
AnswerId: x.answerId,
|
|
135
|
+
AnswerText: x.answerText,
|
|
136
|
+
AnswerIdArr: x.answerIdArr,
|
|
137
|
+
AnswerLevelId: x.answerLevelId
|
|
138
|
+
};
|
|
139
|
+
}
|
|
125
140
|
}));
|
|
126
141
|
const questionSelectors = {
|
|
127
142
|
allQuestions,
|
|
@@ -211,6 +226,15 @@ class SurveyLibService {
|
|
|
211
226
|
isValid: true
|
|
212
227
|
}));
|
|
213
228
|
}
|
|
229
|
+
else if (answer.QuestionType == QuestionTypeEnum.Institutions) {
|
|
230
|
+
this._Store.dispatch(surveyActions.updateInstitutionQuestionAnswer({
|
|
231
|
+
questionId: answer.QuestionId,
|
|
232
|
+
answer: answer.AnswerText,
|
|
233
|
+
answerId: answer.AnswerId,
|
|
234
|
+
answerLevelId: answer.AnswerLevelId,
|
|
235
|
+
isValid: true
|
|
236
|
+
}));
|
|
237
|
+
}
|
|
214
238
|
else {
|
|
215
239
|
this._Store.dispatch(surveyActions.updateQuestionAnswer({
|
|
216
240
|
questionId: answer.QuestionId,
|
|
@@ -1486,7 +1510,7 @@ class ApiService {
|
|
|
1486
1510
|
}
|
|
1487
1511
|
getAllPrograms(filter) {
|
|
1488
1512
|
var queryString = $.param(filter);
|
|
1489
|
-
return this._HttpClient.get(`${this.url}/api/v1/Institutions/
|
|
1513
|
+
return this._HttpClient.get(`${this.url}/api/v1/Institutions/GetPrograms?${queryString}`, { headers: new HttpHeaders({ 'disable-error-alert': 'true' }) });
|
|
1490
1514
|
}
|
|
1491
1515
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: ApiService, deps: [{ token: i1$1.HttpClient }, { token: LibConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1492
1516
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: ApiService, providedIn: 'root' }); }
|
|
@@ -1771,8 +1795,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImpor
|
|
|
1771
1795
|
|
|
1772
1796
|
var SurveyLanguageEnum;
|
|
1773
1797
|
(function (SurveyLanguageEnum) {
|
|
1774
|
-
SurveyLanguageEnum[SurveyLanguageEnum["Arabic"] =
|
|
1775
|
-
SurveyLanguageEnum[SurveyLanguageEnum["English"] =
|
|
1798
|
+
SurveyLanguageEnum[SurveyLanguageEnum["Arabic"] = 3] = "Arabic";
|
|
1799
|
+
SurveyLanguageEnum[SurveyLanguageEnum["English"] = 2] = "English";
|
|
1776
1800
|
})(SurveyLanguageEnum || (SurveyLanguageEnum = {}));
|
|
1777
1801
|
|
|
1778
1802
|
class QuestionInstitutionsTemplateComponent {
|
|
@@ -1848,9 +1872,9 @@ class QuestionInstitutionsTemplateComponent {
|
|
|
1848
1872
|
this._Store.dispatch(surveyActions.updateInstitutionQuestionAnswer({
|
|
1849
1873
|
questionId: group.value.id,
|
|
1850
1874
|
answerId: group.value.answerId,
|
|
1851
|
-
answer: group.value.
|
|
1875
|
+
answer: group.value.answerValue,
|
|
1852
1876
|
isValid: group.controls.answerId.valid,
|
|
1853
|
-
|
|
1877
|
+
answerLevelId: group.value.levelAnswerId,
|
|
1854
1878
|
}));
|
|
1855
1879
|
}
|
|
1856
1880
|
identify(index, item) {
|
|
@@ -1951,7 +1975,7 @@ class QuestionInstitutionsTemplateComponent {
|
|
|
1951
1975
|
});
|
|
1952
1976
|
}
|
|
1953
1977
|
else if (group.value.level == 3) {
|
|
1954
|
-
this._ApiService.getAllCollages({ submissionId: formValue.
|
|
1978
|
+
this._ApiService.getAllCollages({ submissionId: formValue.institutionId, branchSubmissionId: formValue.branchId }).pipe(take(1)).subscribe(res => {
|
|
1955
1979
|
group.controls.answers.setValue(res.responseDetails.map(x => {
|
|
1956
1980
|
return {
|
|
1957
1981
|
id: x.collageSubmissionId,
|
|
@@ -1961,7 +1985,7 @@ class QuestionInstitutionsTemplateComponent {
|
|
|
1961
1985
|
});
|
|
1962
1986
|
}
|
|
1963
1987
|
else if (group.value.level == 4) {
|
|
1964
|
-
this._ApiService.getAllSections({ submissionId: formValue.
|
|
1988
|
+
this._ApiService.getAllSections({ submissionId: formValue.institutionId, collageSubmissionId: formValue.collageId }).pipe(take(1)).subscribe(res => {
|
|
1965
1989
|
group.controls.answers.setValue(res.responseDetails.map(x => {
|
|
1966
1990
|
return {
|
|
1967
1991
|
id: x.sectionSubmissionId,
|
|
@@ -1971,7 +1995,7 @@ class QuestionInstitutionsTemplateComponent {
|
|
|
1971
1995
|
});
|
|
1972
1996
|
}
|
|
1973
1997
|
else if (group.value.level == 5) {
|
|
1974
|
-
this._ApiService.getAllPrograms({ submissionId: formValue.
|
|
1998
|
+
this._ApiService.getAllPrograms({ submissionId: formValue.institutionId, sectionGeneratedKey: formValue.sectionId }).pipe(take(1)).subscribe(res => {
|
|
1975
1999
|
group.controls.answers.setValue(res.responseDetails.map(x => {
|
|
1976
2000
|
return {
|
|
1977
2001
|
id: x.generatedId,
|
|
@@ -2283,7 +2307,7 @@ const _surveyReducer = createReducer(initialSurveyState, on(surveyActions.loadSu
|
|
|
2283
2307
|
changes: {
|
|
2284
2308
|
answerId: props.answerId,
|
|
2285
2309
|
answerText: props.answer,
|
|
2286
|
-
|
|
2310
|
+
answerLevelId: props.answerLevelId,
|
|
2287
2311
|
isValid: props.isValid
|
|
2288
2312
|
}
|
|
2289
2313
|
};
|