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
015b4c86
Unverified
Commit
015b4c86
authored
Nov 15, 2023
by
ksmirnov
Committed by
GitHub
Nov 15, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4 from AyaDigital/hotfix/DMVP-1057
DMVP-1057 - Bug.-Dictionary-selectors-fix
parents
811e7621
c62a070e
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
51 additions
and
47 deletions
+51
-47
App.test.js
src/App.test.js
+0
-1
index.jsx
src/_components/inputs/InFiniteLoader/index.jsx
+18
-22
schedule.api.js
src/_store/api/schedule.api.js
+1
-1
states.api.js
src/_store/api/states.api.js
+1
-1
index.jsx
src/pages/clinicPage/index.jsx
+1
-2
degrees.jsx
...esEdition/components/blocks/dictionaryLoaders/degrees.jsx
+5
-3
insurances.jsx
...dition/components/blocks/dictionaryLoaders/insurances.jsx
+5
-3
languages.jsx
...Edition/components/blocks/dictionaryLoaders/languages.jsx
+5
-3
specialities.jsx
...tion/components/blocks/dictionaryLoaders/specialities.jsx
+13
-9
specialityData.jsx
...ages/profilesEdition/components/blocks/specialityData.jsx
+2
-2
No files found.
src/App.test.js
View file @
015b4c86
...
...
@@ -16,5 +16,4 @@ test('renders learn react link', () => {
<
/BrowserRouter
>
<
/Provider
>
);
// expect(linkElement).toBeInTheDocument();
});
src/_components/inputs/InFiniteLoader/index.jsx
View file @
015b4c86
...
...
@@ -15,14 +15,10 @@ const InfiniteLoaderWrapper =({
items
,
loadNextPage
,
wrapperClassName
,
getOptionProps
,
groupedOptions
,
listboxProps
,
fieldname
=
'name'
,
search
,
onChange
,
onFocus
,
onBlur
,
handleSelect
,
listOpen
})
=>
{
...
...
@@ -33,25 +29,25 @@ const InfiniteLoaderWrapper =({
const
isItemLoaded
=
(
index
)
=>
!
hasNextPage
||
index
<
items
.
length
;
const
Item
=
({
index
,
style
})
=>
{
console
.
log
(
'index'
,
index
);
if
(
!
isItemLoaded
(
index
))
{
return
<
li
style=
{
style
}
>
Loading...
</
li
>;
}
else
{
const
option
=
items
[
index
];
const
name
=
option
.
name
||
"no name"
;
if
(
!
isItemLoaded
(
index
))
{
return
<
li
style=
{
style
}
>
Loading...
</
li
>;
}
else
{
const
option
=
groupedOptions
[
index
];
const
name
=
option
.
name
||
"no name"
;
return
(
<
li
style=
{
style
}
onClick=
{
(
e
)
=>
{
handleSelect
(
Number
(
option
.
id
))
}
}
>
{
name
}
</
li
>
);
}
};
return
(
<
li
style=
{
style
}
onClick=
{
(
e
)
=>
{
handleSelect
(
Number
(
option
.
id
))
}
}
>
{
name
}
</
li
>
);
}
};
return
(
<
Popover
placement=
'bottom-start'
isOpen=
{
listOpen
}
>
...
...
src/_store/api/schedule.api.js
View file @
015b4c86
...
...
@@ -6,7 +6,7 @@ const SCHEDULES = '/api/schedules'
const
ADMIN
=
'/admin'
export
const
schedulesApi
=
createApi
({
reducerPath
:
's
tat
esApi'
,
reducerPath
:
's
chedul
esApi'
,
baseQuery
:
baseQueryWithToken
,
entityTypes
:
[
"Schedule"
],
endpoints
:
(
builder
)
=>
({
...
...
src/_store/api/states.api.js
View file @
015b4c86
...
...
@@ -53,7 +53,7 @@ export const statesApi = createApi({
})
export
const
{
useFetchStatesQuery
,
//
useFetchStatesQuery,
useFetchStatesByPageQuery
,
useCreateStateMutation
,
useUpdateStateMutation
,
...
...
src/pages/clinicPage/index.jsx
View file @
015b4c86
import
React
,
{
useState
}
from
'react'
;
import
{
useNavigate
,
useLocation
}
from
"react-router-dom"
;
import
upperfirst
from
'lodash.upperfirst
'
;
import
ErrorBoundary
from
'_components/error/ErrorBoundary
'
;
import
clone
from
'lodash/clone'
;
import
{
Button
}
from
'@chakra-ui/react'
;
import
{
Checkbox
}
from
'@chakra-ui/react'
;
...
...
@@ -118,7 +118,6 @@ const ClinicPage = () => {
</
BreadcrumbItem
>
<
BreadcrumbItem
isLoading=
{
isOneClinicLoading
}
isCurrentPage
>
<
BreadcrumbLink
...
...
src/pages/profilesEdition/components/blocks/dictionaryLoaders/degrees.jsx
View file @
015b4c86
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
uniq
}
from
'lodash'
;
import
{
uniq
,
isEqual
}
from
'lodash'
;
import
{
Spinner
,
}
from
'@chakra-ui/react'
;
...
...
@@ -28,8 +28,10 @@ const DegreesLoader = ({
useEffect
(()
=>
{
const
list
=
currentScrollToken
===
null
?
data
:
uniq
([...
data
,
...
currentList
]);
setCurrentList
(
list
)
},
[
isSuccess
,
isLastPage
,
scrollToken
,
data
,
currentScrollToken
,
currentList
]);
if
(
!
isEqual
(
currentList
,
list
))
{
setCurrentList
(
list
);
}
},
[
isSuccess
,
data
,
currentScrollToken
,
currentList
]);
const
_loadNextPage
=
()
=>
{
return
new
Promise
(
resolve
=>
...
...
src/pages/profilesEdition/components/blocks/dictionaryLoaders/insurances.jsx
View file @
015b4c86
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
uniq
}
from
'lodash'
;
import
{
uniq
,
isEqual
}
from
'lodash'
;
import
{
Spinner
,
}
from
'@chakra-ui/react'
;
...
...
@@ -28,8 +28,10 @@ const InsurancesLoader = ({
useEffect
(()
=>
{
const
list
=
currentScrollToken
===
null
?
data
:
uniq
([...
data
,
...
currentList
]);
setCurrentList
(
list
)
},
[
isSuccess
,
isLastPage
,
scrollToken
,
data
,
currentScrollToken
,
currentList
]);
if
(
!
isEqual
(
currentList
,
list
))
{
setCurrentList
(
list
);
}
},
[
isSuccess
,
data
,
currentScrollToken
,
currentList
]);
const
_loadNextPage
=
()
=>
{
return
new
Promise
(
resolve
=>
...
...
src/pages/profilesEdition/components/blocks/dictionaryLoaders/languages.jsx
View file @
015b4c86
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
uniq
}
from
'lodash'
;
import
{
uniq
,
isEqual
}
from
'lodash'
;
import
{
Spinner
,
}
from
'@chakra-ui/react'
;
...
...
@@ -29,8 +29,10 @@ const LanguagesLoader = ({
useEffect
(()
=>
{
const
list
=
currentScrollToken
===
null
?
data
:
uniq
([...
data
,
...
currentList
]);
setCurrentList
(
list
)
},
[
isSuccess
,
isLastPage
,
scrollToken
,
data
,
currentScrollToken
,
currentList
]);
if
(
!
isEqual
(
currentList
,
list
))
{
setCurrentList
(
list
);
}
},
[
isSuccess
,
data
,
currentScrollToken
,
currentList
]);
const
_loadNextPage
=
()
=>
{
return
new
Promise
(
resolve
=>
...
...
src/pages/profilesEdition/components/blocks/dictionaryLoaders/specialities.jsx
View file @
015b4c86
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
uniq
}
from
'lodash'
;
import
{
uniq
,
isEqual
}
from
'lodash'
;
import
{
Spinner
,
}
from
'@chakra-ui/react'
;
...
...
@@ -16,7 +16,7 @@ const SpecialitiesLoader = ({
})
=>
{
const
[
search
,
setSearch
]
=
useState
(
''
);
const
[
currentScrollToken
,
setCurrentScrollToken
]
=
useState
(
null
);
const
[
current
Specialities
,
setCurrentSpecialities
]
=
useState
([]);
const
[
current
List
,
setCurrentList
]
=
useState
([]);
const
[
page
,
setPage
]
=
useState
(
0
);
const
{
isLoading
:
isSpecialitiesLoading
,
isSuccess
,
data
:
specialities
=
{}}
...
...
@@ -28,11 +28,14 @@ const SpecialitiesLoader = ({
const
{
data
=
[],
scrollToken
,
isLastPage
}
=
specialities
;
useEffect
(()
=>
{
const
specialitiesData
=
currentScrollToken
===
null
?
data
:
uniq
([...
data
,
...
currentSpecialities
]);
setCurrentSpecialities
(
specialitiesData
)
},
[
isSuccess
,
isLastPage
,
scrollToken
,
data
,
currentScrollToken
,
currentSpecialities
]);
const
list
=
currentScrollToken
===
null
?
data
:
uniq
([...
data
,
...
currentList
]);
if
(
!
isEqual
(
list
,
currentList
))
{
setCurrentList
(
list
);
}
},
[
isSuccess
,
data
,
currentScrollToken
,
currentList
]);
const
_loadNextPage
=
()
=>
{
console
.
log
(
'loadnextPage'
)
return
new
Promise
(
resolve
=>
setTimeout
(()
=>
{
setPage
(
page
+
1
)
...
...
@@ -44,12 +47,13 @@ const SpecialitiesLoader = ({
useEffect
(()
=>
{
if
(
search
)
{
console
.
log
(
'search'
)
setPage
(
0
)
setCurrentScrollToken
(
null
);
setCurrent
Specialities
([])
setCurrent
List
([])
}
},
[
search
])
console
.
log
(
'8888'
)
return
(
<
div
className=
'speciality-layout'
>
<>
...
...
@@ -67,11 +71,11 @@ const SpecialitiesLoader = ({
<
InfiniteLoaderBlock
hasNextPage=
{
!
isLastPage
}
isNextPageLoading=
{
false
}
items=
{
currentSpecialities
}
items=
{
currentList
||
[]
}
fieldname=
'spec'
// listOpen=
{
search
}
loadNextPage=
{
_loadNextPage
}
wrapperClassName=
'listbox'
groupedOptions=
{
currentSpecialities
||
[]
}
handleSelect=
{
handleAddSpeciality
}
search=
{
search
}
onFocus=
{
handleListOpen
}
...
...
src/pages/profilesEdition/components/blocks/specialityData.jsx
View file @
015b4c86
...
...
@@ -263,7 +263,7 @@ const SpecialityData = ({
<
GridItem
h=
'50px'
colSpan=
{
2
}
>
<
InsurancesLoader
handleAdd
Speciality=
{
handleAddSpeciality
}
handleAdd
Insurance=
{
handleAddInsurance
}
/>
</
GridItem
>
...
...
@@ -294,7 +294,7 @@ const SpecialityData = ({
<
GridItem
h=
'50px'
colSpan=
{
2
}
>
<
SpecialitiesLoader
handleAdd
Insurance=
{
handleAddInsurance
}
handleAdd
Speciality=
{
handleAddSpeciality
}
/>
</
GridItem
>
...
...
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