Dashboard filter missing "Me" workspace member option
https://sonarly.com/issue/33893?type=bug Dashboard widget filters use a side panel code path that delegates RELATION field filtering to FormFieldInput, which has no "Me" (current workspace member) option, unlike regular views. Fix: Added explicit handling for `FieldMetadataType.RELATION` filter type in `AdvancedFilterSidePanelValueFormInput`, which is the value input component used by dashboard widget filters (both chart and record table widgets). **Problem:** When users set a RELATION filter (e.g., "Account Owner") in dashboard widgets, the side panel filter component fell through to the generic `FormFieldInput` → `FormRelationToOneFieldInput` → `FormSingleRecordPicker`, which is a plain record picker with no "Me" (current workspace member) option. **Fix:** Added a new conditional block before the `FormFieldInput` fallthrough that checks for `FieldMetadataType.RELATION` and renders `ObjectFilterDropdownSearchInput` + `ObjectFilterDropdownRecordSelect` — the same components used by the regular view filter path (`AdvancedFilterDropdownFilterInput`). `ObjectFilterDropdownRecordSelect` automatically shows the "Me" pinned item when the relation target is `workspaceMember` (line 141 of that component: `objectNameSingular === 'workspaceMember'`). The `dropdownInstanceId` is already computed in the component (line 52-53) and the parent `AdvancedFilterSidePanelRecordFilterColumn` already provides the required `ObjectFilterDropdownComponentInstanceContext`, so no additional context setup is needed. Three new imports were added: `ObjectFilterDropdownRecordSelect`, `ObjectFilterDropdownSearchInput`, and `DropdownMenuSeparator` — all existing components already used elsewhere in the codebase.
This commit is contained in:
+16
@@ -3,6 +3,8 @@ import { AdvancedFilterSidePanelValueFormCompositeFieldInput } from '@/object-re
|
||||
import { AdvancedFilterContext } from '@/object-record/advanced-filter/states/context/AdvancedFilterContext';
|
||||
import { getAdvancedFilterObjectFilterDropdownComponentInstanceId } from '@/object-record/advanced-filter/utils/getAdvancedFilterObjectFilterDropdownComponentInstanceId';
|
||||
import { shouldShowFilterTextInput } from '@/object-record/advanced-filter/utils/shouldShowFilterTextInput';
|
||||
import { ObjectFilterDropdownRecordSelect } from '@/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordSelect';
|
||||
import { ObjectFilterDropdownSearchInput } from '@/object-record/object-filter-dropdown/components/ObjectFilterDropdownSearchInput';
|
||||
import { useApplyObjectFilterDropdownFilterValue } from '@/object-record/object-filter-dropdown/hooks/useApplyObjectFilterDropdownFilterValue';
|
||||
import { fieldMetadataItemUsedInDropdownComponentSelector } from '@/object-record/object-filter-dropdown/states/fieldMetadataItemUsedInDropdownComponentSelector';
|
||||
import { subFieldNameUsedInDropdownComponentState } from '@/object-record/object-filter-dropdown/states/subFieldNameUsedInDropdownComponentState';
|
||||
@@ -19,6 +21,7 @@ import {
|
||||
} from '@/object-record/record-field/ui/types/FieldMetadata';
|
||||
import { currentRecordFiltersComponentState } from '@/object-record/record-filter/states/currentRecordFiltersComponentState';
|
||||
import { RecordFilterOperand } from '@/object-record/record-filter/types/RecordFilterOperand';
|
||||
import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';
|
||||
import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentSelectorValue';
|
||||
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
|
||||
import { stringifyRelativeDateFilter } from '@/views/view-filter-value/utils/stringifyRelativeDateFilter';
|
||||
@@ -189,6 +192,19 @@ export const AdvancedFilterSidePanelValueFormInput = ({
|
||||
);
|
||||
}
|
||||
|
||||
if (recordFilter.type === FieldMetadataType.RELATION) {
|
||||
return (
|
||||
<>
|
||||
<ObjectFilterDropdownSearchInput />
|
||||
<DropdownMenuSeparator />
|
||||
<ObjectFilterDropdownRecordSelect
|
||||
recordFilterId={recordFilter.id}
|
||||
dropdownId={dropdownInstanceId}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const field = {
|
||||
type:
|
||||
recordFilter.type === FieldMetadataType.DATE_TIME &&
|
||||
|
||||
Reference in New Issue
Block a user