Fix see versions and runs hooks (#9244)
<img width="871" alt="Capture d’écran 2024-12-26 à 15 04 27"
src="https://github.com/user-attachments/assets/40a37230-59be-4d9b-ae43-cebbf94e1b47"
/>
Filters had been broken by this PR
86d74724fb (diff-eb3ca3591567c47e75165b8279bd2a51f8dd77810a643cba0d9c317d2f77107eR19)
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
import { SingleRecordActionHookWithoutObjectMetadataItem } from '@/action-menu/actions/types/SingleRecordActionHook';
|
||||
import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';
|
||||
import { FilterQueryParams } from '@/views/hooks/internal/useViewFromQueryParams';
|
||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||
import qs from 'qs';
|
||||
@ -20,10 +19,12 @@ export const useSeeRunsWorkflowSingleRecordAction: SingleRecordActionHookWithout
|
||||
return;
|
||||
}
|
||||
|
||||
const filterQueryParams: FilterQueryParams = {
|
||||
const filterQueryParams = {
|
||||
filter: {
|
||||
workflow: {
|
||||
[ViewFilterOperand.Is]: [workflowWithCurrentVersion.id],
|
||||
[ViewFilterOperand.Is]: {
|
||||
selectedRecordIds: [workflowWithCurrentVersion.id],
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { SingleRecordActionHookWithoutObjectMetadataItem } from '@/action-menu/actions/types/SingleRecordActionHook';
|
||||
import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';
|
||||
import { FilterQueryParams } from '@/views/hooks/internal/useViewFromQueryParams';
|
||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||
import qs from 'qs';
|
||||
@ -20,10 +19,12 @@ export const useSeeVersionsWorkflowSingleRecordAction: SingleRecordActionHookWit
|
||||
return;
|
||||
}
|
||||
|
||||
const filterQueryParams: FilterQueryParams = {
|
||||
const filterQueryParams = {
|
||||
filter: {
|
||||
workflow: {
|
||||
[ViewFilterOperand.Is]: [workflowWithCurrentVersion.id],
|
||||
[ViewFilterOperand.Is]: {
|
||||
selectedRecordIds: [workflowWithCurrentVersion.id],
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { SingleRecordActionHookWithoutObjectMetadataItem } from '@/action-menu/actions/types/SingleRecordActionHook';
|
||||
import { CoreObjectNamePlural } from '@/object-metadata/types/CoreObjectNamePlural';
|
||||
import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
|
||||
import { FilterQueryParams } from '@/views/hooks/internal/useViewFromQueryParams';
|
||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||
import { useWorkflowWithCurrentVersion } from '@/workflow/hooks/useWorkflowWithCurrentVersion';
|
||||
import qs from 'qs';
|
||||
@ -24,13 +23,17 @@ export const useSeeRunsWorkflowVersionSingleRecordAction: SingleRecordActionHook
|
||||
const onClick = () => {
|
||||
if (!shouldBeRegistered) return;
|
||||
|
||||
const filterQueryParams: FilterQueryParams = {
|
||||
const filterQueryParams = {
|
||||
filter: {
|
||||
workflow: {
|
||||
[ViewFilterOperand.Is]: [workflowWithCurrentVersion.id],
|
||||
[ViewFilterOperand.Is]: {
|
||||
selectedRecordIds: [workflowWithCurrentVersion.id],
|
||||
},
|
||||
},
|
||||
workflowVersion: {
|
||||
[ViewFilterOperand.Is]: [recordId],
|
||||
[ViewFilterOperand.Is]: {
|
||||
selectedRecordIds: [recordId],
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -30,7 +30,6 @@ import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
|
||||
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
||||
import { DropdownScope } from '@/ui/layout/dropdown/scopes/DropdownScope';
|
||||
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
|
||||
import { FilterQueryParams } from '@/views/hooks/internal/useViewFromQueryParams';
|
||||
import { View } from '@/views/types/View';
|
||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||
import { RelationDefinitionType } from '~/generated-metadata/graphql';
|
||||
@ -129,10 +128,12 @@ export const RecordDetailRelationSection = ({
|
||||
view.objectMetadataId === relationObjectMetadataItem.id,
|
||||
);
|
||||
|
||||
const filterQueryParams: FilterQueryParams = {
|
||||
const filterQueryParams = {
|
||||
filter: {
|
||||
[relationFieldMetadataItem?.name || '']: {
|
||||
[ViewFilterOperand.Is]: [recordId],
|
||||
[ViewFilterOperand.Is]: {
|
||||
selectedRecordIds: [recordId],
|
||||
},
|
||||
},
|
||||
},
|
||||
view: indexView?.id,
|
||||
|
||||
Reference in New Issue
Block a user