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

blank screen bugfix on login

parent a0750474
No related branches found
No related tags found
1 merge request!49Dev nico
Pipeline #16594 passed
...@@ -22,26 +22,27 @@ export function QueryContextProvider({ children }) { ...@@ -22,26 +22,27 @@ export function QueryContextProvider({ children }) {
// this hook executes fetchConfiguration every time that the values between brackets are changed // this hook executes fetchConfiguration every time that the values between brackets are changed
useEffect(() => { useEffect(() => {
fetchConfiguration(configName) if (!fetchConfiguration(configName, {withCredentials: true})) {
fetchConfiguration(configName)
}
}, [api_host, configName]); }, [api_host, configName]);
//}, [api_host, configName, dplevel, collection]); //}, [api_host, configName, dplevel, collection]);
function fetchConfiguration(configName) { function fetchConfiguration(configName, header) {
let configNameString = ""; let configNameString = "";
if (configName) { if (configName) {
configNameString = `?name=${configName}`; configNameString = `?name=${configName}`;
} }
axios axios
.get(api_host + "query/configuration" + configNameString, {withCredentials: true}) .get(api_host + "query/configuration" + configNameString, {header})
.then((response) => { .then((response) => {
//alert(configNameString) //alert(configNameString)
let config = response.data["configuration"]; let config = response.data["configuration"];
let props = config.query_schema.properties; let props = config.query_schema.properties;
console.log("config props: ", props);
console.log("collection value: ", collection);
console.log("dplevel value: ", dplevel);
Object.keys(props).map((key) => { Object.keys(props).map((key) => {
if (key === "collection" && collection) { if (key === "collection" && collection) {
console.log("has key collection, default value is: ", props[key]["default"]); console.log("has key collection, default value is: ", props[key]["default"]);
...@@ -58,7 +59,10 @@ export function QueryContextProvider({ children }) { ...@@ -58,7 +59,10 @@ export function QueryContextProvider({ children }) {
.catch((error) => { .catch((error) => {
let description = ". Configuration not loaded. Is ESAP-API online? " + api_host let description = ". Configuration not loaded. Is ESAP-API online? " + api_host
console.log(error.toString() + description) console.log(error.toString() + description)
//alert(description)
}); });
return true
} }
console.log("config: ", { config }); console.log("config: ", { config });
......
...@@ -87,7 +87,7 @@ export default function Routes() { ...@@ -87,7 +87,7 @@ export default function Routes() {
</Switch> </Switch>
<footer><small>esap-gui version 19 aug 2021 - 8:00</small></footer> <footer><small>esap-gui version 20 aug 2021 - 10:00</small></footer>
</Router> </Router>
); );
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment