@@ -8,8 +8,6 @@ import { modalSubmitBtnColor, modalCancelBtnColor } from "../constant/const";
8
8
import Alert from "./Alert" ;
9
9
import Tooltip from "./Tooltip" ;
10
10
import { RWebShare } from "react-web-share" ;
11
- import Tour from "reactour" ;
12
- import Parse from "parse" ;
13
11
14
12
const ReportTable = ( {
15
13
ReportName,
@@ -21,9 +19,7 @@ const ReportTable = ({
21
19
isMoreDocs,
22
20
docPerPage,
23
21
form,
24
- report_help,
25
- tourData,
26
- isDontShow
22
+ report_help
27
23
} ) => {
28
24
const navigate = useNavigate ( ) ;
29
25
const [ currentPage , setCurrentPage ] = useState ( 1 ) ;
@@ -37,8 +33,6 @@ const ReportTable = ({
37
33
const [ shareUrls , setShareUrls ] = useState ( [ ] ) ;
38
34
const [ copied , setCopied ] = useState ( false ) ;
39
35
const [ alertMsg , setAlertMsg ] = useState ( { type : "success" , message : "" } ) ;
40
- const [ isTour , setIsTour ] = useState ( false ) ;
41
- const [ tourStatusArr , setTourStatusArr ] = useState ( [ ] ) ;
42
36
const startIndex = ( currentPage - 1 ) * docPerPage ;
43
37
44
38
// For loop is used to calculate page numbers visible below table
@@ -52,7 +46,6 @@ const ReportTable = ({
52
46
} , [ List , docPerPage ] ) ;
53
47
// below useEffect reset currenpage to 1 if user change route
54
48
useEffect ( ( ) => {
55
- checkTourStatus ( ) ;
56
49
return ( ) => setCurrentPage ( 1 ) ;
57
50
} , [ ] ) ;
58
51
@@ -357,80 +350,6 @@ const ReportTable = ({
357
350
setActLoader ( { } ) ;
358
351
} ) ;
359
352
} ;
360
-
361
- async function checkTourStatus ( ) {
362
- const currentUser = Parse . User . current ( ) ;
363
- const cloudRes = await Parse . Cloud . run ( "getUserDetails" , {
364
- email : currentUser . get ( "email" )
365
- } ) ;
366
- const res = { data : cloudRes . toJSON ( ) } ;
367
- if ( res . data && res . data . TourStatus && res . data . TourStatus . length > 0 ) {
368
- const tourStatus = res . data . TourStatus ;
369
- // console.log("res ", res.data.TourStatus);
370
- setTourStatusArr ( tourStatus ) ;
371
- const filteredtourStatus = tourStatus . filter (
372
- ( obj ) => obj [ "templateReportTour" ]
373
- ) ;
374
- if ( filteredtourStatus . length > 0 ) {
375
- const templateReportTour = filteredtourStatus [ 0 ] [ "templateReportTour" ] ;
376
-
377
- if ( templateReportTour ) {
378
- setIsTour ( false ) ;
379
- } else {
380
- setIsTour ( true ) ;
381
- }
382
- } else {
383
- setIsTour ( true ) ;
384
- }
385
- } else {
386
- setIsTour ( true ) ;
387
- }
388
- }
389
-
390
- const closeTour = async ( ) => {
391
- // console.log("closeTour");
392
- setIsTour ( false ) ;
393
- if ( isDontShow ) {
394
- const serverUrl = localStorage . getItem ( "baseUrl" ) ;
395
- const appId = localStorage . getItem ( "parseAppId" ) ;
396
- const extUserClass = localStorage . getItem ( "extended_class" ) ;
397
- const json = JSON . parse ( localStorage . getItem ( "Extand_Class" ) ) ;
398
- const extUserId = json && json . length > 0 && json [ 0 ] . objectId ;
399
- // console.log("extUserId ", extUserId)
400
-
401
- let updatedTourStatus = [ ] ;
402
- if ( tourStatusArr . length > 0 ) {
403
- updatedTourStatus = [ ...tourStatusArr ] ;
404
- const templateReportTourIndex = tourStatusArr . findIndex (
405
- ( obj ) =>
406
- obj [ "templateReportTour" ] === false ||
407
- obj [ "templateReportTour" ] === true
408
- ) ;
409
- if ( templateReportTourIndex !== - 1 ) {
410
- updatedTourStatus [ templateReportTourIndex ] = {
411
- templateReportTour : true
412
- } ;
413
- } else {
414
- updatedTourStatus . push ( { templateReportTour : true } ) ;
415
- }
416
- } else {
417
- updatedTourStatus = [ { templateReportTour : true } ] ;
418
- }
419
-
420
- await axios . put (
421
- serverUrl + "classes/" + extUserClass + "/" + extUserId ,
422
- {
423
- TourStatus : updatedTourStatus
424
- } ,
425
- {
426
- headers : {
427
- "X-Parse-Application-Id" : appId
428
- }
429
- }
430
- ) ;
431
- }
432
- } ;
433
-
434
353
return (
435
354
< div className = "relative" >
436
355
{ Object . keys ( actLoader ) ?. length > 0 && (
@@ -443,15 +362,6 @@ const ReportTable = ({
443
362
) }
444
363
< div className = "p-2 overflow-x-scroll w-full bg-white rounded-md" >
445
364
{ isAlert && < Alert type = { alertMsg . type } > { alertMsg . message } </ Alert > }
446
- { tourData && ReportName === "Templates" && (
447
- < Tour
448
- onRequestClose = { closeTour }
449
- steps = { tourData }
450
- isOpen = { isTour }
451
- // rounded={5}
452
- closeWithMask = { false }
453
- />
454
- ) }
455
365
< div className = "flex flex-row items-center justify-between my-2 mx-3 text-[20px] md:text-[23px]" >
456
366
< div className = "font-light" >
457
367
{ ReportName } { " " }
@@ -463,7 +373,6 @@ const ReportTable = ({
463
373
</ div >
464
374
{ ReportName === "Templates" && (
465
375
< i
466
- data-tut = "reactourFirst"
467
376
onClick = { ( ) => navigate ( "/form/template" ) }
468
377
className = "fa-solid fa-square-plus text-sky-400 text-[25px]"
469
378
> </ i >
@@ -595,7 +504,6 @@ const ReportTable = ({
595
504
{ actions ?. length > 0 &&
596
505
actions . map ( ( act , index ) => (
597
506
< button
598
- data-tut = { act ?. selector }
599
507
key = { index }
600
508
onClick = { ( ) => handleActionBtn ( act , item ) }
601
509
className = { `w-[25px] h-[25px] flex justify-center items-center rounded shadow` }
0 commit comments