Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
ESAP GUI
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
ASTRON SDC
ESCAPE WP5
ESAP GUI
Commits
0f67f06d
Commit
0f67f06d
authored
4 years ago
by
Zheng Meyer
Browse files
Options
Downloads
Patches
Plain Diff
move navbar outside of query schema config files
parent
a9f9d7aa
No related branches found
No related tags found
1 merge request
!8
Esap gui dev
Pipeline
#6325
passed
4 years ago
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/NavBar.js
+4
-2
4 additions, 2 deletions
src/components/NavBar.js
src/contexts/GlobalContext.js
+12
-1
12 additions, 1 deletion
src/contexts/GlobalContext.js
src/routes/Routes.js
+3
-6
3 additions, 6 deletions
src/routes/Routes.js
with
19 additions
and
9 deletions
src/components/NavBar.js
+
4
−
2
View file @
0f67f06d
...
...
@@ -2,14 +2,16 @@ import React, { useContext } from "react";
import
{
Navbar
,
Nav
}
from
"
react-bootstrap
"
;
import
{
NavLink
}
from
"
react-router-dom
"
;
import
AuthControl
from
"
./auth/authControl
"
;
import
{
QueryContext
}
from
"
../contexts/QueryContext
"
;
import
{
GlobalContext
}
from
"
../contexts/GlobalContext
"
;
export
default
function
NavBar
()
{
const
{
navbar
}
=
useContext
(
GlobalContext
);
const
{
config
}
=
useContext
(
QueryContext
);
if
(
!
navbar
)
return
null
;
if
(
!
config
)
return
null
;
// construct the navigation bar based on the configuration
const
navlist
=
config
.
navbar
;
const
navlist
=
navbar
.
navbar
;
return
(
<
Navbar
bg
=
"
dark
"
variant
=
"
dark
"
>
...
...
This diff is collapsed.
Click to expand it.
src/contexts/GlobalContext.js
+
12
−
1
View file @
0f67f06d
...
...
@@ -9,18 +9,28 @@ export function GlobalContextProvider({ children }) {
const
api_host
=
process
.
env
.
NODE_ENV
===
"
development
"
?
"
http
s
://
sdc.astron.nl
:5555/esap-api/
"
?
"
http://
localhost
:5555/esap-api/
"
:
"
https://sdc.astron.nl:5555/esap-api/
"
;
// "https://sdc.astron.nl:5555/esap-api/"
// "http://localhost:5555/esap-api/"
const
[
archives
,
setArchives
]
=
useState
();
const
[
navbar
,
setNavbar
]
=
useState
();
useEffect
(()
=>
{
axios
.
get
(
api_host
+
"
query/archives-uri
"
)
.
then
((
response
)
=>
setArchives
(
response
.
data
.
results
));
},
[
api_host
]);
useEffect
(()
=>
{
axios
.
get
(
api_host
+
"
query/configuration?name=navbar
"
)
.
then
((
response
)
=>
{
console
.
log
(
"
navbar response
"
,
response
.
data
.
configuration
);
setNavbar
(
response
.
data
.
configuration
);
});
},
[
api_host
]);
// !!!!! Still need to look at sessionid and stuff
const
[
sessionid
,
setSessionid
]
=
useState
(
getCookie
(
"
sessionid
"
));
console
.
log
(
"
waah
"
,
sessionid
,
getCookie
(
"
sessionid
"
),
document
.
cookie
);
...
...
@@ -62,6 +72,7 @@ export function GlobalContextProvider({ children }) {
isAuthenticated
,
sessionid
,
archives
,
navbar
,
handleLogin
,
handleLogout
,
handleError
,
...
...
This diff is collapsed.
Click to expand it.
src/routes/Routes.js
+
3
−
6
View file @
0f67f06d
...
...
@@ -7,22 +7,19 @@ import QueryCatalogs from "../components/query/QueryCatalogs";
import
QueryIVOARegistry
from
"
../components/query/QueryIVOARegistry
"
;
import
{
BrowserRouter
as
Router
}
from
"
react-router-dom
"
;
import
NavBar
from
"
../components/NavBar
"
;
import
{
QueryContext
}
from
"
../contexts/QueryContext
"
;
import
Rucio
from
"
../components/Rucio
"
;
import
Interactive
from
"
../components/Interactive
"
;
import
{
IVOAContextProvider
}
from
"
../contexts/IVOAContext
"
;
import
{
IDAContext
}
from
"
../contexts/IDAContext
"
;
export
default
function
Routes
()
{
const
{
handleLogin
,
handleLogout
,
handleError
}
=
useContext
(
GlobalContext
);
const
{
config
}
=
useContext
(
QueryContext
);
const
{
navbar
,
handleLogin
,
handleLogout
,
handleError
}
=
useContext
(
GlobalContext
);
const
{
jhubURL
}
=
useContext
(
IDAContext
);
if
(
!
config
)
return
null
;
if
(
!
navbar
)
return
null
;
if
(
!
jhubURL
)
return
null
;
console
.
log
(
jhubURL
);
return
(
<
Router
basename
=
{
config
.
frontend_basename
}
>
<
Router
basename
=
{
navbar
.
frontend_basename
}
>
<
NavBar
/>
<
Switch
>
<
Route
exact
path
=
{[
"
/
"
,
"
/archives
"
]}
>
...
...
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