Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Frontend V2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GraphPolaris
Frontend V2
Commits
4b4230a2
Commit
4b4230a2
authored
1 year ago
by
Vink, S.A. (Sjoerd)
Committed by
Leonardo Christino
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(userFeedbackDBLoading): added extra user feedback to db loading
parent
d3ece871
No related branches found
No related tags found
1 merge request
!94
fix(userFeedbackDBLoading)
Pipeline
#128121
passed
1 year ago
Stage: tag-release
Stage: get-release-tag
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/web/src/components/navbar/DatabaseManagement/DatabaseSelector.tsx
+4
-9
4 additions, 9 deletions
...components/navbar/DatabaseManagement/DatabaseSelector.tsx
with
4 additions
and
9 deletions
apps/web/src/components/navbar/DatabaseManagement/DatabaseSelector.tsx
+
4
−
9
View file @
4b4230a2
...
...
@@ -5,6 +5,7 @@ import { updateCurrentDatabase } from '@graphpolaris/shared/lib/data-access/stor
import
{
SettingsForm
}
from
'
./forms/settings
'
;
import
{
NewDatabaseForm
}
from
'
./forms/AddDatabase/newdatabase
'
;
import
{
LoadingSpinner
}
from
'
@graphpolaris/shared/lib/components/LoadingSpinner
'
;
import
{
addError
}
from
'
@graphpolaris/shared/lib/data-access/store/configSlice
'
;
export
default
function
DatabaseSelector
({})
{
const
dispatch
=
useAppDispatch
();
...
...
@@ -18,7 +19,6 @@ export default function DatabaseSelector({}) {
const
[
settingsMenuOpen
,
setSettingsMenuOpen
]
=
useState
<
boolean
>
(
false
);
const
[
selectedDatabase
,
setSelectedDatabase
]
=
useState
<
DatabaseInfo
|
null
>
(
null
);
const
[
addDatabaseFormOpen
,
setAddDatabaseFormOpen
]
=
useState
<
boolean
>
(
false
);
const
[
connectionError
,
setConnectionError
]
=
useState
<
boolean
>
(
false
);
useEffect
(()
=>
{
const
handleClickOutside
=
({
target
}:
MouseEvent
)
=>
{
...
...
@@ -40,8 +40,9 @@ export default function DatabaseSelector({}) {
let
timeoutId
:
ReturnType
<
typeof
setTimeout
>
;
if
(
connecting
)
{
timeoutId
=
setTimeout
(()
=>
{
dispatch
(
addError
(
"
Couldn't establish connection
"
));
setConnecting
(
false
);
setConnectionError
(
true
);
dispatch
(
updateCurrentDatabase
(
''
)
);
},
10000
);
}
...
...
@@ -73,12 +74,7 @@ export default function DatabaseSelector({}) {
onClick
=
{
()
=>
setDbSelectionMenuOpen
(
!
dbSelectionMenuOpen
)
}
>
<
div
className
=
"flex items-center w-full"
>
{
connectionError
?
(
<>
<
div
className
=
"h-2 w-2 rounded-full bg-red-500"
/>
<
p
className
=
"ml-2 truncate"
>
Database connection failed
</
p
>
</>
)
:
connecting
?
(
{
connecting
?
(
<>
<
LoadingSpinner
/>
<
p
className
=
"ml-2 truncate"
>
Connecting to
{
session
.
currentDatabase
}
</
p
>
...
...
@@ -136,7 +132,6 @@ export default function DatabaseSelector({}) {
setDbSelectionMenuOpen
(
false
);
setConnecting
(
true
);
dispatch
(
updateCurrentDatabase
(
db
.
Name
));
setConnectionError
(
false
);
}
else
{
setDbSelectionMenuOpen
(
false
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment