CEC-2970: Multiple Superset Dashboards (#229)

Co-authored-by: Alexander Andrews <aandrews@fiskerinc.com>
This commit is contained in:
Alexander Andrews
2022-11-02 14:37:08 -04:00
committed by GitHub
parent 843fddd0b7
commit 2d298368c5
9 changed files with 4406 additions and 501 deletions

View File

@@ -21,15 +21,32 @@ const supersetAPI = {
let q = r["token"]
return q
},
getEmbeddedDashboards: async(token) => {
const u = addQueryParams(`${API_ENDPOINT}/dashboard/embedded-dashboards`);
let res = await fetch(u, {
method: "GET",
headers: Object.assign(
getAuthHeaderOptions(token)
),
})
if(res.status !== 200){
return [{title: "dashboard", embedded_id: GetSupersetDashboardID()}]
}
let r = await res.json()
return r
},
SupersetDashboardURL: () => {
const SUPERSET_BASE_URL = process.env.REACT_APP_SUPERSET_URL;
return SUPERSET_BASE_URL
},
SupersetDashboardID: () => {
const SUPERSET_BASE_ID = process.env.REACT_APP_SUPERSET_KEYS_LIST;
return SUPERSET_BASE_ID
return GetSupersetDashboardID()
}
}
const GetSupersetDashboardID = () => {
const SUPERSET_BASE_ID = process.env.REACT_APP_SUPERSET_KEYS_LIST;
return SUPERSET_BASE_ID
}
export default supersetAPI;