Skip to content

Commit 3fca2cd

Browse files
committed
feat: copperCRM company assigned in create person module
1 parent eb708f8 commit 3fca2cd

File tree

8 files changed

+211
-161
lines changed

8 files changed

+211
-161
lines changed

frontend-dev/src/components/AllIntegrations/CopperCRM/CopperCRM.jsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function CopperCRM({ formFields, setFlow, flow, allIntegURL }) {
6262
{ key: 'details', label: __('Description', 'bit-integrations'), required: false }
6363
]
6464

65-
const [coppercrmConf, setCopperCRMConf] = useState({
65+
const [copperCRMConf, setCopperCRMConf] = useState({
6666
name: 'CopperCRM',
6767
type: 'CopperCRM',
6868
api_key: '',
@@ -82,7 +82,7 @@ function CopperCRM({ formFields, setFlow, flow, allIntegURL }) {
8282
flow,
8383
setFlow,
8484
allIntegURL,
85-
coppercrmConf,
85+
copperCRMConf,
8686
navigate,
8787
'',
8888
'',
@@ -103,23 +103,23 @@ function CopperCRM({ formFields, setFlow, flow, allIntegURL }) {
103103
document.getElementById('btcd-settings-wrp').scrollTop = 0
104104
}, 300)
105105

106-
if (!checkMappedFields(coppercrmConf)) {
106+
if (!checkMappedFields(copperCRMConf)) {
107107
toast.error(__('Please map mandatory fields', 'bit-integrations'))
108108
return
109109
}
110110

111-
if (coppercrmConf.actionName === 'opportunity') {
112-
if (!coppercrmConf.selectedCRMPeople) {
111+
if (copperCRMConf.actionName === 'opportunity') {
112+
if (!copperCRMConf.selectedCRMPeople) {
113113
toast.error(__('Please select a people', 'bit-integrations'))
114114
return
115115
}
116-
if (!coppercrmConf.selectedCRMPipelines && coppercrmConf.actionName === 'opportunity') {
116+
if (!copperCRMConf.selectedCRMPipelines && copperCRMConf.actionName === 'opportunity') {
117117
toast.error(__('Please select a Pipeline', 'bit-integrations'))
118118
return
119119
}
120120
}
121121

122-
coppercrmConf.field_map.length > 0 && setStep(pageNo)
122+
copperCRMConf.field_map.length > 0 && setStep(pageNo)
123123
}
124124

125125
return (
@@ -131,7 +131,7 @@ function CopperCRM({ formFields, setFlow, flow, allIntegURL }) {
131131

132132
{/* STEP 1 */}
133133
<CopperCRMAuthorization
134-
coppercrmConf={coppercrmConf}
134+
copperCRMConf={copperCRMConf}
135135
setCopperCRMConf={setCopperCRMConf}
136136
step={step}
137137
setStep={setStep}
@@ -146,18 +146,18 @@ function CopperCRM({ formFields, setFlow, flow, allIntegURL }) {
146146
style={{ ...(step === 2 && { width: 900, height: 'auto', overflow: 'visible' }) }}>
147147
<CopperCRMIntegLayout
148148
formFields={formFields}
149-
handleInput={e => handleInput(e, coppercrmConf, setCopperCRMConf, setLoading, setSnackbar)}
150-
coppercrmConf={coppercrmConf}
149+
handleInput={e => handleInput(e, copperCRMConf, setCopperCRMConf, setLoading, setSnackbar)}
150+
copperCRMConf={copperCRMConf}
151151
setCopperCRMConf={setCopperCRMConf}
152152
loading={loading}
153153
setLoading={setLoading}
154154
setSnackbar={setSnackbar}
155155
/>
156156

157-
{coppercrmConf?.actionName && (
157+
{copperCRMConf?.actionName && (
158158
<button
159159
onClick={() => nextPage(3)}
160-
disabled={!checkMappedFields(coppercrmConf)}
160+
disabled={!checkMappedFields(copperCRMConf)}
161161
className="btn f-right btcd-btn-lg purple sh-sm flx"
162162
type="button">
163163
{__('Next', 'bit-integrations')} &nbsp;
@@ -167,12 +167,12 @@ function CopperCRM({ formFields, setFlow, flow, allIntegURL }) {
167167
</div>
168168

169169
{/* STEP 3 */}
170-
{coppercrmConf?.actionName && (
170+
{copperCRMConf?.actionName && (
171171
<IntegrationStepThree
172172
step={step}
173173
saveConfig={() => saveConfig()}
174174
isLoading={isLoading}
175-
dataConf={coppercrmConf}
175+
dataConf={copperCRMConf}
176176
setDataConf={setCopperCRMConf}
177177
formFields={formFields}
178178
/>

0 commit comments

Comments
 (0)