Skip to content

Commit

Permalink
fixed data model search for instance filter and added missing query k…
Browse files Browse the repository at this point in the history
…ey for several queries
  • Loading branch information
pramodcog committed Sep 6, 2024
1 parent 823768b commit 5b0cb69
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
7 changes: 6 additions & 1 deletion react-components/src/query/use3dRelatedDirectConnections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ export function use3dRelatedDirectConnections(
const fdmDataProvider = useFdm3dDataProvider();

return useQuery({
queryKey: ['reveal-react-components', 'get-3d-related-direct-connections'],
queryKey: [
'reveal-react-components',
'get-3d-related-direct-connections',
instance?.externalId,
instance?.space
],
queryFn: async () => {
assert(instance !== undefined);
const views = await fdmSdk.inspectInstances({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ export const useAllAssetsMapped360Annotations = (
image360AnnotationFilterOptions: Image360AnnotationFilterOptions = { status: `approved` }
): UseQueryResult<Image360AnnotationMappedAssetData[]> => {
return useQuery({
queryKey: ['reveal', 'react-components', 'all-assets-mapped-360-annotations', siteIds],
queryKey: [
'reveal',
'react-components',
'all-assets-mapped-360-annotations',
siteIds,
image360AnnotationFilterOptions.status
],
queryFn: async () => {
const assetMappings = await getAssetsMapped360Annotations(
sdk,
Expand Down Expand Up @@ -54,7 +60,8 @@ export const useSearchAssetsMapped360Annotations = (
'react-components',
'search-assets-mapped-360-annotations',
query,
siteIds
siteIds,
image360AnnotationFilterOptions?.status
],
queryFn: async () => {
if (query === '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const useSearchMappedEquipmentAssetMappings = (
'react-components',
'search-mapped-asset-mappings',
query,
limit,
...models.map((model) => [model.modelId, model.revisionId])
],
queryFn: async ({ pageParam }: { pageParam: string | undefined }) => {
Expand Down Expand Up @@ -123,6 +124,7 @@ export const useAllMappedEquipmentAssetMappings = (
'reveal',
'react-components',
'all-mapped-equipment-asset-mappings',
limit,
...models.map((model) => [model.modelId, model.revisionId])
],
queryFn: async ({ pageParam }) => {
Expand Down
13 changes: 11 additions & 2 deletions react-components/src/query/useSearchMappedEquipmentFDM.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ export const useSearchMappedEquipmentFDM = (
);

return useQuery({
queryKey: ['reveal', 'react-components', 'search-mapped-fdm', query, models, viewsToSearch],
queryKey: [
'reveal',
'react-components',
'search-mapped-fdm',
query,
models,
viewsToSearch,
instancesFilter,
limit
],
queryFn: async () => {
if (models.length === 0) {
return [];
Expand Down Expand Up @@ -123,7 +132,7 @@ export const useAllMappedEquipmentFDM = (
const fdmDataProvider = useFdm3dDataProvider();

return useQuery({
queryKey: ['reveal', 'react-components', 'all-mapped-equipment-fdm', viewsToSearch],
queryKey: ['reveal', 'react-components', 'all-mapped-equipment-fdm', viewsToSearch, models],
queryFn: async () => {
const viewSources = await createSourcesFromViews(viewsToSearch, fdmSdk);

Expand Down

0 comments on commit 5b0cb69

Please sign in to comment.