From 6365b6b16f0fa3ddc1104a764fae444436e510cb Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Tue, 10 Dec 2024 16:01:30 +0100 Subject: [PATCH] fix: rename old modelsingleselect to legacy --- .../ModelSingleSelect/ModelSingleSelect.tsx | 2 +- .../ModelSingleSelect/useRefreshSingleSelect.tsx | 3 +-- .../metadataFormControls/OptionSetSelect/OptionSetSelect.tsx | 4 ++-- src/lib/query/index.ts | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/metadataFormControls/ModelSingleSelect/ModelSingleSelect.tsx b/src/components/metadataFormControls/ModelSingleSelect/ModelSingleSelect.tsx index a9b51e42..1288e696 100644 --- a/src/components/metadataFormControls/ModelSingleSelect/ModelSingleSelect.tsx +++ b/src/components/metadataFormControls/ModelSingleSelect/ModelSingleSelect.tsx @@ -77,7 +77,7 @@ export interface ModelSingleSelectProps { useOptionsQuery: () => QueryResponse } -export const ModelSingleSelect = forwardRef(function ModelSingleSelect( +export const ModelSingleSelectLegacy = forwardRef(function ModelSingleSelect( { onChange, invalid, diff --git a/src/components/metadataFormControls/ModelSingleSelect/useRefreshSingleSelect.tsx b/src/components/metadataFormControls/ModelSingleSelect/useRefreshSingleSelect.tsx index d1b53384..6a65948d 100644 --- a/src/components/metadataFormControls/ModelSingleSelect/useRefreshSingleSelect.tsx +++ b/src/components/metadataFormControls/ModelSingleSelect/useRefreshSingleSelect.tsx @@ -9,10 +9,9 @@ export const useRefreshModelSingleSelect = ( return useCallback( (invalidateFilters?: InvalidateQueryFilters) => { - console.log('invalidate', query) queryClient.invalidateQueries({ queryKey: [query], - // ...invalidateFilters, + ...invalidateFilters, }) }, [queryClient, query] diff --git a/src/components/metadataFormControls/OptionSetSelect/OptionSetSelect.tsx b/src/components/metadataFormControls/OptionSetSelect/OptionSetSelect.tsx index 44715fc4..061b98a0 100644 --- a/src/components/metadataFormControls/OptionSetSelect/OptionSetSelect.tsx +++ b/src/components/metadataFormControls/OptionSetSelect/OptionSetSelect.tsx @@ -1,7 +1,7 @@ import i18n from '@dhis2/d2-i18n' import React, { forwardRef } from 'react' import { useOptionSetsQuery } from '../../../lib' -import { ModelSingleSelect } from '../ModelSingleSelect' +import { ModelSingleSelectLegacy } from '../ModelSingleSelect' import type { ModelSingleSelectProps } from '../ModelSingleSelect' import { useInitialOptionQuery } from './useInitialOptionQuery' @@ -24,7 +24,7 @@ export const OptionSetSelect = forwardRef(function OptionSetSelect( ref ) { return ( -