Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Agiliza
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
evologica
Agiliza
Commits
d9214454
Commit
d9214454
authored
Oct 07, 2021
by
Rafael
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrige bugs com obter referências e veículos.
parent
c5e9603f
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
116 additions
and
70 deletions
+116
-70
config.json
cli/web/cliente/public/config.json
+2
-2
customerData.tsx
...cliente/src/api/mappers/api/proposalData/customerData.tsx
+6
-1
customerData.ts
...iente/src/api/mappers/domain/proposalData/customerData.ts
+2
-1
customerData.ts
...web/cliente/src/api/useCases/proposalData/customerData.ts
+3
-3
slice.ts
...nte/src/redux/entities/proposalData/customerData/slice.ts
+19
-8
slice.ts
...cliente/src/redux/entities/proposalData/proposal/slice.ts
+0
-1
selectors.ts
...src/redux/useCases/proposalData/customerData/selectors.ts
+2
-0
slice.ts
...nte/src/redux/useCases/proposalData/customerData/slice.ts
+19
-9
state.ts
...s/ProposalData/pages/CustomerData/Identification/state.ts
+10
-22
connect.ts
...s/ProposalData/pages/CustomerData/PersonalData/connect.ts
+2
-1
References.tsx
...ProposalData/pages/CustomerData/References/References.tsx
+13
-6
connect.ts
...ews/ProposalData/pages/CustomerData/References/connect.ts
+1
-1
Vehicles.tsx
...ews/ProposalData/pages/CustomerData/Vehicles/Vehicles.tsx
+14
-2
conect.ts
.../views/ProposalData/pages/CustomerData/Vehicles/conect.ts
+1
-1
ProposalData.tsx
...web/cliente/src/views/ProposalData/pages/ProposalData.tsx
+18
-11
connect.ts
cli/web/cliente/src/views/ProposalData/pages/connect.ts
+3
-0
shared-styles.ts
cli/web/cliente/src/views/shared-styles.ts
+1
-1
No files found.
cli/web/cliente/public/config.json
View file @
d9214454
{
"API_URL"
:
"http://192.168.0.
65
:8080"
,
"API_URL"
:
"http://192.168.0.
34
:8080"
,
"APP_NAME_BROKER"
:
"@agiliza-dev/agente"
,
"APP_NAME_CUSTOMER"
:
"@agiliza-dev/cliente"
,
"SESSION_KEY_BROKER"
:
"@agiliza-dev/agente"
,
"SESSION_KEY_CUSTOMER"
:
"@agiliza-dev/cliente"
}
\ No newline at end of file
}
cli/web/cliente/src/api/mappers/api/proposalData/customerData.tsx
View file @
d9214454
...
...
@@ -68,7 +68,12 @@ export class AddInvolvedPersonIdentification implements ApiAdapter<InvolvedPerso
nome
:
domain
.
name
,
cpfcnpj
:
extractNumbers
(
domain
.
cpfcnpj
),
sexo
:
domain
.
gender
,
tipo
:
domain
.
type
===
INVOLVED_PERSON_NAMES
[
'2'
]
?
INVOLVED_PERSON_TYPES
[
'CUSTOMER'
]
:
''
,
tipo
:
domain
.
type
===
INVOLVED_PERSON_NAMES
[
'2'
]
?
INVOLVED_PERSON_TYPES
[
'CUSTOMER'
]
:
domain
.
type
===
INVOLVED_PERSON_TYPES
[
'CUSTOMER'
]
?
domain
.
type
:
''
,
contaBanestes
:
domain
.
account
?
this
.
mapBanestesAccountToApi
(
domain
.
account
)
:
undefined
,
dadosTipo
:
domain
.
dataType
?
this
.
mapDateTypeToApi
(
domain
.
dataType
)
:
undefined
,
})
...
...
cli/web/cliente/src/api/mappers/domain/proposalData/customerData.ts
View file @
d9214454
...
...
@@ -11,6 +11,7 @@ import {
Vehicle
,
Workplace
}
from
'@agiliza/api/domain'
import
{
INVOLVED_PERSON_NAMES
,
INVOLVED_PERSON_TYPES
}
from
'@agiliza/constants/involvedPeople'
import
{
EnderecoApiModel
,
ProjetoPessoaEnvolvidaConjugeApiModel
,
...
...
@@ -61,7 +62,7 @@ export class CDIdentificationAdapter implements DomainAdapter<ProjetoPessoaEnvol
name
:
pessoa
.
nome
,
cpfcnpj
:
pessoa
.
cpfcnpj
,
gender
:
pessoa
.
sexo
,
type
:
pessoa
.
tipo
,
type
:
pessoa
.
tipo
===
INVOLVED_PERSON_NAMES
[
INVOLVED_PERSON_TYPES
.
CUSTOMER
]
?
INVOLVED_PERSON_TYPES
.
CUSTOMER
:
''
,
account
:
pessoa
.
contaBanestes
?
this
.
mapContaBanestesToDomain
(
pessoa
.
contaBanestes
)
:
undefined
,
dataType
:
pessoa
.
dadosTipo
?
this
.
mapDadosTipoToDomain
(
pessoa
.
dadosTipo
)
:
undefined
,
})
...
...
cli/web/cliente/src/api/useCases/proposalData/customerData.ts
View file @
d9214454
...
...
@@ -17,7 +17,7 @@ import {
UpdateCDVehicle
}
from
'@agiliza/api/domain'
import
{
DadosCliente
}
from
'@agiliza/api/mappers/domain/proposalData'
import
{
INVOLVED_PERSON_
NAMES
,
INVOLVED_PERSON_
TYPES
}
from
'@agiliza/constants/involvedPeople'
import
{
INVOLVED_PERSON_TYPES
}
from
'@agiliza/constants/involvedPeople'
import
{
ClienteApi
,
Configuration
}
from
'@microcredito/client'
import
{
ErrorMappers
,
ProposalDataApiMappers
,
ProposalDataMappers
}
from
'../../mappers'
...
...
@@ -106,8 +106,7 @@ export class PDCustomerDataRepositoryImpl implements PDCustomerDataDataRepositor
try
{
const
pessoasEnvolvidas
=
await
this
.
api
.
obterPessoasEnvolvidas
({
projetoId
:
input
.
projectId
})
const
involvedPeople
=
pessoasEnvolvidas
.
map
(
this
.
cdIdentificationMapper
.
mapApiModelToDomain
)
console
.
log
(
involvedPeople
)
const
identification
=
involvedPeople
.
find
((
pE
)
=>
pE
.
type
===
INVOLVED_PERSON_NAMES
[
INVOLVED_PERSON_TYPES
[
'CUSTOMER'
]])
const
identification
=
involvedPeople
.
find
((
pE
)
=>
pE
.
type
===
INVOLVED_PERSON_TYPES
[
'CUSTOMER'
])
return
identification
}
catch
(
e
)
{
const
result
=
await
this
.
errorAdapter
.
mapApiModelToDomain
(
e
)
...
...
@@ -141,6 +140,7 @@ export class PDCustomerDataRepositoryImpl implements PDCustomerDataDataRepositor
public
updateIdentification
=
async
(
input
:
UpdateCDIdentification
[
'Input'
]):
Promise
<
UpdateCDIdentification
[
'Output'
]
>
=>
{
try
{
console
.
log
(
this
.
cdUpdateIdentificationApiMapper
.
mapDomainToApiModel
(
input
))
const
response
=
await
this
.
api
.
atualizarIdentificacaoPessoaEnvolvida
(
this
.
cdUpdateIdentificationApiMapper
.
mapDomainToApiModel
(
input
))
return
this
.
cdIdentificationMapper
.
mapApiModelToDomain
(
response
)
}
catch
(
e
)
{
...
...
cli/web/cliente/src/redux/entities/proposalData/customerData/slice.ts
View file @
d9214454
...
...
@@ -50,6 +50,17 @@ const updateVehiclesReferences = (state: Store, pds: Vehicle[] = [], rfs: Refere
state
.
references
.
byId
=
references
state
.
references
.
allIds
=
keys
(
references
)
}
const
updateReferences
=
(
state
:
Store
,
rfs
:
Reference
[])
=>
{
const
{
references
}
=
normalizeCustomerData
([],
rfs
)
state
.
references
.
byId
=
references
state
.
references
.
allIds
=
keys
(
references
)
}
const
updateVehicles
=
(
state
:
Store
,
vhs
:
Vehicle
[])
=>
{
const
{
vehicles
}
=
normalizeCustomerData
(
vhs
,
[])
state
.
vehicles
.
byId
=
vehicles
state
.
vehicles
.
allIds
=
keys
(
vehicles
)
}
export
default
createSlice
({
name
:
`
${
PROPOSAL_DATA_PREFIX
}
/customerData`
,
...
...
@@ -69,27 +80,27 @@ export default createSlice({
},
[
customerDataTypes
.
getVehicles
.
fulfilled
]:
(
state
,
action
:
PayloadAction
<
GetCDVehicles
[
'Output'
]
>
)
=>
{
const
{
payload
}
=
action
updateVehicles
References
(
state
,
payload
)
updateVehicles
(
state
,
payload
)
},
[
customerDataTypes
.
update
Referenc
e
.
fulfilled
]:
(
state
,
action
:
PayloadAction
<
UpdateCDVehicle
[
'Output'
]
>
)
=>
{
[
customerDataTypes
.
update
Vehicl
e
.
fulfilled
]:
(
state
,
action
:
PayloadAction
<
UpdateCDVehicle
[
'Output'
]
>
)
=>
{
const
{
payload
}
=
action
updateVehicles
References
(
state
,
payload
)
updateVehicles
(
state
,
payload
)
},
[
customerDataTypes
.
add
Referenc
e
.
fulfilled
]:
(
state
,
action
:
PayloadAction
<
AddCDVehicle
[
'Output'
]
>
)
=>
{
[
customerDataTypes
.
add
Vehicl
e
.
fulfilled
]:
(
state
,
action
:
PayloadAction
<
AddCDVehicle
[
'Output'
]
>
)
=>
{
const
{
payload
}
=
action
updateVehicles
References
(
state
,
payload
)
updateVehicles
(
state
,
payload
)
},
[
customerDataTypes
.
getReferences
.
fulfilled
]:
(
state
,
action
:
PayloadAction
<
GetCDReferences
[
'Output'
]
>
)
=>
{
const
{
payload
}
=
action
update
VehiclesReferences
(
state
,
[]
,
payload
)
update
References
(
state
,
payload
)
},
[
customerDataTypes
.
updateReference
.
fulfilled
]:
(
state
,
action
:
PayloadAction
<
UpdateCDReference
[
'Output'
]
>
)
=>
{
const
{
payload
}
=
action
update
VehiclesReferences
(
state
,
[]
,
payload
)
update
References
(
state
,
payload
)
},
[
customerDataTypes
.
addReference
.
fulfilled
]:
(
state
,
action
:
PayloadAction
<
AddCDReference
[
'Output'
]
>
)
=>
{
const
{
payload
}
=
action
update
VehiclesReferences
(
state
,
[]
,
payload
)
update
References
(
state
,
payload
)
},
},
})
cli/web/cliente/src/redux/entities/proposalData/proposal/slice.ts
View file @
d9214454
...
...
@@ -38,7 +38,6 @@ export default createSlice({
state
.
personId
=
action
.
payload
.
id
},
[
customerDataTypes
.
getIdentification
.
fulfilled
]:
(
state
,
action
:
PayloadAction
<
Identification
>
)
=>
{
console
.
log
(
action
.
payload
)
state
.
personId
=
action
.
payload
?.
id
},
},
...
...
cli/web/cliente/src/redux/useCases/proposalData/customerData/selectors.ts
View file @
d9214454
...
...
@@ -2,3 +2,5 @@ import { State } from './slice'
export
const
isFetching
=
(
state
:
State
)
=>
state
.
fetching
export
const
isGettingCustomerData
=
(
state
:
State
)
=>
state
.
gettingCustomerData
export
const
isGettingReferences
=
(
state
:
State
)
=>
state
.
gettingReferences
export
const
isGettingVehicles
=
(
state
:
State
)
=>
state
.
gettingVehicles
cli/web/cliente/src/redux/useCases/proposalData/customerData/slice.ts
View file @
d9214454
...
...
@@ -7,6 +7,7 @@ import {
GetCDReferences
,
GetCDVehicles
,
GetCustomerData
,
InvolvedPerson
,
UpdateCDAddress
,
UpdateCDHome
,
UpdateCDIdentification
,
...
...
@@ -33,11 +34,15 @@ const prefix = 'useCases/customerData'
export
interface
State
{
fetching
:
boolean
gettingCustomerData
:
boolean
gettingReferences
:
boolean
gettingVehicles
:
boolean
}
export
const
initialState
:
State
=
{
fetching
:
false
,
gettingCustomerData
:
false
,
gettingReferences
:
false
,
gettingVehicles
:
false
,
}
export
const
actions
=
{
...
...
@@ -181,16 +186,19 @@ export const actions = {
return
thunkApi
.
rejectWithValue
(
e
)
}
}),
getCustomerData
:
createAsyncThunk
(
`
${
prefix
}
/getCustomerData`
,
async
(
input
:
WithSuccess
<
GetCustomerData
[
'Input'
]
>
,
thunkApi
)
=>
{
const
useCase
=
PDCustomerDataRepositoryImplFactory
.
create
(
appPlatform
)
try
{
const
response
=
await
useCase
.
getCustomerData
(
input
)
input
.
onSuccess
&&
input
.
onSuccess
()
return
response
}
catch
(
e
)
{
return
thunkApi
.
rejectWithValue
(
e
)
getCustomerData
:
createAsyncThunk
(
`
${
prefix
}
/getCustomerData`
,
async
(
input
:
WithSuccess
<
GetCustomerData
[
'Input'
],
Omit
<
InvolvedPerson
,
'id'
>>
,
thunkApi
)
=>
{
const
useCase
=
PDCustomerDataRepositoryImplFactory
.
create
(
appPlatform
)
try
{
const
response
=
await
useCase
.
getCustomerData
(
input
)
input
.
onSuccess
&&
input
.
onSuccess
(
response
)
return
response
}
catch
(
e
)
{
return
thunkApi
.
rejectWithValue
(
e
)
}
}
}
),
),
getIdentification
:
createAsyncThunk
(
`
${
prefix
}
/getIdentification`
,
async
(
input
:
WithSuccess
<
GetCDIdentification
[
'Input'
],
string
>
,
thunkApi
)
=>
{
const
useCase
=
PDCustomerDataRepositoryImplFactory
.
create
(
appPlatform
)
try
{
...
...
@@ -211,6 +219,8 @@ const login = createSlice({
extraReducers
:
{
...
values
(
types
).
reduce
((
reducers
,
type
)
=>
({
...
reducers
,
...
createAsyncReducers
(
type
)
}),
{}),
...
createAsyncReducers
(
types
.
getCustomerData
,
'gettingCustomerData'
),
...
createAsyncReducers
(
types
.
getReferences
,
'gettingReferences'
),
...
createAsyncReducers
(
types
.
getVehicles
,
'gettingVehicles'
),
},
})
...
...
cli/web/cliente/src/views/ProposalData/pages/CustomerData/Identification/state.ts
View file @
d9214454
...
...
@@ -7,25 +7,13 @@ export interface CDIdentificationState extends ExtendedState {
hasAccount
:
boolean
}
export
const
initialState
:
CDIdentificationState
=
process
.
env
.
NODE_ENV
===
'development'
?
{
id
:
''
,
name
:
'TEST'
,
cpfcnpj
:
'80.162.745/0001-96'
,
gender
:
'1'
,
type
:
INVOLVED_PERSON_TYPES
[
'CUSTOMER'
],
hasAccount
:
false
,
account
:
{
agencyNumber
:
''
,
number
:
''
,
cardPicture
:
''
},
dataType
:
{
doesWithdrawal
:
false
,
framework
:
'1'
},
}
:
{
id
:
''
,
name
:
''
,
cpfcnpj
:
''
,
gender
:
''
,
type
:
INVOLVED_PERSON_TYPES
[
'CUSTOMER'
],
hasAccount
:
false
,
account
:
{
agencyNumber
:
''
,
number
:
''
,
cardPicture
:
''
},
dataType
:
{
doesWithdrawal
:
false
,
framework
:
''
},
}
export
const
initialState
:
CDIdentificationState
=
{
id
:
''
,
name
:
''
,
cpfcnpj
:
''
,
gender
:
''
,
type
:
INVOLVED_PERSON_TYPES
[
'CUSTOMER'
],
hasAccount
:
false
,
account
:
{
agencyNumber
:
''
,
number
:
''
,
cardPicture
:
''
},
dataType
:
{
doesWithdrawal
:
false
,
framework
:
''
},
}
cli/web/cliente/src/views/ProposalData/pages/CustomerData/PersonalData/connect.ts
View file @
d9214454
...
...
@@ -11,7 +11,7 @@ export interface ConnectedProps {
}
type
StateProps
=
Pick
<
ConnectedProps
,
'fetching'
|
'context'
>
// type DispatchProps = Pick<ConnectedProps, '
updateIndentification
'>
// type DispatchProps = Pick<ConnectedProps, '
getReferences
'>
const
mapStateToProps
=
(
state
:
StoreState
):
StateProps
=>
({
fetching
:
ucProposalDataContext
.
selectors
.
isFetching
(
state
.
ui
.
login
),
...
...
@@ -21,6 +21,7 @@ const mapStateToProps = (state: StoreState): StateProps => ({
// const mapDispatchToProps = (dispatch: Dispatch): DispatchProps =>
// bindActionCreators(
// {
// getReferences: ucProposalData.actions.getReferences,
// },
// dispatch
// )
...
...
cli/web/cliente/src/views/ProposalData/pages/CustomerData/References/References.tsx
View file @
d9214454
...
...
@@ -2,7 +2,14 @@ import React, { useEffect, useState } from 'react'
import
{
Reference
}
from
'@agiliza/api/domain/proposalData/involvedPeople/reference'
import
{
ActionType
}
from
'@agiliza/utils/hooks/state'
import
{
Avatar
,
List
,
ListItem
,
ListItemAvatar
,
ListItemText
}
from
'@material-ui/core'
import
{
Avatar
,
CircularProgress
,
List
,
ListItem
,
ListItemAvatar
,
ListItemText
}
from
'@material-ui/core'
import
{
withStyles
,
WithStyles
}
from
'@material-ui/core/styles'
import
{
Add
as
AddIcon
,
EmojiEmotions
as
EmojiEmotionsIcon
}
from
'@material-ui/icons'
...
...
@@ -23,14 +30,12 @@ interface Props extends ExtendedProps {
const
References
=
(
props
:
Props
)
=>
{
const
{
classes
,
fetching
,
context
,
state
,
actions
,
references
,
projectId
,
personId
}
=
props
console
.
log
(
personId
)
const
[
selectedReference
,
setSelectedReference
]
=
useState
<
Reference
|
undefined
>
()
const
[
open
,
setOpen
]
=
useState
(
false
)
useEffect
(()
=>
{
props
.
getReferences
({
p
ersonId
,
project
Id
})
props
.
getReferences
({
p
rojectId
,
person
Id
})
},
[])
const
handleClickListItem
=
(
reference
:
Reference
)
=>
()
=>
{
...
...
@@ -49,8 +54,8 @@ const References = (props: Props) => {
const
handleSave
=
(
reference
:
Reference
,
add
:
boolean
)
=>
()
=>
{
const
onSuccess
=
()
=>
{
setOpen
(
false
)
setSelectedReference
(
reference
)
//
setOpen(false)
//
setSelectedReference(reference)
}
if
(
add
)
props
.
addReference
({
...
...
@@ -69,6 +74,8 @@ const References = (props: Props) => {
})
}
if
(
fetching
)
return
<
CircularProgress
className=
{
classes
.
circularProgress
}
/>
return
(
<>
<
div
className=
{
classes
.
contentContainer
}
>
...
...
cli/web/cliente/src/views/ProposalData/pages/CustomerData/References/connect.ts
View file @
d9214454
...
...
@@ -20,7 +20,7 @@ type StateProps = Pick<ConnectedProps, 'fetching' | 'context' | 'references'>
type
DispatchProps
=
Pick
<
ConnectedProps
,
'getReferences'
|
'addReference'
|
'updateReference'
>
const
mapStateToProps
=
(
state
:
StoreState
):
StateProps
=>
({
fetching
:
ucProposalData
.
selectors
.
is
Fetching
(
state
.
useCases
.
proposalData
.
customerData
),
fetching
:
ucProposalData
.
selectors
.
is
GettingReferences
(
state
.
useCases
.
proposalData
.
customerData
),
context
:
entProposalDataContext
.
selectors
.
getContext
(
state
.
entities
.
proposalData
.
context
),
references
:
entCustomerData
.
selectors
.
getReferences
(
state
.
entities
.
proposalData
.
customerData
),
})
...
...
cli/web/cliente/src/views/ProposalData/pages/CustomerData/Vehicles/Vehicles.tsx
View file @
d9214454
import
React
,
{
useState
}
from
'react'
import
React
,
{
use
Effect
,
use
State
}
from
'react'
import
{
Vehicle
}
from
'@agiliza/api/domain'
import
{
ActionType
}
from
'@agiliza/utils/hooks/state'
import
{
Avatar
,
List
,
ListItem
,
ListItemAvatar
,
ListItemText
}
from
'@material-ui/core'
import
{
Avatar
,
CircularProgress
,
List
,
ListItem
,
ListItemAvatar
,
ListItemText
}
from
'@material-ui/core'
import
{
withStyles
,
WithStyles
}
from
'@material-ui/core/styles'
import
{
Add
as
AddIcon
,
DriveEta
as
DriveEtaIcon
}
from
'@material-ui/icons'
...
...
@@ -26,6 +33,9 @@ const Vehicles = (props: Props) => {
const
[
selectedVehicle
,
setSelectedVehicle
]
=
useState
<
Vehicle
|
undefined
>
()
const
[
open
,
setOpen
]
=
useState
(
false
)
useEffect
(()
=>
{
props
.
getVehicles
({
personId
,
projectId
})
},
[])
const
handleClickListItem
=
(
vehicle
:
Vehicle
)
=>
()
=>
{
setOpen
(
true
)
...
...
@@ -64,6 +74,8 @@ const Vehicles = (props: Props) => {
})
}
if
(
fetching
)
return
<
CircularProgress
className=
{
classes
.
circularProgress
}
/>
return
(
<>
<
div
className=
{
classes
.
contentContainer
}
>
...
...
cli/web/cliente/src/views/ProposalData/pages/CustomerData/Vehicles/conect.ts
View file @
d9214454
...
...
@@ -20,7 +20,7 @@ type StateProps = Pick<ConnectedProps, 'fetching' | 'context' | 'vehicles'>
type
DispatchProps
=
Pick
<
ConnectedProps
,
'getVehicles'
|
'addVehicle'
|
'updateVehicle'
>
const
mapStateToProps
=
(
state
:
StoreState
):
StateProps
=>
({
fetching
:
ucProposalData
.
selectors
.
is
Fetching
(
state
.
useCases
.
proposalData
.
customerData
),
fetching
:
ucProposalData
.
selectors
.
is
GettingVehicles
(
state
.
useCases
.
proposalData
.
customerData
),
context
:
entProposalDataContext
.
selectors
.
getContext
(
state
.
entities
.
proposalData
.
context
),
vehicles
:
entCustomerData
.
selectors
.
getVehicles
(
state
.
entities
.
proposalData
.
customerData
),
})
...
...
cli/web/cliente/src/views/ProposalData/pages/ProposalData.tsx
View file @
d9214454
...
...
@@ -88,7 +88,12 @@ const ProposalData = (props: Props) => {
props
.
getCDIdentification
({
projectId
:
proposalId
,
onSuccess
:
(
pID
)
=>
{
if
(
pID
)
props
.
getCustomerData
({
projectId
:
proposalId
,
personId
:
pID
})
if
(
pID
)
props
.
getCustomerData
({
projectId
:
proposalId
,
personId
:
pID
,
onSuccess
:
(
cD
)
=>
{},
})
},
})
},
[])
...
...
@@ -137,20 +142,18 @@ const ProposalData = (props: Props) => {
else
return
idn
},
{})
)
},
[
customerData
])
useEffect
(()
=>
{
const
{
identification
,
address
,
stockSalesCosts
}
=
businessData
if
(
identification
)
const
{
identification
:
bdIdentification
,
address
:
bdAddress
,
stockSalesCosts
}
=
businessData
if
(
bdIdentification
)
bdIdentificationState
.
actions
.
update
(
entries
(
i
dentification
).
reduce
((
idn
,
[
k
,
v
])
=>
{
entries
(
bdI
dentification
).
reduce
((
idn
,
[
k
,
v
])
=>
{
if
(
v
!==
undefined
)
return
{
...
idn
,
[
k
]:
v
}
else
return
idn
},
{})
)
if
(
a
ddress
)
if
(
bdA
ddress
)
bdAddressState
.
actions
.
update
(
entries
(
a
ddress
).
reduce
((
idn
,
[
k
,
v
])
=>
{
entries
(
bdA
ddress
).
reduce
((
idn
,
[
k
,
v
])
=>
{
if
(
v
!==
undefined
)
return
{
...
idn
,
[
k
]:
v
}
else
return
idn
},
{})
...
...
@@ -162,7 +165,7 @@ const ProposalData = (props: Props) => {
else
return
idn
},
{})
)
},
[
businessData
])
},
[
customerData
,
businessData
])
const
customerDataItems
=
useMemo
(
()
=>
[
...
...
@@ -171,7 +174,11 @@ const ProposalData = (props: Props) => {
icon
:
<
AccountBoxIcon
/>,
component
:
<
Identification
state=
{
cdIdentification
.
state
}
actions=
{
cdIdentification
.
actions
}
/>,
},
{
label
:
'Dados Pessoais'
,
icon
:
<
ListIcon
/>,
component
:
<
PersonalData
state=
{
cdPersonalData
.
state
}
actions=
{
cdPersonalData
.
actions
}
/>
},
{
label
:
'Dados Pessoais'
,
icon
:
<
ListIcon
/>,
component
:
<
PersonalData
state=
{
cdPersonalData
.
state
}
actions=
{
cdPersonalData
.
actions
}
/>,
},
{
label
:
'Endereço'
,
icon
:
<
ContactMailIcon
/>,
component
:
<
Address
state=
{
cdAddress
.
state
}
actions=
{
cdAddress
.
actions
}
/>
},
{
label
:
'Fonte de renda'
,
icon
:
<
LocalAtmIcon
/>,
component
:
<
SourceIncome
state=
{
cdSourceIncome
.
state
}
actions=
{
cdSourceIncome
.
actions
}
/>
},
{
label
:
'Cônjuge - Ident.'
,
icon
:
<
ForumIcon
/>,
component
:
<
SpouseData
state=
{
cdSpouseData
.
state
}
actions=
{
cdSpouseData
.
actions
}
/>
},
...
...
@@ -192,7 +199,7 @@ const ProposalData = (props: Props) => {
component
:
<
Vehicles
state=
{
cdVehicleState
.
state
}
actions=
{
cdVehicleState
.
actions
}
projectId=
{
proposalId
}
personId=
{
personId
}
/>,
},
],
[
cdIdentification
,
cdPersonalData
,
cdAddress
,
cdSpouseData
,
cdReference
,
cdHomeState
,
cdVehicleState
]
[
cdIdentification
,
cdPersonalData
,
cdAddress
,
cdS
ourceIncome
,
cdS
pouseData
,
cdReference
,
cdHomeState
,
cdVehicleState
]
)
const
businessDataItems
=
useMemo
(
...
...
cli/web/cliente/src/views/ProposalData/pages/connect.ts
View file @
d9214454
...
...
@@ -36,6 +36,7 @@ export interface ConnectedProps {
getCDIdentification
:
typeof
ucProposalDataCD
.
actions
.
getIdentification
getCustomerData
:
typeof
ucProposalDataCD
.
actions
.
getCustomerData
getBusinessData
:
typeof
ucProposalDataBD
.
actions
.
getBusinessData
getReferences
:
typeof
ucProposalDataCD
.
actions
.
getReferences
}
type
StateProps
=
Pick
<
ConnectedProps
,
'fetching'
|
'proposalId'
|
'personId'
|
'businessData'
|
'customerData'
>
...
...
@@ -58,6 +59,7 @@ type DispatchProps = Pick<
|
'getCDIdentification'
|
'getCustomerData'
|
'getBusinessData'
|
'getReferences'
>
const
isFetching
=
createSelector
(
...
...
@@ -99,6 +101,7 @@ const mapDispatchToProps = (dispatch: Dispatch): DispatchProps =>
getBusinessData
:
ucProposalDataBD
.
actions
.
getBusinessData
,
getCustomerData
:
ucProposalDataCD
.
actions
.
getCustomerData
,
getCDIdentification
:
ucProposalDataCD
.
actions
.
getIdentification
,
getReferences
:
ucProposalDataCD
.
actions
.
getReferences
,
},
dispatch
)
...
...
cli/web/cliente/src/views/shared-styles.ts
View file @
d9214454
...
...
@@ -11,7 +11,7 @@ export default (theme: Theme) => {
padding
:
theme
.
spacing
(
2
),
display
:
'flex'
,
flexDirection
:
'column'
,
overflowY
:
'
hidden
'
,
overflowY
:
'
auto
'
,
},
title
:
{
flexGrow
:
1
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment