@mseva/digit-ui-module-engagement 1.1.24 → 1.1.26
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 +1 -32928
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +307 -437
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -880,9 +880,6 @@ function compareAsc(dirtyDateLeft, dirtyDateRight) {
|
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
882
|
|
|
883
|
-
var millisecondsInMinute = 60000;
|
|
884
|
-
var millisecondsInHour = 3600000;
|
|
885
|
-
|
|
886
883
|
function isDate(value) {
|
|
887
884
|
requiredArgs(1, arguments);
|
|
888
885
|
return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';
|
|
@@ -2504,182 +2501,6 @@ function formatDistanceToNow(dirtyDate, dirtyOptions) {
|
|
|
2504
2501
|
return formatDistance$1(dirtyDate, Date.now(), dirtyOptions);
|
|
2505
2502
|
}
|
|
2506
2503
|
|
|
2507
|
-
function parseISO(argument, dirtyOptions) {
|
|
2508
|
-
requiredArgs(1, arguments);
|
|
2509
|
-
var options = dirtyOptions || {};
|
|
2510
|
-
var additionalDigits = options.additionalDigits == null ? 2 : toInteger(options.additionalDigits);
|
|
2511
|
-
if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
|
|
2512
|
-
throw new RangeError('additionalDigits must be 0, 1 or 2');
|
|
2513
|
-
}
|
|
2514
|
-
if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {
|
|
2515
|
-
return new Date(NaN);
|
|
2516
|
-
}
|
|
2517
|
-
var dateStrings = splitDateString(argument);
|
|
2518
|
-
var date;
|
|
2519
|
-
if (dateStrings.date) {
|
|
2520
|
-
var parseYearResult = parseYear(dateStrings.date, additionalDigits);
|
|
2521
|
-
date = parseDate(parseYearResult.restDateString, parseYearResult.year);
|
|
2522
|
-
}
|
|
2523
|
-
if (!date || isNaN(date.getTime())) {
|
|
2524
|
-
return new Date(NaN);
|
|
2525
|
-
}
|
|
2526
|
-
var timestamp = date.getTime();
|
|
2527
|
-
var time = 0;
|
|
2528
|
-
var offset;
|
|
2529
|
-
if (dateStrings.time) {
|
|
2530
|
-
time = parseTime(dateStrings.time);
|
|
2531
|
-
if (isNaN(time)) {
|
|
2532
|
-
return new Date(NaN);
|
|
2533
|
-
}
|
|
2534
|
-
}
|
|
2535
|
-
if (dateStrings.timezone) {
|
|
2536
|
-
offset = parseTimezone(dateStrings.timezone);
|
|
2537
|
-
if (isNaN(offset)) {
|
|
2538
|
-
return new Date(NaN);
|
|
2539
|
-
}
|
|
2540
|
-
} else {
|
|
2541
|
-
var dirtyDate = new Date(timestamp + time);
|
|
2542
|
-
var result = new Date(0);
|
|
2543
|
-
result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
|
|
2544
|
-
result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
|
|
2545
|
-
return result;
|
|
2546
|
-
}
|
|
2547
|
-
return new Date(timestamp + time + offset);
|
|
2548
|
-
}
|
|
2549
|
-
var patterns = {
|
|
2550
|
-
dateTimeDelimiter: /[T ]/,
|
|
2551
|
-
timeZoneDelimiter: /[Z ]/i,
|
|
2552
|
-
timezone: /([Z+-].*)$/
|
|
2553
|
-
};
|
|
2554
|
-
var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
|
|
2555
|
-
var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
|
|
2556
|
-
var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
2557
|
-
function splitDateString(dateString) {
|
|
2558
|
-
var dateStrings = {};
|
|
2559
|
-
var array = dateString.split(patterns.dateTimeDelimiter);
|
|
2560
|
-
var timeString;
|
|
2561
|
-
if (array.length > 2) {
|
|
2562
|
-
return dateStrings;
|
|
2563
|
-
}
|
|
2564
|
-
if (/:/.test(array[0])) {
|
|
2565
|
-
timeString = array[0];
|
|
2566
|
-
} else {
|
|
2567
|
-
dateStrings.date = array[0];
|
|
2568
|
-
timeString = array[1];
|
|
2569
|
-
if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
|
|
2570
|
-
dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
|
|
2571
|
-
timeString = dateString.substr(dateStrings.date.length, dateString.length);
|
|
2572
|
-
}
|
|
2573
|
-
}
|
|
2574
|
-
if (timeString) {
|
|
2575
|
-
var token = patterns.timezone.exec(timeString);
|
|
2576
|
-
if (token) {
|
|
2577
|
-
dateStrings.time = timeString.replace(token[1], '');
|
|
2578
|
-
dateStrings.timezone = token[1];
|
|
2579
|
-
} else {
|
|
2580
|
-
dateStrings.time = timeString;
|
|
2581
|
-
}
|
|
2582
|
-
}
|
|
2583
|
-
return dateStrings;
|
|
2584
|
-
}
|
|
2585
|
-
function parseYear(dateString, additionalDigits) {
|
|
2586
|
-
var regex = new RegExp('^(?:(\\d{4}|[+-]\\d{' + (4 + additionalDigits) + '})|(\\d{2}|[+-]\\d{' + (2 + additionalDigits) + '})$)');
|
|
2587
|
-
var captures = dateString.match(regex);
|
|
2588
|
-
if (!captures) return {
|
|
2589
|
-
year: NaN,
|
|
2590
|
-
restDateString: ''
|
|
2591
|
-
};
|
|
2592
|
-
var year = captures[1] ? parseInt(captures[1]) : null;
|
|
2593
|
-
var century = captures[2] ? parseInt(captures[2]) : null;
|
|
2594
|
-
return {
|
|
2595
|
-
year: century === null ? year : century * 100,
|
|
2596
|
-
restDateString: dateString.slice((captures[1] || captures[2]).length)
|
|
2597
|
-
};
|
|
2598
|
-
}
|
|
2599
|
-
function parseDate(dateString, year) {
|
|
2600
|
-
if (year === null) return new Date(NaN);
|
|
2601
|
-
var captures = dateString.match(dateRegex);
|
|
2602
|
-
if (!captures) return new Date(NaN);
|
|
2603
|
-
var isWeekDate = !!captures[4];
|
|
2604
|
-
var dayOfYear = parseDateUnit(captures[1]);
|
|
2605
|
-
var month = parseDateUnit(captures[2]) - 1;
|
|
2606
|
-
var day = parseDateUnit(captures[3]);
|
|
2607
|
-
var week = parseDateUnit(captures[4]);
|
|
2608
|
-
var dayOfWeek = parseDateUnit(captures[5]) - 1;
|
|
2609
|
-
if (isWeekDate) {
|
|
2610
|
-
if (!validateWeekDate(year, week, dayOfWeek)) {
|
|
2611
|
-
return new Date(NaN);
|
|
2612
|
-
}
|
|
2613
|
-
return dayOfISOWeekYear(year, week, dayOfWeek);
|
|
2614
|
-
} else {
|
|
2615
|
-
var date = new Date(0);
|
|
2616
|
-
if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
|
|
2617
|
-
return new Date(NaN);
|
|
2618
|
-
}
|
|
2619
|
-
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
|
|
2620
|
-
return date;
|
|
2621
|
-
}
|
|
2622
|
-
}
|
|
2623
|
-
function parseDateUnit(value) {
|
|
2624
|
-
return value ? parseInt(value) : 1;
|
|
2625
|
-
}
|
|
2626
|
-
function parseTime(timeString) {
|
|
2627
|
-
var captures = timeString.match(timeRegex);
|
|
2628
|
-
if (!captures) return NaN;
|
|
2629
|
-
var hours = parseTimeUnit(captures[1]);
|
|
2630
|
-
var minutes = parseTimeUnit(captures[2]);
|
|
2631
|
-
var seconds = parseTimeUnit(captures[3]);
|
|
2632
|
-
if (!validateTime(hours, minutes, seconds)) {
|
|
2633
|
-
return NaN;
|
|
2634
|
-
}
|
|
2635
|
-
return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000;
|
|
2636
|
-
}
|
|
2637
|
-
function parseTimeUnit(value) {
|
|
2638
|
-
return value && parseFloat(value.replace(',', '.')) || 0;
|
|
2639
|
-
}
|
|
2640
|
-
function parseTimezone(timezoneString) {
|
|
2641
|
-
if (timezoneString === 'Z') return 0;
|
|
2642
|
-
var captures = timezoneString.match(timezoneRegex);
|
|
2643
|
-
if (!captures) return 0;
|
|
2644
|
-
var sign = captures[1] === '+' ? -1 : 1;
|
|
2645
|
-
var hours = parseInt(captures[2]);
|
|
2646
|
-
var minutes = captures[3] && parseInt(captures[3]) || 0;
|
|
2647
|
-
if (!validateTimezone(hours, minutes)) {
|
|
2648
|
-
return NaN;
|
|
2649
|
-
}
|
|
2650
|
-
return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
|
|
2651
|
-
}
|
|
2652
|
-
function dayOfISOWeekYear(isoWeekYear, week, day) {
|
|
2653
|
-
var date = new Date(0);
|
|
2654
|
-
date.setUTCFullYear(isoWeekYear, 0, 4);
|
|
2655
|
-
var fourthOfJanuaryDay = date.getUTCDay() || 7;
|
|
2656
|
-
var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
|
|
2657
|
-
date.setUTCDate(date.getUTCDate() + diff);
|
|
2658
|
-
return date;
|
|
2659
|
-
}
|
|
2660
|
-
var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2661
|
-
function isLeapYearIndex(year) {
|
|
2662
|
-
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
2663
|
-
}
|
|
2664
|
-
function validateDate(year, month, date) {
|
|
2665
|
-
return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));
|
|
2666
|
-
}
|
|
2667
|
-
function validateDayOfYearDate(year, dayOfYear) {
|
|
2668
|
-
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
|
|
2669
|
-
}
|
|
2670
|
-
function validateWeekDate(_year, week, day) {
|
|
2671
|
-
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
|
|
2672
|
-
}
|
|
2673
|
-
function validateTime(hours, minutes, seconds) {
|
|
2674
|
-
if (hours === 24) {
|
|
2675
|
-
return minutes === 0 && seconds === 0;
|
|
2676
|
-
}
|
|
2677
|
-
return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
|
|
2678
|
-
}
|
|
2679
|
-
function validateTimezone(_hours, minutes) {
|
|
2680
|
-
return minutes >= 0 && minutes <= 59;
|
|
2681
|
-
}
|
|
2682
|
-
|
|
2683
2504
|
const EditEvents = () => {
|
|
2684
2505
|
var _data$eventDetails, _data$eventDetails2, _data$eventDetails3, _data$eventDetails4, _data$eventDetails5, _data$eventDetails6, _data$eventDetails7, _data$eventDetails8, _data$eventDetails9;
|
|
2685
2506
|
const {
|
|
@@ -17366,6 +17187,166 @@ const ArrearSummary = ({
|
|
|
17366
17187
|
}, t("CS_HIDE_CARD"))));
|
|
17367
17188
|
};
|
|
17368
17189
|
|
|
17190
|
+
const DcbTable = ({
|
|
17191
|
+
demandData,
|
|
17192
|
+
totalDemandTax,
|
|
17193
|
+
totalDemandInterest,
|
|
17194
|
+
totalDemandPenality,
|
|
17195
|
+
totalCollectionTax,
|
|
17196
|
+
totalCollectionInterest,
|
|
17197
|
+
totalCollectionPenality,
|
|
17198
|
+
totalBalanceTax,
|
|
17199
|
+
totalBalancePenality,
|
|
17200
|
+
totalBalanceInterest
|
|
17201
|
+
}) => {
|
|
17202
|
+
const tableStyles = {
|
|
17203
|
+
table: {
|
|
17204
|
+
border: "2px solid black",
|
|
17205
|
+
width: "100%",
|
|
17206
|
+
fontFamily: "sans-serif"
|
|
17207
|
+
},
|
|
17208
|
+
td: {
|
|
17209
|
+
padding: "10px",
|
|
17210
|
+
border: "1px solid black",
|
|
17211
|
+
textAlign: "center"
|
|
17212
|
+
},
|
|
17213
|
+
th: {
|
|
17214
|
+
padding: "10px",
|
|
17215
|
+
border: "1px solid black",
|
|
17216
|
+
textAlign: "center"
|
|
17217
|
+
}
|
|
17218
|
+
};
|
|
17219
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardSectionHeader$1, {
|
|
17220
|
+
style: {
|
|
17221
|
+
marginBottom: "16px",
|
|
17222
|
+
marginTop: "16px",
|
|
17223
|
+
fontSize: "24px"
|
|
17224
|
+
}
|
|
17225
|
+
}, "DCB Details"), /*#__PURE__*/React.createElement("table", {
|
|
17226
|
+
border: "1px",
|
|
17227
|
+
style: tableStyles.table
|
|
17228
|
+
}, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
|
|
17229
|
+
style: tableStyles.th
|
|
17230
|
+
}, "Installments"), /*#__PURE__*/React.createElement("th", {
|
|
17231
|
+
colSpan: "3",
|
|
17232
|
+
style: tableStyles.th
|
|
17233
|
+
}, "Demand"), /*#__PURE__*/React.createElement("th", {
|
|
17234
|
+
colSpan: "3",
|
|
17235
|
+
style: tableStyles.th
|
|
17236
|
+
}, "Collection"), /*#__PURE__*/React.createElement("th", {
|
|
17237
|
+
colSpan: "3",
|
|
17238
|
+
style: tableStyles.th
|
|
17239
|
+
}, "Balance"), /*#__PURE__*/React.createElement("th", {
|
|
17240
|
+
style: tableStyles.th
|
|
17241
|
+
}, "Advance")), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
|
|
17242
|
+
style: tableStyles.th
|
|
17243
|
+
}), /*#__PURE__*/React.createElement("th", {
|
|
17244
|
+
style: tableStyles.th
|
|
17245
|
+
}, "Tax"), /*#__PURE__*/React.createElement("th", {
|
|
17246
|
+
style: tableStyles.th
|
|
17247
|
+
}, "Interest"), /*#__PURE__*/React.createElement("th", {
|
|
17248
|
+
style: tableStyles.th
|
|
17249
|
+
}, "Penalty"), /*#__PURE__*/React.createElement("th", {
|
|
17250
|
+
style: tableStyles.th
|
|
17251
|
+
}, "Tax"), /*#__PURE__*/React.createElement("th", {
|
|
17252
|
+
style: tableStyles.th
|
|
17253
|
+
}, "Interest"), /*#__PURE__*/React.createElement("th", {
|
|
17254
|
+
style: tableStyles.th
|
|
17255
|
+
}, "Penalty"), /*#__PURE__*/React.createElement("th", {
|
|
17256
|
+
style: tableStyles.th
|
|
17257
|
+
}, "Tax"), /*#__PURE__*/React.createElement("th", {
|
|
17258
|
+
style: tableStyles.th
|
|
17259
|
+
}, "Interest"), /*#__PURE__*/React.createElement("th", {
|
|
17260
|
+
style: tableStyles.th
|
|
17261
|
+
}, "Penalty"), /*#__PURE__*/React.createElement("th", {
|
|
17262
|
+
style: tableStyles.th
|
|
17263
|
+
}, "Advance"))), /*#__PURE__*/React.createElement("tbody", null, demandData === null || demandData === void 0 ? void 0 : demandData.map(item => {
|
|
17264
|
+
return /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
17265
|
+
style: tableStyles.td
|
|
17266
|
+
}, item.taxPeriodFrom, "-", item.taxPeriodTo), /*#__PURE__*/React.createElement("td", {
|
|
17267
|
+
style: tableStyles.td
|
|
17268
|
+
}, item.demandTax), /*#__PURE__*/React.createElement("td", {
|
|
17269
|
+
style: tableStyles.td
|
|
17270
|
+
}, item.demandInterest), /*#__PURE__*/React.createElement("td", {
|
|
17271
|
+
style: tableStyles.td
|
|
17272
|
+
}, item.demandPenality), /*#__PURE__*/React.createElement("td", {
|
|
17273
|
+
style: tableStyles.td
|
|
17274
|
+
}, item.collectionTax), /*#__PURE__*/React.createElement("td", {
|
|
17275
|
+
style: tableStyles.td
|
|
17276
|
+
}, item.collectionInterest), /*#__PURE__*/React.createElement("td", {
|
|
17277
|
+
style: tableStyles.td
|
|
17278
|
+
}, item.collectionPenality), /*#__PURE__*/React.createElement("td", {
|
|
17279
|
+
style: tableStyles.td
|
|
17280
|
+
}, item.balanceTax), /*#__PURE__*/React.createElement("td", {
|
|
17281
|
+
style: tableStyles.td
|
|
17282
|
+
}, item.balanceInterest), /*#__PURE__*/React.createElement("td", {
|
|
17283
|
+
style: tableStyles.td
|
|
17284
|
+
}, item.balancePenality), /*#__PURE__*/React.createElement("td", {
|
|
17285
|
+
style: tableStyles.td
|
|
17286
|
+
}, item.advance));
|
|
17287
|
+
}), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
|
|
17288
|
+
style: tableStyles.th
|
|
17289
|
+
}, "Total"), /*#__PURE__*/React.createElement("td", {
|
|
17290
|
+
style: tableStyles.td
|
|
17291
|
+
}, totalDemandTax), /*#__PURE__*/React.createElement("td", {
|
|
17292
|
+
style: tableStyles.td
|
|
17293
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17294
|
+
style: tableStyles.td
|
|
17295
|
+
}, totalDemandPenality), /*#__PURE__*/React.createElement("td", {
|
|
17296
|
+
style: tableStyles.td
|
|
17297
|
+
}, totalCollectionTax), /*#__PURE__*/React.createElement("td", {
|
|
17298
|
+
style: tableStyles.td
|
|
17299
|
+
}, totalCollectionInterest), /*#__PURE__*/React.createElement("td", {
|
|
17300
|
+
style: tableStyles.td
|
|
17301
|
+
}, totalCollectionPenality), /*#__PURE__*/React.createElement("td", {
|
|
17302
|
+
style: tableStyles.td
|
|
17303
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17304
|
+
style: tableStyles.td
|
|
17305
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17306
|
+
style: tableStyles.td
|
|
17307
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17308
|
+
style: tableStyles.td
|
|
17309
|
+
})), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
17310
|
+
style: tableStyles.td
|
|
17311
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17312
|
+
style: tableStyles.td
|
|
17313
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17314
|
+
style: tableStyles.td
|
|
17315
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17316
|
+
style: tableStyles.td
|
|
17317
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17318
|
+
style: tableStyles.td
|
|
17319
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17320
|
+
style: tableStyles.td
|
|
17321
|
+
}), /*#__PURE__*/React.createElement("th", {
|
|
17322
|
+
style: tableStyles.th
|
|
17323
|
+
}, "Total"), /*#__PURE__*/React.createElement("td", {
|
|
17324
|
+
style: tableStyles.td
|
|
17325
|
+
}, totalBalanceTax), /*#__PURE__*/React.createElement("td", {
|
|
17326
|
+
style: tableStyles.td
|
|
17327
|
+
}, "0"), /*#__PURE__*/React.createElement("td", {
|
|
17328
|
+
style: tableStyles.td
|
|
17329
|
+
}, "0"), /*#__PURE__*/React.createElement("td", {
|
|
17330
|
+
style: tableStyles.td
|
|
17331
|
+
}, "0")), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
17332
|
+
style: tableStyles.td
|
|
17333
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17334
|
+
style: tableStyles.td
|
|
17335
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17336
|
+
style: tableStyles.td
|
|
17337
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17338
|
+
style: tableStyles.td
|
|
17339
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17340
|
+
style: tableStyles.td
|
|
17341
|
+
}), /*#__PURE__*/React.createElement("td", {
|
|
17342
|
+
style: tableStyles.td
|
|
17343
|
+
}), /*#__PURE__*/React.createElement("th", {
|
|
17344
|
+
style: tableStyles.th
|
|
17345
|
+
}, "Total Balance"), /*#__PURE__*/React.createElement("td", {
|
|
17346
|
+
style: tableStyles.td
|
|
17347
|
+
})))));
|
|
17348
|
+
};
|
|
17349
|
+
|
|
17369
17350
|
function ApplicationDetailsContent({
|
|
17370
17351
|
applicationDetails,
|
|
17371
17352
|
demandData,
|
|
@@ -17553,23 +17534,6 @@ function ApplicationDetailsContent({
|
|
|
17553
17534
|
return {};
|
|
17554
17535
|
}
|
|
17555
17536
|
};
|
|
17556
|
-
const tableStyles = {
|
|
17557
|
-
table: {
|
|
17558
|
-
border: '2px solid black',
|
|
17559
|
-
width: '100%',
|
|
17560
|
-
fontFamily: 'sans-serif'
|
|
17561
|
-
},
|
|
17562
|
-
td: {
|
|
17563
|
-
padding: "10px",
|
|
17564
|
-
border: '1px solid black',
|
|
17565
|
-
textAlign: 'center'
|
|
17566
|
-
},
|
|
17567
|
-
th: {
|
|
17568
|
-
padding: "10px",
|
|
17569
|
-
border: '1px solid black',
|
|
17570
|
-
textAlign: 'center'
|
|
17571
|
-
}
|
|
17572
|
-
};
|
|
17573
17537
|
const getMainDivStyles = () => {
|
|
17574
17538
|
if (window.location.href.includes("employee/obps") || window.location.href.includes("employee/noc") || window.location.href.includes("employee/ws")) {
|
|
17575
17539
|
return {
|
|
@@ -17874,135 +17838,18 @@ function ApplicationDetailsContent({
|
|
|
17874
17838
|
}))), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data19 = workflowDetails.data) === null || _workflowDetails$data19 === void 0 ? void 0 : (_workflowDetails$data20 = _workflowDetails$data19.timeline) === null || _workflowDetails$data20 === void 0 ? void 0 : _workflowDetails$data20.length) > 2 && /*#__PURE__*/React.createElement(LinkButton$1, {
|
|
17875
17839
|
label: showAllTimeline ? t("COLLAPSE") : t("VIEW_TIMELINE"),
|
|
17876
17840
|
onClick: toggleTimeline
|
|
17877
|
-
})))), /*#__PURE__*/React.createElement(
|
|
17878
|
-
|
|
17879
|
-
|
|
17880
|
-
|
|
17881
|
-
|
|
17882
|
-
|
|
17883
|
-
|
|
17884
|
-
|
|
17885
|
-
|
|
17886
|
-
|
|
17887
|
-
|
|
17888
|
-
}
|
|
17889
|
-
colSpan: "3",
|
|
17890
|
-
style: tableStyles.th
|
|
17891
|
-
}, "Demand"), /*#__PURE__*/React.createElement("th", {
|
|
17892
|
-
colSpan: "3",
|
|
17893
|
-
style: tableStyles.th
|
|
17894
|
-
}, "Collection"), /*#__PURE__*/React.createElement("th", {
|
|
17895
|
-
colSpan: "3",
|
|
17896
|
-
style: tableStyles.th
|
|
17897
|
-
}, "Balance"), /*#__PURE__*/React.createElement("th", {
|
|
17898
|
-
style: tableStyles.th
|
|
17899
|
-
}, "Advance")), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
|
|
17900
|
-
style: tableStyles.th
|
|
17901
|
-
}), /*#__PURE__*/React.createElement("th", {
|
|
17902
|
-
style: tableStyles.th
|
|
17903
|
-
}, "Tax"), /*#__PURE__*/React.createElement("th", {
|
|
17904
|
-
style: tableStyles.th
|
|
17905
|
-
}, "Interest"), /*#__PURE__*/React.createElement("th", {
|
|
17906
|
-
style: tableStyles.th
|
|
17907
|
-
}, "Penalty"), /*#__PURE__*/React.createElement("th", {
|
|
17908
|
-
style: tableStyles.th
|
|
17909
|
-
}, "Tax"), /*#__PURE__*/React.createElement("th", {
|
|
17910
|
-
style: tableStyles.th
|
|
17911
|
-
}, "Interest"), /*#__PURE__*/React.createElement("th", {
|
|
17912
|
-
style: tableStyles.th
|
|
17913
|
-
}, "Penalty"), /*#__PURE__*/React.createElement("th", {
|
|
17914
|
-
style: tableStyles.th
|
|
17915
|
-
}, "Tax"), /*#__PURE__*/React.createElement("th", {
|
|
17916
|
-
style: tableStyles.th
|
|
17917
|
-
}, "Interest"), /*#__PURE__*/React.createElement("th", {
|
|
17918
|
-
style: tableStyles.th
|
|
17919
|
-
}, "Penalty"), /*#__PURE__*/React.createElement("th", {
|
|
17920
|
-
style: tableStyles.th
|
|
17921
|
-
}, "Advance"))), /*#__PURE__*/React.createElement("tbody", null, demandData === null || demandData === void 0 ? void 0 : demandData.map(item => {
|
|
17922
|
-
return /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
17923
|
-
style: tableStyles.td
|
|
17924
|
-
}, item.taxPeriodFrom, "-", item.taxPeriodTo), /*#__PURE__*/React.createElement("td", {
|
|
17925
|
-
style: tableStyles.td
|
|
17926
|
-
}, item.demandTax), /*#__PURE__*/React.createElement("td", {
|
|
17927
|
-
style: tableStyles.td
|
|
17928
|
-
}, item.demandInterest), /*#__PURE__*/React.createElement("td", {
|
|
17929
|
-
style: tableStyles.td
|
|
17930
|
-
}, item.demandPenality), /*#__PURE__*/React.createElement("td", {
|
|
17931
|
-
style: tableStyles.td
|
|
17932
|
-
}, item.collectionTax), /*#__PURE__*/React.createElement("td", {
|
|
17933
|
-
style: tableStyles.td
|
|
17934
|
-
}, item.collectionInterest), /*#__PURE__*/React.createElement("td", {
|
|
17935
|
-
style: tableStyles.td
|
|
17936
|
-
}, item.collectionPenality), /*#__PURE__*/React.createElement("td", {
|
|
17937
|
-
style: tableStyles.td
|
|
17938
|
-
}, item.balanceTax), /*#__PURE__*/React.createElement("td", {
|
|
17939
|
-
style: tableStyles.td
|
|
17940
|
-
}, item.balanceInterest), /*#__PURE__*/React.createElement("td", {
|
|
17941
|
-
style: tableStyles.td
|
|
17942
|
-
}, item.balancePenality), /*#__PURE__*/React.createElement("td", {
|
|
17943
|
-
style: tableStyles.td
|
|
17944
|
-
}, item.advance));
|
|
17945
|
-
}), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
|
|
17946
|
-
style: tableStyles.th
|
|
17947
|
-
}, "Total"), /*#__PURE__*/React.createElement("td", {
|
|
17948
|
-
style: tableStyles.td
|
|
17949
|
-
}, totalDemandTax), /*#__PURE__*/React.createElement("td", {
|
|
17950
|
-
style: tableStyles.td
|
|
17951
|
-
}, totalDemandInterest), /*#__PURE__*/React.createElement("td", {
|
|
17952
|
-
style: tableStyles.td
|
|
17953
|
-
}, totalDemandPenality), /*#__PURE__*/React.createElement("td", {
|
|
17954
|
-
style: tableStyles.td
|
|
17955
|
-
}, totalCollectionTax), /*#__PURE__*/React.createElement("td", {
|
|
17956
|
-
style: tableStyles.td
|
|
17957
|
-
}, totalCollectionInterest), /*#__PURE__*/React.createElement("td", {
|
|
17958
|
-
style: tableStyles.td
|
|
17959
|
-
}, totalCollectionPenality), /*#__PURE__*/React.createElement("td", {
|
|
17960
|
-
style: tableStyles.td
|
|
17961
|
-
}), /*#__PURE__*/React.createElement("td", {
|
|
17962
|
-
style: tableStyles.td
|
|
17963
|
-
}), /*#__PURE__*/React.createElement("td", {
|
|
17964
|
-
style: tableStyles.td
|
|
17965
|
-
}), /*#__PURE__*/React.createElement("td", {
|
|
17966
|
-
style: tableStyles.td
|
|
17967
|
-
})), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
17968
|
-
style: tableStyles.td
|
|
17969
|
-
}), /*#__PURE__*/React.createElement("td", {
|
|
17970
|
-
style: tableStyles.td
|
|
17971
|
-
}), /*#__PURE__*/React.createElement("td", {
|
|
17972
|
-
style: tableStyles.td
|
|
17973
|
-
}), /*#__PURE__*/React.createElement("td", {
|
|
17974
|
-
style: tableStyles.td
|
|
17975
|
-
}), /*#__PURE__*/React.createElement("td", {
|
|
17976
|
-
style: tableStyles.td
|
|
17977
|
-
}), /*#__PURE__*/React.createElement("td", {
|
|
17978
|
-
style: tableStyles.td
|
|
17979
|
-
}), /*#__PURE__*/React.createElement("th", {
|
|
17980
|
-
style: tableStyles.th
|
|
17981
|
-
}, "Total"), /*#__PURE__*/React.createElement("td", {
|
|
17982
|
-
style: tableStyles.td
|
|
17983
|
-
}, totalBalanceTax), /*#__PURE__*/React.createElement("td", {
|
|
17984
|
-
style: tableStyles.td
|
|
17985
|
-
}, "0"), /*#__PURE__*/React.createElement("td", {
|
|
17986
|
-
style: tableStyles.td
|
|
17987
|
-
}, "0"), /*#__PURE__*/React.createElement("td", {
|
|
17988
|
-
style: tableStyles.td
|
|
17989
|
-
}, "0")), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
17990
|
-
style: tableStyles.td
|
|
17991
|
-
}), /*#__PURE__*/React.createElement("td", {
|
|
17992
|
-
style: tableStyles.td
|
|
17993
|
-
}), /*#__PURE__*/React.createElement("td", {
|
|
17994
|
-
style: tableStyles.td
|
|
17995
|
-
}), /*#__PURE__*/React.createElement("td", {
|
|
17996
|
-
style: tableStyles.td
|
|
17997
|
-
}), /*#__PURE__*/React.createElement("td", {
|
|
17998
|
-
style: tableStyles.td
|
|
17999
|
-
}), /*#__PURE__*/React.createElement("td", {
|
|
18000
|
-
style: tableStyles.td
|
|
18001
|
-
}), /*#__PURE__*/React.createElement("th", {
|
|
18002
|
-
style: tableStyles.th
|
|
18003
|
-
}, "Total Balance"), /*#__PURE__*/React.createElement("td", {
|
|
18004
|
-
style: tableStyles.td
|
|
18005
|
-
}, totalBalanceTax)))));
|
|
17841
|
+
})))), businessService === "PT" && /*#__PURE__*/React.createElement(DcbTable, {
|
|
17842
|
+
demandData: demandData,
|
|
17843
|
+
totalDemandTax: totalDemandTax,
|
|
17844
|
+
totalDemandInterest: totalDemandInterest,
|
|
17845
|
+
totalDemandPenality: totalDemandPenality,
|
|
17846
|
+
totalCollectionTax: totalCollectionTax,
|
|
17847
|
+
totalCollectionInterest: totalCollectionInterest,
|
|
17848
|
+
totalCollectionPenality: totalCollectionPenality,
|
|
17849
|
+
totalBalanceTax: totalBalanceTax,
|
|
17850
|
+
totalBalancePenality: totalBalancePenality,
|
|
17851
|
+
totalBalanceInterest: totalBalanceInterest
|
|
17852
|
+
}));
|
|
18006
17853
|
}
|
|
18007
17854
|
|
|
18008
17855
|
function ApplicationDetailsToast({
|
|
@@ -24389,7 +24236,7 @@ const Checkboxes = ({
|
|
|
24389
24236
|
padding: "8px 16px 8px",
|
|
24390
24237
|
backgroundColor: "#2947a3",
|
|
24391
24238
|
color: "white",
|
|
24392
|
-
borderRadius:
|
|
24239
|
+
borderRadius: "8px"
|
|
24393
24240
|
},
|
|
24394
24241
|
disabled: !createNewSurvey && formDisabled || (isPartiallyEnabled ? !isPartiallyEnabled : formDisabled),
|
|
24395
24242
|
onClick: () => addOption()
|
|
@@ -24416,7 +24263,7 @@ const CheckBoxOption = ({
|
|
|
24416
24263
|
const [optionTitle, setOptionTitle] = useState(title);
|
|
24417
24264
|
const [optionWeightage, setOptionWeightage] = useState(weightage);
|
|
24418
24265
|
const [isFocused, setIsFocused] = useState(false);
|
|
24419
|
-
const [error, setError] = useState(
|
|
24266
|
+
const [error, setError] = useState("");
|
|
24420
24267
|
useEffect(() => {
|
|
24421
24268
|
updateOption({
|
|
24422
24269
|
value: optionTitle,
|
|
@@ -24426,17 +24273,17 @@ const CheckBoxOption = ({
|
|
|
24426
24273
|
}, [optionTitle, optionWeightage]);
|
|
24427
24274
|
const handleChange = e => {
|
|
24428
24275
|
const inputValue = e.target.value;
|
|
24429
|
-
if (inputValue ===
|
|
24430
|
-
setError(
|
|
24276
|
+
if (inputValue === "" || /^(10|[0-9])$/.test(inputValue) && !inputValue.includes("-")) {
|
|
24277
|
+
setError("");
|
|
24431
24278
|
setOptionWeightage(e.target.value);
|
|
24432
24279
|
} else {
|
|
24433
|
-
setError(
|
|
24280
|
+
setError("Please enter a number between 0 and 10.");
|
|
24434
24281
|
}
|
|
24435
24282
|
};
|
|
24436
24283
|
return /*#__PURE__*/React.createElement("div", {
|
|
24437
24284
|
className: "optioncheckboxwrapper",
|
|
24438
24285
|
style: {
|
|
24439
|
-
alignItems:
|
|
24286
|
+
alignItems: "flex-start"
|
|
24440
24287
|
}
|
|
24441
24288
|
}, /*#__PURE__*/React.createElement(CheckBox, {
|
|
24442
24289
|
disable: isInputDisabled
|
|
@@ -24459,8 +24306,8 @@ const CheckBoxOption = ({
|
|
|
24459
24306
|
onClick: () => removeOption(index)
|
|
24460
24307
|
}, /*#__PURE__*/React.createElement(CloseSvg, null)), /*#__PURE__*/React.createElement("div", {
|
|
24461
24308
|
style: {
|
|
24462
|
-
display:
|
|
24463
|
-
flexDirection:
|
|
24309
|
+
display: "flex",
|
|
24310
|
+
flexDirection: "column"
|
|
24464
24311
|
}
|
|
24465
24312
|
}, /*#__PURE__*/React.createElement("label", {
|
|
24466
24313
|
htmlFor: "numberInput"
|
|
@@ -24473,11 +24320,12 @@ const CheckBoxOption = ({
|
|
|
24473
24320
|
min: minWeight,
|
|
24474
24321
|
max: maxWeight,
|
|
24475
24322
|
title: weightHover,
|
|
24323
|
+
onWheel: e => e.target.blur(),
|
|
24476
24324
|
className: "employee-card-input",
|
|
24477
24325
|
onChange: handleChange
|
|
24478
24326
|
}), error && /*#__PURE__*/React.createElement("span", {
|
|
24479
24327
|
style: {
|
|
24480
|
-
color:
|
|
24328
|
+
color: "red"
|
|
24481
24329
|
}
|
|
24482
24330
|
}, error)));
|
|
24483
24331
|
};
|
|
@@ -24744,6 +24592,7 @@ const DropdownOption = ({
|
|
|
24744
24592
|
min: minWeight,
|
|
24745
24593
|
max: maxWeight,
|
|
24746
24594
|
title: weightHover,
|
|
24595
|
+
onWheel: e => e.target.blur(),
|
|
24747
24596
|
className: "employee-card-input",
|
|
24748
24597
|
onChange: handleChange
|
|
24749
24598
|
}), error && /*#__PURE__*/React.createElement("span", {
|
|
@@ -26492,7 +26341,8 @@ const CitizenDetails = ({
|
|
|
26492
26341
|
setErrors,
|
|
26493
26342
|
stateCode,
|
|
26494
26343
|
Otp,
|
|
26495
|
-
setGetOtp
|
|
26344
|
+
setGetOtp,
|
|
26345
|
+
setUser
|
|
26496
26346
|
}) => {
|
|
26497
26347
|
const {
|
|
26498
26348
|
data: cities,
|
|
@@ -26503,26 +26353,25 @@ const CitizenDetails = ({
|
|
|
26503
26353
|
t
|
|
26504
26354
|
} = useTranslation();
|
|
26505
26355
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
26506
|
-
const defaultCity = cities === null || cities === void 0 ? void 0 : cities.filter(ulb => tenantId === (ulb === null || ulb === void 0 ? void 0 : ulb.code));
|
|
26507
|
-
console.log("cities", cities);
|
|
26356
|
+
const defaultCity = useMemo(() => cities === null || cities === void 0 ? void 0 : cities.filter(ulb => tenantId === (ulb === null || ulb === void 0 ? void 0 : ulb.code)), [cities, tenantId]);
|
|
26508
26357
|
useEffect(() => {
|
|
26509
|
-
|
|
26510
|
-
|
|
26511
|
-
|
|
26512
|
-
|
|
26513
|
-
|
|
26514
|
-
|
|
26515
|
-
|
|
26358
|
+
if (defaultCity && defaultCity.length > 0) {
|
|
26359
|
+
setFormData(prevData => ({
|
|
26360
|
+
...prevData,
|
|
26361
|
+
city: defaultCity[0]
|
|
26362
|
+
}));
|
|
26363
|
+
}
|
|
26364
|
+
}, [defaultCity]);
|
|
26516
26365
|
const {
|
|
26517
26366
|
data: Menu
|
|
26518
26367
|
} = Digit.Hooks.pt.useGenderMDMS(stateCode, "common-masters", "GenderType");
|
|
26519
|
-
|
|
26520
|
-
|
|
26368
|
+
const menu = useMemo(() => {
|
|
26369
|
+
return (Menu === null || Menu === void 0 ? void 0 : Menu.map(genderDetails => ({
|
|
26521
26370
|
i18nKey: `PT_COMMON_GENDER_${genderDetails.code}`,
|
|
26522
|
-
code:
|
|
26523
|
-
value:
|
|
26524
|
-
});
|
|
26525
|
-
});
|
|
26371
|
+
code: genderDetails.code,
|
|
26372
|
+
value: genderDetails.code
|
|
26373
|
+
}))) || [];
|
|
26374
|
+
}, [Menu]);
|
|
26526
26375
|
const closeToast = () => {
|
|
26527
26376
|
setShowToast(null);
|
|
26528
26377
|
};
|
|
@@ -26531,8 +26380,6 @@ const CitizenDetails = ({
|
|
|
26531
26380
|
name,
|
|
26532
26381
|
value
|
|
26533
26382
|
} = event.target;
|
|
26534
|
-
console.log("date e", event);
|
|
26535
|
-
console.log("date value", event.target);
|
|
26536
26383
|
setFormData(prevData => ({
|
|
26537
26384
|
...prevData,
|
|
26538
26385
|
[name]: value
|
|
@@ -26543,22 +26390,18 @@ const CitizenDetails = ({
|
|
|
26543
26390
|
name,
|
|
26544
26391
|
value
|
|
26545
26392
|
} = event.target;
|
|
26546
|
-
console.log("date e", event);
|
|
26547
|
-
console.log("date value", event.target);
|
|
26548
26393
|
setFormData(prevData => ({
|
|
26549
26394
|
...prevData,
|
|
26550
26395
|
[name]: value
|
|
26551
26396
|
}));
|
|
26552
26397
|
};
|
|
26553
26398
|
const handleDropdownChange = (name, event) => {
|
|
26554
|
-
console.log("dropdown e", event);
|
|
26555
26399
|
setFormData(prevData => ({
|
|
26556
26400
|
...prevData,
|
|
26557
26401
|
[name]: event
|
|
26558
26402
|
}));
|
|
26559
26403
|
};
|
|
26560
26404
|
const handleDropdownChangeNew = (name, event) => {
|
|
26561
|
-
console.log("dropdown e", event);
|
|
26562
26405
|
setFormData(prevData => ({
|
|
26563
26406
|
...prevData,
|
|
26564
26407
|
[name]: event.target.value
|
|
@@ -26576,7 +26419,6 @@ const CitizenDetails = ({
|
|
|
26576
26419
|
};
|
|
26577
26420
|
try {
|
|
26578
26421
|
Digit.UserService.sendOtp(payload, stateCode).then(response => {
|
|
26579
|
-
console.log(response);
|
|
26580
26422
|
if ((response === null || response === void 0 ? void 0 : response.isSuccessful) === true) {
|
|
26581
26423
|
setGetOtp(true);
|
|
26582
26424
|
} else {
|
|
@@ -26589,18 +26431,19 @@ const CitizenDetails = ({
|
|
|
26589
26431
|
}
|
|
26590
26432
|
});
|
|
26591
26433
|
} catch (err) {
|
|
26592
|
-
console.log(err);
|
|
26593
26434
|
setGetOtp(false);
|
|
26594
26435
|
}
|
|
26595
26436
|
};
|
|
26596
|
-
const
|
|
26597
|
-
|
|
26598
|
-
let newErrors = {};
|
|
26437
|
+
const validateForm = () => {
|
|
26438
|
+
const newErrors = {};
|
|
26599
26439
|
if (!formData.mobile) newErrors.mobile = "Mobile number is required";else if (!/^\d{10}$/.test(formData.mobile)) newErrors.mobile = "Mobile number is invalid";
|
|
26600
26440
|
if (!formData.city) newErrors.city = "City is required";
|
|
26441
|
+
return newErrors;
|
|
26442
|
+
};
|
|
26443
|
+
const handleFetchDetails = () => {
|
|
26444
|
+
const newErrors = validateForm();
|
|
26601
26445
|
setErrors(newErrors);
|
|
26602
|
-
|
|
26603
|
-
if ((newErrors === null || newErrors === void 0 ? void 0 : newErrors.mobile) === undefined && (newErrors === null || newErrors === void 0 ? void 0 : newErrors.city) === undefined) {
|
|
26446
|
+
if (Object.keys(newErrors).length === 0) {
|
|
26604
26447
|
var _formData$city, _formData$city2;
|
|
26605
26448
|
const data = {
|
|
26606
26449
|
userName: formData === null || formData === void 0 ? void 0 : formData.mobile,
|
|
@@ -26610,25 +26453,27 @@ const CitizenDetails = ({
|
|
|
26610
26453
|
tenantId: (formData === null || formData === void 0 ? void 0 : (_formData$city2 = formData.city) === null || _formData$city2 === void 0 ? void 0 : _formData$city2.code).split(".")[0]
|
|
26611
26454
|
};
|
|
26612
26455
|
Digit.Surveys.userSearch(data, filters).then(response => {
|
|
26613
|
-
var _response$user$, _response$responseInf, _response$responseInf2;
|
|
26456
|
+
var _response$user, _response$user2, _response$user$, _response$responseInf, _response$responseInf2;
|
|
26457
|
+
setUser(response === null || response === void 0 ? void 0 : (_response$user = response.user) === null || _response$user === void 0 ? void 0 : _response$user[0]);
|
|
26458
|
+
console.log("response=====", response === null || response === void 0 ? void 0 : (_response$user2 = response.user) === null || _response$user2 === void 0 ? void 0 : _response$user2[0]);
|
|
26614
26459
|
console.log("response", (_response$user$ = response.user[0]) === null || _response$user$ === void 0 ? void 0 : _response$user$.emailId);
|
|
26615
26460
|
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) {
|
|
26616
|
-
|
|
26617
|
-
const formattedDate = format(parseISO((_response$user$2 = response.user[0]) === null || _response$user$2 === void 0 ? void 0 : _response$user$2.dob), "dd/MM/yyyy");
|
|
26461
|
+
console.log("coming here na");
|
|
26618
26462
|
setFormData(prevData => {
|
|
26619
|
-
var _response$user$
|
|
26463
|
+
var _response$user$2, _response$user$3, _response$user$4, _response$user$5;
|
|
26620
26464
|
return {
|
|
26621
26465
|
...prevData,
|
|
26622
26466
|
citizenFound: true,
|
|
26623
|
-
name: (_response$user$
|
|
26624
|
-
["email"]: (_response$user$
|
|
26625
|
-
["gender"]: (_response$user$
|
|
26626
|
-
["dob"]: (_response$user$
|
|
26467
|
+
name: (_response$user$2 = response.user[0]) === null || _response$user$2 === void 0 ? void 0 : _response$user$2.name,
|
|
26468
|
+
["email"]: (_response$user$3 = response.user[0]) === null || _response$user$3 === void 0 ? void 0 : _response$user$3.emailId,
|
|
26469
|
+
["gender"]: (_response$user$4 = response.user[0]) === null || _response$user$4 === void 0 ? void 0 : _response$user$4.gender,
|
|
26470
|
+
["dob"]: (_response$user$5 = response.user[0]) === null || _response$user$5 === void 0 ? void 0 : _response$user$5.dob,
|
|
26627
26471
|
register: false,
|
|
26628
26472
|
user: response.user[0]
|
|
26629
26473
|
};
|
|
26630
26474
|
});
|
|
26631
26475
|
} else {
|
|
26476
|
+
console.log("not here");
|
|
26632
26477
|
setFormData(prevData => ({
|
|
26633
26478
|
...prevData,
|
|
26634
26479
|
citizenFound: false
|
|
@@ -26644,7 +26489,9 @@ const CitizenDetails = ({
|
|
|
26644
26489
|
});
|
|
26645
26490
|
}
|
|
26646
26491
|
};
|
|
26647
|
-
|
|
26492
|
+
useEffect(() => {
|
|
26493
|
+
console.log("UPDATED formData", formData);
|
|
26494
|
+
}, [formData]);
|
|
26648
26495
|
return /*#__PURE__*/React.createElement("div", {
|
|
26649
26496
|
style: {
|
|
26650
26497
|
border: "2px solid #ccc",
|
|
@@ -26775,15 +26622,17 @@ const CitizenDetails = ({
|
|
|
26775
26622
|
const FillSurvey = ({
|
|
26776
26623
|
stateCode
|
|
26777
26624
|
}) => {
|
|
26778
|
-
var _location$state;
|
|
26625
|
+
var _location$state, _Digit$UserService$ge;
|
|
26779
26626
|
const history = useHistory();
|
|
26780
26627
|
const {
|
|
26781
26628
|
t
|
|
26782
26629
|
} = useTranslation();
|
|
26783
26630
|
const location = useLocation();
|
|
26631
|
+
const [getUser, setUser] = useState();
|
|
26784
26632
|
console.log("loca", location.state.surveyDetails);
|
|
26785
26633
|
const surveyDetails = ((_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.surveyDetails) || {};
|
|
26786
26634
|
console.log("surv det", surveyDetails);
|
|
26635
|
+
const userInfo = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
|
|
26787
26636
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
26788
26637
|
const [showToast, setShowToast] = useState(null);
|
|
26789
26638
|
const [register, setRegister] = useState(null);
|
|
@@ -26800,15 +26649,6 @@ const FillSurvey = ({
|
|
|
26800
26649
|
register: null,
|
|
26801
26650
|
user: null
|
|
26802
26651
|
});
|
|
26803
|
-
useEffect(() => {
|
|
26804
|
-
const savedData = localStorage.getItem("surveyFormCitizenData");
|
|
26805
|
-
if (savedData) {
|
|
26806
|
-
setFormData(JSON.parse(savedData));
|
|
26807
|
-
}
|
|
26808
|
-
}, []);
|
|
26809
|
-
useEffect(() => {
|
|
26810
|
-
localStorage.setItem("surveyFormCitizenData", JSON.stringify(formData));
|
|
26811
|
-
}, [formData]);
|
|
26812
26652
|
console.log("formData", formData);
|
|
26813
26653
|
const [errors, setErrors] = useState({});
|
|
26814
26654
|
function calculateAge(dob) {
|
|
@@ -26869,7 +26709,7 @@ const FillSurvey = ({
|
|
|
26869
26709
|
console.log(err);
|
|
26870
26710
|
}
|
|
26871
26711
|
};
|
|
26872
|
-
const handleSubmit = event => {
|
|
26712
|
+
const handleSubmit = async event => {
|
|
26873
26713
|
event.preventDefault();
|
|
26874
26714
|
if (formData.citizenFound === null) {
|
|
26875
26715
|
setShowToast({
|
|
@@ -26883,8 +26723,45 @@ const FillSurvey = ({
|
|
|
26883
26723
|
if (proceed) {
|
|
26884
26724
|
console.log("Form submitted:", formData);
|
|
26885
26725
|
console.log("reg", formData.register, formData.citizenFound);
|
|
26726
|
+
console.log("getUser", getUser);
|
|
26727
|
+
const existingUser = formData.user;
|
|
26886
26728
|
if ((formData.register === false || formData.register === null) && formData.citizenFound === true) {
|
|
26887
26729
|
var _location$state2;
|
|
26730
|
+
const isEmailChanged = formData.email && formData.email !== (existingUser === null || existingUser === void 0 ? void 0 : existingUser.emailId);
|
|
26731
|
+
const isGenderChanged = formData.gender && formData.gender !== (existingUser === null || existingUser === void 0 ? void 0 : existingUser.gender);
|
|
26732
|
+
const isDobChanged = formData.dob && formData.dob !== (existingUser === null || existingUser === void 0 ? void 0 : existingUser.dob);
|
|
26733
|
+
if (isEmailChanged || isGenderChanged || isDobChanged) {
|
|
26734
|
+
const requestData = {
|
|
26735
|
+
...getUser,
|
|
26736
|
+
...(isEmailChanged && {
|
|
26737
|
+
emailId: formData.email
|
|
26738
|
+
}),
|
|
26739
|
+
...(isGenderChanged && {
|
|
26740
|
+
gender: formData.gender
|
|
26741
|
+
}),
|
|
26742
|
+
...(isDobChanged && {
|
|
26743
|
+
dob: formData.dob
|
|
26744
|
+
})
|
|
26745
|
+
};
|
|
26746
|
+
try {
|
|
26747
|
+
const {
|
|
26748
|
+
responseInfo,
|
|
26749
|
+
user
|
|
26750
|
+
} = await Digit.UserService.updateUser(requestData, getUser === null || getUser === void 0 ? void 0 : getUser.tenantId);
|
|
26751
|
+
console.log("User updated:", user);
|
|
26752
|
+
} catch (error) {
|
|
26753
|
+
console.error("Error updating user:", error);
|
|
26754
|
+
setShowToast({
|
|
26755
|
+
key: true,
|
|
26756
|
+
isError: true,
|
|
26757
|
+
label: "FAILED TO UPDATE USER INFORMATION"
|
|
26758
|
+
});
|
|
26759
|
+
return;
|
|
26760
|
+
}
|
|
26761
|
+
} else {
|
|
26762
|
+
console.log("No user info changed. Skipping API call.");
|
|
26763
|
+
}
|
|
26764
|
+
console.log("formData", formData);
|
|
26888
26765
|
history.push("/digit-ui/employee/engagement/surveys/fill-survey", {
|
|
26889
26766
|
citizenFill: true,
|
|
26890
26767
|
citizenData: formData,
|
|
@@ -26941,7 +26818,9 @@ const FillSurvey = ({
|
|
|
26941
26818
|
stateCode: stateCode,
|
|
26942
26819
|
Otp: Otp,
|
|
26943
26820
|
setGetOtp: setGetOtp,
|
|
26944
|
-
city: formData === null || formData === void 0 ? void 0 : formData.city
|
|
26821
|
+
city: formData === null || formData === void 0 ? void 0 : formData.city,
|
|
26822
|
+
getUser: getUser,
|
|
26823
|
+
setUser: setUser
|
|
26945
26824
|
}), /*#__PURE__*/React.createElement("div", {
|
|
26946
26825
|
style: {
|
|
26947
26826
|
display: "flex",
|
|
@@ -32014,13 +31893,13 @@ const CitizenSurveyFormNew = () => {
|
|
|
32014
31893
|
relation: null,
|
|
32015
31894
|
address: "",
|
|
32016
31895
|
email: "",
|
|
32017
|
-
dob:
|
|
31896
|
+
dob: "",
|
|
32018
31897
|
section1: {
|
|
32019
31898
|
checkboxes: [],
|
|
32020
|
-
shortText:
|
|
31899
|
+
shortText: ""
|
|
32021
31900
|
},
|
|
32022
31901
|
section2: {
|
|
32023
|
-
multipleChoice:
|
|
31902
|
+
multipleChoice: ""
|
|
32024
31903
|
}
|
|
32025
31904
|
});
|
|
32026
31905
|
const {
|
|
@@ -32035,15 +31914,6 @@ const CitizenSurveyFormNew = () => {
|
|
|
32035
31914
|
label: "Husband",
|
|
32036
31915
|
value: "Husband"
|
|
32037
31916
|
}];
|
|
32038
|
-
useEffect(() => {
|
|
32039
|
-
const savedData = localStorage.getItem('surveyFormData');
|
|
32040
|
-
if (savedData) {
|
|
32041
|
-
setFormData(JSON.parse(savedData));
|
|
32042
|
-
}
|
|
32043
|
-
}, []);
|
|
32044
|
-
useEffect(() => {
|
|
32045
|
-
localStorage.setItem('surveyFormData', JSON.stringify(formData));
|
|
32046
|
-
}, [formData]);
|
|
32047
31917
|
const handleCheckboxChange = (section, event) => {
|
|
32048
31918
|
const {
|
|
32049
31919
|
value,
|
|
@@ -32077,45 +31947,45 @@ const CitizenSurveyFormNew = () => {
|
|
|
32077
31947
|
const [errors, setErrors] = useState({});
|
|
32078
31948
|
const validateForm = () => {
|
|
32079
31949
|
const newErrors = {};
|
|
32080
|
-
if (!formData.name) newErrors.name =
|
|
32081
|
-
if (!formData.relationName) newErrors.relationName =
|
|
32082
|
-
if (!formData.email) newErrors.email =
|
|
32083
|
-
if (!formData.mobile) newErrors.mobile =
|
|
32084
|
-
if (!formData.relation) newErrors.relation =
|
|
32085
|
-
if (!formData.address) newErrors.address =
|
|
32086
|
-
if (!formData.dob) newErrors.dob =
|
|
32087
|
-
if (!formData.section1.checkboxes.length > 0) newErrors.checkboxes =
|
|
32088
|
-
if (!formData.section1.shortText) newErrors.shortText =
|
|
32089
|
-
if (!formData.section2.multipleChoice) newErrors.multipleChoice =
|
|
31950
|
+
if (!formData.name) newErrors.name = "Name is required";else if (!/^[A-Za-z\s]+$/.test(formData.name)) newErrors.name = "Name can only contain alphabets and spaces";
|
|
31951
|
+
if (!formData.relationName) newErrors.relationName = "Father/Husband Name is required";else if (!/^[A-Za-z\s]+$/.test(formData.relationName)) newErrors.relationName = "Relation Name can only contain alphabets and spaces";
|
|
31952
|
+
if (!formData.email) newErrors.email = "Email is required";else if (!/\S+@\S+\.\S+/.test(formData.email)) newErrors.email = "Email is invalid";
|
|
31953
|
+
if (!formData.mobile) newErrors.mobile = "Mobile number is required";else if (!/^\d{10}$/.test(formData.mobile)) newErrors.mobile = "Mobile number is invalid";
|
|
31954
|
+
if (!formData.relation) newErrors.relation = "Relation is required";
|
|
31955
|
+
if (!formData.address) newErrors.address = "Address is required";
|
|
31956
|
+
if (!formData.dob) newErrors.dob = "Date of Birth is required";
|
|
31957
|
+
if (!formData.section1.checkboxes.length > 0) newErrors.checkboxes = "This question is required to answer";
|
|
31958
|
+
if (!formData.section1.shortText) newErrors.shortText = "This question is required to answer";
|
|
31959
|
+
if (!formData.section2.multipleChoice) newErrors.multipleChoice = "This question is required to answer";
|
|
32090
31960
|
setErrors(newErrors);
|
|
32091
31961
|
return Object.keys(newErrors).length === 0;
|
|
32092
31962
|
};
|
|
32093
31963
|
const handleSubmit = event => {
|
|
32094
31964
|
event.preventDefault();
|
|
32095
31965
|
if (validateForm()) {
|
|
32096
|
-
console.log(
|
|
31966
|
+
console.log("Form submitted:", formData);
|
|
32097
31967
|
}
|
|
32098
31968
|
};
|
|
32099
31969
|
return /*#__PURE__*/React.createElement("div", {
|
|
32100
31970
|
className: "create-survey-page",
|
|
32101
31971
|
style: {
|
|
32102
|
-
background:
|
|
32103
|
-
display:
|
|
32104
|
-
padding:
|
|
31972
|
+
background: "white",
|
|
31973
|
+
display: "block",
|
|
31974
|
+
padding: "15px"
|
|
32105
31975
|
}
|
|
32106
31976
|
}, /*#__PURE__*/React.createElement("div", {
|
|
32107
31977
|
className: "category-card"
|
|
32108
31978
|
}, /*#__PURE__*/React.createElement("h1", {
|
|
32109
31979
|
style: {
|
|
32110
|
-
fontWeight:
|
|
32111
|
-
fontSize:
|
|
31980
|
+
fontWeight: "bold",
|
|
31981
|
+
fontSize: "20px"
|
|
32112
31982
|
}
|
|
32113
31983
|
}, "Survey Title : Citizen Survey"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h1", {
|
|
32114
31984
|
style: {
|
|
32115
|
-
fontWeight:
|
|
32116
|
-
fontSize:
|
|
31985
|
+
fontWeight: "bold",
|
|
31986
|
+
fontSize: "20px"
|
|
32117
31987
|
}
|
|
32118
|
-
}, "Survey Description :
|
|
31988
|
+
}, "Survey Description : This is a sample citizen survey")), /*#__PURE__*/React.createElement("form", {
|
|
32119
31989
|
onSubmit: handleSubmit
|
|
32120
31990
|
}, /*#__PURE__*/React.createElement(CitizenDetails, {
|
|
32121
31991
|
formData: formData,
|
|
@@ -32124,35 +31994,35 @@ const CitizenSurveyFormNew = () => {
|
|
|
32124
31994
|
relationList: relationList
|
|
32125
31995
|
}), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h2", null, "Section 1"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", null, "What is your feedback?"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
32126
31996
|
style: {
|
|
32127
|
-
display:
|
|
32128
|
-
alignItems:
|
|
31997
|
+
display: "flex",
|
|
31998
|
+
alignItems: "center"
|
|
32129
31999
|
}
|
|
32130
32000
|
}, /*#__PURE__*/React.createElement("input", {
|
|
32131
32001
|
type: "checkbox",
|
|
32132
32002
|
value: "option1",
|
|
32133
32003
|
style: {
|
|
32134
|
-
width:
|
|
32135
|
-
height:
|
|
32136
|
-
marginRight:
|
|
32004
|
+
width: "20px",
|
|
32005
|
+
height: "20px",
|
|
32006
|
+
marginRight: "10px"
|
|
32137
32007
|
},
|
|
32138
|
-
checked: formData.section1.checkboxes.includes(
|
|
32139
|
-
onChange: e => handleCheckboxChange(
|
|
32008
|
+
checked: formData.section1.checkboxes.includes("option1"),
|
|
32009
|
+
onChange: e => handleCheckboxChange("section1", e)
|
|
32140
32010
|
}), "Option 1"), /*#__PURE__*/React.createElement("div", {
|
|
32141
32011
|
style: {
|
|
32142
|
-
display:
|
|
32143
|
-
alignItems:
|
|
32012
|
+
display: "flex",
|
|
32013
|
+
alignItems: "center"
|
|
32144
32014
|
}
|
|
32145
32015
|
}, /*#__PURE__*/React.createElement("input", {
|
|
32146
32016
|
type: "checkbox",
|
|
32147
32017
|
value: "option2",
|
|
32148
32018
|
style: {
|
|
32149
|
-
width:
|
|
32150
|
-
height:
|
|
32151
|
-
marginRight:
|
|
32152
|
-
color:
|
|
32019
|
+
width: "20px",
|
|
32020
|
+
height: "20px",
|
|
32021
|
+
marginRight: "10px",
|
|
32022
|
+
color: "#0d43a7"
|
|
32153
32023
|
},
|
|
32154
|
-
checked: formData.section1.checkboxes.includes(
|
|
32155
|
-
onChange: e => handleCheckboxChange(
|
|
32024
|
+
checked: formData.section1.checkboxes.includes("option2"),
|
|
32025
|
+
onChange: e => handleCheckboxChange("section1", e)
|
|
32156
32026
|
}), "Option 2"), errors.checkboxes && /*#__PURE__*/React.createElement("span", {
|
|
32157
32027
|
className: "error"
|
|
32158
32028
|
}, errors.checkboxes))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", null, "Tell us more about your product quality?"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
|
|
@@ -32160,13 +32030,13 @@ const CitizenSurveyFormNew = () => {
|
|
|
32160
32030
|
name: "shortText",
|
|
32161
32031
|
placeholder: "enter here",
|
|
32162
32032
|
value: formData.section1.shortText,
|
|
32163
|
-
onChange: e => handleInputChange(
|
|
32033
|
+
onChange: e => handleInputChange("section1", e)
|
|
32164
32034
|
}), errors.shortText && /*#__PURE__*/React.createElement("span", {
|
|
32165
32035
|
className: "error"
|
|
32166
32036
|
}, errors.shortText)))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h2", null, "Section 2"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", null, "Give your rating?"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("select", {
|
|
32167
32037
|
name: "multipleChoice",
|
|
32168
32038
|
value: formData.section2.multipleChoice,
|
|
32169
|
-
onChange: e => handleInputChange(
|
|
32039
|
+
onChange: e => handleInputChange("section2", e)
|
|
32170
32040
|
}, /*#__PURE__*/React.createElement("option", {
|
|
32171
32041
|
value: ""
|
|
32172
32042
|
}, "Select an option"), /*#__PURE__*/React.createElement("option", {
|
|
@@ -32179,8 +32049,8 @@ const CitizenSurveyFormNew = () => {
|
|
|
32179
32049
|
type: "submit"
|
|
32180
32050
|
}, "Submit"), /*#__PURE__*/React.createElement("button", {
|
|
32181
32051
|
style: {
|
|
32182
|
-
backgroundColor:
|
|
32183
|
-
marginLeft:
|
|
32052
|
+
backgroundColor: "none",
|
|
32053
|
+
marginLeft: "10px"
|
|
32184
32054
|
},
|
|
32185
32055
|
onClick: () => setFormData({
|
|
32186
32056
|
name: "",
|
|
@@ -32189,13 +32059,13 @@ const CitizenSurveyFormNew = () => {
|
|
|
32189
32059
|
relation: null,
|
|
32190
32060
|
address: "",
|
|
32191
32061
|
email: "",
|
|
32192
|
-
dob:
|
|
32062
|
+
dob: "",
|
|
32193
32063
|
section1: {
|
|
32194
32064
|
checkboxes: [],
|
|
32195
|
-
shortText:
|
|
32065
|
+
shortText: ""
|
|
32196
32066
|
},
|
|
32197
32067
|
section2: {
|
|
32198
|
-
multipleChoice:
|
|
32068
|
+
multipleChoice: ""
|
|
32199
32069
|
}
|
|
32200
32070
|
})
|
|
32201
32071
|
}, "Reset"))));
|