Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
application-administarator-service
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
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Рогов Артем Владимирович
application-administarator-service
Commits
9ce10768
Commit
9ce10768
authored
Nov 21, 2023
by
konstantin-smirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DMVP-1080 - Изменить запрос на получение карточки профиля по uuid в административном сервисе
parent
5682d794
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
9 deletions
+21
-9
ProfilesEdition.jsx
src/pages/profilesEdition/ProfilesEdition.jsx
+12
-2
baseData.jsx
src/pages/profilesEdition/components/blocks/baseData.jsx
+8
-6
specialityData.jsx
...ages/profilesEdition/components/blocks/specialityData.jsx
+1
-1
No files found.
src/pages/profilesEdition/ProfilesEdition.jsx
View file @
9ce10768
...
...
@@ -10,6 +10,8 @@ import {
Input
as
TextField
}
from
'@chakra-ui/react'
;
import
{
useGetProfileByIdQuery
}
from
'_store'
;
import
{
BaseData
,
SpecialityData
,
AddressData
}
from
'./components'
;
import
'./profilesEdition.scss'
;
import
{
}
from
"react-router-dom"
;
...
...
@@ -18,6 +20,7 @@ const ProfilesEdition = () => {
const
navigate
=
useNavigate
();
const
{
pathname
}
=
useLocation
();
const
profileId
=
pathname
.
split
(
'/'
).
pop
();
const
{
isLoading
,
isSuccess
,
data
:
profile
=
{}}
=
useGetProfileByIdQuery
(
profileId
);
return
(
<
div
className=
'settings-layout'
>
...
...
@@ -65,10 +68,17 @@ const ProfilesEdition = () => {
</
TabList
>
<
TabPanels
>
<
TabPanel
>
<
BaseData
id=
{
profileId
}
/>
<
BaseData
id=
{
profileId
}
isLoading=
{
isLoading
}
isSuccess=
{
isSuccess
}
profile=
{
profile
}
/>
</
TabPanel
>
<
TabPanel
>
<
SpecialityData
id=
{
profileId
}
/>
<
SpecialityData
id=
{
profileId
}
/>
</
TabPanel
>
<
TabPanel
>
<
AddressData
id=
{
profileId
}
/>
...
...
src/pages/profilesEdition/components/blocks/baseData.jsx
View file @
9ce10768
...
...
@@ -23,7 +23,6 @@ import {
}
from
'@chakra-ui/react'
;
import
{
useGetProfileByIdQuery
,
useUpdateProfileMutation
,
useFetchRolesQuery
,
useUpdateCredentialsMutation
...
...
@@ -33,6 +32,9 @@ import '../../profilesEdition.scss';
const
BaseData
=
({
id
,
isLoading
,
isSuccess
,
profile
})
=>
{
const
[
firstName
,
setFirstName
]
=
useState
();
const
[
lastName
,
setLastName
]
=
useState
();
...
...
@@ -42,12 +44,11 @@ const BaseData = ({
const
[
isActive
,
setIsActive
]
=
useState
(
false
);
const
[
isVerified
,
setIsVerified
]
=
useState
(
false
);
const
[
showPassword
,
setShowPassword
]
=
useState
(
false
);
const
[
isEmailError
,
setIsEmailError
]
=
useState
(
false
);
const
[
roles
,
setRoles
]
=
useState
([]);
const
[
error
,
setError
]
=
useState
(
false
);
const
[
isModalOpen
,
setIsModalOpen
]
=
useState
(
false
);
const
[
validError
,
setValidError
]
=
useState
(
false
);
const
{
isLoading
,
isSuccess
,
data
:
profile
=
{}}
=
useGetProfileByIdQuery
(
id
);
const
[
updateProfile
,
{
isLoading
:
isProfileUpdating
,
isSuccess
:
isProfileUpdated
}]
=
useUpdateProfileMutation
();
const
[
updatePassword
,
{
isLoading
:
isCredentialsUpdating
,
isSuccess
:
isCredentialsUpdated
}]
=
useUpdateCredentialsMutation
();
const
{
data
:
rolesList
=
[]
}
=
useFetchRolesQuery
();
...
...
@@ -58,10 +59,11 @@ const BaseData = ({
useEffect
(()
=>
{
if
(
profile
)
{
setEmail
(
profile
.
email
);
setFirstName
(
profile
.
fullName
);
setFirstName
(
profile
.
firstName
);
setLastName
(
profile
.
lastName
);
setIsVerified
(
profile
.
verified
);
setIsActive
(
profile
.
active
);
//
setRoles(profile?.roles || [])
setRoles
(
profile
?.
roles
||
[])
}
},
[
profile
,
isSuccess
])
...
...
@@ -335,7 +337,7 @@ const BaseData = ({
}
}
>
{
rolesList
.
map
(({
code
,
name
},
index
)
=>
(
rolesList
?
.
map
(({
code
,
name
},
index
)
=>
(
<
option
key=
{
index
}
value=
{
code
}
>
{
name
}
</
option
>
))
}
...
...
src/pages/profilesEdition/components/blocks/specialityData.jsx
View file @
9ce10768
...
...
@@ -38,7 +38,7 @@ import { LanguagesLoader } from './dictionaryLoaders/languages';
import
'../../profilesEdition.scss'
;
const
SpecialityData
=
({
id
=
null
,
id
=
null
})
=>
{
const
isLoading
=
false
;
const
[
file
,
setFile
]
=
useState
([]);
...
...
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