Skip to content
Snippets Groups Projects
Commit cb0d67ac authored by Nico Vermaas's avatar Nico Vermaas
Browse files

renaming stuff

preventing initial fetch
parent b0f5bf6b
No related branches found
No related tags found
1 merge request!10renaming stuff
Pipeline #47988 passed
......@@ -9,8 +9,8 @@ import {
import NavigationBar from './NavigationBar';
import WelcomePage from '../pages/welcome/WelcomePage';
import ADEXBackendsPage from '../pages/benchmarking/ADEXBackendsPage';
import FocusProjectPage from '../pages/skyview/FocusProjectPage';
import BenchmarkingPage from '../pages/benchmarking/BenchmarkingPage';
import SkyViewPage from '../pages/skyview/SkyViewPage';
import ConfigurationPage from "../pages/configuration/ConfigurationPage";
import FetchADEXData from '../data/FetchADEXData';
import AncillaryPage from "../pages/ancillary/AncillaryPage";
......@@ -33,10 +33,10 @@ export default function Main() {
<WelcomePage />
</Route>
<Route exact path="/benchmarking">
<ADEXBackendsPage />
<BenchmarkingPage />
</Route>
<Route exact path="/skyview">
<FocusProjectPage />
<SkyViewPage />
</Route>
<Route exact path="/ancillary">
<AncillaryPage />
......@@ -50,7 +50,7 @@ export default function Main() {
</Switch>
</div>
<footer>
<small>version 17 april 2023 - 13:00</small>
<small>version 18 april 2023 - 8:00</small>
</footer>
</Router>
......
......@@ -34,17 +34,13 @@ export const SHOW_LABELS = 'SHOW_LABELS'
export const SET_LABEL_FIELD = 'SET_LABEL_FIELD'
export const SET_SIMBAD_ENABLED = 'SET_SIMBAD_ENABLED'
const api_host =
process.env.NODE_ENV === "development"
? "localhost:8000"
: "sdc.astron.nl";
const default_adex_backend =
process.env.NODE_ENV === "development"
? {
"name": "localhost:8000",
"type": "primary_dp",
"url": "http://localhost:8000",
//"url": "https://sdc-dev.astron.nl", // uncomment if you don't want to run the adex-backend locally
}
: {
"name": "sdc.astron.nl",
......@@ -68,7 +64,7 @@ export const initialState = {
data_limit: 10000,
labels_enabled : false,
label_field : 'name',
collection : {name: ""}
// collection : {name: ""}
}
export const reducer = (state, action) => {
......
......@@ -116,8 +116,16 @@ export default function FetchADEXData(skipAbortController) {
}
async function fetchSkyviewDataAsync() {
// only fetch when there is a collection selected to fetch
// (this prevents a fetch during initialisation of the app).
if (my_state.collection === undefined) {
return null
}
let url = constructUrl()
if (my_state.status_adex !== 'fetching') {
my_dispatch({type: SET_STATUS_ADEX, status_adex: 'fetching'})
let startTime = new Date()
......@@ -144,12 +152,11 @@ export default function FetchADEXData(skipAbortController) {
my_dispatch({type: SET_STATUS_ADEX, status_adex: 'failed'})
}
}
}
}
// fetch a single primary dataproduct
const fetchPrimaryDP = (url) => {
if (my_state.status_primary !== 'fetching') {
my_dispatch({type: SET_STATUS_PRIMARY, status_primary: "fetching"})
......
......@@ -8,7 +8,7 @@ import LeftPanel from './LeftPanel'
import Aladin from './AladinPanel'
export default function ADEXBackendsPage(props) {
export default function BenchmarkingPage(props) {
const [ my_state, my_dispatch] = useGlobalReducer()
......
......@@ -17,6 +17,10 @@ export default function SelectCollectionButton() {
my_dispatch({type: RELOAD_ADEX, reload_adex: !my_state.reload_adex})
}
if (!my_state.collection) {
return null
}
let renderDropdownItems
if (my_state.backend_config) {
if (my_state.backend_config.config) {
......
......@@ -8,7 +8,7 @@ import LeftPanel from './LeftPanel'
import Aladin from './AladinPanel'
export default function FocusProjectPage(props) {
export default function SkyViewPage(props) {
const [ my_state, my_dispatch] = useGlobalReducer()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment