Display columns on Record Board (#3626)

* Display columns on Record board

* Fix

* Fix according to review

* Fix
This commit is contained in:
Charles Bochet
2024-01-25 18:21:15 +01:00
committed by GitHub
parent ca6250286a
commit 377fd23c90
27 changed files with 591 additions and 29 deletions

View File

@ -2,7 +2,7 @@ import { useRecoilState } from 'recoil';
import { useDropdownStates } from '@/ui/layout/dropdown/hooks/internal/useDropdownStates';
import { usePreviousHotkeyScope } from '@/ui/utilities/hotkey/hooks/usePreviousHotkeyScope';
import { getScopeIdFromComponentId } from '@/ui/utilities/recoil-scope/utils/getScopeIdFromComponentId';
import { getScopeIdOrUndefinedFromComponentId } from '@/ui/utilities/recoil-scope/utils/getScopeIdOrUndefinedFromComponentId';
export const useDropdown = (dropdownId?: string) => {
const {
@ -11,7 +11,7 @@ export const useDropdown = (dropdownId?: string) => {
dropdownWidthState,
isDropdownOpenState,
} = useDropdownStates({
dropdownScopeId: getScopeIdFromComponentId(dropdownId),
dropdownScopeId: getScopeIdOrUndefinedFromComponentId(dropdownId),
});
const {

View File

@ -5,8 +5,7 @@ import { getScopeIdFromComponentId } from '@/ui/utilities/recoil-scope/utils/get
import { getState } from '@/ui/utilities/recoil-scope/utils/getState';
export const useClickOustideListenerStates = (componentId: string) => {
// TODO: improve typing
const scopeId = getScopeIdFromComponentId(componentId) ?? '';
const scopeId = getScopeIdFromComponentId(componentId);
return {
scopeId,

View File

@ -1,2 +1,2 @@
export const getScopeIdFromComponentId = (componentId?: string) =>
componentId ? `${componentId}-scope` : undefined;
export const getScopeIdFromComponentId = (componentId: string) =>
`${componentId}-scope`;

View File

@ -0,0 +1,4 @@
import { getScopeIdFromComponentId } from '@/ui/utilities/recoil-scope/utils/getScopeIdFromComponentId';
export const getScopeIdOrUndefinedFromComponentId = (componentId?: string) =>
componentId ? getScopeIdFromComponentId(componentId) : undefined;

View File

@ -0,0 +1,8 @@
import { DefaultValue } from 'recoil';
export const guardRecoilDefaultValue = (
candidate: any,
): candidate is DefaultValue => {
if (candidate instanceof DefaultValue) return true;
return false;
};