mirror of https://github.com/buster-so/buster.git
version updates
This commit is contained in:
parent
9092723faf
commit
53474546db
|
@ -180,7 +180,6 @@ describe('DataSourceSchema', () => {
|
|||
|
||||
// This validation currently passes because there's no cross-field validation
|
||||
// If you want to enforce this, you'd need to add a custom validator
|
||||
console.log('Note: Current schema does not validate credential type matching DataSource type');
|
||||
expect(result.success).toBe(true);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -49,10 +49,21 @@ export const useAppLayout = () => {
|
|||
}
|
||||
);
|
||||
|
||||
const onChangeQueryParams = useMemoizedFn((params: Record<string, string>) => {
|
||||
const searchParams = window.location.search;
|
||||
const newSearchParams = new URLSearchParams(searchParams);
|
||||
Object.entries(params).forEach(([key, value]) => {
|
||||
newSearchParams.set(key, value);
|
||||
});
|
||||
const newPath = `${pathname}?${newSearchParams.toString()}`;
|
||||
push(newPath);
|
||||
});
|
||||
|
||||
return {
|
||||
currentRoute,
|
||||
onChangePage,
|
||||
currentParentRoute
|
||||
currentParentRoute,
|
||||
onChangeQueryParams
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -49,6 +49,8 @@ import { METRIC_CHART_TITLE_INPUT_ID } from '@/controllers/MetricController/Metr
|
|||
import { ShareMenuContent } from '@/components/features/ShareMenu/ShareMenuContent';
|
||||
import { canEdit, getIsEffectiveOwner, getIsOwner } from '@/lib/share';
|
||||
import { getShareAssetConfig } from '@/components/features/ShareMenu/helpers';
|
||||
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
||||
import { useAppLayoutContextSelector } from '@/context/BusterAppLayout';
|
||||
|
||||
export const ThreeDotMenuButton = React.memo(({ metricId }: { metricId: string }) => {
|
||||
const { openSuccessMessage } = useBusterNotifications();
|
||||
|
@ -176,6 +178,7 @@ const useDashboardSelectMenu = ({ metricId }: { metricId: string }) => {
|
|||
};
|
||||
|
||||
const useVersionHistorySelectMenu = ({ metricId }: { metricId: string }) => {
|
||||
const onChangeQueryParams = useAppLayoutContextSelector((x) => x.onChangeQueryParams);
|
||||
const { data } = useGetMetric({ id: metricId }, (x) => ({
|
||||
versions: x.versions,
|
||||
version_number: x.version_number
|
||||
|
@ -183,7 +186,7 @@ const useVersionHistorySelectMenu = ({ metricId }: { metricId: string }) => {
|
|||
const { versions = [], version_number } = data || {};
|
||||
|
||||
const onClickVersionHistory = useMemoizedFn((versionNumber: number) => {
|
||||
console.log('versionNumber', versionNumber);
|
||||
onChangeQueryParams({ metric_version_number: versionNumber.toString() });
|
||||
});
|
||||
|
||||
const versionHistoryItems: DropdownItems = useMemo(() => {
|
||||
|
|
|
@ -5,7 +5,6 @@ import { useChatLayoutContextSelector } from '../../ChatLayoutContext';
|
|||
import type { FileView, MetricFileView } from '../../ChatLayoutContext/useChatFileLayout';
|
||||
import { type SegmentedItem } from '@/components/ui/segmented';
|
||||
import { useMemoizedFn } from '@/hooks';
|
||||
import { useGetMetric } from '@/api/buster_rest/metrics';
|
||||
|
||||
const segmentOptions: { label: string; value: MetricFileView }[] = [
|
||||
{ label: 'Chart', value: 'chart' },
|
||||
|
|
Loading…
Reference in New Issue