@@ -68,6 +68,7 @@ function PlaceHolderSign() {
68
68
const [ isSendAlert , setIsSendAlert ] = useState ( { } ) ;
69
69
const [ isSend , setIsSend ] = useState ( false ) ;
70
70
const [ copied , setCopied ] = useState ( false ) ;
71
+ const [ isAddSigner , setIsAddSigner ] = useState ( false ) ;
71
72
const [ isLoading , setIsLoading ] = useState ( {
72
73
isLoad : true ,
73
74
message : "This might take some time"
@@ -350,15 +351,15 @@ function PlaceHolderSign() {
350
351
const updatedSigners = documentData [ 0 ] . Signers . map ( ( x , index ) => ( {
351
352
...x ,
352
353
Id : randomId ( ) ,
353
- Role : "User " + ( index + 1 ) ,
354
+ // Role: "User " + (index + 1),
354
355
blockColor : color [ index % color . length ]
355
356
} ) ) ;
356
357
setSignersData ( updatedSigners ) ;
357
358
setUniqueId ( updatedSigners [ 0 ] . Id ) ;
358
359
setBlockColor ( updatedSigners [ 0 ] . blockColor ) ;
359
360
}
360
361
} else {
361
- setRoleName ( "User 1" ) ;
362
+ // setRoleName("User 1");
362
363
if (
363
364
documentData [ 0 ] . Placeholders &&
364
365
documentData [ 0 ] . Placeholders . length > 0
@@ -1525,8 +1526,25 @@ function PlaceHolderSign() {
1525
1526
}
1526
1527
} ;
1527
1528
1529
+ //function to add new signer in document signers list
1530
+ const handleAddNewRecipients = ( data ) => {
1531
+ const newId = randomId ( ) ;
1532
+ signersdata . push ( {
1533
+ ...data ,
1534
+ className : "contracts_Contactbook" ,
1535
+ Id : newId ,
1536
+ blockColor : color [ signersdata . length ]
1537
+ } ) ;
1538
+ setUniqueId ( newId ) ;
1539
+ setIsSelectId ( signersdata . length - 1 ) ;
1540
+ setBlockColor ( color [ signersdata . length ] ) ;
1541
+ setContractName ( "contracts_Contactbook" ) ;
1542
+ setSignerObjId ( data . objectId ) ;
1543
+ } ;
1544
+
1528
1545
const closePopup = ( ) => {
1529
1546
setIsAddUser ( { } ) ;
1547
+ setIsAddSigner ( false ) ;
1530
1548
} ;
1531
1549
1532
1550
//function for handle ontext change and save again text in delta in Request Email flow
@@ -1546,6 +1564,30 @@ function PlaceHolderSign() {
1546
1564
style : { fontSize : "13px" }
1547
1565
}
1548
1566
] ;
1567
+
1568
+ // `handleDeleteUser` function is used to delete record and placeholder when user click on delete which is place next user name in recipients list
1569
+ const handleDeleteUser = ( Id ) => {
1570
+ const updateSigner = signersdata
1571
+ . filter ( ( x ) => x . Id !== Id )
1572
+ . map ( ( x , i ) => ( { ...x , blockColor : color [ i ] } ) ) ;
1573
+ setSignersData ( updateSigner ) ;
1574
+ const updatePlaceholderUser = signerPos
1575
+ . filter ( ( x ) => x . Id !== Id )
1576
+ . map ( ( x , i ) => ( { ...x , blockColor : color [ i ] } ) ) ;
1577
+ const index = signersdata . findIndex ( ( x ) => x . Id === Id ) ;
1578
+ if ( index === signersdata . length - 1 ) {
1579
+ setUniqueId ( updateSigner [ updateSigner . length - 1 ] ?. Id || "" ) ;
1580
+ setIsSelectId ( index - 1 || 0 ) ;
1581
+ setBlockColor ( color [ index - 1 || 0 ] ) ;
1582
+ } else {
1583
+ setUniqueId ( updateSigner [ index ] ?. Id || "" ) ;
1584
+ setIsSelectId ( index ) ;
1585
+ setBlockColor ( color [ index ] ) ;
1586
+ }
1587
+
1588
+ setSignerPos ( updatePlaceholderUser ) ;
1589
+ setIsMailSend ( false ) ;
1590
+ } ;
1549
1591
return (
1550
1592
< >
1551
1593
< Title title = { state ?. title ? state . title : "New Document" } />
@@ -1712,9 +1754,7 @@ function PlaceHolderSign() {
1712
1754
"cursor-pointer underline text-blue-700 focus:outline-none"
1713
1755
}
1714
1756
onClick = { ( ) => {
1715
- isSubscribe ||
1716
- ( ! isEnableSubscription &&
1717
- setIsCustomize ( ! isCustomize ) ) ;
1757
+ setIsCustomize ( ! isCustomize ) ;
1718
1758
} }
1719
1759
>
1720
1760
Cutomize Email
@@ -1982,6 +2022,8 @@ function PlaceHolderSign() {
1982
2022
setSignersData = { setSignersData }
1983
2023
blockColor = { blockColor }
1984
2024
setBlockColor = { setBlockColor }
2025
+ setIsAddSigner = { setIsAddSigner }
2026
+ handleDeleteUser = { handleDeleteUser }
1985
2027
/>
1986
2028
</ div >
1987
2029
) : (
@@ -2007,6 +2049,9 @@ function PlaceHolderSign() {
2007
2049
blockColor = { blockColor }
2008
2050
setBlockColor = { setBlockColor }
2009
2051
isMailSend = { isMailSend }
2052
+ setIsAddSigner = { setIsAddSigner }
2053
+ handleDeleteUser = { handleDeleteUser }
2054
+ roleName = { roleName }
2010
2055
// handleAddSigner={handleAddSigner}
2011
2056
/>
2012
2057
< div data-tut = "reactourSecond" >
@@ -2033,35 +2078,6 @@ function PlaceHolderSign() {
2033
2078
) }
2034
2079
</ DndProvider >
2035
2080
< div >
2036
- { /* <ModalUi
2037
- headerColor={"#dc3545"}
2038
- isOpen={signerExistModal}
2039
- title={"Users required"}
2040
- handleClose={() => {
2041
- setSignerExistModal(false);
2042
- }}
2043
- >
2044
- <div style={{ height: "100%", padding: 20 }}>
2045
- <p>Please assign signers to all placeholders</p>
2046
-
2047
- <div
2048
- style={{
2049
- height: "1px",
2050
- backgroundColor: "#9f9f9f",
2051
- width: "100%",
2052
- marginTop: "15px",
2053
- marginBottom: "15px"
2054
- }}
2055
- ></div>
2056
- <button
2057
- onClick={() => setSignerExistModal(false)}
2058
- type="button"
2059
- className="finishBtn cancelBtn"
2060
- >
2061
- Close
2062
- </button>
2063
- </div>
2064
- </ModalUi> */ }
2065
2081
< ModalUi
2066
2082
headerColor = { "#dc3545" }
2067
2083
isOpen = { isAlreadyPlace . status }
@@ -2095,6 +2111,13 @@ function PlaceHolderSign() {
2095
2111
isAddUser = { isAddUser }
2096
2112
uniqueId = { uniqueId }
2097
2113
closePopup = { closePopup }
2114
+ signersData = { signersdata }
2115
+ />
2116
+ < LinkUserModal
2117
+ handleAddUser = { handleAddNewRecipients }
2118
+ isAddSigner = { isAddSigner }
2119
+ closePopup = { closePopup }
2120
+ signersData = { signersdata }
2098
2121
/>
2099
2122
< WidgetNameModal
2100
2123
widgetName = { widgetName }
0 commit comments