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
1d7723e0
Commit
1d7723e0
authored
1 year ago
by
Leonardo Christino
Browse files
Options
Downloads
Patches
Plain Diff
fix(ui): fix add database not opening after adding one db
parent
474e1be3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!71
fix(ui): fix add database not opening after adding one db
Pipeline
#127264
passed
1 year ago
Stage: tag-release
Stage: get-release-tag
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/web/src/components/navbar/AddDatabaseForm/newdatabaseform.tsx
+1
-2
1 addition, 2 deletions
...src/components/navbar/AddDatabaseForm/newdatabaseform.tsx
apps/web/src/components/navbar/navbar.tsx
+7
-23
7 additions, 23 deletions
apps/web/src/components/navbar/navbar.tsx
with
8 additions
and
25 deletions
apps/web/src/components/navbar/AddDatabaseForm/newdatabaseform.tsx
+
1
−
2
View file @
1d7723e0
...
...
@@ -68,7 +68,6 @@ export const NewDatabaseForm = (props: { onClose(): void; open: boolean }) => {
/** Handles the submit button click. Calls the onSubmit in the props with all the fields. */
function
handleSubmitClicked
():
void
{
ref
.
current
?.
close
();
if
(
!
Object
.
values
(
hasError
).
some
((
e
)
=>
e
===
true
))
{
api
.
AddDatabase
(
state
,
{
updateDatabaseCache
:
true
,
setAsCurrent
:
true
})
...
...
@@ -78,8 +77,8 @@ export const NewDatabaseForm = (props: { onClose(): void; open: boolean }) => {
.
catch
((
e
)
=>
{
dispatch
(
addError
(
e
.
message
));
});
props
.
onClose
();
}
// props.onSubmit(state);
}
return
(
...
...
This diff is collapsed.
Click to expand it.
apps/web/src/components/navbar/navbar.tsx
+
7
−
23
View file @
1d7723e0
...
...
@@ -59,27 +59,18 @@ export const Navbar = (props: NavbarComponentProps) => {
const
[
menuOpen
,
setMenuOpen
]
=
useState
(
false
);
const
[
subMenuOpen
,
setSubMenuOpen
]
=
useState
<
string
|
undefined
>
(
undefined
);
/**
* Called when the user clicks on the 'submit' button of the add database form.
*/
function
onAddDatabaseFormSubmit
(
request
:
AddDatabaseRequest
):
Promise
<
void
|
Response
>
{
return
api
.
AddDatabase
(
request
,
{
updateDatabaseCache
:
true
,
setAsCurrent
:
true
})
.
then
(()
=>
{
schemaApi
.
RequestSchema
(
request
.
name
);
})
.
catch
((
e
)
=>
{
dispatch
(
addError
(
e
.
message
));
});
}
const
currentLogo
=
!
'
dark
'
?
logo_white
:
logo
;
// TODO: support dark mode
const
buildInfo
=
import
.
meta
.
env
.
GRAPHPOLARIS_VERSION
;
return
(
<
div
className
=
"w-full h-auto px-5"
>
<
NewDatabaseForm
open
=
{
addDatabaseFormOpen
}
onClose
=
{
()
=>
setAddDatabaseFormOpen
(
false
)
}
/>
<
NewDatabaseForm
open
=
{
addDatabaseFormOpen
}
onClose
=
{
()
=>
{
setAddDatabaseFormOpen
(
false
);
}
}
/>
<
div
title
=
"GraphPolaris"
className
=
"navbar w-full"
>
<
a
href
=
"https://graphpolaris.com/"
className
=
"w-full"
>
<
img
src
=
{
currentLogo
}
/>
...
...
@@ -118,6 +109,7 @@ export const Navbar = (props: NavbarComponentProps) => {
setAddDatabaseFormOpen
(
true
);
setMenuOpen
(
false
);
setSubMenuOpen
(
undefined
);
console
.
log
(
'
add database
'
,
addDatabaseFormOpen
,
menuOpen
,
subMenuOpen
);
}
}
>
Add database
...
...
@@ -205,14 +197,6 @@ export const Navbar = (props: NavbarComponentProps) => {
</
div
>
</
div
>
</
div
>
{
/* <AddDatabaseForm
open={state.showAddDatabaseForm}
onClose={() => setState({ ...state, showAddDatabaseForm: false })}
onSubmit={(...params) => {
onAddDatabaseFormSubmit(...params);
setState({ ...state, showAddDatabaseForm: false });
}}
/> */
}
</
div
>
);
};
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