From 3cc7019a1b83cd8a43c0110b5fea827872d0f665 Mon Sep 17 00:00:00 2001 From: HendrikThePendric Date: Mon, 13 Jan 2025 16:59:57 +0100 Subject: [PATCH] chore: ensure set in superset is in lower case --- src/api/{superSetGateway.js => supersetGateway.js} | 6 +++--- src/components/SystemSettingsProvider.js | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) rename src/api/{superSetGateway.js => supersetGateway.js} (83%) diff --git a/src/api/superSetGateway.js b/src/api/supersetGateway.js similarity index 83% rename from src/api/superSetGateway.js rename to src/api/supersetGateway.js index 874c4d8fe..4f5cf13ec 100644 --- a/src/api/superSetGateway.js +++ b/src/api/supersetGateway.js @@ -1,7 +1,7 @@ import { useConfig } from '@dhis2/app-service-config' import { useCallback, useMemo } from 'react' -export const useFetchSuperSetBaseUrl = () => { +export const useFetchSupersetBaseUrl = () => { const { baseUrl } = useConfig() const url = useMemo( () => @@ -14,7 +14,7 @@ export const useFetchSuperSetBaseUrl = () => { [baseUrl] ) - const fetchSuperSetBaseUrl = useCallback(async () => { + const fetchSupersetBaseUrl = useCallback(async () => { const response = await fetch(url) if (!response.ok) { throw new Error(`Response status: ${response.status}`) @@ -24,5 +24,5 @@ export const useFetchSuperSetBaseUrl = () => { return data.supersetBaseUrl }, [url]) - return fetchSuperSetBaseUrl + return fetchSupersetBaseUrl } diff --git a/src/components/SystemSettingsProvider.js b/src/components/SystemSettingsProvider.js index 4b0bc6413..135348854 100644 --- a/src/components/SystemSettingsProvider.js +++ b/src/components/SystemSettingsProvider.js @@ -1,7 +1,7 @@ import { useDataEngine } from '@dhis2/app-runtime' import PropTypes from 'prop-types' import React, { useContext, useState, useEffect, createContext } from 'react' -import { useFetchSuperSetBaseUrl } from '../api/superSetGateway.js' +import { useFetchSupersetBaseUrl } from '../api/supersetGateway.js' import { systemSettingsQuery, renameSystemSettings, @@ -13,7 +13,7 @@ export const SystemSettingsCtx = createContext({}) const SystemSettingsProvider = ({ children }) => { const [settings, setSettings] = useState(null) const engine = useDataEngine() - const fetchSuperSetBaseUrl = useFetchSuperSetBaseUrl() + const fetchSupersetBaseUrl = useFetchSupersetBaseUrl() useEffect(() => { async function fetchData() { @@ -34,13 +34,13 @@ const SystemSettingsProvider = ({ children }) => { } if (resolvedSystemSettings.embeddedDashboardsEnabled) { resolvedSystemSettings.supersetBaseUrl = - await fetchSuperSetBaseUrl() + await fetchSupersetBaseUrl() } setSettings(resolvedSystemSettings) } fetchData() - }, [engine, fetchSuperSetBaseUrl]) + }, [engine, fetchSupersetBaseUrl]) return ( useContext(SystemSettingsCtx) -export const useHasSuperSetSupport = () => { +export const useHasSupersetSupport = () => { const { embeddedDashboardsEnabled, supersetBaseUrl } = useSystemSettings() return embeddedDashboardsEnabled && !!supersetBaseUrl }