Merge pull request #558 from buster-so/hot-fix/make-colors-passthrough

Hot fix/make colors passthrough
This commit is contained in:
Nate Kelley 2025-07-18 15:44:35 -06:00 committed by GitHub
commit cd3bc58a57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View File

@ -1,11 +1,14 @@
import { useQuery, QueryClient } from '@tanstack/react-query';
import { getColorPalettes, getCurrencies } from './requests';
import { dictionariesQueryKeys } from '@/api/query_keys/dictionaries';
import { useSupabaseContext } from '@/context/Supabase';
export const useColorDictionaryThemes = () => {
const isAnonymousUser = useSupabaseContext((x) => x.isAnonymousUser);
return useQuery({
...dictionariesQueryKeys.colorPalettes,
queryFn: getColorPalettes
queryFn: getColorPalettes,
enabled: !isAnonymousUser
});
};

View File

@ -23,7 +23,8 @@ const useSupabaseContextInternal = ({
const { openErrorNotification, openInfoMessage } = useBusterNotifications();
const [accessToken, setAccessToken] = useState(supabaseContext.accessToken || '');
const isAnonymousUser = !supabaseContext.user?.id || supabaseContext.user?.is_anonymous === true;
const isAnonymousUser: boolean =
!supabaseContext.user?.id || supabaseContext.user?.is_anonymous === true;
const getExpiresAt = useMemoizedFn((token?: string) => {
const decoded = jwtDecode(token || accessToken);

View File

@ -27,7 +27,7 @@ export const ChartConfigPropsSchema = z.object({
columnSettings: z.record(z.string(), ColumnSettingsSchema).default({}),
columnLabelFormats: z.record(z.string(), ColumnLabelFormatSchema).default({}),
// OPTIONAL: default is the buster color palette
colors: z.array(z.string()).optional(),
colors: z.array(z.string()).default(DEFAULT_CHART_THEME),
// OPTIONAL: default is null and will be true if there are multiple Y axes or if a category axis is used
showLegend: z.nullable(z.boolean()).default(null),
// OPTIONAL: default: true