@mseva/digit-ui-module-engagement 1.1.10 → 1.1.12
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/dist/index.js +217 -53
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +217 -53
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20132,7 +20132,7 @@ const FillQuestions = props => {
|
|
|
20132
20132
|
var _response$responseInf, _response$responseInf2;
|
|
20133
20133
|
if (((response === null || response === void 0 ? void 0 : (_response$responseInf = response.responseInfo) === null || _response$responseInf === void 0 ? void 0 : _response$responseInf.status) === "200" || (response === null || response === void 0 ? void 0 : (_response$responseInf2 = response.responseInfo) === null || _response$responseInf2 === void 0 ? void 0 : _response$responseInf2.status) === "201") && (response === null || response === void 0 ? void 0 : response.user.length) > 0) {
|
|
20134
20134
|
var _response$user$, _response$user$2, _response$user$3, _response$user$4, _response$user$5, _response$user$6;
|
|
20135
|
-
if ((response === null || response === void 0 ? void 0 : (_response$user$ = response.user[0]) === null || _response$user$ === void 0 ? void 0 : _response$user$.gender) === null || (response === null || response === void 0 ? void 0 : (_response$user$2 = response.user[0]) === null || _response$user$2 === void 0 ? void 0 : _response$user$2.
|
|
20135
|
+
if ((response === null || response === void 0 ? void 0 : (_response$user$ = response.user[0]) === null || _response$user$ === void 0 ? void 0 : _response$user$.gender) === null || (response === null || response === void 0 ? void 0 : (_response$user$2 = response.user[0]) === null || _response$user$2 === void 0 ? void 0 : _response$user$2.emailId) === null || (response === null || response === void 0 ? void 0 : (_response$user$3 = response.user[0]) === null || _response$user$3 === void 0 ? void 0 : _response$user$3.dob) === null || (response === null || response === void 0 ? void 0 : (_response$user$4 = response.user[0]) === null || _response$user$4 === void 0 ? void 0 : _response$user$4.gender) === "" || (response === null || response === void 0 ? void 0 : (_response$user$5 = response.user[0]) === null || _response$user$5 === void 0 ? void 0 : _response$user$5.emailId) === "" || (response === null || response === void 0 ? void 0 : (_response$user$6 = response.user[0]) === null || _response$user$6 === void 0 ? void 0 : _response$user$6.dob) === "") {
|
|
20136
20136
|
setHasCitizenDetails(false);
|
|
20137
20137
|
} else {
|
|
20138
20138
|
var _response$user$7;
|
|
@@ -20919,7 +20919,7 @@ const FillQuestions = props => {
|
|
|
20919
20919
|
}, "--Please choose a city--"), cities.map((option, index) => /*#__PURE__*/React__default.createElement("option", {
|
|
20920
20920
|
key: index,
|
|
20921
20921
|
value: option.code
|
|
20922
|
-
}, option === null || option === void 0 ? void 0 : option.
|
|
20922
|
+
}, option === null || option === void 0 ? void 0 : option.name))), errors && errors["city"] && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
|
|
20923
20923
|
style: {
|
|
20924
20924
|
marginTop: "0px",
|
|
20925
20925
|
marginBottom: "0px",
|
|
@@ -22546,6 +22546,7 @@ const useInboxTableConfig = _ref => {
|
|
|
22546
22546
|
inboxStyles = {},
|
|
22547
22547
|
setShowToast
|
|
22548
22548
|
} = _ref;
|
|
22549
|
+
const history = reactRouterDom.useHistory();
|
|
22549
22550
|
const GetCell = value => /*#__PURE__*/React__default.createElement("span", {
|
|
22550
22551
|
className: "cell-text styled-cell"
|
|
22551
22552
|
}, value);
|
|
@@ -22579,7 +22580,15 @@ const useInboxTableConfig = _ref => {
|
|
|
22579
22580
|
row
|
|
22580
22581
|
} = _ref2;
|
|
22581
22582
|
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("span", {
|
|
22582
|
-
className: "link"
|
|
22583
|
+
className: "link",
|
|
22584
|
+
onClick: () => {
|
|
22585
|
+
history.push({
|
|
22586
|
+
pathname: `/digit-ui/employee/engagement/surveys/previewQuestions`,
|
|
22587
|
+
state: {
|
|
22588
|
+
data: row.original
|
|
22589
|
+
}
|
|
22590
|
+
});
|
|
22591
|
+
}
|
|
22583
22592
|
}, row.original.surveyTitle));
|
|
22584
22593
|
}
|
|
22585
22594
|
}, {
|
|
@@ -25721,7 +25730,7 @@ const StepWrapper = _ref => {
|
|
|
25721
25730
|
flex: 1,
|
|
25722
25731
|
color: isActive ? "#3f51b5" : "#ccc",
|
|
25723
25732
|
padding: "10px 10px",
|
|
25724
|
-
width:
|
|
25733
|
+
width: "260px"
|
|
25725
25734
|
});
|
|
25726
25735
|
const circleStyle = stepNumber => {
|
|
25727
25736
|
let backgroundColor;
|
|
@@ -25747,7 +25756,7 @@ const StepWrapper = _ref => {
|
|
|
25747
25756
|
};
|
|
25748
25757
|
};
|
|
25749
25758
|
const labelStyle = {
|
|
25750
|
-
fontSize: "
|
|
25759
|
+
fontSize: "18px",
|
|
25751
25760
|
color: "#1E1E1E",
|
|
25752
25761
|
fontWeight: "500",
|
|
25753
25762
|
fontFamily: "Noto Sans,sans-serif",
|
|
@@ -25758,7 +25767,7 @@ const StepWrapper = _ref => {
|
|
|
25758
25767
|
color: "#263238",
|
|
25759
25768
|
fontWeight: "400",
|
|
25760
25769
|
fontFamily: "Noto Sans,sans-serif",
|
|
25761
|
-
margin:
|
|
25770
|
+
margin: "0px 6px 0px 0px"
|
|
25762
25771
|
};
|
|
25763
25772
|
const lineStyle = {
|
|
25764
25773
|
position: "absolute",
|
|
@@ -25804,7 +25813,7 @@ const StepWrapper = _ref => {
|
|
|
25804
25813
|
}, index + 1 === totalSteps ? null : /*#__PURE__*/React__default.createElement("div", {
|
|
25805
25814
|
className: "step-number",
|
|
25806
25815
|
style: stepNumberStyle
|
|
25807
|
-
}
|
|
25816
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
25808
25817
|
className: "step-label",
|
|
25809
25818
|
style: labelStyle
|
|
25810
25819
|
}, t(stepsList[index].stepLabel))), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -25909,21 +25918,22 @@ const newConfig = [{
|
|
|
25909
25918
|
const UPDATE_SURVEY_FORM = "UPDATE_SURVEY_FORM";
|
|
25910
25919
|
const SET_SURVEY_STEP = "SET_SURVEY_STEP";
|
|
25911
25920
|
const FIELD_CHANGE = "FIELD_CHANGE";
|
|
25912
|
-
const ADD_CATEGORY =
|
|
25913
|
-
const ADD_QUESTIONS =
|
|
25914
|
-
const ADD_QUESTIONS_LIST =
|
|
25915
|
-
const RECALCULATE_WEIGHTAGE =
|
|
25916
|
-
const UPDATE_CATEGORY =
|
|
25917
|
-
const UPDATE_QUESTION_SELECTION =
|
|
25918
|
-
const UPDATE_MANDATORY_QUESTION_SELECTION =
|
|
25919
|
-
const UPDATE_QUESTION_WEIGHTAGE =
|
|
25920
|
-
const SET_QUESTIONS =
|
|
25921
|
-
const DELETE_CATEGORY =
|
|
25922
|
-
const GO_PREV =
|
|
25923
|
-
const GO_NEXT =
|
|
25924
|
-
const NEXT_STEP =
|
|
25925
|
-
const PREVIOUS_STEP =
|
|
25926
|
-
const SET_STEP_DATA =
|
|
25921
|
+
const ADD_CATEGORY = "ADD_CATEGORY";
|
|
25922
|
+
const ADD_QUESTIONS = "ADD_QUESTIONS";
|
|
25923
|
+
const ADD_QUESTIONS_LIST = "ADD_QUESTIONS_LIST";
|
|
25924
|
+
const RECALCULATE_WEIGHTAGE = "RECALCULATE_WEIGHTAGE";
|
|
25925
|
+
const UPDATE_CATEGORY = "UPDATE_CATEGORY";
|
|
25926
|
+
const UPDATE_QUESTION_SELECTION = "UPDATE_QUESTION_SELECTION";
|
|
25927
|
+
const UPDATE_MANDATORY_QUESTION_SELECTION = "UPDATE_MANDATORY_QUESTION_SELECTION";
|
|
25928
|
+
const UPDATE_QUESTION_WEIGHTAGE = "UPDATE_QUESTION_WEIGHTAGE";
|
|
25929
|
+
const SET_QUESTIONS = "SET_QUESTIONS";
|
|
25930
|
+
const DELETE_CATEGORY = "DELETE_CATEGORY";
|
|
25931
|
+
const GO_PREV = "GO_PREV";
|
|
25932
|
+
const GO_NEXT = "GO_NEXT";
|
|
25933
|
+
const NEXT_STEP = "NEXT_STEP";
|
|
25934
|
+
const PREVIOUS_STEP = "PREVIOUS_STEP";
|
|
25935
|
+
const SET_STEP_DATA = "SET_STEP_DATA";
|
|
25936
|
+
const AUTO_CALCULATE_CATEGORY = "AUTO_CALCULATE_CATEGORY";
|
|
25927
25937
|
|
|
25928
25938
|
const updateSurveyForm = (key, value) => ({
|
|
25929
25939
|
type: UPDATE_SURVEY_FORM,
|
|
@@ -25988,6 +25998,10 @@ const deleteCategory = categoryId => ({
|
|
|
25988
25998
|
const goPrev = () => ({
|
|
25989
25999
|
type: GO_PREV
|
|
25990
26000
|
});
|
|
26001
|
+
const autoCalculateCategoriesWeight = categoryWeight => ({
|
|
26002
|
+
type: AUTO_CALCULATE_CATEGORY,
|
|
26003
|
+
categoryWeight
|
|
26004
|
+
});
|
|
25991
26005
|
|
|
25992
26006
|
const surveyConfig = [{
|
|
25993
26007
|
head: "SURVEY_DETAILS",
|
|
@@ -27539,6 +27553,142 @@ const Response$6 = props => {
|
|
|
27539
27553
|
}))));
|
|
27540
27554
|
};
|
|
27541
27555
|
|
|
27556
|
+
const PreviewQuestions = props => {
|
|
27557
|
+
const prevProps = props.location.state;
|
|
27558
|
+
const data = prevProps.data;
|
|
27559
|
+
console.log("questions data", data);
|
|
27560
|
+
const [selectedOption, setSelectedOption] = React.useState("");
|
|
27561
|
+
const handleChange = event => {
|
|
27562
|
+
setSelectedOption("");
|
|
27563
|
+
};
|
|
27564
|
+
const displayAnswerField = (answerType, question, section) => {
|
|
27565
|
+
console.log("answer type", answerType, question);
|
|
27566
|
+
switch (answerType) {
|
|
27567
|
+
case "SHORT_ANSWER_TYPE":
|
|
27568
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
27569
|
+
name: question.uuid,
|
|
27570
|
+
disable: true,
|
|
27571
|
+
textInputStyle: {
|
|
27572
|
+
maxWidth: "none"
|
|
27573
|
+
},
|
|
27574
|
+
type: "text"
|
|
27575
|
+
}));
|
|
27576
|
+
case "LONG_ANSWER_TYPE":
|
|
27577
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextArea, {
|
|
27578
|
+
name: question.uuid,
|
|
27579
|
+
style: {
|
|
27580
|
+
maxWidth: "none"
|
|
27581
|
+
},
|
|
27582
|
+
disable: true,
|
|
27583
|
+
disabled: true
|
|
27584
|
+
}));
|
|
27585
|
+
case "DROP_DOWN_MENU_ANSWER_TYPE":
|
|
27586
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("select", {
|
|
27587
|
+
id: "dropdown",
|
|
27588
|
+
value: selectedOption,
|
|
27589
|
+
onChange: handleChange
|
|
27590
|
+
}, /*#__PURE__*/React__default.createElement("option", {
|
|
27591
|
+
value: ""
|
|
27592
|
+
}, "--Please choose an option--"), question.options.map((option, index) => /*#__PURE__*/React__default.createElement("option", {
|
|
27593
|
+
key: index,
|
|
27594
|
+
value: option === null || option === void 0 ? void 0 : option.optionText
|
|
27595
|
+
}, option === null || option === void 0 ? void 0 : option.optionText))));
|
|
27596
|
+
case "MULTIPLE_ANSWER_TYPE":
|
|
27597
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
27598
|
+
style: {
|
|
27599
|
+
display: "flex",
|
|
27600
|
+
flexDirection: "column"
|
|
27601
|
+
}
|
|
27602
|
+
}, question.options.map(option => /*#__PURE__*/React__default.createElement("h4", {
|
|
27603
|
+
key: option === null || option === void 0 ? void 0 : option.uuid,
|
|
27604
|
+
style: {
|
|
27605
|
+
display: "flex",
|
|
27606
|
+
alignItems: "center",
|
|
27607
|
+
marginBottom: "10px",
|
|
27608
|
+
fontSize: "18px"
|
|
27609
|
+
}
|
|
27610
|
+
}, /*#__PURE__*/React__default.createElement("input", {
|
|
27611
|
+
type: "radio",
|
|
27612
|
+
name: question.uuid,
|
|
27613
|
+
value: option === null || option === void 0 ? void 0 : option.optionText,
|
|
27614
|
+
disabled: true,
|
|
27615
|
+
required: true,
|
|
27616
|
+
style: {
|
|
27617
|
+
marginRight: "10px",
|
|
27618
|
+
width: "25px",
|
|
27619
|
+
height: "25px"
|
|
27620
|
+
}
|
|
27621
|
+
}), option === null || option === void 0 ? void 0 : option.optionText))));
|
|
27622
|
+
case "CHECKBOX_ANSWER_TYPE":
|
|
27623
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
27624
|
+
style: {
|
|
27625
|
+
display: "flex",
|
|
27626
|
+
flexDirection: "column"
|
|
27627
|
+
}
|
|
27628
|
+
}, question.options.map(option => /*#__PURE__*/React__default.createElement("h4", {
|
|
27629
|
+
key: option === null || option === void 0 ? void 0 : option.uuid,
|
|
27630
|
+
style: {
|
|
27631
|
+
display: "flex",
|
|
27632
|
+
alignItems: "center",
|
|
27633
|
+
marginBottom: "10px",
|
|
27634
|
+
fontSize: "18px"
|
|
27635
|
+
}
|
|
27636
|
+
}, /*#__PURE__*/React__default.createElement("input", {
|
|
27637
|
+
style: {
|
|
27638
|
+
width: "25px",
|
|
27639
|
+
height: "25px",
|
|
27640
|
+
marginRight: "10px"
|
|
27641
|
+
},
|
|
27642
|
+
type: "checkbox",
|
|
27643
|
+
value: option === null || option === void 0 ? void 0 : option.optionText,
|
|
27644
|
+
disabled: true
|
|
27645
|
+
}), option.optionText))));
|
|
27646
|
+
case "DATE_ANSWER_TYPE":
|
|
27647
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
27648
|
+
type: "date",
|
|
27649
|
+
textInputStyle: {
|
|
27650
|
+
maxWidth: "none"
|
|
27651
|
+
},
|
|
27652
|
+
disable: true
|
|
27653
|
+
}));
|
|
27654
|
+
case "TIME_ANSWER_TYPE":
|
|
27655
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
27656
|
+
type: "time",
|
|
27657
|
+
textInputStyle: {
|
|
27658
|
+
maxWidth: "none"
|
|
27659
|
+
},
|
|
27660
|
+
disable: true
|
|
27661
|
+
}));
|
|
27662
|
+
default:
|
|
27663
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
27664
|
+
name: question.uuid,
|
|
27665
|
+
disable: true,
|
|
27666
|
+
type: "text"
|
|
27667
|
+
});
|
|
27668
|
+
}
|
|
27669
|
+
};
|
|
27670
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
27671
|
+
className: "create-survey-page",
|
|
27672
|
+
style: {
|
|
27673
|
+
background: "white",
|
|
27674
|
+
display: "block",
|
|
27675
|
+
padding: "15px"
|
|
27676
|
+
}
|
|
27677
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
27678
|
+
className: "category-card"
|
|
27679
|
+
}, /*#__PURE__*/React__default.createElement("form", null, data.sections.length > 0 ? data.sections.map(section => /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h2", null, section.title), section.questions.map((question, index) => /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h3", null, question.questionStatement), /*#__PURE__*/React__default.createElement("div", {
|
|
27680
|
+
className: "surveyQuestion-wrapper"
|
|
27681
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
27682
|
+
style: {
|
|
27683
|
+
display: "inline"
|
|
27684
|
+
}
|
|
27685
|
+
}, index + 1, ". ", question.question.questionStatement, " ", (question === null || question === void 0 ? void 0 : question.required) && /*#__PURE__*/React__default.createElement("span", {
|
|
27686
|
+
style: {
|
|
27687
|
+
color: "red"
|
|
27688
|
+
}
|
|
27689
|
+
}, "*")), displayAnswerField(question.question.type, question.question), /*#__PURE__*/React__default.createElement("div", null)))))) : null)));
|
|
27690
|
+
};
|
|
27691
|
+
|
|
27542
27692
|
const SurveyDetailsForms = _ref => {
|
|
27543
27693
|
var _surveyFormState$erro, _surveyFormState$erro2, _surveyFormState$erro3, _surveyFormState$erro4, _surveyFormState$erro5, _surveyFormState$erro6, _surveyFormState$erro7;
|
|
27544
27694
|
let {
|
|
@@ -28704,6 +28854,9 @@ const Surveys = _ref => {
|
|
|
28704
28854
|
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
28705
28855
|
path: `${path}/inbox/results/:id`,
|
|
28706
28856
|
component: props => /*#__PURE__*/React__default.createElement(SurveyResults, props)
|
|
28857
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
|
|
28858
|
+
path: `${path}/previewQuestions`,
|
|
28859
|
+
component: props => /*#__PURE__*/React__default.createElement(PreviewQuestions, props)
|
|
28707
28860
|
}));
|
|
28708
28861
|
};
|
|
28709
28862
|
|
|
@@ -28963,24 +29116,25 @@ const ShowSurvey = _ref => {
|
|
|
28963
29116
|
const initialState = {
|
|
28964
29117
|
surveyDetails: [{
|
|
28965
29118
|
id: 1,
|
|
28966
|
-
ulb:
|
|
28967
|
-
tenantIds:
|
|
28968
|
-
name:
|
|
28969
|
-
description:
|
|
28970
|
-
fromDate:
|
|
28971
|
-
fromTime:
|
|
28972
|
-
toDate:
|
|
28973
|
-
toTime:
|
|
29119
|
+
ulb: "",
|
|
29120
|
+
tenantIds: "",
|
|
29121
|
+
name: "",
|
|
29122
|
+
description: "",
|
|
29123
|
+
fromDate: "",
|
|
29124
|
+
fromTime: "",
|
|
29125
|
+
toDate: "",
|
|
29126
|
+
toTime: ""
|
|
28974
29127
|
}],
|
|
28975
29128
|
categories: [{
|
|
28976
29129
|
id: 1,
|
|
28977
|
-
title:
|
|
29130
|
+
title: "",
|
|
28978
29131
|
weightage: 100,
|
|
28979
|
-
selectCategory:
|
|
28980
|
-
questionStatement:
|
|
29132
|
+
selectCategory: "",
|
|
29133
|
+
questionStatement: "",
|
|
28981
29134
|
questions: [],
|
|
28982
29135
|
selectedQuestions: []
|
|
28983
29136
|
}],
|
|
29137
|
+
autoCalculateCategoriesWeight: true,
|
|
28984
29138
|
goPrev: false,
|
|
28985
29139
|
goNext: false,
|
|
28986
29140
|
stepData: {},
|
|
@@ -29003,12 +29157,17 @@ const surveyFormReducer = function (state, action) {
|
|
|
29003
29157
|
...state,
|
|
29004
29158
|
goNext: true
|
|
29005
29159
|
};
|
|
29160
|
+
case AUTO_CALCULATE_CATEGORY:
|
|
29161
|
+
return {
|
|
29162
|
+
...state,
|
|
29163
|
+
autoCalculateCategoriesWeight: action.categoryWeight
|
|
29164
|
+
};
|
|
29006
29165
|
case ADD_CATEGORY:
|
|
29007
29166
|
const newCategories = [...state.categories, {
|
|
29008
29167
|
id: action.id,
|
|
29009
|
-
title:
|
|
29010
|
-
weightage:
|
|
29011
|
-
selectCategory:
|
|
29168
|
+
title: "",
|
|
29169
|
+
weightage: "",
|
|
29170
|
+
selectCategory: "",
|
|
29012
29171
|
questions: [],
|
|
29013
29172
|
selectedQuestions: []
|
|
29014
29173
|
}];
|
|
@@ -30390,7 +30549,8 @@ const FormComposer = props => {
|
|
|
30390
30549
|
errors,
|
|
30391
30550
|
setError,
|
|
30392
30551
|
clearErrors,
|
|
30393
|
-
unregister
|
|
30552
|
+
unregister,
|
|
30553
|
+
setApi
|
|
30394
30554
|
} = reactHookForm.useForm({
|
|
30395
30555
|
defaultValues: props.defaultValues
|
|
30396
30556
|
});
|
|
@@ -30492,7 +30652,8 @@ const FormComposer = props => {
|
|
|
30492
30652
|
setError: setError,
|
|
30493
30653
|
clearErrors: clearErrors,
|
|
30494
30654
|
formState: formState,
|
|
30495
|
-
onBlur: props.onBlur
|
|
30655
|
+
onBlur: props.onBlur,
|
|
30656
|
+
setApi: setApi
|
|
30496
30657
|
}),
|
|
30497
30658
|
name: config.key,
|
|
30498
30659
|
control: control
|
|
@@ -30675,7 +30836,7 @@ const FormComposer = props => {
|
|
|
30675
30836
|
props.onBackClick && props.onBackClick(formData);
|
|
30676
30837
|
};
|
|
30677
30838
|
const styles = {
|
|
30678
|
-
boxShadow:
|
|
30839
|
+
boxShadow: "none",
|
|
30679
30840
|
padding: "20px 48px 48px"
|
|
30680
30841
|
};
|
|
30681
30842
|
return /*#__PURE__*/React__default.createElement("form", {
|
|
@@ -31250,6 +31411,7 @@ const CategoryCard = _ref => {
|
|
|
31250
31411
|
name: "weightage",
|
|
31251
31412
|
value: category.weightage,
|
|
31252
31413
|
onChange: handleFieldChange,
|
|
31414
|
+
onWheel: e => e.target.blur(),
|
|
31253
31415
|
readOnly: checked,
|
|
31254
31416
|
placeholder: "Section Weightage",
|
|
31255
31417
|
required: true
|
|
@@ -31405,8 +31567,9 @@ const SurveyCreationPage = _ref => {
|
|
|
31405
31567
|
hideQuestionLabel
|
|
31406
31568
|
} = _ref;
|
|
31407
31569
|
const categories = reactRedux.useSelector(state => state.engagement.surveyForm.categories);
|
|
31570
|
+
const categoryWeight = reactRedux.useSelector(state => state.engagement.surveyForm.autoCalculateCategoriesWeight);
|
|
31408
31571
|
const dispatch = reactRedux.useDispatch();
|
|
31409
|
-
const [checked, setChecked] = React.useState(
|
|
31572
|
+
const [checked, setChecked] = React.useState(categoryWeight);
|
|
31410
31573
|
console.log("categories", categories);
|
|
31411
31574
|
const [index, setIndex] = React.useState(2);
|
|
31412
31575
|
const handleDeleteCategory = categoryId => {
|
|
@@ -31415,7 +31578,7 @@ const SurveyCreationPage = _ref => {
|
|
|
31415
31578
|
alert("Atleast one category must be there");
|
|
31416
31579
|
return;
|
|
31417
31580
|
}
|
|
31418
|
-
if (
|
|
31581
|
+
if (categoryWeight) {
|
|
31419
31582
|
dispatch(deleteCategory(categoryId));
|
|
31420
31583
|
dispatch(recalculateWeightage());
|
|
31421
31584
|
} else {
|
|
@@ -31425,14 +31588,14 @@ const SurveyCreationPage = _ref => {
|
|
|
31425
31588
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
31426
31589
|
className: "create-survey-page",
|
|
31427
31590
|
style: {
|
|
31428
|
-
background:
|
|
31429
|
-
display:
|
|
31430
|
-
padding:
|
|
31591
|
+
background: "white",
|
|
31592
|
+
display: "block",
|
|
31593
|
+
padding: "15px"
|
|
31431
31594
|
}
|
|
31432
31595
|
}, categories.map(category => /*#__PURE__*/React__default.createElement(CategoryCard, {
|
|
31433
31596
|
key: category.id,
|
|
31434
31597
|
category: category,
|
|
31435
|
-
checked:
|
|
31598
|
+
checked: categoryWeight,
|
|
31436
31599
|
readOnly: readOnly,
|
|
31437
31600
|
onDelete: handleDeleteCategory,
|
|
31438
31601
|
hideQuestionLabel: hideQuestionLabel
|
|
@@ -31444,11 +31607,11 @@ const SurveyCreationPage = _ref => {
|
|
|
31444
31607
|
backgroundColor: "#007bff",
|
|
31445
31608
|
color: "white",
|
|
31446
31609
|
cursor: "pointer",
|
|
31447
|
-
marginBottom:
|
|
31610
|
+
marginBottom: "10px"
|
|
31448
31611
|
},
|
|
31449
31612
|
onClick: () => {
|
|
31450
|
-
console.log("checked",
|
|
31451
|
-
if (
|
|
31613
|
+
console.log("checked", categoryWeight);
|
|
31614
|
+
if (categoryWeight === true) {
|
|
31452
31615
|
dispatch(addCategory(index));
|
|
31453
31616
|
dispatch(recalculateWeightage());
|
|
31454
31617
|
setIndex(index + 1);
|
|
@@ -31459,7 +31622,7 @@ const SurveyCreationPage = _ref => {
|
|
|
31459
31622
|
}
|
|
31460
31623
|
}, "Add Section"), /*#__PURE__*/React__default.createElement("div", {
|
|
31461
31624
|
style: {
|
|
31462
|
-
marginTop:
|
|
31625
|
+
marginTop: "20px"
|
|
31463
31626
|
}
|
|
31464
31627
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
31465
31628
|
style: {
|
|
@@ -31468,14 +31631,15 @@ const SurveyCreationPage = _ref => {
|
|
|
31468
31631
|
}
|
|
31469
31632
|
}, /*#__PURE__*/React__default.createElement("input", {
|
|
31470
31633
|
style: {
|
|
31471
|
-
height:
|
|
31472
|
-
width:
|
|
31634
|
+
height: "20px",
|
|
31635
|
+
width: "20px"
|
|
31473
31636
|
},
|
|
31474
31637
|
type: "checkbox",
|
|
31475
|
-
checked:
|
|
31476
|
-
|
|
31638
|
+
checked: categoryWeight,
|
|
31639
|
+
disabled: readOnly,
|
|
31477
31640
|
onChange: e => {
|
|
31478
31641
|
console.log("e checked", e.target.checked);
|
|
31642
|
+
dispatch(autoCalculateCategoriesWeight(e.target.checked));
|
|
31479
31643
|
setChecked(e.target.checked);
|
|
31480
31644
|
if (e.target.checked === true) {
|
|
31481
31645
|
dispatch(recalculateWeightage());
|