@@ -43,7 +43,7 @@ const ReportTable = (props) => {
43
43
const [ templateDeatils , setTemplateDetails ] = useState ( { } ) ;
44
44
const [ placeholders , setPlaceholders ] = useState ( [ ] ) ;
45
45
const [ isLoader , setIsLoader ] = useState ( { } ) ;
46
-
46
+ const [ isViewShare , setIsViewShare ] = useState ( { } ) ;
47
47
const startIndex = ( currentPage - 1 ) * props . docPerPage ;
48
48
const { isMoreDocs, setIsNextRecord } = props ;
49
49
// For loop is used to calculate page numbers visible below table
@@ -340,9 +340,9 @@ const ReportTable = (props) => {
340
340
341
341
await axios
342
342
. put (
343
- `${ localStorage . getItem ( "baseUrl" ) } classes/${ localStorage . getItem (
344
- "_appName"
345
- ) } _Document/ ${ item . objectId } `,
343
+ `${ localStorage . getItem ( "baseUrl" ) } classes/contracts_Document/ ${
344
+ item . objectId
345
+ } `,
346
346
data ,
347
347
{
348
348
headers : {
@@ -578,9 +578,15 @@ const ReportTable = (props) => {
578
578
} ;
579
579
try {
580
580
const res = await axios . post ( url , params , { headers : headers } ) ;
581
- if ( res ) {
581
+ if ( res ?. data ?. result ?. status === "success" ) {
582
582
setIsAlert ( true ) ;
583
583
setAlertMsg ( { type : "success" , message : "Mail sent successfully." } ) ;
584
+ } else {
585
+ setIsAlert ( true ) ;
586
+ setAlertMsg ( {
587
+ type : "danger" ,
588
+ message : "Something went wrong, please try again later!"
589
+ } ) ;
584
590
}
585
591
} catch ( err ) {
586
592
console . log ( "err in sendmail" , err ) ;
@@ -681,6 +687,9 @@ const ReportTable = (props) => {
681
687
setTimeout ( ( ) => setIsAlert ( false ) , 1500 ) ;
682
688
}
683
689
} ;
690
+ const handleViewSigners = ( item ) => {
691
+ setIsViewShare ( { [ item . objectId ] : true } ) ;
692
+ } ;
684
693
return (
685
694
< div className = "relative" >
686
695
{ Object . keys ( actLoader ) ?. length > 0 && (
@@ -835,7 +844,17 @@ const ReportTable = (props) => {
835
844
{ formatRow ( item ?. ExtUserPtr ) }
836
845
</ td >
837
846
< td className = "px-4 py-2" >
838
- { item ?. Signers ? formatRow ( item ?. Signers ) : "-" }
847
+ { /* {item?.Signers ? formatRow(item?.Signers) : "-"} */ }
848
+ { item ?. Placeholders ? (
849
+ < button
850
+ onClick = { ( ) => handleViewSigners ( item ) }
851
+ className = "text-[blue] hover:underline focus:outline-none"
852
+ >
853
+ View
854
+ </ button >
855
+ ) : (
856
+ "-"
857
+ ) }
839
858
</ td >
840
859
< td className = "px-2 py-2 text-white flex flex-row gap-x-2 gap-y-1 justify-center items-center" >
841
860
{ props . actions ?. length > 0 &&
@@ -865,19 +884,21 @@ const ReportTable = (props) => {
865
884
) }
866
885
{ isOption [ item . objectId ] &&
867
886
act . action === "option" && (
868
- < div className = "absolute -right-2 top-5 bg-white text-nowrap rounded shadow z-[20] overflow-hidden" >
887
+ < div className = "absolute -right-2 top-5 p-1.5 bg-white text-nowrap rounded shadow-md z-[20] overflow-hidden" >
869
888
{ act . subaction ?. map ( ( subact ) => (
870
889
< div
871
890
key = { subact . btnId }
872
- className = "hover:bg-gray-300 cursor-pointer px-2 py-1.5 flex justify-start items-center text-black"
891
+ className = "hover:bg-gray-300 rounded cursor-pointer px-2 py-1.5 flex justify-start items-center text-black"
873
892
onClick = { ( ) =>
874
893
handleActionBtn ( subact , item )
875
894
}
876
895
title = { subact . hoverLabel }
877
896
>
878
- < i className = { subact . btnIcon } > </ i >
897
+ < i
898
+ className = { `${ subact . btnIcon } mr-1.5` }
899
+ > </ i >
879
900
{ subact . btnLabel && (
880
- < span className = "ml-[4px] text-xs capitalize" >
901
+ < span className = "ml-[4px] text-[13px] capitalize font-medium " >
881
902
{ subact . btnLabel }
882
903
</ span >
883
904
) }
@@ -887,6 +908,48 @@ const ReportTable = (props) => {
887
908
) }
888
909
</ button >
889
910
) ) }
911
+ { isViewShare [ item . objectId ] && (
912
+ < div className = "fixed z-[999] inset-0 w-full h-full bg-black bg-opacity-[75%]" >
913
+ < div className = "fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-sm bg-white rounded shadow-md max-h-90 min-w-[90%] md:min-w-[400px] overflow-y-auto max-h-[340px] md:max-h-[400px] hide-scrollbar" >
914
+ < div
915
+ className = "cursor-pointer absolute text-white text-[22px] font-medium rounded-full z-50 top-1 right-3"
916
+ onClick = { ( ) => setIsViewShare ( { } ) }
917
+ >
918
+ ×
919
+ </ div >
920
+
921
+ < table className = "table-auto w-full" >
922
+ < thead className = "text-white h-[38px] sticky top-0 bg-[#32a3ac]" >
923
+ < tr >
924
+ { props . ReportName === "Templates" && (
925
+ < th className = "p-2" > Roles</ th >
926
+ ) }
927
+ < th className = "p-2" > Signers</ th >
928
+ </ tr >
929
+ </ thead >
930
+ < tbody >
931
+ { item . Placeholders . map ( ( x , i ) => (
932
+ < tr
933
+ key = { i }
934
+ className = "text-sm font-normal text-black odd:bg-white even:bg-gray-200"
935
+ >
936
+ { props . ReportName === "Templates" && (
937
+ < td className = "text-[13px] md:text-sm font-semibold p-2 " >
938
+ { x . Role && x . Role }
939
+ </ td >
940
+ ) }
941
+ < td className = "text-[13px] md:text-sm p-2 break-all" >
942
+ { x . email
943
+ ? x . email
944
+ : x ?. signerPtr ?. Email || "-" }
945
+ </ td >
946
+ </ tr >
947
+ ) ) }
948
+ </ tbody >
949
+ </ table >
950
+ </ div >
951
+ </ div >
952
+ ) }
890
953
{ isDeleteModal [ item . objectId ] && (
891
954
< ModalUi
892
955
isOpen
0 commit comments