@mseva/digit-ui-module-engagement 1.1.19 → 1.1.20

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.
@@ -20414,7 +20414,7 @@ const FillQuestions = props => {
20414
20414
  var _prevProps$userInfo, _prevProps$userInfo2, _prevProps$userInfo3;
20415
20415
  setLoading(true);
20416
20416
  const data = {
20417
- userName: prevProps === null || prevProps === void 0 ? void 0 : (_prevProps$userInfo = prevProps.userInfo) === null || _prevProps$userInfo === void 0 ? void 0 : _prevProps$userInfo.mobileNumber,
20417
+ uuid: [prevProps === null || prevProps === void 0 ? void 0 : (_prevProps$userInfo = prevProps.userInfo) === null || _prevProps$userInfo === void 0 ? void 0 : _prevProps$userInfo.uuid],
20418
20418
  tenantId: prevProps === null || prevProps === void 0 ? void 0 : (_prevProps$userInfo2 = prevProps.userInfo) === null || _prevProps$userInfo2 === void 0 ? void 0 : _prevProps$userInfo2.tenantId
20419
20419
  };
20420
20420
  const filters = {
@@ -20503,7 +20503,7 @@ const FillQuestions = props => {
20503
20503
  return () => clearInterval(interval);
20504
20504
  }, [formData]);
20505
20505
  const handleAutoSave = async () => {
20506
- var _prevProps$citizenDat2, _prevProps$citizenDat3, _prevProps$citizenDat4;
20506
+ var _prevProps$citizenDat2, _prevProps$citizenDat3, _prevProps$citizenDat4, _prevProps$citizenDat5, _prevProps$citizenDat6;
20507
20507
  setLoading(true);
20508
20508
  let answerArr = [];
20509
20509
  for (const sectionId in formData) {
@@ -20533,8 +20533,8 @@ const FillQuestions = props => {
20533
20533
  },
20534
20534
  SurveyResponse: {
20535
20535
  surveyUuid: data.uuid,
20536
- tenantId: city,
20537
20536
  locality: locality,
20537
+ tenantId: city === null ? window.location.href.includes("/employee") ? prevProps === null || prevProps === void 0 ? void 0 : (_prevProps$citizenDat5 = prevProps.citizenData) === null || _prevProps$citizenDat5 === void 0 ? void 0 : (_prevProps$citizenDat6 = _prevProps$citizenDat5.city) === null || _prevProps$citizenDat6 === void 0 ? void 0 : _prevProps$citizenDat6.code : localStorage.getItem("CITIZEN.CITY") : city,
20538
20538
  status: "Draft",
20539
20539
  coordinates: `${geoLocation.latitude},${geoLocation.longitude}`,
20540
20540
  answers: answerArr
@@ -20609,19 +20609,19 @@ const FillQuestions = props => {
20609
20609
  return Object.keys(newErrors).length === 0;
20610
20610
  };
20611
20611
  const handleSubmitSurvey = () => {
20612
- var _prevProps$citizenDat5, _prevProps$citizenDat6, _prevProps$citizenDat7;
20612
+ var _prevProps$citizenDat9, _prevProps$citizenDat0, _prevProps$citizenDat1, _prevProps$citizenDat10, _prevProps$citizenDat11;
20613
20613
  setLoading(true);
20614
20614
  let answerArr = [];
20615
20615
  for (const sectionId in formData) {
20616
20616
  for (const questionId in formData[sectionId]) {
20617
- var _formData$sectionId$q2;
20617
+ var _formData$sectionId$q2, _prevProps$citizenDat7, _prevProps$citizenDat8;
20618
20618
  answerArr.push({
20619
20619
  uuid: formData[sectionId][questionId].answerUuid,
20620
20620
  surveyUuid: data.uuid,
20621
20621
  questionUuid: questionId,
20622
20622
  sectionUuid: sectionId,
20623
20623
  comments: ((_formData$sectionId$q2 = formData[sectionId][questionId]) === null || _formData$sectionId$q2 === void 0 ? void 0 : _formData$sectionId$q2.comments) || "",
20624
- tenantId: localStorage.getItem("CITIZEN.CITY"),
20624
+ tenantId: window.location.href.includes("/employee") ? prevProps === null || prevProps === void 0 ? void 0 : (_prevProps$citizenDat7 = prevProps.citizenData) === null || _prevProps$citizenDat7 === void 0 ? void 0 : (_prevProps$citizenDat8 = _prevProps$citizenDat7.city) === null || _prevProps$citizenDat8 === void 0 ? void 0 : _prevProps$citizenDat8.code : localStorage.getItem("CITIZEN.CITY"),
20625
20625
  answerDetails: [{
20626
20626
  answerType: formData[sectionId][questionId].answerType,
20627
20627
  answerContent: formData[sectionId][questionId].answerType === "CHECKBOX_ANSWER_TYPE" ? formData[sectionId][questionId].answer.join(",") : formData[sectionId][questionId].answer,
@@ -20634,13 +20634,13 @@ const FillQuestions = props => {
20634
20634
  User: {
20635
20635
  type: prevProps.userInfo.type,
20636
20636
  uuid: prevProps.userInfo.uuid,
20637
- gender: (prevProps === null || prevProps === void 0 ? void 0 : prevProps.userType).toUpperCase() === "EMPLOYEE" ? prevProps === null || prevProps === void 0 ? void 0 : (_prevProps$citizenDat5 = prevProps.citizenData) === null || _prevProps$citizenDat5 === void 0 ? void 0 : _prevProps$citizenDat5.gender : prevProps.userInfo.gender,
20638
- emailId: (prevProps === null || prevProps === void 0 ? void 0 : prevProps.userType).toUpperCase() === "EMPLOYEE" ? prevProps === null || prevProps === void 0 ? void 0 : (_prevProps$citizenDat6 = prevProps.citizenData) === null || _prevProps$citizenDat6 === void 0 ? void 0 : _prevProps$citizenDat6.email : prevProps.userInfo.emailId,
20639
- dob: (prevProps === null || prevProps === void 0 ? void 0 : prevProps.userType).toUpperCase() === "EMPLOYEE" ? prevProps === null || prevProps === void 0 ? void 0 : (_prevProps$citizenDat7 = prevProps.citizenData) === null || _prevProps$citizenDat7 === void 0 ? void 0 : _prevProps$citizenDat7.dob : prevProps.userInfo.dob
20637
+ gender: (prevProps === null || prevProps === void 0 ? void 0 : prevProps.userType).toUpperCase() === "EMPLOYEE" ? prevProps === null || prevProps === void 0 ? void 0 : (_prevProps$citizenDat9 = prevProps.citizenData) === null || _prevProps$citizenDat9 === void 0 ? void 0 : _prevProps$citizenDat9.gender : prevProps.userInfo.gender,
20638
+ emailId: (prevProps === null || prevProps === void 0 ? void 0 : prevProps.userType).toUpperCase() === "EMPLOYEE" ? prevProps === null || prevProps === void 0 ? void 0 : (_prevProps$citizenDat0 = prevProps.citizenData) === null || _prevProps$citizenDat0 === void 0 ? void 0 : _prevProps$citizenDat0.email : prevProps.userInfo.emailId,
20639
+ dob: (prevProps === null || prevProps === void 0 ? void 0 : prevProps.userType).toUpperCase() === "EMPLOYEE" ? prevProps === null || prevProps === void 0 ? void 0 : (_prevProps$citizenDat1 = prevProps.citizenData) === null || _prevProps$citizenDat1 === void 0 ? void 0 : _prevProps$citizenDat1.dob : prevProps.userInfo.dob
20640
20640
  },
20641
20641
  SurveyResponse: {
20642
20642
  surveyUuid: data.uuid,
20643
- tenantId: city,
20643
+ tenantId: city === null ? window.location.href.includes("/employee") ? prevProps === null || prevProps === void 0 ? void 0 : (_prevProps$citizenDat10 = prevProps.citizenData) === null || _prevProps$citizenDat10 === void 0 ? void 0 : (_prevProps$citizenDat11 = _prevProps$citizenDat10.city) === null || _prevProps$citizenDat11 === void 0 ? void 0 : _prevProps$citizenDat11.code : localStorage.getItem("CITIZEN.CITY") : city,
20644
20644
  status: "Submit",
20645
20645
  locality: locality,
20646
20646
  coordinates: `${geoLocation.latitude},${geoLocation.longitude}`,
@@ -22866,6 +22866,7 @@ const useInboxTableConfig = ({
22866
22866
  const {
22867
22867
  t
22868
22868
  } = useTranslation();
22869
+ const userInfo = Digit.UserService.getUser();
22869
22870
  const handleUpdateSurveyConfirm = row => {
22870
22871
  var _row$original, _row$original2, _row$original3;
22871
22872
  console.log("Current row: ", row);
@@ -22958,7 +22959,8 @@ const useInboxTableConfig = ({
22958
22959
  Cell: ({
22959
22960
  row
22960
22961
  }) => {
22961
- return /*#__PURE__*/React.createElement("div", {
22962
+ var _row$original12, _userInfo$info;
22963
+ return (row === null || row === void 0 ? void 0 : (_row$original12 = row.original) === null || _row$original12 === void 0 ? void 0 : _row$original12.tenantId) === (userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$info = userInfo.info) === null || _userInfo$info === void 0 ? void 0 : _userInfo$info.tenantId) ? /*#__PURE__*/React.createElement("div", {
22962
22964
  className: "tooltip"
22963
22965
  }, /*#__PURE__*/React.createElement("div", {
22964
22966
  style: {
@@ -22982,7 +22984,11 @@ const useInboxTableConfig = ({
22982
22984
  marginLeft: "50%",
22983
22985
  fontSize: "medium"
22984
22986
  }
22985
- }, t("Click here to update the survey status"))));
22987
+ }, t("Click here to update the survey status")))) : /*#__PURE__*/React.createElement("div", {
22988
+ style: {
22989
+ color: 'red'
22990
+ }
22991
+ }, "No access");
22986
22992
  }
22987
22993
  }];
22988
22994
  });
@@ -23368,7 +23374,7 @@ const Inbox$3 = ({
23368
23374
  onPageSizeChange,
23369
23375
  formState,
23370
23376
  totalCount: TotalCount,
23371
- table: Surveys,
23377
+ table: sortedSurveys,
23372
23378
  noResultsMessage: "CS_SURVEYS_NOT_FOUND",
23373
23379
  dispatch,
23374
23380
  inboxStyles: {
@@ -23381,7 +23387,7 @@ const Inbox$3 = ({
23381
23387
  });
23382
23388
  const propsForInboxMobileCards = useInboxMobileCardsData({
23383
23389
  parentRoute,
23384
- table: Surveys,
23390
+ table: sortedSurveys,
23385
23391
  setShowToast
23386
23392
  });
23387
23393
  const onNoToToast = () => {
@@ -23896,7 +23902,7 @@ const useCategoryInboxTableConfig = ({
23896
23902
  };
23897
23903
  },
23898
23904
  disableSort: false,
23899
- autoSort: true,
23905
+ autoSort: false,
23900
23906
  manualPagination: true,
23901
23907
  initSortI: "endDate",
23902
23908
  onPageSizeChange: onPageSizeChange,
@@ -24145,7 +24151,7 @@ const SearchCategories = ({
24145
24151
  onPageSizeChange,
24146
24152
  formState,
24147
24153
  totalCount: totalCount,
24148
- table: Categories,
24154
+ table: sortedCategories,
24149
24155
  noResultsMessage: "No Categories found",
24150
24156
  dispatch,
24151
24157
  inboxStyles: {
@@ -24157,7 +24163,7 @@ const SearchCategories = ({
24157
24163
  });
24158
24164
  const propsForInboxMobileCards = useCategoryInboxMobileCardsData({
24159
24165
  parentRoute,
24160
- table: Categories,
24166
+ table: sortedCategories,
24161
24167
  setShowToast
24162
24168
  });
24163
24169
  const onNoToToast = () => {
@@ -25639,7 +25645,7 @@ const useQuestionsInboxTableConfig = ({
25639
25645
  };
25640
25646
  },
25641
25647
  disableSort: false,
25642
- autoSort: true,
25648
+ autoSort: false,
25643
25649
  manualPagination: true,
25644
25650
  initSortI: "endDate",
25645
25651
  onPageSizeChange: onPageSizeChange,
@@ -25893,7 +25899,7 @@ const SearchQuestions = ({
25893
25899
  onPageSizeChange,
25894
25900
  formState,
25895
25901
  totalCount: totalCount,
25896
- table: Questions,
25902
+ table: sortedQuestions,
25897
25903
  noResultsMessage: "No Questions found",
25898
25904
  dispatch,
25899
25905
  inboxStyles: {
@@ -25909,7 +25915,7 @@ const SearchQuestions = ({
25909
25915
  });
25910
25916
  const propsForInboxMobileCards = useQuestionsInboxMobileCardsData({
25911
25917
  parentRoute,
25912
- table: Questions,
25918
+ table: sortedQuestions,
25913
25919
  setShowToast
25914
25920
  });
25915
25921
  const onNoToToast = () => {