mirror of https://github.com/buster-so/buster.git
Merge pull request #558 from buster-so/hot-fix/make-colors-passthrough
Hot fix/make colors passthrough
This commit is contained in:
commit
cd3bc58a57
|
@ -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
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue